org.apache.derby.impl.services.monitor
Class TopService

java.lang.Object
  extended by org.apache.derby.impl.services.monitor.TopService

final class TopService
extends java.lang.Object

A description of an instance of a module.


Field Summary
(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 moduleInstances
           
(package private)  BaseMonitor monitor
           
(package private)  java.util.Hashtable 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
TopService(BaseMonitor monitor)
           
TopService(BaseMonitor monitor, ProtocolKey key, PersistentService serviceType, java.util.Locale serviceLocale)
           
 
Method Summary
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 a ModuleInstance object whose getInstance() method returns the object specified by the instance 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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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 protocolTable
List of protocols.


moduleInstances

java.util.Vector 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 a ModuleInstance object whose getInstance() method returns the object specified by the instance parameter.

Parameters:
instance - the instance to look for
Returns:
a ModuleInstance object, or null 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.
  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.

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)

Built on Thu 2011-03-10 11:54:14+0000, from revision ???

Apache Derby V10.6 Internals - Copyright © 2004,2007 The Apache Software Foundation. All Rights Reserved.