Rio Project 4.2 API Documentation



org.rioproject.resources.servicecore
Class AbstractProxy

java.lang.Object
  extended by org.rioproject.resources.servicecore.AbstractProxy
All Implemented Interfaces:
Serializable, Remote, Administrable, ReferentUuid, EventProducer, MonitorableService, Service, Watchable

public abstract class AbstractProxy
extends Object
implements ReferentUuid, Service, Serializable

Defines an abstract class that supplies basic referent UUID and serialization behavior for Service proxies.

Author:
Dennis Reedy
See Also:
Serialized Form

Field Summary
protected  Remote server
          The server
protected  Uuid uuid
          The unique identifier for this proxy
 
Constructor Summary
AbstractProxy(Remote server, Uuid uuid)
           
 
Method Summary
 boolean equals(Object o)
           
 WatchDataSource[] fetch()
          Returns an array of all WatchDataSource instances
 WatchDataSource fetch(String id)
          Returns an array of WatchDataSource instances that match the input id.
 Object getAdmin()
           
 Uuid getReferentUuid()
           
 int hashCode()
          Proxies for servers with the same uuid have the same hash code.
 Lease monitor(long duration)
          Establish a Lease to monitor the reachability of the Service
 void ping()
          Low cost roundtrip check
 EventRegistration register(EventDescriptor descriptor, RemoteEventListener listener, MarshalledObject handback, long duration)
          The register method creates a leased EventRegistration for the EventDescriptor type passed in based on the requested lease duration.
 void startHeartbeat(String[] configArgs)
          Start a heartbeat mechanism to determine the reachability of the Service.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

server

protected final Remote server
The server


uuid

protected final Uuid uuid
The unique identifier for this proxy

Constructor Detail

AbstractProxy

public AbstractProxy(Remote server,
                     Uuid uuid)
Method Detail

hashCode

public int hashCode()
Proxies for servers with the same uuid have the same hash code.

Overrides:
hashCode in class Object

equals

public boolean equals(Object o)
Overrides:
equals in class Object

ping

public void ping()
          throws RemoteException
Description copied from interface: MonitorableService
Low cost roundtrip check

Specified by:
ping in interface MonitorableService
Throws:
RemoteException - If an error occured during communication with the service
See Also:
MonitorableService.ping()

monitor

public Lease monitor(long duration)
              throws LeaseDeniedException,
                     RemoteException
Description copied from interface: MonitorableService
Establish a Lease to monitor the reachability of the Service

Specified by:
monitor in interface MonitorableService
Parameters:
duration - The duration (in milliseconds) of the requested Lease
Returns:
Lease The Lease to maintain
Throws:
LeaseDeniedException - If requested Lease is denied
RemoteException - If communication errors occur
See Also:
MonitorableService.monitor(long)

startHeartbeat

public void startHeartbeat(String[] configArgs)
                    throws ConfigurationException,
                           RemoteException
Description copied from interface: MonitorableService
Start a heartbeat mechanism to determine the reachability of the Service. The endpoint to send the heartbeat to will be found by the configuration property
 org.rioproject.fdh.HeartbeatFaultDetectionHandler.heartbeatServer
 

Specified by:
startHeartbeat in interface MonitorableService
Parameters:
configArgs - Configuration attributes the Service will use to establish a heartbeat mechanism
Throws:
ConfigurationException - If there are errors processing the configuration
RemoteException - If communication errors occur
See Also:
MonitorableService.startHeartbeat(java.lang.String[])

register

public EventRegistration register(EventDescriptor descriptor,
                                  RemoteEventListener listener,
                                  MarshalledObject handback,
                                  long duration)
                           throws LeaseDeniedException,
                                  UnknownEventException,
                                  RemoteException
Description copied from interface: EventProducer
The register method creates a leased EventRegistration for the EventDescriptor type passed in based on the requested lease duration. The implied semantics of notification are dependant on EventHandler specializations.

Specified by:
register in interface EventProducer
Parameters:
descriptor - The EventDescriptor to register
listener - A RemoteEventListener
handback - A MarshalledObject referencing a handback object to be used with Event notification
duration - Requested EventRegistration lease duration
Returns:
An EventRegistration
Throws:
LeaseDeniedException - if the duration parameter is not accepted
UnknownEventException - if the service does not produce events described by the EventDescriptor
RemoteException - if communication errors occur
See Also:
EventProducer.register(org.rioproject.event.EventDescriptor, net.jini.core.event.RemoteEventListener, java.rmi.MarshalledObject, long)

fetch

public WatchDataSource[] fetch()
                        throws RemoteException
Description copied from interface: Watchable
Returns an array of all WatchDataSource instances

Specified by:
fetch in interface Watchable
Returns:
An array of WatchDataSource objects
Throws:
RemoteException - If communication errors happen
See Also:
Watchable.fetch()

fetch

public WatchDataSource fetch(String id)
                      throws RemoteException
Description copied from interface: Watchable
Returns an array of WatchDataSource instances that match the input id.

Specified by:
fetch in interface Watchable
Parameters:
id - The identifier to fetch
Returns:
An array of WatchDataSource objects
Throws:
RemoteException - If communication errors happen
See Also:
Watchable.fetch()

getAdmin

public Object getAdmin()
                throws RemoteException
Specified by:
getAdmin in interface Administrable
Throws:
RemoteException
See Also:
Administrable.getAdmin()

getReferentUuid

public Uuid getReferentUuid()
Specified by:
getReferentUuid in interface ReferentUuid
See Also:
ReferentUuid.getReferentUuid()

Copyright © Rio Project.

Copyright © 2006-2011 Rio Project. All Rights Reserved.