org.apache.derby.impl.services.monitor
Class FileMonitor

java.lang.Object
  extended byorg.apache.derby.impl.services.monitor.BaseMonitor
      extended byorg.apache.derby.impl.services.monitor.FileMonitor
All Implemented Interfaces:
BundleFinder, ModuleFactory, java.security.PrivilegedExceptionAction

public final class FileMonitor
extends BaseMonitor
implements java.security.PrivilegedExceptionAction

Implementation of the monitor that uses the class loader that the its was loaded in for all class loading.


Nested Class Summary
 
Nested classes inherited from class org.apache.derby.impl.services.monitor.BaseMonitor
BaseMonitor.ProviderEnumeration
 
Field Summary
private  int action
           
private  ProductVersionHolder engineVersion
           
private  java.io.File home
           
private  int intValue
           
private  java.lang.String key3
           
private  java.net.URL propertyFileURL
           
private  java.lang.Runnable task
           
 
Fields inherited from class org.apache.derby.impl.services.monitor.BaseMonitor
applicationProperties, bootProperties, daemonGroup, dontGC, implementationSets, inShutdown, reportOn, serviceProviders
 
Constructor Summary
FileMonitor()
           
FileMonitor(java.util.Properties properties, java.io.PrintStream log)
           
 
Method Summary
protected  java.io.InputStream applicationPropertiesStream()
          Get InputStream for application properties file Returns nul if it does not exist.
 java.lang.Thread getDaemonThread(java.lang.Runnable task, java.lang.String name, boolean setMinPriority)
          Get a newly created background thread.
 ProductVersionHolder getEngineVersion()
           
 java.lang.Object getEnvironment()
          Return the environment object that this system was booted in.
 java.lang.String getJVMProperty(java.lang.String key)
          Return a property from the JVM's system set.
 boolean initialize(boolean lite)
          Initialize the system in a privileged block.
protected  java.io.InputStream loadModuleDefinitions(java.net.URL propertyFileURL)
           
private  java.io.InputStream PBapplicationPropertiesStream()
           
private  java.lang.String PBgetJVMProperty(java.lang.String key)
          SECURITY WARNING.
private  boolean PBinitialize(boolean lite)
          SECURITY WARNING.
 java.lang.Object run()
           
 void setThreadPriority(int priority)
          Set the priority of the current thread.
 
Methods inherited from class org.apache.derby.impl.services.monitor.BaseMonitor
boot, bootPersistentServices, bootProviderServices, bootService, bootServiceProviders, canSupport, classFromIdentifier, createPersistentService, dumpProperties, findModule, findProvider, findProviderAndStartService, findProviderForCreate, findService, getApplicationProperties, getBundle, getDefaultImplementations, getImplementations, getLocale, getLocaleFromString, getServiceList, getServiceName, getServiceProvider, getServiceType, getSystemStreams, getUUIDFactory, loadInstance, newInstanceFromIdentifier, readApplicationProperties, removePersistentService, removeRuntimeProperties, report, reportException, runWithState, setLocale, setLocale, shutdown, shutdown, startModule, startNonPersistentService, startPersistentService, startPersistentService, startProviderService, startServices
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

home

private java.io.File home

engineVersion

private ProductVersionHolder engineVersion

action

private int action

key3

private java.lang.String key3

task

private java.lang.Runnable task

intValue

private int intValue

propertyFileURL

private java.net.URL propertyFileURL
Constructor Detail

FileMonitor

public FileMonitor()

FileMonitor

public FileMonitor(java.util.Properties properties,
                   java.io.PrintStream log)
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: 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.

Specified by:
getEnvironment in interface ModuleFactory

PBinitialize

private boolean PBinitialize(boolean lite)
SECURITY WARNING. This method is run in a privledged 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 privledged 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 privliged block if and only if the property starts with db2j. If a SecurityException occurs, null is returned.


initialize

public final boolean initialize(boolean lite)
Initialize the system in a privileged block.

Specified by:
initialize in class BaseMonitor

loadModuleDefinitions

protected final java.io.InputStream loadModuleDefinitions(java.net.URL propertyFileURL)
                                                   throws java.io.IOException
Overrides:
loadModuleDefinitions in class BaseMonitor
Throws:
java.io.IOException

getJVMProperty

public final java.lang.String getJVMProperty(java.lang.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 privliged block if and only if the property starts with db2j. If a SecurityException occurs, null is returned.

Specified by:
getJVMProperty in interface ModuleFactory

getDaemonThread

public final java.lang.Thread getDaemonThread(java.lang.Runnable task,
                                              java.lang.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

setThreadPriority

public final void setThreadPriority(int priority)
Description copied from interface: ModuleFactory
Set the priority of the current thread. If the current thread was not returned by getDaemonThread() then no action is taken.

Specified by:
setThreadPriority in interface ModuleFactory
Overrides:
setThreadPriority in class BaseMonitor

applicationPropertiesStream

protected final java.io.InputStream applicationPropertiesStream()
                                                         throws java.io.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:
java.io.IOException

run

public final java.lang.Object run()
                           throws java.io.IOException
Specified by:
run in interface java.security.PrivilegedExceptionAction
Throws:
java.io.IOException

getEngineVersion

public final ProductVersionHolder getEngineVersion()
Specified by:
getEngineVersion in interface ModuleFactory

Built on Tue 2006-10-10 19:23:47+0200, from revision exported

Apache Derby V10.1 Engine Documentation - Copyright © 1997,2005 The Apache Software Foundation or its licensors, as applicable.