Class CombinedJavaConfigSystemPropertyListener
- java.lang.Object
-
- com.sun.enterprise.v3.admin.listener.CombinedJavaConfigSystemPropertyListener
-
- All Implemented Interfaces:
org.glassfish.hk2.api.PostConstruct
,ConfigListener
@Service @RunLevel(mode=1, value=1) public final class CombinedJavaConfigSystemPropertyListener extends Object implements org.glassfish.hk2.api.PostConstruct, ConfigListener
Listens for the changes to the configuration of JVM and Java system properties (including the Java VM options). Most of the effort involves the jvm-options list, but restart is also required for any changes to the java-config.This class is implemented so that the server restart is NOT required if a deployer wants to deploy an application and the application depends on a particular Java system property (-D) to be specified. As of now, the deployer specifies the system property and deploys the application and the application should find it when it does System.getProperty("property-name"). Here is the complete algorithm:
- If any of the attributes of the java-config element (JavaConfig) change, this listener flags it as server-restart-required kind of change.
- If a system property is being defined and it is NOT one that starts with "-Djava." or "-Djavax.", it will be immediately set in the System using System.setProperty() call. A server restart won't be needed.
- If any other JVM option is defined that does not start with "-D" (excluding the cases covered above), it is deemed to be a JVM option resulting in server-restart-required flag set.
- If a System Property (with above distinctions) is removed, System.clearProperty() is called and server-restart-required flag is set accordingly.
- Since:
- GlassFish V3
- Author:
- केदार ([email protected])
- See Also:
JavaConfig
-
-
Constructor Summary
Constructors Constructor Description CombinedJavaConfigSystemPropertyListener()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description UnprocessedChangeEvents
changed(PropertyChangeEvent[] events)
Notification that @Configured objects that were injected have changedvoid
postConstruct()
-
-
-
Method Detail
-
postConstruct
public void postConstruct()
- Specified by:
postConstruct
in interfaceorg.glassfish.hk2.api.PostConstruct
-
changed
public UnprocessedChangeEvents changed(PropertyChangeEvent[] events)
Description copied from interface:ConfigListener
Notification that @Configured objects that were injected have changed- Specified by:
changed
in interfaceConfigListener
- Parameters:
events
- list of changes- Returns:
- the list of unprocessed events (requiring a restart) or null if all reconfiguration was processed successfully
-
-