BundleFinder, ModuleFactoryFileMonitorabstract class BaseMonitor extends java.lang.Object implements ModuleFactory, BundleFinder
| Modifier and Type | Class | Description |
|---|---|---|
(package private) class |
BaseMonitor.ProviderEnumeration |
| Modifier and Type | Field | Description |
|---|---|---|
(package private) java.util.Properties |
applicationProperties |
|
(package private) java.util.Properties |
bootProperties |
|
private ContextService |
contextService |
|
(package private) java.lang.ThreadGroup |
daemonGroup |
|
private boolean |
dumpedTempWriter |
|
private java.util.List<java.util.List<java.lang.Class<?>>> |
implementationSets |
|
(package private) boolean |
inShutdown |
|
private static java.lang.String |
LINE |
|
private java.io.PrintWriter |
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<java.lang.String,PersistentService> |
serviceProviders |
Hash table of objects that implement PersistentService keyed by their getType() method.
|
private java.util.Vector<TopService> |
services |
|
private static java.util.HashMap<java.lang.String,java.lang.String> |
storageFactories |
|
private InfoStreams |
systemStreams |
|
private TimerFactory |
timerFactory |
|
private AccessibleByteArrayOutputStream |
tmpArray |
|
private java.io.PrintWriter |
tmpWriter |
|
private UUIDFactory |
uuidFactory |
| Constructor | Description |
|---|---|
BaseMonitor() |
| Modifier and Type | Method | Description |
|---|---|---|
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.List<java.lang.Class<?>> implementations,
int startIndex,
java.lang.Class<?> factoryInterface) |
Find a class that implements the required index, return the index
into the implementations vector 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.String |
getCanonicalServiceName(java.lang.String userSpecifiedName) |
Canonicalize a service name, mapping different user-specifications of a database name
onto a single, standard name.
|
private static ContextService |
getContextService() |
Privileged lookup of the ContextService.
|
java.lang.Thread |
getDaemonThread(java.lang.Runnable task,
java.lang.String name,
boolean setMinPriority) |
Get a newly created background thread.
|
private java.util.Vector<java.lang.Class<?>> |
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<java.lang.Class<?>> |
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.
|
boolean |
isDaemonThread(java.lang.Thread thread) |
Check if a thread is a daemon thread created by
ModuleFactory.getDaemonThread(java.lang.Runnable, java.lang.String, boolean). |
protected java.lang.Object |
loadInstance(java.lang.Class<?> factoryInterface,
java.util.Properties properties) |
load a module instance.
|
private java.lang.Object |
loadInstance(java.util.List<java.lang.Class<?>> implementations,
java.lang.Class<?> factoryInterface,
java.util.Properties properties) |
|
private java.lang.Object |
newInstance(java.lang.Class<?> classObject) |
Return a new instance of class
classObject using
a no-param constructor. |
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.PrintWriter 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.
|
private static boolean |
setMonitor(BaseMonitor baseMonitor) |
Privileged startup.
|
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) |
|
private static void |
stopContextService() |
Privileged shutdown of the ContextService.
|
getEngineVersion, getEnvironment, getJVMPropertyprivate final java.util.HashMap<java.lang.String,PersistentService> serviceProviders
private static final java.lang.String LINE
private java.util.List<java.util.List<java.lang.Class<?>>> implementationSets
private final java.util.Vector<TopService> 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.PrintWriter logging
java.lang.ThreadGroup daemonGroup
private InstanceGetter[] rc2
private static final java.lang.String SERVICE
private static final java.util.HashMap<java.lang.String,java.lang.String> storageFactories
private java.io.PrintWriter tmpWriter
private AccessibleByteArrayOutputStream tmpArray
private boolean dumpedTempWriter
public InfoStreams getSystemStreams()
ModuleFactorygetSystemStreams in interface ModuleFactorypublic void shutdown()
ModuleFactoryshutdown in interface ModuleFactorypublic void shutdown(java.lang.Object serviceModule)
shutdown in interface ModuleFactoryprotected final void runWithState(java.util.Properties properties,
java.io.PrintWriter log)
public java.lang.String getCanonicalServiceName(java.lang.String userSpecifiedName)
throws StandardException
ModuleFactorygetCanonicalServiceName in interface ModuleFactoryStandardExceptionpublic java.lang.Object findService(java.lang.String factoryInterface,
java.lang.String serviceName)
ModuleFactoryfindService in interface ModuleFactoryMonitor.findService(java.lang.String, java.lang.String)public java.util.Locale getLocale(java.lang.Object serviceModule)
ModuleFactorygetLocale in interface ModuleFactorypublic java.util.Locale getLocaleFromString(java.lang.String localeDescription)
throws StandardException
ModuleFactorygetLocaleFromString in interface ModuleFactoryStandardExceptionpublic java.lang.String getServiceName(java.lang.Object serviceModule)
getServiceName in interface ModuleFactorypublic java.util.Locale setLocale(java.lang.Object serviceModule,
java.lang.String userDefinedLocale)
throws StandardException
setLocale in interface ModuleFactoryuserDefinedLocale - 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 ModuleFactoryStandardException - Standard Derby error.public PersistentService getServiceType(java.lang.Object serviceModule)
getServiceType in interface ModuleFactorypublic 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 ModuleFactoryStandardException - 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)
ModuleFactoryfindModule in interface ModuleFactorypublic InstanceGetter classFromIdentifier(int fmtId) throws StandardException
classFromIdentifier in interface ModuleFactoryfmtId - identifer to associate with classStandardException - See Monitor.classFromIdentifierModuleFactory.classFromIdentifier(int)public java.lang.Object newInstanceFromIdentifier(int identifier)
throws StandardException
newInstanceFromIdentifier in interface ModuleFactoryidentifier - identifer to associate with classStandardException - See Monitor.newInstanceFromIdentifierprotected java.lang.Object loadInstance(java.lang.Class<?> factoryInterface,
java.util.Properties properties)
private java.lang.Object loadInstance(java.util.List<java.lang.Class<?>> implementations,
java.lang.Class<?> factoryInterface,
java.util.Properties properties)
private static int findImplementation(java.util.List<java.lang.Class<?>> implementations,
int startIndex,
java.lang.Class<?> factoryInterface)
private java.lang.Object newInstance(java.lang.Class<?> classObject)
classObject using
a no-param constructor.classObject - the class to instantiatepublic java.util.Properties getApplicationProperties()
ModuleFactorygetApplicationProperties in interface ModuleFactorypublic java.lang.String[] getServiceList(java.lang.String protocol)
getServiceList in interface ModuleFactoryModuleFactory.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)
ModuleFactorystartServices in interface ModuleFactorypublic final boolean startPersistentService(java.lang.String name,
java.util.Properties properties)
throws StandardException
startPersistentService in interface ModuleFactoryname - 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 ModuleFactoryStandardException - 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 ModuleFactoryname - : Service name to be removed.StandardExceptionpublic java.lang.Object startNonPersistentService(java.lang.String factoryInterface,
java.lang.String serviceName,
java.util.Properties properties)
throws StandardException
startNonPersistentService in interface ModuleFactoryStandardException - 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<java.lang.Class<?>> getImplementations(java.util.Properties moduleList,
boolean actualModuleList)
private boolean getPersistentServiceImplementation(java.lang.Class<?> possibleModule)
private java.util.Vector<java.lang.Class<?>> 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.IOExceptionprotected 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
StandardExceptionprotected PersistentService findProviderForCreate(java.lang.String name) throws StandardException
StandardExceptionprivate PersistentService findProviderFromName(java.lang.String name, int colon) throws StandardException
StandardExceptionpublic PersistentService getServiceProvider(java.lang.String subSubProtocol) throws StandardException
ModuleFactorygetServiceProvider in interface ModuleFactoryStandardExceptionprivate PersistentService getPersistentService(java.lang.String subSubProtocol) throws StandardException
StandardExceptionprivate PersistentService getPersistentService(java.lang.String className, java.lang.String subSubProtocol) throws StandardException
StandardExceptionprivate java.lang.String getStorageFactoryClassName(java.lang.String subSubProtocol)
protected void startProviderService(PersistentService provider, java.lang.String serviceName, java.util.Properties serviceProperties) throws StandardException
StandardExceptionprotected java.lang.Object bootService(PersistentService provider, java.lang.String factoryInterface, java.lang.String serviceName, java.util.Properties properties, boolean create) throws StandardException
StandardExceptionpublic UUIDFactory getUUIDFactory()
getUUIDFactory in interface ModuleFactorypublic TimerFactory getTimerFactory()
getTimerFactory in interface ModuleFactoryprivate 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
StandardExceptionprivate static java.util.Locale staticGetLocaleFromString(java.lang.String localeDescription)
throws StandardException
StandardExceptionprivate static java.util.Locale setLocale(java.util.Properties properties)
throws StandardException
StandardExceptionpublic java.util.ResourceBundle getBundle(java.lang.String messageId)
getBundle in interface BundleFindermessageId - Message being searched for.public java.lang.Thread getDaemonThread(java.lang.Runnable task,
java.lang.String name,
boolean setMinPriority)
ModuleFactorygetDaemonThread in interface ModuleFactorypublic final boolean isDaemonThread(java.lang.Thread thread)
ModuleFactoryModuleFactory.getDaemonThread(java.lang.Runnable, java.lang.String, boolean).isDaemonThread in interface ModuleFactorythread - the thread to checktrue if thread was created by
getDaemonThread(), false otherwise.private static ContextService getContextService()
private static void stopContextService()
private static boolean setMonitor(BaseMonitor baseMonitor)
abstract boolean initialize(boolean lite)
Apache Derby V10.14 Internals - Copyright © 2004,2018 The Apache Software Foundation. All Rights Reserved.