org.apache.avalon.framework.availability
Interface AvailabilityAware


public interface AvailabilityAware

An Availability contract between the container and the component.

A component that implements AvailabilityAware, is capable to be notified that components that it has previously looked up via the ServiceManager.lookup() method are made available and non-available, and can gracefully handle unavailability.

Containers are only required to support this interface, if the container supports dynamic loading/unloading of components, hot-deploys, remote components and similar cases where components may disappear for a shorter or longer period of time.

Since:
4.5
Version:
$Id$
Author:
Avalon Development Team

Method Summary
 void componentAvailable(java.lang.String key)
          Notification that component is available.
 void componentUnavailable(java.lang.String key)
          Notification that component is no longer available.
 

Method Detail

componentAvailable

public void componentAvailable(java.lang.String key)
Notification that component is available.

The component that previously has been looked up in the ServiceManager, using key is now available. This method can either be called after the componentUnavailable() method signalled that a component is no longer available, OR if the ServiceManager.lookup() returned a null (optional lookup) indicating that the requested component didn't exist.

This method will NOT be called with a key argument that has not been used in a ServiceManager.lookup() previously.

Parameters:
key - The key that was used to lookup the component in the ServiceManager earlier.

componentUnavailable

public void componentUnavailable(java.lang.String key)
Notification that component is no longer available.

The component that previously has been looked up in the ServiceManager, using key is no longer available. The container does not place any restrictions on how long the component will be unavailble, and the AvailabilityAware component, must employ one or more strategies on how to gracefully handle short and long absences of dependent components.

This method will NOT be called with a key argument that has not been used in a ServiceManager.lookup() previously.

Parameters:
key - The key that was used to lookup the component in the ServiceManager earlier.


Copyright © 1997-2005 The Apache Software Foundation. All Rights Reserved.