Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.derby.iapi.services.monitor
Interface ModuleFactory  view ModuleFactory download ModuleFactory.java


public interface ModuleFactory

The monitor provides a central registry for all modules in the system, and manages loading, starting, and finding them.


Method Summary
 org.apache.derby.iapi.services.loader.InstanceGetter classFromIdentifier(int identifier)
          Obtain a class that supports the given identifier.
 java.lang.Object createPersistentService(java.lang.String factoryInterface, java.lang.String serviceName, java.util.Properties properties)
          Create a persistent service.
 java.lang.Object findModule(java.lang.Object service, java.lang.String protocol, java.lang.String identifier)
          Find the module in the system with the given module protocol, protocolVersion and identifier.
 java.lang.Object findService(java.lang.String protocol, java.lang.String identifier)
          Find a service.
 java.util.Properties getApplicationProperties()
           
 java.lang.Thread getDaemonThread(java.lang.Runnable task, java.lang.String name, boolean setMinPriority)
          Get a newly created background thread.
 org.apache.derby.iapi.services.info.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.
 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.
 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.
 org.apache.derby.iapi.services.stream.InfoStreams getSystemStreams()
          Get the defined default system streams object.
 org.apache.derby.iapi.services.uuid.UUIDFactory getUUIDFactory()
          Get the UUID factory for the system.
 java.lang.Object newInstanceFromIdentifier(int identifier)
          Obtain an new instance of a class that supports the given identifier.
 void removePersistentService(java.lang.String name)
           
 java.util.Locale setLocale(java.lang.Object serviceModule, java.lang.String userDefinedLocale)
          Set the locale for the service *outside* of boot time.
 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 service)
          Shut down a service that was started by this Monitor.
 java.lang.Object startModule(boolean create, java.lang.Object service, java.lang.String protocol, 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 serviceName, java.util.Properties properties)
          Start a persistent service.
 void startServices(java.util.Properties properties, boolean bootAll)
          Start all services identified by derby.service.* in the property set.
 

Method Detail

findModule

public java.lang.Object findModule(java.lang.Object service,
                                   java.lang.String protocol,
                                   java.lang.String identifier)
Find the module in the system with the given module protocol, protocolVersion and identifier.


getServiceName

public java.lang.String getServiceName(java.lang.Object serviceModule)
Return the name of the service that the passed in module lives in.


getLocale

public java.util.Locale getLocale(java.lang.Object serviceModule)
Return the locale of the service that the passed in module lives in. Will return null if no-locale has been defined.


getLocaleFromString

public java.util.Locale getLocaleFromString(java.lang.String localeDescription)
                                     throws org.apache.derby.iapi.error.StandardException
Translate a string of the form ll[_CC[_variant]] to a Locale. This is in the Monitor because we want this translation to be in only one place in the code.


setLocale

public java.util.Locale setLocale(java.lang.Object serviceModule,
                                  java.lang.String userDefinedLocale)
                           throws org.apache.derby.iapi.error.StandardException
Set the locale for the service *outside* of boot time.


setLocale

public java.util.Locale setLocale(java.util.Properties serviceProperties,
                                  java.lang.String userDefinedLocale)
                           throws org.apache.derby.iapi.error.StandardException
Set the locale for the service at boot time. The passed-in properties must be the one passed to the boot method.


getServiceType

public PersistentService getServiceType(java.lang.Object serviceModule)
Return the PersistentService object for a service. Will return null if the service does not exist.


getServiceProvider

public PersistentService getServiceProvider(java.util.Properties startParams,
                                            java.lang.String subSubProtocol)
                                     throws org.apache.derby.iapi.error.StandardException
Return the PersistentService for a subsubprotocol.


getApplicationProperties

public java.util.Properties getApplicationProperties()

shutdown

public void shutdown()
Shut down the complete system that was started by this Monitor. Will cause the stop() method to be called on each loaded module.


shutdown

public void shutdown(java.lang.Object service)
Shut down a service that was started by this Monitor. Will cause the stop() method to be called on each loaded module. Requires that a context stack exist.


classFromIdentifier

public org.apache.derby.iapi.services.loader.InstanceGetter classFromIdentifier(int identifier)
                                                                         throws org.apache.derby.iapi.error.StandardException
Obtain a class that supports the given identifier.


newInstanceFromIdentifier

public java.lang.Object newInstanceFromIdentifier(int identifier)
                                           throws org.apache.derby.iapi.error.StandardException
Obtain an new instance of a class that supports the given identifier.


getEnvironment

public java.lang.Object getEnvironment()
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.


getServiceList

public 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). This list is a snapshot of the current running systesm, once the call returns the service may have been shutdown or new ones added.


startPersistentService

public boolean startPersistentService(java.lang.String serviceName,
                                      java.util.Properties properties)
                               throws org.apache.derby.iapi.error.StandardException
Start a persistent service.
Do not call directly - use Monitor.startPersistentService()


createPersistentService

public java.lang.Object createPersistentService(java.lang.String factoryInterface,
                                                java.lang.String serviceName,
                                                java.util.Properties properties)
                                         throws org.apache.derby.iapi.error.StandardException
Create a persistent service.
Do not call directly - use Monitor.startPersistentService()


removePersistentService

public void removePersistentService(java.lang.String name)
                             throws org.apache.derby.iapi.error.StandardException

startNonPersistentService

public java.lang.Object startNonPersistentService(java.lang.String factoryInterface,
                                                  java.lang.String serviceName,
                                                  java.util.Properties properties)
                                           throws org.apache.derby.iapi.error.StandardException
Start a non-persistent service.
Do not call directly - use Monitor.startNonPersistentService()


findService

public java.lang.Object findService(java.lang.String protocol,
                                    java.lang.String identifier)
Find a service.
Do not call directly - use Monitor.findService()


startModule

public java.lang.Object startModule(boolean create,
                                    java.lang.Object service,
                                    java.lang.String protocol,
                                    java.lang.String identifier,
                                    java.util.Properties properties)
                             throws org.apache.derby.iapi.error.StandardException
Start a module.
Do not call directly - use Monitor.startSystemModule() or Monitor.bootServiceModule()


getSystemStreams

public org.apache.derby.iapi.services.stream.InfoStreams getSystemStreams()
Get the defined default system streams object.


startServices

public void startServices(java.util.Properties properties,
                          boolean bootAll)
Start all services identified by derby.service.* in the property set. If bootAll is true the services that are persistent will be booted.


getJVMProperty

public java.lang.String getJVMProperty(java.lang.String key)
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.


getDaemonThread

public java.lang.Thread getDaemonThread(java.lang.Runnable task,
                                        java.lang.String name,
                                        boolean setMinPriority)
Get a newly created background thread. The thread is set to be a daemon but is not started.


setThreadPriority

public void setThreadPriority(int priority)
Set the priority of the current thread. If the current thread was not returned by getDaemonThread() then no action is taken.


getEngineVersion

public org.apache.derby.iapi.services.info.ProductVersionHolder getEngineVersion()

getUUIDFactory

public org.apache.derby.iapi.services.uuid.UUIDFactory getUUIDFactory()
Get the UUID factory for the system. The UUID factory provides methods to create and recreate database unique identifiers.