org.glite.rgma
Interface Resource

All Known Subinterfaces:
Consumer, OnDemandProducer, PrimaryProducer, SecondaryProducer

public interface Resource

An object managed by a service that an API can interact with. Either a Producer or a Consumer.


Method Summary
 void close()
          Closes the resource.
 void destroy()
          Closes and destroys the resource.
 ResourceEndpoint getResourceEndpoint()
          Gets the endpoint of the resource with which the API communicates.
 TimeInterval getTerminationInterval()
          Retrieves the resource's termination interval.
 void setTerminationInterval(TimeInterval terminationInterval)
          Deprecated. Termination interval can only be set in factory create method.
 void showSignOfLife()
          Indicates to the resource that this API is still alive.
 

Method Detail

getResourceEndpoint

public ResourceEndpoint getResourceEndpoint()
Gets the endpoint of the resource with which the API communicates.

Returns:
The resource endpoint

setTerminationInterval

public void setTerminationInterval(TimeInterval terminationInterval)
                            throws RemoteException,
                                   UnknownResourceException,
                                   RGMAException
Deprecated. Termination interval can only be set in factory create method.

Sets the termination interval for this resource.

Parameters:
terminationInterval - The time interval after which the resource may destroy itself if no contact has been made from the API.
Throws:
RemoteException - If the service could not be contacted.
UnknownResourceException - If the resource could not be found.
RGMAException - If the termination interval is invalid (e.g. in the past).
See Also:
getTerminationInterval()

getTerminationInterval

public TimeInterval getTerminationInterval()
                                    throws RemoteException,
                                           UnknownResourceException
Retrieves the resource's termination interval.

Returns:
The termination interval as a TimeInterval.
Throws:
RemoteException - If the service could not be contacted.
UnknownResourceException - If the resource could not be found.
See Also:
setTerminationInterval(TimeInterval)

close

public void close()
           throws RemoteException,
                  UnknownResourceException
Closes the resource. The resource will no longer be available through this API and will be destroyed once it has finished interacting with other components.

Throws:
RemoteException - If the service could not be contacted.
UnknownResourceException - If the resource could not be found.
See Also:
destroy()

destroy

public void destroy()
             throws RemoteException,
                    UnknownResourceException
Closes and destroys the resource. The resource will no longer be available to any component.

Throws:
RemoteException - If the service could not be contacted.
UnknownResourceException - If the resource could not be found.
See Also:
close()

showSignOfLife

public void showSignOfLife()
                    throws RemoteException,
                           UnknownResourceException
Indicates to the resource that this API is still alive. This should be used to keep a resource alive when no other method needs to be called.

Throws:
RemoteException - If the service could not be contacted.
UnknownResourceException - If the resource could not be found.