edu.cmu.aura.service
Class SimpleClient

java.lang.Object
  |
  +--edu.cmu.aura.service.SimpleClient
All Implemented Interfaces:
QueryClient, java.rmi.Remote

public abstract class SimpleClient
extends java.lang.Object
implements QueryClient

This class should be extended by clients that desire to receive results from posted queries and triggers. One or both of queryExecuted() and triggerFired() should be implemented by the client in order to actually receive results from posted queries and triggers.


Field Summary
protected  edu.cmu.aura.service.rpc.RemoteReference refToThis
           
protected  QueryClientSkel skel
           
protected  edu.cmu.aura.service.rpc.SkelServer skelServer
           
 
Constructor Summary
SimpleClient(int port)
          Construct a simple client listening on a specified port.
 
Method Summary
 void finalize()
           
 edu.cmu.aura.service.rpc.RemoteReference getReference()
          Returns a reference to this client.
 void queryExecuted(int queryID, QueryResult queryResult)
          Called by a service to inform a client of the result of a posted query.
 void triggerFired(int triggerID, QueryResult queryResult)
          Called by a service to inform clients of results of triggers.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

skelServer

protected edu.cmu.aura.service.rpc.SkelServer skelServer

skel

protected QueryClientSkel skel

refToThis

protected edu.cmu.aura.service.rpc.RemoteReference refToThis
Constructor Detail

SimpleClient

public SimpleClient(int port)
             throws java.io.IOException
Construct a simple client listening on a specified port.

Parameters:
port - port to listen on
Method Detail

queryExecuted

public void queryExecuted(int queryID,
                          QueryResult queryResult)
                   throws java.rmi.RemoteException
Called by a service to inform a client of the result of a posted query. The default implementation does nothing. Clients that actually wish to receive results should implement override this.

Specified by:
queryExecuted in interface QueryClient
Parameters:
queryID - the ID of the posted query
queryResult - the result of the posted query execution
java.rmi.RemoteException

triggerFired

public void triggerFired(int triggerID,
                         QueryResult queryResult)
                  throws java.rmi.RemoteException
Called by a service to inform clients of results of triggers. The default implementation does nothing. Clients that actually wish to receive results should implement override this.

Specified by:
triggerFired in interface QueryClient
Parameters:
queryResult - the result of a trigger execution
java.rmi.RemoteException

getReference

public edu.cmu.aura.service.rpc.RemoteReference getReference()
Returns a reference to this client.

Specified by:
getReference in interface QueryClient
Returns:
return a reference to this client

finalize

public void finalize()
Overrides:
finalize in class java.lang.Object