context.arch.comm
Interface CommunicationsHandler

All Known Implementing Classes:
BaseObject

public interface CommunicationsHandler

This interface specifies all the basic methods to allow communications with other components. Currently, this means calling userRequest, executeAsynchronousWidgetService and executeSynchronousWidgetService.


Method Summary
 DataObject executeAsynchronousWidgetService(AsyncServiceHandler handler, java.lang.String serviceHost, int servicePort, java.lang.String serviceId, java.lang.String service, java.lang.String function, AttributeNameValues input, java.lang.String requestTag)
          This method requests that a widget execute an asynchronous service
 DataObject executeSynchronousWidgetService(java.lang.String remoteHost, int remotePort, java.lang.String remoteId, java.lang.String service, java.lang.String function, AttributeNameValues input)
          This method requests that a widget execute a synchronous service
 DataObject userRequest(DataObject data, java.lang.String url)
          Method that allows a component to communicate with another component.
 DataObject userRequest(DataObject data, java.lang.String url, java.lang.String server)
          Method that allows a component to communicate with another component.
 DataObject userRequest(DataObject data, java.lang.String url, java.lang.String server, int port)
          Method that allows a component to communicate with another component.
 

Method Detail

userRequest

public DataObject userRequest(DataObject data,
                              java.lang.String url)
                       throws EncodeException,
                              InvalidProtocolException,
                              ProtocolException,
                              DecodeException,
                              InvalidDecoderException,
                              InvalidEncoderException
Method that allows a component to communicate with another component.
Parameters:
data - DataObject that contains the request
url - RPC tag that indicates the type of request
Returns:
DataObject containing the reply to the request
Throws:
EncodeException - when the encoding can't be completed successfully
DecodeException - when the decoding can't be completed successfully
InvalidEncoderException - when the encoder can't be created
InvalidDecoderException - when the decoder can't be created
ProtocolException - when the request can't be sent successfully
InvalidProtocolException - when the request can't be sent successfully due to invalid protocol use

userRequest

public DataObject userRequest(DataObject data,
                              java.lang.String url,
                              java.lang.String server)
                       throws EncodeException,
                              InvalidProtocolException,
                              ProtocolException,
                              DecodeException,
                              InvalidDecoderException,
                              InvalidEncoderException
Method that allows a component to communicate with another component.
Parameters:
data - DataObject that contains the request
url - RPC tag that indicates the type of request
server - Hostname of the component to communicate with
Returns:
DataObject containing the reply to the request
Throws:
EncodeException - when the encoding can't be completed successfully
DecodeException - when the decoding can't be completed successfully
InvalidEncoderException - when the encoder can't be created
InvalidDecoderException - when the decoder can't be created
ProtocolException - when the request can't be sent successfully
InvalidProtocolException - when the request can't be sent successfully due to invalid protocol use

userRequest

public DataObject userRequest(DataObject data,
                              java.lang.String url,
                              java.lang.String server,
                              int port)
                       throws EncodeException,
                              ProtocolException,
                              InvalidProtocolException,
                              DecodeException,
                              InvalidDecoderException,
                              InvalidEncoderException
Method that allows a component to communicate with another component.
Parameters:
data - DataObject that contains the request
url - RPC tag that indicates the type of request
server - Hostname of the component to communicate with
port - Port number of the component to communicate with
Returns:
DataObject containing the reply to the request
Throws:
EncodeException - when the encoding can't be completed successfully
DecodeException - when the decoding can't be completed successfully
InvalidEncoderException - when the encoder can't be created
InvalidDecoderException - when the decoder can't be created
ProtocolException - when the request can't be sent successfully
InvalidProtocolException - when the request can't be sent successfully due to invalid protocol use

executeAsynchronousWidgetService

public DataObject executeAsynchronousWidgetService(AsyncServiceHandler handler,
                                                   java.lang.String serviceHost,
                                                   int servicePort,
                                                   java.lang.String serviceId,
                                                   java.lang.String service,
                                                   java.lang.String function,
                                                   AttributeNameValues input,
                                                   java.lang.String requestTag)
This method requests that a widget execute an asynchronous service
Parameters:
handler - Handler to handle the results of the service
serviceHost - Hostname of the widget with the service
servicePort - Port number of the widget with the service
serviceId - Id of the widget with the service
service - Name of the widget service to run
function - Name of the particular service function to run
input - AttributeNameValues object to use to execute the service
requestTag - Unique tag provided by caller to identify result
Returns:
DataObject containing the results of the execution request

executeSynchronousWidgetService

public DataObject executeSynchronousWidgetService(java.lang.String remoteHost,
                                                  int remotePort,
                                                  java.lang.String remoteId,
                                                  java.lang.String service,
                                                  java.lang.String function,
                                                  AttributeNameValues input)
This method requests that a widget execute a synchronous service
Parameters:
remoteHost - Hostname of the widget
remotePort - Port number of the widget
remoteId - Id of the widget
service - Name of the widget service to run
function - Name of the particular service function to run
input - AttributeNameValues object to use to execute the service
Returns:
DataObject containing the results of the execution request