|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.derby.impl.services.monitor.BaseMonitor
Implementation of the monitor that uses the class loader that the its was loaded in for all class loading.
Nested Class Summary | |
(package private) class |
BaseMonitor.ProviderEnumeration
|
Field Summary | |
protected java.util.Properties |
applicationProperties
|
protected java.util.Properties |
bootProperties
|
private ContextService |
contextService
|
protected java.lang.ThreadGroup |
daemonGroup
|
(package private) AntiGC |
dontGC
|
private boolean |
dumpedTempWriter
|
private java.lang.Boolean |
exceptionTrace
|
protected java.util.Vector[] |
implementationSets
|
(package private) boolean |
inShutdown
|
private java.io.PrintStream |
logging
|
private InstanceGetter[] |
rc2
|
protected boolean |
reportOn
|
private static java.lang.String |
SERVICE
Look for any services in the a properties set and the application property set and then start them. |
protected java.util.Hashtable |
serviceProviders
Hashtable of objects that implement PersistentService keyed by their getType() method. |
private java.util.Vector |
services
|
private static java.util.HashMap |
storageFactories
|
private InfoStreams |
systemStreams
|
private AccessibleByteArrayOutputStream |
tmpArray
|
private java.io.PrintWriter |
tmpWriter
|
private UUIDFactory |
uuidFactory
|
Constructor Summary | |
BaseMonitor()
|
Method Summary | |
private void |
addDebugFlags(java.lang.String flags,
boolean set)
|
protected abstract java.io.InputStream |
applicationPropertiesStream()
Get InputStream for application properties file Returns nul if it does not exist. |
(package private) static void |
boot(java.lang.Object module,
boolean create,
java.util.Properties properties)
Boot a module. |
protected void |
bootPersistentServices()
Boot all persistent services that can be located at run time. |
protected void |
bootProviderServices(PersistentService provider)
Boot all persistent services that can be located by a single service provider This method enumerates through all the service providers that are active and calls bootPersistentServices(PersistentService) to boot all the services that that provider knows about. |
protected java.lang.Object |
bootService(PersistentService provider,
java.lang.String factoryInterface,
java.lang.String serviceName,
java.util.Properties properties,
boolean create)
Boot (start or create) a service (persistent or non-persistent). |
protected void |
bootServiceProviders()
Boot all the service providers, ie. any module that implemented PersistentService. |
(package private) static boolean |
canSupport(java.lang.Object instance,
java.util.Properties properties)
If the module implements ModuleSupportable then call its canSupport() method to see if it can or should run in this setup. |
InstanceGetter |
classFromIdentifier(int fmtId)
Obtain a class that supports the given identifier. |
java.lang.Object |
createPersistentService(java.lang.String factoryInterface,
java.lang.String name,
java.util.Properties properties)
Create a persistent service. |
(package private) void |
dumpProperties(java.lang.String title,
java.util.Properties props)
|
private void |
dumpTempWriter(boolean bothPlaces)
|
private static int |
findImplementation(java.util.Vector implementations,
int startIndex,
java.lang.Class factoryInterface)
Find a class that implements the required index, return the index into the implementations vecotr of that class. |
java.lang.Object |
findModule(java.lang.Object serviceModule,
java.lang.String factoryInterface,
java.lang.String identifier)
Find the module in the system with the given module protocol, protocolVersion and identifier. |
protected PersistentService |
findProvider()
|
protected boolean |
findProviderAndStartService(java.lang.String name,
java.util.Properties properties,
boolean bootTime)
Find a provider and start a service. |
protected PersistentService |
findProviderForCreate(java.util.Properties startParams,
java.lang.String name)
|
private PersistentService |
findProviderFromName(java.util.Properties startParams,
java.lang.String name,
int colon)
Find the service provider from a name that includes a service type, ie. is of the form 'type:name'. |
java.lang.Object |
findService(java.lang.String factoryInterface,
java.lang.String serviceName)
Find a service. |
private TopService |
findTopService(java.lang.Object serviceModule)
|
java.util.Properties |
getApplicationProperties()
|
java.util.ResourceBundle |
getBundle(java.lang.String messageId)
Get the locale from the ContextManager and then find the bundle based upon that locale. |
java.lang.Thread |
getDaemonThread(java.lang.Runnable task,
java.lang.String name,
boolean setMinPriority)
Get a newly created background thread. |
protected java.util.Vector |
getDefaultImplementations()
|
protected java.util.Vector |
getImplementations(java.util.Properties moduleList,
boolean actualModuleList)
Create an implementation set. |
java.util.Locale |
getLocale(java.lang.Object serviceModule)
Return the locale of the service that the passed in module lives in. |
java.util.Locale |
getLocaleFromString(java.lang.String localeDescription)
Translate a string of the form ll[_CC[_variant]] to a Locale. |
private PersistentService |
getPersistentService(java.util.Properties properties,
java.lang.String subSubProtocol)
|
private PersistentService |
getPersistentService(java.lang.String className,
java.lang.String subSubProtocol)
|
private boolean |
getPersistentServiceImplementation(java.lang.Class possibleModule)
|
java.lang.String[] |
getServiceList(java.lang.String protocol)
Return an array of the service identifiers that are running and implement the passed in protocol (java interface class name). |
java.lang.String |
getServiceName(java.lang.Object serviceModule)
Return the name of the service that the passed in module lives in. |
PersistentService |
getServiceProvider(java.util.Properties startParams,
java.lang.String subSubProtocol)
Return the PersistentService for a subsubprotocol. |
PersistentService |
getServiceType(java.lang.Object serviceModule)
Return the PersistentService object for a service. |
private java.lang.String |
getStorageFactoryClassName(java.util.Properties properties,
java.lang.String subSubProtocol)
|
InfoStreams |
getSystemStreams()
Get the defined default system streams object. |
private java.io.PrintWriter |
getTempWriter()
|
UUIDFactory |
getUUIDFactory()
Return the UUID factory for this system. |
abstract boolean |
initialize(boolean lite)
Initialize the monitor wrt the current environemnt. |
protected java.lang.Object |
loadInstance(java.lang.Class factoryInterface,
java.util.Properties properties)
load a module instance. |
private java.lang.Object |
loadInstance(java.util.Vector implementations,
java.lang.Class factoryInterface,
java.util.Properties properties)
|
protected java.io.InputStream |
loadModuleDefinitions(java.net.URL propertyFileURL)
|
private java.lang.Object |
newInstance(java.lang.Class classObject)
|
private java.lang.Object |
newInstance(java.lang.String className)
|
java.lang.Object |
newInstanceFromIdentifier(int identifier)
Obtain an new instance of a class that supports the given identifier. |
protected java.util.Properties |
readApplicationProperties()
|
void |
removePersistentService(java.lang.String name)
|
protected static java.util.Properties |
removeRuntimeProperties(java.util.Properties properties)
Return a property set that has the runtime properties removed. |
protected void |
report(java.lang.String message)
Should only be called if reportOn is true apart from report/Exception(). |
protected void |
reportException(java.lang.Throwable t)
|
protected void |
runWithState(java.util.Properties properties,
java.io.PrintStream log)
|
java.util.Locale |
setLocale(java.lang.Object serviceModule,
java.lang.String userDefinedLocale)
Set the locale for the service *outside* of boot time. |
private static java.util.Locale |
setLocale(java.util.Properties properties)
|
java.util.Locale |
setLocale(java.util.Properties serviceProperties,
java.lang.String userDefinedLocale)
Set the locale for the service at boot time. |
void |
setThreadPriority(int priority)
Set the priority of the current thread. |
void |
shutdown()
Shut down the complete system that was started by this Monitor. |
void |
shutdown(java.lang.Object serviceModule)
Shut down a service that was started by this Monitor. |
java.lang.Object |
startModule(boolean create,
java.lang.Object serviceModule,
java.lang.String factoryInterface,
java.lang.String identifier,
java.util.Properties properties)
Start a module. |
java.lang.Object |
startNonPersistentService(java.lang.String factoryInterface,
java.lang.String serviceName,
java.util.Properties properties)
Start a non-persistent service. |
boolean |
startPersistentService(java.lang.String name,
java.util.Properties properties)
Start a peristent service. |
protected boolean |
startPersistentService(java.lang.String name,
java.util.Properties properties,
boolean bootTime)
|
protected void |
startProviderService(PersistentService provider,
java.lang.String serviceName,
java.util.Properties serviceProperties)
Boot a service under the control of the provider |
void |
startServices(java.util.Properties properties,
boolean bootAll)
Start all services identified by derby.service.* in the property set. |
private static java.util.Locale |
staticGetLocaleFromString(java.lang.String localeDescription)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.derby.iapi.services.monitor.ModuleFactory |
getEngineVersion, getEnvironment, getJVMProperty |
Field Detail |
protected java.util.Hashtable serviceProviders
protected java.util.Vector[] implementationSets
private java.util.Vector services
protected java.util.Properties bootProperties
protected java.util.Properties applicationProperties
boolean inShutdown
private InfoStreams systemStreams
private ContextService contextService
private UUIDFactory uuidFactory
protected boolean reportOn
private java.io.PrintStream logging
protected java.lang.ThreadGroup daemonGroup
AntiGC dontGC
private InstanceGetter[] rc2
private java.lang.Boolean exceptionTrace
private static final java.lang.String SERVICE
private static final java.util.HashMap storageFactories
private java.io.PrintWriter tmpWriter
private AccessibleByteArrayOutputStream tmpArray
private boolean dumpedTempWriter
Constructor Detail |
public BaseMonitor()
Method Detail |
public InfoStreams getSystemStreams()
ModuleFactory
getSystemStreams
in interface ModuleFactory
public void shutdown()
ModuleFactory
shutdown
in interface ModuleFactory
public void shutdown(java.lang.Object serviceModule)
shutdown
in interface ModuleFactory
protected final void runWithState(java.util.Properties properties, java.io.PrintStream log)
public java.lang.Object findService(java.lang.String factoryInterface, java.lang.String serviceName)
ModuleFactory
findService
in interface ModuleFactory
Monitor.findService(java.lang.String, java.lang.String)
public java.util.Locale getLocale(java.lang.Object serviceModule)
ModuleFactory
getLocale
in interface ModuleFactory
public java.util.Locale getLocaleFromString(java.lang.String localeDescription) throws StandardException
ModuleFactory
getLocaleFromString
in interface ModuleFactory
StandardException
public java.lang.String getServiceName(java.lang.Object serviceModule)
getServiceName
in interface ModuleFactory
public java.util.Locale setLocale(java.lang.Object serviceModule, java.lang.String userDefinedLocale) throws StandardException
setLocale
in interface ModuleFactory
userDefinedLocale
- A String in the form xx_YY, where xx is the
language code and YY is the country code.
StandardException
- Standard Cloudscape error.public java.util.Locale setLocale(java.util.Properties serviceProperties, java.lang.String userDefinedLocale) throws StandardException
setLocale
in interface ModuleFactory
StandardException
- Standard Cloudscape error.public PersistentService getServiceType(java.lang.Object serviceModule)
getServiceType
in interface ModuleFactory
public java.lang.Object startModule(boolean create, java.lang.Object serviceModule, java.lang.String factoryInterface, java.lang.String identifier, java.util.Properties properties) throws StandardException
startModule
in interface ModuleFactory
StandardException
- se An attempt to start the module failed.ModuleFactory.startModule(boolean, java.lang.Object, java.lang.String, java.lang.String, java.util.Properties)
private TopService findTopService(java.lang.Object serviceModule)
public java.lang.Object findModule(java.lang.Object serviceModule, java.lang.String factoryInterface, java.lang.String identifier)
ModuleFactory
findModule
in interface ModuleFactory
public InstanceGetter classFromIdentifier(int fmtId) throws StandardException
classFromIdentifier
in interface ModuleFactory
fmtId
- identifer to associate with class
StandardException
- See Monitor.classFromIdentifierModuleFactory.classFromIdentifier(int)
public java.lang.Object newInstanceFromIdentifier(int identifier) throws StandardException
newInstanceFromIdentifier
in interface ModuleFactory
identifier
- identifer to associate with class
StandardException
- See Monitor.newInstanceFromIdentifierprotected java.lang.Object loadInstance(java.lang.Class factoryInterface, java.util.Properties properties)
private java.lang.Object loadInstance(java.util.Vector implementations, java.lang.Class factoryInterface, java.util.Properties properties)
private static int findImplementation(java.util.Vector implementations, int startIndex, java.lang.Class factoryInterface)
private java.lang.Object newInstance(java.lang.String className)
private java.lang.Object newInstance(java.lang.Class classObject)
public java.util.Properties getApplicationProperties()
getApplicationProperties
in interface ModuleFactory
public java.lang.String[] getServiceList(java.lang.String protocol)
getServiceList
in interface ModuleFactory
ModuleFactory.getServiceList(java.lang.String)
void dumpProperties(java.lang.String title, java.util.Properties props)
protected void report(java.lang.String message)
protected void reportException(java.lang.Throwable t)
private void addDebugFlags(java.lang.String flags, boolean set)
public void startServices(java.util.Properties properties, boolean bootAll)
ModuleFactory
startServices
in interface ModuleFactory
public boolean startPersistentService(java.lang.String name, java.util.Properties properties) throws StandardException
startPersistentService
in interface ModuleFactory
StandardException
- An attempt to start the service failed.ModuleFactory.startPersistentService(java.lang.String, java.util.Properties)
,
Monitor.startPersistentService(java.lang.String, java.util.Properties)
protected boolean startPersistentService(java.lang.String name, java.util.Properties properties, boolean bootTime) throws StandardException
StandardException
public java.lang.Object createPersistentService(java.lang.String factoryInterface, java.lang.String name, java.util.Properties properties) throws StandardException
createPersistentService
in interface ModuleFactory
StandardException
- An exception was thrown trying to create the service.Monitor.createPersistentService(java.lang.String, java.lang.String, java.util.Properties)
public void removePersistentService(java.lang.String name) throws StandardException
removePersistentService
in interface ModuleFactory
StandardException
public java.lang.Object startNonPersistentService(java.lang.String factoryInterface, java.lang.String serviceName, java.util.Properties properties) throws StandardException
startNonPersistentService
in interface ModuleFactory
StandardException
- An attempt to start the service failed.Monitor.startNonPersistentService(java.lang.String, java.lang.String, java.util.Properties)
,
ModuleFactory.startNonPersistentService(java.lang.String, java.lang.String, java.util.Properties)
protected java.util.Vector getImplementations(java.util.Properties moduleList, boolean actualModuleList)
private boolean getPersistentServiceImplementation(java.lang.Class possibleModule)
protected java.util.Vector getDefaultImplementations()
protected java.io.InputStream loadModuleDefinitions(java.net.URL propertyFileURL) throws java.io.IOException
java.io.IOException
protected static java.util.Properties removeRuntimeProperties(java.util.Properties properties)
protected abstract java.io.InputStream applicationPropertiesStream() throws java.io.IOException
java.io.IOException
protected java.util.Properties readApplicationProperties()
protected void bootServiceProviders()
protected void bootPersistentServices()
protected void bootProviderServices(PersistentService provider)
protected boolean findProviderAndStartService(java.lang.String name, java.util.Properties properties, boolean bootTime) throws StandardException
StandardException
protected PersistentService findProvider() throws StandardException
StandardException
protected PersistentService findProviderForCreate(java.util.Properties startParams, java.lang.String name) throws StandardException
StandardException
private PersistentService findProviderFromName(java.util.Properties startParams, java.lang.String name, int colon) throws StandardException
StandardException
public PersistentService getServiceProvider(java.util.Properties startParams, java.lang.String subSubProtocol) throws StandardException
ModuleFactory
getServiceProvider
in interface ModuleFactory
StandardException
private PersistentService getPersistentService(java.util.Properties properties, java.lang.String subSubProtocol) throws StandardException
StandardException
private PersistentService getPersistentService(java.lang.String className, java.lang.String subSubProtocol) throws StandardException
StandardException
private java.lang.String getStorageFactoryClassName(java.util.Properties properties, java.lang.String subSubProtocol)
protected void startProviderService(PersistentService provider, java.lang.String serviceName, java.util.Properties serviceProperties) throws StandardException
StandardException
protected java.lang.Object bootService(PersistentService provider, java.lang.String factoryInterface, java.lang.String serviceName, java.util.Properties properties, boolean create) throws StandardException
StandardException
public UUIDFactory getUUIDFactory()
getUUIDFactory
in interface ModuleFactory
com.ibm.db2j.system.System
private java.io.PrintWriter getTempWriter()
private void dumpTempWriter(boolean bothPlaces)
static boolean canSupport(java.lang.Object instance, java.util.Properties properties)
static void boot(java.lang.Object module, boolean create, java.util.Properties properties) throws StandardException
StandardException
private static java.util.Locale staticGetLocaleFromString(java.lang.String localeDescription) throws StandardException
StandardException
private static java.util.Locale setLocale(java.util.Properties properties) throws StandardException
StandardException
public java.util.ResourceBundle getBundle(java.lang.String messageId)
getBundle
in interface BundleFinder
messageId
- Message being searched for.public java.lang.Thread getDaemonThread(java.lang.Runnable task, java.lang.String name, boolean setMinPriority)
ModuleFactory
getDaemonThread
in interface ModuleFactory
public void setThreadPriority(int priority)
ModuleFactory
setThreadPriority
in interface ModuleFactory
public abstract boolean initialize(boolean lite)
|
Built on Mon 2007-06-04 09:58:47+0400, from revision ??? | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |