com.lightdev.app.trec.client
Interface TrecClientApplication


public interface TrecClientApplication

Applications that wish to act as a TREC client application using client stubs need to implement this interface.

Version:
1, 23.01.2006
Author:
Ulrich Hilger, Light Development, http://www.lightdev.com, info@lightdev.com, published under the terms and conditions of the BSD License, for details see file license.txt in the distribution package of this software

Method Summary
 Object deserialize(byte[] bytes)
          deserialize an object from a given byte array Typically a TREC client application uses a Client object to deserialize objects and wraps that call in a custom error handling.
 Object executeRequest(Request request, String text)
          execute a request and report success with a given message Typically a TREC client application uses a client object to execute requests.
 void executeRequest(Request request, String text, AsyncCallback listener)
          execute a request asynchronously and report success with a given message Typically a TREC client application uses a client object to execute requests.
 Client getClient()
          get the client of this TrecClientApplication Typically a TREC client application instanciates a client object to execute requests.
 byte[] serialize(Object obj)
          serialize an object to a byte array Typically a TREC client application uses a Client object to serialize objects and wraps that call in a custom error handling.
 

Method Detail

getClient

Client getClient()
get the client of this TrecClientApplication

Typically a TREC client application instanciates a client object to execute requests. To not instanciate and destroy client objects all te time such client object typically is cached and can be provided to other objects of this application through this method

Returns:
the client

executeRequest

Object executeRequest(Request request,
                      String text)
execute a request and report success with a given message

Typically a TREC client application uses a client object to execute requests. The client object however does not handle exceptions which is why a TREC client application typically should have an own execution method to implement custom exception handling. Such custom execution method can be provided to other objects of that client application through this interface method.

Parameters:
request - the request to execute
text - the text message to use as an indication for success
Returns:
the object returned by the remote method called through this request

executeRequest

void executeRequest(Request request,
                    String text,
                    AsyncCallback listener)
execute a request asynchronously and report success with a given message

Typically a TREC client application uses a client object to execute requests. The client object however does not handle exceptions which is why a TREC client application typically should have an own execution method to implement custom exception handling. Such custom execution method can be provided to other objects of that client application through this interface method.

Parameters:
request - the request to execute
text - the text message to use as an indication for success
listener - the listener that handles the result of this asynchronous call once it returns

serialize

byte[] serialize(Object obj)
serialize an object to a byte array

Typically a TREC client application uses a Client object to serialize objects and wraps that call in a custom error handling. The resulting method can be made available to other objects of this application through this method.

Parameters:
obj - the object to serialize
Returns:
the byte array resulting from the serialization

deserialize

Object deserialize(byte[] bytes)
deserialize an object from a given byte array

Typically a TREC client application uses a Client object to deserialize objects and wraps that call in a custom error handling. The resulting method can be made available to other objects of this application through this method.

Parameters:
bytes - the byte array to deserialize
Returns:
the deserialized object