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.
  • Field Details

  • Constructor Details

    • FileMonitor

      public FileMonitor()
    • FileMonitor

      public FileMonitor(Properties properties, PrintWriter log)
  • Method Details

    • PBapplicationPropertiesStream

      private InputStream PBapplicationPropertiesStream() throws IOException
      Throws:
      IOException
    • getEnvironment

      public Object getEnvironment()
      Description copied from interface: ModuleFactory
      Return 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 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 String PBgetJVMProperty(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(SecurityException e, String key)
    • report

      private void report(SecurityException e, File file)
    • reportThread

      private void reportThread(SecurityException e)
    • initialize

      final boolean initialize(boolean lite)
      Initialize the system in a privileged block.
      Specified by:
      initialize in class BaseMonitor
    • getDefaultModuleProperties

      final Properties getDefaultModuleProperties()
      Description copied from class: BaseMonitor
      Get 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:
      getDefaultModuleProperties in class BaseMonitor
    • getJVMProperty

      public final String getJVMProperty(String key)
      Description copied from interface: ModuleFactory
      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.
    • getDaemonThread

      public final Thread getDaemonThread(Runnable task, String name, boolean setMinPriority)
      Description copied from interface: ModuleFactory
      Get a newly created background thread. The thread is set to be a daemon but is not started.
      Specified by:
      getDaemonThread in interface ModuleFactory
      Overrides:
      getDaemonThread in class BaseMonitor
    • applicationPropertiesStream

      final InputStream applicationPropertiesStream() throws IOException
      Description copied from class: BaseMonitor
      Get InputStream for application properties file Returns nul if it does not exist.
      Specified by:
      applicationPropertiesStream in class BaseMonitor
      Throws:
      IOException
    • getEngineVersion

      public final ProductVersionHolder getEngineVersion()