Class FileMonitor
- java.lang.Object
-
- org.apache.derby.impl.services.monitor.BaseMonitor
-
- org.apache.derby.impl.services.monitor.FileMonitor
-
- All Implemented Interfaces:
BundleFinder,ModuleFactory
public final class FileMonitor extends BaseMonitor
Implementation of the monitor that uses the class loader that the its was loaded in for all class loading.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.derby.impl.services.monitor.BaseMonitor
BaseMonitor.ProviderEnumeration
-
-
Field Summary
Fields Modifier and Type Field Description private ProductVersionHolderengineVersionprivate java.io.Filehomeprivate static java.util.Map<java.lang.String,java.lang.Void>securityProperties-
Fields inherited from class org.apache.derby.impl.services.monitor.BaseMonitor
applicationProperties, bootProperties, daemonGroup, inShutdown, reportOn
-
-
Constructor Summary
Constructors Constructor Description FileMonitor()FileMonitor(java.util.Properties properties, java.io.PrintWriter log)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) java.io.InputStreamapplicationPropertiesStream()Get InputStream for application properties file Returns nul if it does not exist.private java.lang.ThreadGroupcreateDaemonGroup()Create a ThreadGroup and set the daemon property to make sure the group is destroyed and garbage collected when all its members have finished (i.e., either when the driver is unloaded, or when the last database is shut down).java.lang.ThreadgetDaemonThread(java.lang.Runnable task, java.lang.String name, boolean setMinPriority)Get a newly created background thread.(package private) java.util.PropertiesgetDefaultModuleProperties()Get the complete set of module properties by loading in contents of all the org/apache/derby/modules.properties files.ProductVersionHoldergetEngineVersion()java.lang.ObjectgetEnvironment()Return the environment object that this system was booted in.java.lang.StringgetJVMProperty(java.lang.String key)Return a property from the JVM's system set.(package private) booleaninitialize(boolean lite)Initialize the system in a privileged block.private java.io.InputStreamPBapplicationPropertiesStream()private java.lang.StringPBgetJVMProperty(java.lang.String key)SECURITY WARNING.private booleanPBinitialize(boolean lite)SECURITY WARNING.private voidreport(java.lang.SecurityException e, java.io.File file)private voidreport(java.lang.SecurityException e, java.lang.String key)private voidreportThread(java.lang.SecurityException e)-
Methods inherited from class org.apache.derby.impl.services.monitor.BaseMonitor
boot, bootProviderServices, bootService, canSupport, classFromIdentifier, createPersistentService, dumpProperties, findModule, findProviderForCreate, findService, getApplicationProperties, getBundle, getCanonicalServiceName, getLocale, getLocaleFromString, getServiceList, getServiceName, getServiceProvider, getServiceType, getSystemStreams, getTimerFactory, getUUIDFactory, isDaemonThread, loadInstance, newInstanceFromIdentifier, readApplicationProperties, removePersistentService, removeRuntimeProperties, report, reportException, runWithState, setLocale, setLocale, shutdown, shutdown, startModule, startNonPersistentService, startPersistentService, startProviderService, startServices
-
-
-
-
Field Detail
-
home
private java.io.File home
-
engineVersion
private ProductVersionHolder engineVersion
-
securityProperties
private static final java.util.Map<java.lang.String,java.lang.Void> securityProperties
-
-
Method Detail
-
PBapplicationPropertiesStream
private java.io.InputStream PBapplicationPropertiesStream() throws java.io.IOException- Throws:
java.io.IOException
-
getEnvironment
public java.lang.Object getEnvironment()
Description copied from interface:ModuleFactoryReturn the environment object that this system was booted in. This is a free form object that is set by the method the system is booted. For example when running in a Marimba system it is set to the maribma application context. In most environments it will be set to a java.io.File object representing the system home directory. Code that call this method usualy have predefined knowledge of the type of the returned object, e.g. Marimba store code knows that this will be set to a marimba application context.
-
createDaemonGroup
private java.lang.ThreadGroup createDaemonGroup()
Create a ThreadGroup and set the daemon property to make sure the group is destroyed and garbage collected when all its members have finished (i.e., either when the driver is unloaded, or when the last database is shut down).- Returns:
- the thread group "derby.daemons" or null if we saw a SecurityException
-
PBinitialize
private boolean PBinitialize(boolean lite)
SECURITY WARNING. This method is run in a privileged block in a Java 2 environment. Set the system home directory. Returns false if it couldn't for some reason.
-
PBgetJVMProperty
private java.lang.String PBgetJVMProperty(java.lang.String key)
SECURITY WARNING. This method is run in a privileged block in a Java 2 environment. Return a property from the JVM's system set. In a Java2 environment this will be executed as a privileged block if and only if the property starts with 'derby.'. If a SecurityException occurs, null is returned.
-
report
private void report(java.lang.SecurityException e, java.lang.String key)
-
report
private void report(java.lang.SecurityException e, java.io.File file)
-
reportThread
private void reportThread(java.lang.SecurityException e)
-
initialize
final boolean initialize(boolean lite)
Initialize the system in a privileged block.- Specified by:
initializein classBaseMonitor
-
getDefaultModuleProperties
final java.util.Properties getDefaultModuleProperties()
Description copied from class:BaseMonitorGet the complete set of module properties by loading in contents of all the org/apache/derby/modules.properties files. This must be executed in a privileged block otherwise when running in a security manager environment no properties will be returned.- Overrides:
getDefaultModulePropertiesin classBaseMonitor
-
getJVMProperty
public final java.lang.String getJVMProperty(java.lang.String key)
Description copied from interface:ModuleFactoryReturn a property from the JVM's system set. In a Java2 environment this will be executed as a privileged block if and only if the property starts with 'derby.'. If a SecurityException occurs, null is returned.
-
getDaemonThread
public final java.lang.Thread getDaemonThread(java.lang.Runnable task, java.lang.String name, boolean setMinPriority)Description copied from interface:ModuleFactoryGet a newly created background thread. The thread is set to be a daemon but is not started.- Specified by:
getDaemonThreadin interfaceModuleFactory- Overrides:
getDaemonThreadin classBaseMonitor
-
applicationPropertiesStream
final java.io.InputStream applicationPropertiesStream() throws java.io.IOExceptionDescription copied from class:BaseMonitorGet InputStream for application properties file Returns nul if it does not exist.- Specified by:
applicationPropertiesStreamin classBaseMonitor- Throws:
java.io.IOException
-
getEngineVersion
public final ProductVersionHolder getEngineVersion()
-
-