com.cafesoft.core.lifecycle
Interface Lifecycle

All Known Subinterfaces:
ActiveDirectoryGroupNameService, ActiveDirectoryPrimaryGroupService, JdbcConnectionPoolService, LdapConnectionPoolService, LifecycleService, RemoteSessionManager, RMIRegistryProxyService, ServiceConnector, ServiceManager, ServiceProvider, UserRepositoryService
All Known Implementing Classes:
AbstractLifecycleService, AbstractServiceConnector, LifecycleBase, StandardServiceManager, StandardServiceProvider

public interface Lifecycle

Defines a common interface for component life cycle methods. Any managed component that needs to be started, and stopped during it's lifetime may implement this interface. It is up to the associated manager to invoke these methods.

Since:
12/1/01

Field Summary
static String START_EVENT
          The LifecycleEvent type for the "component start" event.
static String STOP_EVENT
          The LifecycleEvent type for the "component stop" event.
 
Method Summary
 void addLifecycleListener(LifecycleListener listener)
          Add a LifecycleEvent listener to this component.
 boolean isStarted()
          Determine if the implementing Lifecycle object has been started.
 void removeLifecycleListener(LifecycleListener listener)
          Remove a LifecycleEvent listener from this component.
 void start()
          Prepare for the beginning of active use of the public methods of this component.
 void stop()
          Gracefully terminate the active use of the public methods of this component.
 

Field Detail

START_EVENT

public static final String START_EVENT
The LifecycleEvent type for the "component start" event.

See Also:
Constant Field Values

STOP_EVENT

public static final String STOP_EVENT
The LifecycleEvent type for the "component stop" event.

See Also:
Constant Field Values
Method Detail

addLifecycleListener

public void addLifecycleListener(LifecycleListener listener)
Add a LifecycleEvent listener to this component.

Parameters:
listener - The listener to add

removeLifecycleListener

public void removeLifecycleListener(LifecycleListener listener)
Remove a LifecycleEvent listener from this component.

Parameters:
listener - The listener to remove

start

public void start()
           throws LifecycleException
Prepare for the beginning of active use of the public methods of this component. This method should be called before any of the public methods of this component are utilized. It should also send a LifecycleEvent of type START_EVENT to any registered listeners.

Throws:
LifecycleException - if this component detects a fatal error that prevents this component from being used

stop

public void stop()
          throws LifecycleException
Gracefully terminate the active use of the public methods of this component. This method should be the last one called on a given instance of this component. It should also send a LifecycleEvent of type STOP_EVENT to any registered listeners.

Throws:
LifecycleException - if this component detects a fatal error that needs to be reported

isStarted

public boolean isStarted()
Determine if the implementing Lifecycle object has been started.

Returns:
true if the Lifecycle object has been started, false otherwise.


Generated on 5:16:42 PM May 12, 2008, © 1996-2005 Cafésoft LLC. All rights reserved.