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

pack-priv final Class TopService

extends Object
Class Inheritance
Imports
org.apache.derby.iapi.services.monitor.ModuleControl, .Monitor, .PersistentService, org.apache.derby.shared.common.error.StandardException, org.apache.derby.shared.common.sanity.SanityManager, org.apache.derby.iapi.util.InterruptStatus, org.apache.derby.shared.common.reference.SQLState, .EngineType, java.util.Hashtable, .Vector, .Properties, .Locale

A description of an instance of a module.

Field Summary

Modifier and TypeField and Description
pack-priv boolean
pack-priv ProtocolKey
key

The idenity of this service, note that it may not be active yet.

pack-priv Vector<ModuleInstance>
pack-priv BaseMonitor
pack-priv Hashtable<ProtocolKey, ModuleInstance>
protocolTable

List of protocols.

pack-priv Locale
pack-priv PersistentService
serviceType

The type of service this was created by.

pack-priv ModuleInstance
topModule

The top module instance

Constructor Summary

AccessConstructor and Description
pack-priv
pack-priv
TopService(BaseMonitor monitor, ProtocolKey key, PersistentService serviceType, Locale serviceLocale)

Method Summary

Modifier and TypeMethod and Description
private boolean
addToProtocol(ProtocolKey key, ModuleInstance module)

Add a running module into the protocol hash table.

pack-priv Object
bootModule(boolean create, Object service, ProtocolKey key, Properties properties)

Boot a module, performs three steps.

pack-priv synchronized Object
findModule(ProtocolKey key, boolean findOnly, Properties properties)

Find an module in the protocol table that supports the required protocol name combination and can handle the properties.

private ModuleInstance

Returns:

a ModuleInstance object, or null if no match was found
findModuleInstance
(Object
the instance to look for
instance
)

Find a ModuleInstance object whose getInstance() method returns the object specified by the instance parameter.

public ProtocolKey
pack-priv Object
pack-priv PersistentService
pack-priv boolean
inService(Object instance)

pack-priv boolean
pack-priv boolean
pack-priv boolean
pack-priv void
setTopModule(Object instance)

pack-priv boolean
shutdown()

If the service is already beign shutdown we return false.

private static void
stop(Object instance)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

inShutdownback to summary
pack-priv boolean inShutdown
keyback to summary
pack-priv ProtocolKey key

The idenity of this service, note that it may not be active yet.

moduleInstancesback to summary
pack-priv Vector<ModuleInstance> moduleInstances
monitorback to summary
pack-priv BaseMonitor monitor
protocolTableback to summary
pack-priv Hashtable<ProtocolKey, ModuleInstance> protocolTable

List of protocols.

serviceLocaleback to summary
pack-priv Locale serviceLocale
serviceTypeback to summary
pack-priv PersistentService serviceType

The type of service this was created by. If null then this is a non-persistent service.

topModuleback to summary
pack-priv ModuleInstance topModule

The top module instance

Constructor Detail

TopServiceback to summary
pack-priv TopService(BaseMonitor monitor)
TopServiceback to summary
pack-priv TopService(BaseMonitor monitor, ProtocolKey key, PersistentService serviceType, Locale serviceLocale)

Method Detail

addToProtocolback to summary
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.

bootModuleback to summary
pack-priv Object bootModule(boolean create, Object service, ProtocolKey key, Properties properties) throws StandardException

Boot a module, performs three steps.

  1. Look for an existing module in the protocol table
  2. Look for a module in the implementation table that handles this protocol
  3. Create an instance that handles this protocol.
findModuleback to summary
pack-priv synchronized Object findModule(ProtocolKey key, boolean findOnly, 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.

findModuleInstanceback to summary
private ModuleInstance findModuleInstance(Object instance)

Find a ModuleInstance object whose getInstance() method returns the object specified by the instance parameter.

Parameters
instance:Object

the instance to look for

Returns:ModuleInstance

a ModuleInstance object, or null if no match was found

getKeyback to summary
public ProtocolKey getKey()
getServiceback to summary
pack-priv Object getService()
getServiceTypeback to summary
pack-priv PersistentService getServiceType()
inServiceback to summary
pack-priv boolean inService(Object instance)
isActiveServiceback to summary
pack-priv boolean isActiveService()
isActiveServiceback to summary
pack-priv boolean isActiveService(ProtocolKey otherKey)
isPotentialServiceback to summary
pack-priv boolean isPotentialService(ProtocolKey otherKey)
setTopModuleback to summary
pack-priv void setTopModule(Object instance)
shutdownback to summary
pack-priv boolean shutdown()

If the service is already beign shutdown we return false.

stopback to summary
private static void stop(Object instance)