org.silvermoon.moonglow.common
Class Client

java.lang.Object
  |
  +--org.silvermoon.moonglow.common.Client
All Implemented Interfaces:
ResponseListener

public class Client
extends java.lang.Object
implements ResponseListener

The Client manages user requests as follows:

  1. takes request(s) from a UI, represented by Query objects
  2. instantiates the correct Plugin
  3. implements ResponseListener to listen for the results
  4. formats the Response using the correct Formatter instance
  5. outputs the result to the correct OutputStream


Constructor Summary
Client(Query query)
           
 
Method Summary
 void handleResponse(int requestId, Response response)
          Called when a Plugin object returns a Response
 void handleResponseError(int requestId, java.lang.Throwable error)
          Called when a Plugin object returns an error
 void run()
          Start the Client
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Client

public Client(Query query)
Method Detail

run

public void run()
         throws ClientException,
                PluginException
Start the Client

ClientException
PluginException

handleResponse

public void handleResponse(int requestId,
                           Response response)
Called when a Plugin object returns a Response

Specified by:
handleResponse in interface ResponseListener

handleResponseError

public void handleResponseError(int requestId,
                                java.lang.Throwable error)
Called when a Plugin object returns an error

Specified by:
handleResponseError in interface ResponseListener