Class TopService
- java.lang.Object
-
- org.apache.derby.impl.services.monitor.TopService
-
final class TopService extends java.lang.Object
A description of an instance of a module.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) boolean
inShutdown
(package private) ProtocolKey
key
The idenity of this service, note that it may not be active yet.(package private) java.util.Vector<ModuleInstance>
moduleInstances
(package private) BaseMonitor
monitor
(package private) java.util.Hashtable<ProtocolKey,ModuleInstance>
protocolTable
List of protocols.(package private) java.util.Locale
serviceLocale
(package private) PersistentService
serviceType
The type of service this was created by.(package private) ModuleInstance
topModule
The 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 boolean
addToProtocol(ProtocolKey key, ModuleInstance module)
Add a running module into the protocol hash table.(package private) java.lang.Object
bootModule(boolean create, java.lang.Object service, ProtocolKey key, java.util.Properties properties)
Boot a module, performs three steps.(package private) 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.private ModuleInstance
findModuleInstance(java.lang.Object instance)
Find aModuleInstance
object whosegetInstance()
method returns the object specified by theinstance
parameter.ProtocolKey
getKey()
(package private) java.lang.Object
getService()
(package private) PersistentService
getServiceType()
(package private) boolean
inService(java.lang.Object instance)
(package private) boolean
isActiveService()
(package private) boolean
isActiveService(ProtocolKey otherKey)
(package private) boolean
isPotentialService(ProtocolKey otherKey)
(package private) void
setTopModule(java.lang.Object instance)
(package private) boolean
shutdown()
If the service is already beign shutdown we return false.private static void
stop(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 aModuleInstance
object whosegetInstance()
method returns the object specified by theinstance
parameter.- Parameters:
instance
- the instance to look for- Returns:
- a
ModuleInstance
object, ornull
if no match was found
-
bootModule
java.lang.Object bootModule(boolean create, java.lang.Object service, ProtocolKey key, java.util.Properties properties) throws StandardException
Boot 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)
-
-