net.dpml.component
Interface Provider

All Superinterfaces:
Remote

public interface Provider
extends Remote

Provider holder.

Version:
1.0.0
Author:
Digital Product Meta Library

Method Summary
 void addStateListener(StateListener listener)
          Add a state listener to the control.
 State apply(String key)
          Apply a transition to the instance.
 Object exec(String name, Object[] args)
          Invoke an operation on the instance.
 Provider getParent()
          Return a parent provider.
 State getState()
          Returns the current state of the control.
 Status getStatus()
          Return the current status of the provider.
 Object getValue(boolean isolate)
          Return the runtime value associated with this instance.
 Object invoke(String method, Object[] args)
          Invoke an operation on the instance.
 Provider lookup(Service service)
          Return a provider capable of supporting the requested service.
 void removeStateListener(StateListener listener)
          Remove a state listener from the control.
 

Method Detail

getParent

public Provider getParent()
                   throws RemoteException
Return a parent provider.

Returns:
the parent provider or null if this is a root provider
Throws:
RemoteException - if a remote I/O occurs

getStatus

public Status getStatus()
                 throws RemoteException
Return the current status of the provider.

Returns:
the provider status
Throws:
RemoteException - if a remote I/O occurs

lookup

public Provider lookup(Service service)
                throws ServiceNotFoundException,
                       RemoteException
Return a provider capable of supporting the requested service.

Parameters:
service - the service descriptor
Returns:
a component matching the requested service
Throws:
ServiceNotFoundException - if no component could found
RemoteException - if a remote I/O occurs

getState

public State getState()
               throws RemoteException
Returns the current state of the control.

Returns:
the current runtime state
Throws:
RemoteException - if a remote I/O error occurs

addStateListener

public void addStateListener(StateListener listener)
                      throws RemoteException
Add a state listener to the control.

Parameters:
listener - the state listener
Throws:
RemoteException - if a remote I/O error occurs

removeStateListener

public void removeStateListener(StateListener listener)
                         throws RemoteException
Remove a state listener from the control.

Parameters:
listener - the state listener
Throws:
RemoteException - if a remote I/O error occurs

getValue

public Object getValue(boolean isolate)
                throws RemoteException
Return the runtime value associated with this instance.

Parameters:
isolate - if TRUE the value returned is a proxy exposing the service interfaces declared by the component type otherwise the instance value is returned.
Returns:
the value
Throws:
RemoteException - if a remote I/O error occurs

apply

public State apply(String key)
            throws UnknownTransitionException,
                   InvocationTargetException,
                   RemoteException
Apply a transition to the instance.

Parameters:
key - the transition name
Returns:
the state established as a result of applying the transition
Throws:
UnknownTransitionException - if the supplied key does not map to an available transition
InvocationTargetException - if an invocation error occurs
RemoteException - if a remote I/O error occurs

exec

public Object exec(String name,
                   Object[] args)
            throws UnknownOperationException,
                   InvocationTargetException,
                   RemoteException
Invoke an operation on the instance.

Parameters:
name - the operation name
args - operation arguments
Returns:
the result of the operation invocation
Throws:
UnknownOperationException - if the supplied key does not map to an available operation
InvocationTargetException - if an invocation error occurs
RemoteException - if a remote I/O error occurs

invoke

public Object invoke(String method,
                     Object[] args)
              throws UnknownOperationException,
                     InvocationTargetException,
                     IllegalStateException,
                     RemoteException
Invoke an operation on the instance.

Parameters:
method - the operation name
args - operation arguments
Returns:
the result of the operation invocation
Throws:
UnknownOperationException - if the supplied key does not map to an available operation
InvocationTargetException - if an invocation error occurs
IllegalStateException - if the component state does not expose the operation
RemoteException - if a remote I/O error occurs