Top Description Inners Fields Constructors Methods
org.apache.derby.impl.services.monitor

pack-priv abstract Class BaseMonitor

extends Object
implements ModuleFactory, BundleFinder
Class Inheritance
All Implemented Interfaces
org.apache.derby.shared.common.i18n.BundleFinder, org.apache.derby.iapi.services.monitor.ModuleFactory
Known Direct Subclasses
org.apache.derby.impl.services.monitor.FileMonitor
Imports
java.io.BufferedInputStream, .BufferedReader, .ByteArrayInputStream, .IOException, .InputStream, .InputStreamReader, .PrintWriter, java.lang.reflect.Constructor, .InvocationTargetException, .Method, java.net.URL, java.util.ArrayList, .Collections, .Date, .Enumeration, .HashMap, .Iterator, .List, .Locale, .NoSuchElementException, .Properties, .ResourceBundle, .StringTokenizer, .Vector, org.apache.derby.shared.common.error.ErrorStringBuilder, .ExceptionSeverity, .ShutdownException, .StandardException, org.apache.derby.shared.common.reference.Attribute, .MessageId, .Module, .Property, .SQLState, org.apache.derby.iapi.services.context.Context, .ContextManager, .ContextService, org.apache.derby.shared.common.i18n.BundleFinder, .MessageService, org.apache.derby.shared.common.info.JVMInfo, org.apache.derby.iapi.services.io.AccessibleByteArrayOutputStream, .FormatIdUtil, .FormatableInstanceGetter, .RegisteredFormatIds, .StoredFormatIds, org.apache.derby.iapi.services.loader.ClassInfo, .InstanceGetter, org.apache.derby.iapi.services.monitor.ModuleControl, .ModuleFactory, .ModuleSupportable, .Monitor, .PersistentService, org.apache.derby.iapi.services.property.PropertyUtil, org.apache.derby.shared.common.stream.InfoStreams, .PrintWriterGetHeader, org.apache.derby.iapi.services.timer.TimerFactory, org.apache.derby.iapi.services.uuid.UUIDFactory, org.apache.derby.io.StorageFactory, org.apache.derby.shared.common.sanity.SanityManager

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

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv class

Field Summary

Modifier and TypeField and Description
pack-priv Properties
pack-priv Properties
private ContextService
pack-priv ThreadGroup
private boolean
private List<List<Class<?>>>
pack-priv boolean
private static final String
private PrintWriter
private InstanceGetter[]
pack-priv boolean
private static final String
SERVICE

Look for any services in the a properties set and the application property set and then start them.

private final HashMap<String, PersistentService>
serviceProviders

Hash table of objects that implement PersistentService keyed by their getType() method.

private final Vector<TopService>
private static final HashMap<String, String>
private InfoStreams
private TimerFactory
private AccessibleByteArrayOutputStream
private PrintWriter
private UUIDFactory

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
private void
addDebugFlags(String flags, boolean set)

pack-priv abstract InputStream
applicationPropertiesStream()

Get InputStream for application properties file Returns nul if it does not exist.

pack-priv static void
boot(Object module, boolean create, 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 Object
bootService(PersistentService provider, String factoryInterface, String serviceName, Properties properties, boolean create)

Boot (start or create) a service (persistent or non-persistent).

pack-priv static boolean
canSupport(Object instance, Properties properties)

If the module implements ModuleSupportable then call its canSupport() method to see if it can or should run in this setup.

public InstanceGetter

Returns:

a reference InstanceGetter
classFromIdentifier
(int
identifer to associate with class
fmtId
)

Implements org.apache.derby.iapi.services.monitor.ModuleFactory.classFromIdentifier.

Obtain a class that supports the given identifier.

public Object

Returns:

The module from the service if it was created successfully, null if a service already existed.
createPersistentService
(String factoryInterface, String name, Properties properties)

Implements org.apache.derby.iapi.services.monitor.ModuleFactory.createPersistentService.

Create a persistent service.

private void
determineSupportedServiceProviders()

Determine which of the set of service providers (PersistentService objects) are supported in the current environment.

pack-priv void
private void
dumpTempWriter(boolean bothPlaces)

private static int
findImplementation(List<Class<?>> implementations, int startIndex, Class<?> factoryInterface)

Find a class that implements the required index, return the index into the implementations vector of that class.

public Object
findModule(Object serviceModule, String factoryInterface, String identifier)

Implements org.apache.derby.iapi.services.monitor.ModuleFactory.findModule.

Find the module in the system with the given module protocol, protocolVersion and identifier.

private boolean
findProviderAndStartService(String name, Properties properties, boolean bootTime)

Find a provider and start a service.

protected PersistentService
private PersistentService
findProviderFromName(String name, int colon)

Find the service provider from a name that includes a service type, ie.

public Object
findService(String factoryInterface, String serviceName)

Implements org.apache.derby.iapi.services.monitor.ModuleFactory.findService.

Find a service.

private synchronized TopService
findTopService(Object serviceModule)

public Properties
getApplicationProperties()

Implements org.apache.derby.iapi.services.monitor.ModuleFactory.getApplicationProperties.

Return the application set of properties which correspond to the set of properties in the file derby.properties.

public ResourceBundle
getBundle(String
Message being searched for.
messageId
)

Implements org.apache.derby.shared.common.i18n.BundleFinder.getBundle.

Get the locale from the ContextManager and then find the bundle based upon that locale.

public String
getCanonicalServiceName(String userSpecifiedName)

Implements org.apache.derby.iapi.services.monitor.ModuleFactory.getCanonicalServiceName.

Canonicalize a service name, mapping different user-specifications of a database name onto a single, standard name.

private static ContextService
getContextService()

Must be private so that user code can't call this entry point.

public Thread
getDaemonThread(Runnable task, String name, boolean setMinPriority)

Implements org.apache.derby.iapi.services.monitor.ModuleFactory.getDaemonThread.

Get a newly created background thread.

private Vector<Class<?>>
pack-priv Properties
getDefaultModuleProperties()

Get the complete set of module properties by loading in contents of all the org/apache/derby/modules.properties files.

private Vector<Class<?>>
getImplementations(Properties moduleList, boolean actualModuleList)

Create an implementation set.

public Locale
getLocale(Object serviceModule)

Implements org.apache.derby.iapi.services.monitor.ModuleFactory.getLocale.

Return the locale of the service that the passed in module lives in. Will return null if no-locale has been defined.

public Locale
getLocaleFromString(String localeDescription)

Implements org.apache.derby.iapi.services.monitor.ModuleFactory.getLocaleFromString.

Translate a string of the form ll[_CC[_variant]] to a Locale.

private PersistentService

Returns:

Valid PersistentService or null if the protocol is not handled.
getPersistentService
(String subSubProtocol)

Return a PersistentService implementation to handle the subSubProtocol.

private PersistentService
getPersistentService(final String className, String subSubProtocol)

private boolean
public String[]

Returns:

The list of service names, if no services exist that implement the protocol an array with zero elements is returned.
getServiceList
(String protocol)

Implements org.apache.derby.iapi.services.monitor.ModuleFactory.getServiceList.

Return an array of the service identifiers that are running and implement the passed in protocol (java interface class name).

public String
getServiceName(Object serviceModule)

Implements org.apache.derby.iapi.services.monitor.ModuleFactory.getServiceName.

Return the name of the service that the passed in module lives in.

public PersistentService
getServiceProvider(String subSubProtocol)

Implements org.apache.derby.iapi.services.monitor.ModuleFactory.getServiceProvider.

Return the PersistentService for a subsubprotocol.

public PersistentService
getServiceType(Object serviceModule)

Implements org.apache.derby.iapi.services.monitor.ModuleFactory.getServiceType.

Return the PersistentService object for a service.

private String

Returns:

Valid class name, or null if no StorageFactory handles the protocol.
getStorageFactoryClassName
(String subSubProtocol)

Find the StorageFactory class name that handles the subSub protocol.

public InfoStreams
getSystemStreams()

Implements org.apache.derby.iapi.services.monitor.ModuleFactory.getSystemStreams.

Get the defined default system streams object.

private PrintWriter
public TimerFactory

Returns:

the system's Timer factory.
getTimerFactory
()

Implements org.apache.derby.iapi.services.monitor.ModuleFactory.getTimerFactory.

Returns the Timer factory for this system.

public UUIDFactory
getUUIDFactory()

Implements org.apache.derby.iapi.services.monitor.ModuleFactory.getUUIDFactory.

Return the UUID factory for this system.

pack-priv abstract boolean
initialize(boolean lite)

Initialize the monitor wrt the current environemnt.

public final boolean
isDaemonThread(Thread
the thread to check
thread
)

Implements org.apache.derby.iapi.services.monitor.ModuleFactory.isDaemonThread.

Check if a thread is a daemon thread created by getDaemonThread.

protected Object
loadInstance(Class<?> factoryInterface, Properties properties)

load a module instance.

private Object
loadInstance(List<Class<?>> implementations, Class<?> factoryInterface, Properties properties)

private Object

Returns:

the instantiated object
newInstance
(Class<?>
the class to instantiate
classObject
)

Return a new instance of class classObject using a no-param constructor.

public Object

Returns:

a reference to a newly created object or null if a matching class cannot be found.
newInstanceFromIdentifier
(int
identifer to associate with class
identifier
)

Implements org.apache.derby.iapi.services.monitor.ModuleFactory.newInstanceFromIdentifier.

Obtain an new instance of a class that supports the given identifier.

protected Properties
public void
removePersistentService(String
: Service name to be removed.
name
)

Implements org.apache.derby.iapi.services.monitor.ModuleFactory.removePersistentService.

Removes a PersistentService.

protected static Properties
removeRuntimeProperties(Properties properties)

Return a property set that has the runtime properties removed.

protected void
report(String message)

Should only be called if reportOn is true apart from report/Exception().

protected void
protected final void
public Locale
setLocale(Object serviceModule, String
A String in the form xx_YY, where xx is the language code and YY is the country code.
userDefinedLocale
)

Implements org.apache.derby.iapi.services.monitor.ModuleFactory.setLocale.

Set the locale for the service *outside* of boot time.

public Locale
setLocale(Properties serviceProperties, String userDefinedLocale)

Implements org.apache.derby.iapi.services.monitor.ModuleFactory.setLocale.

Set the locale for the service at boot time.

private static Locale
setLocale(Properties properties)

private static boolean
setMonitor(final BaseMonitor baseMonitor)

Must be private so that user code can't call this entry point.

public void
shutdown()

Implements org.apache.derby.iapi.services.monitor.ModuleFactory.shutdown.

Shut down the complete system that was started by this Monitor.

public void
shutdown(Object serviceModule)

Implements org.apache.derby.iapi.services.monitor.ModuleFactory.shutdown.

Shut down a service that was started by this Monitor.

public Object
startModule(boolean create, Object serviceModule, String factoryInterface, String identifier, Properties properties)

Implements org.apache.derby.iapi.services.monitor.ModuleFactory.startModule.

Start a module.

public Object
startNonPersistentService(String factoryInterface, String serviceName, Properties properties)

Implements org.apache.derby.iapi.services.monitor.ModuleFactory.startNonPersistentService.

Start a non-persistent service.

public final boolean
startPersistentService(String
Name of the service to be started
name
,
Properties
Property set made available to all modules booted for this service, through their ModuleControl.boot method.
properties
)

Implements org.apache.derby.iapi.services.monitor.ModuleFactory.startPersistentService.

Start a peristent service.

protected void
startProviderService(PersistentService provider, String serviceName, Properties serviceProperties)

Boot a service under the control of the provider

public void
startServices(Properties properties, boolean bootAll)

Implements org.apache.derby.iapi.services.monitor.ModuleFactory.startServices.

Start all services identified by derby.service.* in the property set.

private static Locale
staticGetLocaleFromString(String localeDescription)

private static void
stopContextService()

Must be private so that user code can't call this entry point.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait