|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwt.services.StandardManager
wt.services.StandardManagerService
A reference implementation of a ManagerService. A service which starts up, shuts down and provides access to, managers.
Use the newStandardManagerService
static factory method(s),
not the StandardManagerService
constructor, to construct
instances of this class. Instances must be constructed using the static
factory(s), in order to ensure proper initialization of the instance.
Supported API: true
Extendable: false
ManagerService
,
ManagerResources
,
Serialized FormField Summary | |
private static String |
CLASSNAME
|
private static String |
DEPTH_INDICATOR
|
private StandardKeyedEventDispatcher |
eventDispatcher
|
private ManagerResourceFactory |
factory
|
private Vector |
keyedEventBranches
|
private static String |
RESOURCE
|
private StartupHandler |
startupHandler
|
Fields inherited from class wt.services.StandardManager |
|
Fields inherited from interface wt.services.Manager |
MANAGER_SERVICE, STARTUP_AUTOMATIC, STARTUP_MANUAL, STATUS_EMERGENCY_SHUTDOWN, STATUS_EMERGENCY_SHUTTING_DOWN, STATUS_SHUTDOWN, STATUS_SHUTDOWN_ERRORS, STATUS_SHUTDOWN_FAILURE, STATUS_SHUTTING_DOWN, STATUS_STARTED, STATUS_STARTED_ERRORS, STATUS_STARTING_UP, STATUS_STARTUP_FAILURE |
Fields inherited from interface wt.events.KeyedEventDispatcher |
EVENT_KEY_DELIMITER, EVENT_KEY_ROOT |
Constructor Summary | |
StandardManagerService()
|
Method Summary | |
KeyedEventBranch |
addEventBranch(String eventKey,
String eventClassName,
String eventType)
Create and register an event key branch. |
void |
addEventListener(KeyedEventListener listener,
String eventKey)
Add a synchronous "in thread/transaction" event listener. |
void |
dispatchEvent(Object event,
String eventKey)
Dispatch a non-vetoable single-object event to all listeners for the event key. |
void |
dispatchMultiObjectEvent(Object event,
String eventKey)
Dispatch a non-vetoable multi-object event to all listeners for the event key. |
void |
dispatchVetoableEvent(Object event,
String eventKey)
Dispatch a vetoable single-object event to all listeners for the event key. |
void |
dispatchVetoableMultiObjectEvent(Object event,
String eventKey)
Dispatch a vetoable multi-object event to all listeners for the event key. |
Enumeration |
getAllEventBranches()
Return all event branches Supported API: true |
String |
getConceptualClassname()
Deprecated. |
KeyedEventBranch |
getEventBranch(String eventKey)
Return the event key branch which exactly matches the event key. |
Vector |
getKeyedEventBranches()
Gets the object for the association that plays role: keyedEventBranches. |
Manager |
getManager(Class managerClass)
Return the concrete instance of the manager for the specified abstract manager name. |
Manager |
getManager(Class aClass,
Object managedObject)
Return the concrete instance of the manager for the specified abstract manager name. |
boolean |
hasManager(Class aClass)
Indicate whether an instance of the passed class is available. |
boolean |
hasManager(Class aClass,
Object managedObject)
Indicate whether an instance of the passed class is available. |
protected void |
initialize()
Supported API: false |
void |
intDispatchVetoableEvent(Object event,
String eventKey,
boolean isSingleObjectEvent)
|
static StandardManagerService |
newStandardManagerService()
Supported API: false |
protected void |
performShutdownProcess()
Dummy method to be overridden by subclasses. |
protected void |
performStartupProcess()
Dummy method to be overridden by subclasses. |
void |
printAllEventBranches()
Print all event branches Supported API: false |
KeyedEventBranch |
removeEventBranch(String eventKey)
Locate and remove the event key branch which exactly matches the event key. |
void |
removeEventListener(KeyedEventListener listener,
String eventKey)
Remove an event listener. |
void |
setKeyedEventBranches(Vector a_KeyedEventBranches)
Sets the object for the association that plays role: keyedEventBranches. |
protected String |
truncateEventKey(String eventKey)
Utility used to "climb the event tree"; strips off the trailing key token yielding the event key of the parent branch. |
protected boolean |
waitForManagersToShutdown()
Supported API: false |
protected boolean |
waitForManagersToStartup()
Supported API: false |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface wt.services.Manager |
emergencyShutdown, getManagerService, getManagerStatus, getName, getStartupType, isStarted, registerEvents, setManagerService, shutdown, startup |
Methods inherited from interface wt.fc.NetFactor |
getClassInfo |
Field Detail |
private static final String RESOURCE
private static final String CLASSNAME
private static final String DEPTH_INDICATOR
private StandardKeyedEventDispatcher eventDispatcher
private StartupHandler startupHandler
private ManagerResourceFactory factory
private Vector keyedEventBranches
Constructor Detail |
public StandardManagerService()
Method Detail |
public String getConceptualClassname()
getConceptualClassname
in interface NetFactor
getConceptualClassname
in class StandardManager
public static StandardManagerService newStandardManagerService() throws WTException
WTException
protected boolean waitForManagersToStartup()
protected boolean waitForManagersToShutdown()
protected void performStartupProcess() throws ManagerException
performStartupProcess
in class StandardManager
ManagerException
protected void performShutdownProcess() throws ManagerException
performShutdownProcess
in class StandardManager
ManagerException
public Manager getManager(Class managerClass)
getManager
in interface ManagerService
managerClass
-
public boolean hasManager(Class aClass)
hasManager
in interface ManagerService
aClass
-
public Manager getManager(Class aClass, Object managedObject)
getManager
in interface ManagerService
aClass
- managedObject
-
public boolean hasManager(Class aClass, Object managedObject)
hasManager
in interface ManagerService
aClass
- managedObject
-
public KeyedEventBranch addEventBranch(String eventKey, String eventClassName, String eventType) throws IllegalArgumentException
addEventBranch
in interface KeyedEventDispatcher
eventKey
- eventClassName
- eventType
-
IllegalArgumentException
public KeyedEventBranch getEventBranch(String eventKey)
getEventBranch
in interface KeyedEventDispatcher
eventKey
-
public KeyedEventBranch removeEventBranch(String eventKey)
removeEventBranch
in interface KeyedEventDispatcher
eventKey
-
public Enumeration getAllEventBranches()
getAllEventBranches
in interface KeyedEventDispatcher
public void addEventListener(KeyedEventListener listener, String eventKey)
addEventListener
in interface KeyedEventDispatcher
listener
- the listener to be added.eventKey
- the key which identifies the branch for listening.public void removeEventListener(KeyedEventListener listener, String eventKey)
removeEventListener
in interface KeyedEventDispatcher
listener
- the listener to be removedeventKey
- the key which identifies the branch from wihch to removepublic void dispatchEvent(Object event, String eventKey)
Perform a synchronous "in thread/transaction" notification of each
event listener for the event branch identified by the event key.
Call the notifyEvent operation on each subscriber. If a multi-object
notifyMultiObjectEvent exists for a subscriber, convert the single-object
event to an multi-object event and call the multi-object subscriber's
notifyMultiObjectEvent.
Supported API: true
dispatchEvent
in interface KeyedEventDispatcher
event
- the event to be dispatchedeventKey
- the key of the event branch which has the subscriberspublic void dispatchVetoableEvent(Object event, String eventKey) throws WTException
Perform a synchronous "in thread/transaction" notification of each
event listener for the event branch identified by the event key.
Call the notifyVetoableEvent operation on each subscriber. If a multi-object
notifyVetoableMultiObjectEvent exists for a subscriber, convert the
single-object event to an multi-object event and call the multi-object
subscriber's notifyVetoableMultiObjectEvent. If the subscriber objects
to the event is may throw an excpetion which will be returned to the
operation invoker. It is upto the dispatch invoker and the exception
thrower to agree on what exception is to be thrown.
Supported API: true
dispatchVetoableEvent
in interface KeyedEventDispatcher
event
- eventKey
-
WTException
public void dispatchMultiObjectEvent(Object event, String eventKey)
Perform a synchronous "in thread/transaction" notification of each
event listener for the event branch identified by the event key.
Call the notifyMultiObjectEvent operation on each subscriber. If
a single-object notifyEvent exists for a subscriber, convert the multi-object
event to an array of single-object events and loop over the single-object
subscriber's notifyEvent.
Supported API: true
dispatchMultiObjectEvent
in interface KeyedEventDispatcher
event
- the event to be dispatchedeventKey
- the key of the event branch which has the subscriberspublic void dispatchVetoableMultiObjectEvent(Object event, String eventKey) throws WTException
Perform a synchronous "in thread/transaction" notification of each
event listener for the event branch identified by the event key.
Call the notifyVetoableMultiObjectEvent operation on each subscriber.
If a single-object notifyVetoabelEvent exists for a subscriber, convert
the multi-object event to an array of single-object events and loop
over the single-object subscriber's notifyVetoableEvent. If the subscriber
objects to the event is may throw an excpetion which will be returned
to the operation invoker. It is upto the dispatch invoker and the
exception thrower to agree on what exception is to be thrown.
Supported API: true
dispatchVetoableMultiObjectEvent
in interface KeyedEventDispatcher
event
- eventKey
-
WTException
public void printAllEventBranches()
printAllEventBranches
in interface KeyedEventDispatcher
protected String truncateEventKey(String eventKey)
eventKey
-
public Vector getKeyedEventBranches()
public void setKeyedEventBranches(Vector a_KeyedEventBranches) throws WTPropertyVetoException
a_KeyedEventBranches
-
WTPropertyVetoException
protected void initialize() throws WTException
StandardManager
initialize
in class StandardManager
WTException
public void intDispatchVetoableEvent(Object event, String eventKey, boolean isSingleObjectEvent) throws WTException
WTException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |