-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added module-info files + resolved dependency on LogFacade of glassfi…
…sh.jar Signed-off-by: David Matějček <david.matejcek@omnifish.ee>
- Loading branch information
Showing
21 changed files
with
295 additions
and
224 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
nucleus/common/glassfish-jdk-extensions/src/main/java/module-info.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* Copyright (c) 2024 Contributors to the Eclipse Foundation | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License v. 2.0, which is available at | ||
* http://www.eclipse.org/legal/epl-2.0. | ||
* | ||
* This Source Code may also be made available under the following Secondary | ||
* Licenses when the conditions for such availability set forth in the | ||
* Eclipse Public License v. 2.0 are satisfied: GNU General Public License, | ||
* version 2 with the GNU Classpath Exception, which is available at | ||
* https://www.gnu.org/software/classpath/license.html. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 | ||
*/ | ||
|
||
/** | ||
* @author David Matejcek | ||
*/ | ||
module org.glassfish.main.jdke { | ||
|
||
requires java.base; | ||
|
||
exports org.glassfish.main.jdke.cl; | ||
exports org.glassfish.main.jdke.i18n; | ||
} |
27 changes: 27 additions & 0 deletions
27
nucleus/common/simple-glassfish-api/src/main/java/module-info.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
* Copyright (c) 2024 Contributors to the Eclipse Foundation | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License v. 2.0, which is available at | ||
* http://www.eclipse.org/legal/epl-2.0. | ||
* | ||
* This Source Code may also be made available under the following Secondary | ||
* Licenses when the conditions for such availability set forth in the | ||
* Eclipse Public License v. 2.0 are satisfied: GNU General Public License, | ||
* version 2 with the GNU Classpath Exception, which is available at | ||
* https://www.gnu.org/software/classpath/license.html. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 | ||
*/ | ||
|
||
/** | ||
* @author David Matejcek | ||
*/ | ||
module org.glassfish.main.api.simple { | ||
|
||
requires java.base; | ||
requires java.logging; | ||
|
||
exports org.glassfish.embeddable; | ||
exports org.glassfish.embeddable.spi; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
183 changes: 183 additions & 0 deletions
183
nucleus/core/bootstrap-osgi/src/main/java/org/glassfish/main/boot/log/LogFacade.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,183 @@ | ||
/* | ||
* Copyright (c) 2022, 2024 Contributors to the Eclipse Foundation | ||
* Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License v. 2.0, which is available at | ||
* http://www.eclipse.org/legal/epl-2.0. | ||
* | ||
* This Source Code may also be made available under the following Secondary | ||
* Licenses when the conditions for such availability set forth in the | ||
* Eclipse Public License v. 2.0 are satisfied: GNU General Public License, | ||
* version 2 with the GNU Classpath Exception, which is available at | ||
* https://www.gnu.org/software/classpath/license.html. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 | ||
*/ | ||
|
||
package org.glassfish.main.boot.log; | ||
|
||
import java.util.logging.Level; | ||
import java.util.logging.LogRecord; | ||
import java.util.logging.Logger; | ||
|
||
import org.glassfish.logging.annotation.LogMessageInfo; | ||
import org.glassfish.logging.annotation.LogMessagesResourceBundle; | ||
import org.glassfish.logging.annotation.LoggerInfo; | ||
|
||
public class LogFacade { | ||
|
||
@LoggerInfo(subsystem = "BOOTSTRAP", description="Main bootstrap logger.") | ||
public static final String BOOTSTRAP_LOGGER_NAME = "jakarta.enterprise.bootstrap"; | ||
|
||
@LogMessagesResourceBundle | ||
public static final String RB_NAME = "org.glassfish.main.boot.log.LogMessages"; | ||
|
||
public static final Logger BOOTSTRAP_LOGGER = Logger.getLogger(BOOTSTRAP_LOGGER_NAME, RB_NAME); | ||
|
||
@LogMessageInfo( | ||
message = "Can not start bundle {0} because it is not contained in the list of installed bundles.", | ||
level = "WARNING") | ||
public static final String CANT_START_BUNDLE = "NCLS-BOOTSTRAP-00005"; | ||
|
||
@LogMessageInfo( | ||
message = "Failed to start {0}.", | ||
level = "WARNING") | ||
public static final String BUNDLE_START_FAILED = "NCLS-BOOTSTRAP-00006"; | ||
|
||
@LogMessageInfo( | ||
message = "Can't uninstall bundle = {0} as it's already uninstalled.", | ||
level = "WARNING") | ||
public static final String BUNDLE_ALREADY_UNINSTALED = "NCLS-BOOTSTRAP-00007"; | ||
|
||
@LogMessageInfo( | ||
message = "Uninstalled bundle {0} installed from {1}.", | ||
level = "INFO") | ||
public static final String UNINSTALLED_BUNDLE = "NCLS-BOOTSTRAP-00008"; | ||
|
||
@LogMessageInfo( | ||
message = "Can't update bundle = {0} as it's already uninstalled.", | ||
level = "WARNING") | ||
public static final String CANT_UPDATE_ALREADY_INSTALLED = "NCLS-BOOTSTRAP-00009"; | ||
|
||
@LogMessageInfo( | ||
message = "Updated bundle {0} from {1}.", | ||
level = "INFO") | ||
public static final String BUNDLE_UPDATED = "NCLS-BOOTSTRAP-00010"; | ||
|
||
@LogMessageInfo( | ||
message = "Failed to uninstall bundle {0}.", | ||
level = "WARNING") | ||
public static final String BUNDLE_UNINSTALL_FAILED = "NCLS-BOOTSTRAP-00011"; | ||
|
||
@LogMessageInfo( | ||
message = "Failed to update {0}.", | ||
level = "WARNING") | ||
public static final String UPDATE_FAILED = "NCLS-BOOTSTRAP-00012"; | ||
|
||
@LogMessageInfo( | ||
message = "Failed to install {0}.", | ||
level = "WARNING") | ||
public static final String INSTALL_FAILED = "NCLS-BOOTSTRAP-00013"; | ||
|
||
@LogMessageInfo( | ||
message = "Can not set the start level for {0} to {2} as it is already set to {1}.", | ||
level = "WARNING") | ||
public static final String CANT_SET_START_LEVEL = "NCLS-BOOTSTRAP-00014"; | ||
|
||
@LogMessageInfo( | ||
message = "Skipping entry {0} because it is not an absolute URI.", | ||
level = "WARNING") | ||
public static final String ENTRY_SKIPPED = "NCLS-BOOTSTRAP-00015"; | ||
|
||
@LogMessageInfo( | ||
message = "Skipping entry {0} due to exception: ", | ||
level = "WARNING") | ||
public static final String ENTRY_SKIPPED_DUE_TO = "NCLS-BOOTSTRAP-00016"; | ||
|
||
@LogMessageInfo( | ||
message = "Create bundle provisioner {0}.", | ||
level = "CONFIG") | ||
public static final String CREATE_BUNDLE_PROVISIONER = "NCLS-BOOTSTRAP-00026"; | ||
|
||
@LogMessageInfo( | ||
message = "Registered {0} as OSGi service registration: {1}.", | ||
level = "CONFIG") | ||
public static final String SERVICE_REGISTERED = "NCLS-BOOTSTRAP-00027"; | ||
|
||
@LogMessageInfo( | ||
message = "Unregistered {0} from service registry.", | ||
level = "CONFIG") | ||
public static final String SERVICE_UNREGISTERED = "NCLS-BOOTSTRAP-00028"; | ||
|
||
@LogMessageInfo( | ||
message = "Exception while unregistering: ", | ||
level = "WARNING") | ||
public static final String SERVICE_UNREGISTRATION_EXCEPTION = "NCLS-BOOTSTRAP-00029"; | ||
|
||
@LogMessageInfo( | ||
message = "installLocations = {0}.", | ||
level = "INFO") | ||
public static final String SHOW_INSTALL_LOCATIONS = "NCLS-BOOTSTRAP-00030"; | ||
|
||
@LogMessageInfo( | ||
message = "Unable to determine if {0} is a fragment or not due to ", | ||
level = "INFO") | ||
public static final String CANT_TELL_IF_FRAGMENT = "NCLS-BOOTSTRAP-00031"; | ||
|
||
@LogMessageInfo( | ||
message = "Skipping starting of bundles bundles have been provisioned already.", | ||
level = "INFO") | ||
public static final String SKIP_STARTING_ALREADY_PROVISIONED_BUNDLES = "NCLS-BOOTSTRAP-00032"; | ||
|
||
@LogMessageInfo( | ||
message = "{0} : latest file in installation location = {1} and latest installed bundle = {2} ", | ||
level = "INFO") | ||
public static final String LATEST_FILE_IN_INSTALL_LOCATION = "NCLS-BOOTSTRAP-00033"; | ||
|
||
@LogMessageInfo( | ||
message = "Updating system bundle.", | ||
level = "INFO") | ||
public static final String UPDATING_SYSTEM_BUNDLE = "NCLS-BOOTSTRAP-00034"; | ||
|
||
@LogMessageInfo( | ||
message = "Provisioning options have changed, recreating the framework with a clean OSGi storage(aka cache).", | ||
level = "INFO") | ||
public static final String PROVISIONING_OPTIONS_CHANGED = "NCLS-BOOTSTRAP-00035"; | ||
|
||
@LogMessageInfo( | ||
message = "Storage support not available in framework bundle, so can't store bundle ids. This may lead to slower start up time.", | ||
level = "WARNING") | ||
public static final String CANT_STORE_BUNDLEIDS = "NCLS-BOOTSTRAP-00037"; | ||
|
||
@LogMessageInfo( | ||
message = "Storage support not available in framework bundle, so can't store provisioning options. This may lead to slower start up time.", | ||
level = "WARNING") | ||
public static final String CANT_STORE_PROVISIONING_OPTIONS = "NCLS-BOOTSTRAP-00038"; | ||
|
||
@LogMessageInfo( | ||
message = "Got an unexpected exception.", | ||
level = "WARNING") | ||
public static final String CAUGHT_EXCEPTION = "NCLS-BOOTSTRAP-00039"; | ||
|
||
/** | ||
* This helper method is duplicated from org.glassfish.api.logging.LogHelper to avoid adding | ||
* dependency on the glassfish-api bundle. | ||
* Logs a message with the given level, message, parameters and <code>Throwable</code>. | ||
* | ||
* @param logger the <code>Logger</code> object to be used for logging the message. | ||
* @param level the <code>Level</code> of the message to be logged. | ||
* @param messageId the key in the resource bundle of the <code>Logger</code> containing the localized text. | ||
* @param thrown the <code>Throwable</code> associated with the message to be logged. | ||
* @param params the parameters to the localized text. | ||
*/ | ||
public static void log(Logger logger, Level level, String messageId, Throwable thrown, Object... params) { | ||
LogRecord rec = new LogRecord(level, messageId); | ||
rec.setLoggerName(logger.getName()); | ||
rec.setResourceBundleName(logger.getResourceBundleName()); | ||
rec.setResourceBundle(logger.getResourceBundle()); | ||
rec.setParameters(params); | ||
rec.setThrown(thrown); | ||
logger.log(rec); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.