Class TopService
- java.lang.Object
-
- org.apache.derby.impl.services.monitor.TopService
-
final class TopService extends java.lang.ObjectA description of an instance of a module.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) booleaninShutdown(package private) ProtocolKeykeyThe idenity of this service, note that it may not be active yet.(package private) java.util.Vector<ModuleInstance>moduleInstances(package private) BaseMonitormonitor(package private) java.util.Hashtable<ProtocolKey,ModuleInstance>protocolTableList of protocols.(package private) java.util.LocaleserviceLocale(package private) PersistentServiceserviceTypeThe type of service this was created by.(package private) ModuleInstancetopModuleThe top module instance
-
Constructor Summary
Constructors Constructor Description TopService(BaseMonitor monitor)TopService(BaseMonitor monitor, ProtocolKey key, PersistentService serviceType, java.util.Locale serviceLocale)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private booleanaddToProtocol(ProtocolKey key, ModuleInstance module)Add a running module into the protocol hash table.(package private) java.lang.ObjectbootModule(boolean create, java.lang.Object service, ProtocolKey key, java.util.Properties properties)Boot a module, performs three steps.(package private) java.lang.ObjectfindModule(ProtocolKey key, boolean findOnly, java.util.Properties properties)Find an module in the protocol table that supports the required protocol name combination and can handle the properties.private ModuleInstancefindModuleInstance(java.lang.Object instance)Find aModuleInstanceobject whosegetInstance()method returns the object specified by theinstanceparameter.ProtocolKeygetKey()(package private) java.lang.ObjectgetService()(package private) PersistentServicegetServiceType()(package private) booleaninService(java.lang.Object instance)(package private) booleanisActiveService()(package private) booleanisActiveService(ProtocolKey otherKey)(package private) booleanisPotentialService(ProtocolKey otherKey)(package private) voidsetTopModule(java.lang.Object instance)(package private) booleanshutdown()If the service is already beign shutdown we return false.private static voidstop(java.lang.Object instance)
-
-
-
Field Detail
-
key
ProtocolKey key
The idenity of this service, note that it may not be active yet.
-
topModule
ModuleInstance topModule
The top module instance
-
protocolTable
java.util.Hashtable<ProtocolKey,ModuleInstance> protocolTable
List of protocols.
-
moduleInstances
java.util.Vector<ModuleInstance> moduleInstances
-
monitor
BaseMonitor monitor
-
inShutdown
boolean inShutdown
-
serviceType
PersistentService serviceType
The type of service this was created by. If null then this is a non-persistent service.
-
serviceLocale
java.util.Locale serviceLocale
-
-
Constructor Detail
-
TopService
TopService(BaseMonitor monitor)
-
TopService
TopService(BaseMonitor monitor, ProtocolKey key, PersistentService serviceType, java.util.Locale serviceLocale)
-
-
Method Detail
-
setTopModule
void setTopModule(java.lang.Object instance)
-
getService
java.lang.Object getService()
-
isPotentialService
boolean isPotentialService(ProtocolKey otherKey)
-
isActiveService
boolean isActiveService()
-
isActiveService
boolean isActiveService(ProtocolKey otherKey)
-
findModule
java.lang.Object findModule(ProtocolKey key, boolean findOnly, java.util.Properties properties)
Find an module in the protocol table that supports the required protocol name combination and can handle the properties. Returns the instance of the module or null if one does not exist in the protocol table.
-
findModuleInstance
private ModuleInstance findModuleInstance(java.lang.Object instance)
Find aModuleInstanceobject whosegetInstance()method returns the object specified by theinstanceparameter.- Parameters:
instance- the instance to look for- Returns:
- a
ModuleInstanceobject, ornullif no match was found
-
bootModule
java.lang.Object bootModule(boolean create, java.lang.Object service, ProtocolKey key, java.util.Properties properties) throws StandardExceptionBoot a module, performs three steps.- Look for an existing module in the protocol table
- Look for a module in the implementation table that handles this protocol
- Create an instance that handles this protocol.
- Throws:
StandardException
-
shutdown
boolean shutdown()
If the service is already beign shutdown we return false.
-
addToProtocol
private boolean addToProtocol(ProtocolKey key, ModuleInstance module)
Add a running module into the protocol hash table. Return true if the module was added successfully, false if it couldn't be added. In the latter case the module should be shutdown if its reference count is 0.
-
inService
boolean inService(java.lang.Object instance)
-
getKey
public ProtocolKey getKey()
-
getServiceType
PersistentService getServiceType()
-
stop
private static void stop(java.lang.Object instance)
-
-