com.bea.alsb.resources.custom
Interface ResourceManager


public interface ResourceManager

Exposed to resource provider for registering the resource and its listeners.


Method Summary
 ResourceInstanceData getRid(Ref ref)
          Method used to retrieve the ResourceInstanceData object for a given Ref
 void registerLifecycleListener(ResourceProviderListener l, String typeId)
          Add a lifecycle listener to the resource identified by typeId
 void registerLoadListener(ResourceProviderLoadListener l, String typeId)
          Add a load listener to the resource identified by typeId
 void registerProvider(ResourceProvider p)
          Registers a new provider with optional lifecycle listener
 byte[] serialize(ResourceInstanceData rid)
          To serialize ResourceInstanceData to binary representation.
 

Method Detail

registerProvider

void registerProvider(ResourceProvider p)
                      throws CustomResourceException
Registers a new provider with optional lifecycle listener

Parameters:
p - the ResourceProvider to be registered
Throws:
CustomResourceException - on error

registerLifecycleListener

void registerLifecycleListener(ResourceProviderListener l,
                               String typeId)
                               throws CustomResourceException
Add a lifecycle listener to the resource identified by typeId

Parameters:
l - the resource lifecycle listener for the given typeId
typeId - the typeId of the resource to register a listener for
Throws:
CustomResourceException - on error

registerLoadListener

void registerLoadListener(ResourceProviderLoadListener l,
                          String typeId)
                          throws CustomResourceException
Add a load listener to the resource identified by typeId

Parameters:
l - the resource load listener for the given typeId
typeId - the typeId of the resource to register a listener for
Throws:
CustomResourceException - on error

getRid

ResourceInstanceData getRid(Ref ref)
                            throws CustomResourceException
Method used to retrieve the ResourceInstanceData object for a given Ref

Parameters:
ref - the Ref to retrieve the ResourceInstanceData
Returns:
the ResourceInstanceData for the ref
Throws:
CustomResourceException - on error

serialize

byte[] serialize(ResourceInstanceData rid)
                 throws CustomResourceException
To serialize ResourceInstanceData to binary representation. This is used to solve a classloader issue. Implementation should in turn call ResourceInstanceData's serialize method.

Parameters:
rid - the ResourceInstanceData object
Returns:
the binary representation
Throws:
CustomResourceException - on error