toolbox.services.socket.simple
Class SimpleSocketServiceImpl

Package class diagram package SimpleSocketServiceImpl
java.lang.Object
  extended by toolbox.services.BaseService
      extended by toolbox.services.socket.SocketClientService
          extended by toolbox.services.socket.simple.SimpleSocketServiceImpl
All Implemented Interfaces:
Service, SimpleSocketService

public class SimpleSocketServiceImpl
extends SocketClientService
implements SimpleSocketService

Default implementation of the SimpleSocketService interface.


Constructor Summary
SimpleSocketServiceImpl()
          Default constructor.
 
Method Summary
 void publish(SocketMessage message)
          Perform a 1-way asynhronous fire and forget operation.
 SocketMessage request(SocketMessage message)
          Perform a 2-way synchronous request/reply operation.
 
Methods inherited from class toolbox.services.socket.SocketClientService
create, destroy, getSocketClient, getSocketClientManager
 
Methods inherited from class toolbox.services.BaseService
getConfigHome, getName, getProperties, getProperty, getXMLProperties, logConfig, logFine, logFiner, logFinest, logInfo, logSevere, logWarning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleSocketServiceImpl

public SimpleSocketServiceImpl()
Default constructor.

Method Detail

request

public SocketMessage request(SocketMessage message)
                      throws SimpleSocketException
Perform a 2-way synchronous request/reply operation.

Specified by:
request in interface SimpleSocketService
Parameters:
message - SocketMessage instance containing the request data.
Returns:
SocketMessage instance with the reply data.
Throws:
SimpleSocketException - if an error occurs during socket communication.

publish

public void publish(SocketMessage message)
             throws SimpleSocketException
Perform a 1-way asynhronous fire and forget operation. At the lowest level of interaction this method silently ignores any response from the client socket. However, this class returns an empty response if the sokcet communication succeeded and throws an exception if a socket connectiviy problem occurred.

Specified by:
publish in interface SimpleSocketService
Parameters:
message - SocketMessage instance containing the publish data.
Throws:
SimpleSocketException - if the publish action could not be performed.