org.electrocodeogram.cpc.core.api.provider
Interface IManagableProvider

All Superinterfaces:
IProvider
All Known Subinterfaces:
IPoolableProvider

public interface IManagableProvider
extends IProvider

Special extension interface for IProvider which provides internal life cycle management methods.

This interface lists provider instance management related methods which must only be called by the active IProviderRegistry implementation.

All IProvider implementations must also implement this interface.
Their corresponding API interfaces should not extend this interface.

Author:
vw
See Also:
IProvider

Method Summary
 void onLoad()
          Called when this provider is first returned to a user by the IProviderRegistry.
 void onUnload()
          Called when this provider is unregistered with the IProviderRegistry.
 
Methods inherited from interface org.electrocodeogram.cpc.core.api.provider.IProvider
getProviderName, toString
 

Method Detail

onLoad

void onLoad()
Called when this provider is first returned to a user by the IProviderRegistry.
The method will be called only once per provider instance.

If this provider was registered as a singleton, subsequent requests to IProviderRegistry.lookupProvider(Class) will always return the same instance and onLoad() will not be called again.

In other words, it is guaranteed that this method is called exactly once before this instance is first used.

Clients must not call this method.


onUnload

void onUnload()
Called when this provider is unregistered with the IProviderRegistry.
It is guaranteed that this provider will not be used again once this method was called.

For a provider instance which has not been registered as a singleton this method will be called once the client indicates that it no longer needs this provider. However, a client is not required to do so!

Providers should not depend on this method for their correct operation. There may be shutdown scenarios in which the IProviderRegistry will not be able to unregister all providers in time. And there may be situations in which clients are not notifying the provider registry about no longer needed provider instances.
A provider instance may thus be garbage collected without ever receiving a call to this method.

Clients must not call this method.