|
|||||||||
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
abstract class 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 | |
---|---|
(package private) java.util.Properties |
applicationProperties
|
(package private) java.util.Properties |
bootProperties
|
private ContextService |
contextService
|
(package private) java.lang.ThreadGroup |
daemonGroup
|
(package private) AntiGC |
dontGC
|
private boolean |
dumpedTempWriter
|
private java.lang.Boolean |
exceptionTrace
|
(package private) java.util.Vector[] |
implementationSets
|
(package private) boolean |
inShutdown
|
private java.io.PrintStream |
logging
|
private InstanceGetter[] |
rc2
|
(package private) 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. |
private java.util.HashMap |
serviceProviders
Hash table 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 TimerFactory |
timerFactory
|
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)
|
(package private) 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. |
private 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). |
(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. |
private void |
determineSupportedServiceProviders()
Determine which of the set of service providers (PersistentService objects) are supported in the current environment. |
(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. |
private boolean |
findProviderAndStartService(java.lang.String name,
java.util.Properties properties,
boolean bootTime)
Find a provider and start a service. |
protected PersistentService |
findProviderForCreate(java.lang.String name)
|
private PersistentService |
findProviderFromName(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()
Return the application set of properties which correspond to the set of properties in the file derby.properties. |
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. |
private java.util.Vector |
getDefaultImplementations()
|
(package private) java.util.Properties |
getDefaultModuleProperties()
Get the complete set of module properties by loading in contents of all the org/apache/derby/modules.properties files. |
private 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.lang.String subSubProtocol)
Return a PersistentService implementation to handle the 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.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.lang.String subSubProtocol)
Find the StorageFactory class name that handles the subSub protocol. |
InfoStreams |
getSystemStreams()
Get the defined default system streams object. |
private java.io.PrintWriter |
getTempWriter()
|
TimerFactory |
getTimerFactory()
Returns the Timer factory for this system. |
UUIDFactory |
getUUIDFactory()
Return the UUID factory for this system. |
(package private) 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)
|
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)
Removes a PersistentService. |
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 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 |
---|
private java.util.HashMap serviceProviders
java.util.Vector[] implementationSets
private java.util.Vector services
java.util.Properties bootProperties
java.util.Properties applicationProperties
boolean inShutdown
private InfoStreams systemStreams
private ContextService contextService
private UUIDFactory uuidFactory
private TimerFactory timerFactory
boolean reportOn
private java.io.PrintStream logging
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 |
---|
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 Derby error.public java.util.Locale setLocale(java.util.Properties serviceProperties, java.lang.String userDefinedLocale) throws StandardException
setLocale
in interface ModuleFactory
StandardException
- Standard Derby 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()
ModuleFactory
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 final boolean startPersistentService(java.lang.String name, java.util.Properties properties) throws StandardException
startPersistentService
in interface ModuleFactory
name
- Name of the service to be startedproperties
- Property set made available to all modules booted
for this service, through their ModuleControl.boot method.
StandardException
- An attempt to start the service failed.ModuleFactory.startPersistentService(java.lang.String, java.util.Properties)
,
Monitor.startPersistentService(java.lang.String, java.util.Properties)
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
name
- : Service name to be removed.
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)
private java.util.Vector getImplementations(java.util.Properties moduleList, boolean actualModuleList)
private boolean getPersistentServiceImplementation(java.lang.Class possibleModule)
private java.util.Vector getDefaultImplementations()
java.util.Properties getDefaultModuleProperties()
protected static java.util.Properties removeRuntimeProperties(java.util.Properties properties)
abstract java.io.InputStream applicationPropertiesStream() throws java.io.IOException
java.io.IOException
protected java.util.Properties readApplicationProperties()
private void determineSupportedServiceProviders()
private void bootPersistentServices()
protected void bootProviderServices(PersistentService provider)
private boolean findProviderAndStartService(java.lang.String name, java.util.Properties properties, boolean bootTime) throws StandardException
StandardException
protected PersistentService findProviderForCreate(java.lang.String name) throws StandardException
StandardException
private PersistentService findProviderFromName(java.lang.String name, int colon) throws StandardException
StandardException
public PersistentService getServiceProvider(java.lang.String subSubProtocol) throws StandardException
ModuleFactory
getServiceProvider
in interface ModuleFactory
StandardException
private PersistentService getPersistentService(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.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
public TimerFactory getTimerFactory()
getTimerFactory
in interface ModuleFactory
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
abstract boolean initialize(boolean lite)
|
Built on Thu 2010-12-23 20:49:13+0000, from revision ??? | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |