things.thinger.service.actor
Class ActorClientBase

java.lang.Object
  extended by things.thinger.service.actor.ActorClientBase

public abstract class ActorClientBase
extends java.lang.Object

The actor client base. This can be used to make specific clients.

Version:
1.0

Version History

EPG - Initial - 12 MAY 07
 
Author:
Erich P. Gatejen

Field Summary
protected  Logger logger
          Usable local logger.
protected  SystemInterface si
          The System Interface
 
Constructor Summary
ActorClientBase()
           
 
Method Summary
abstract  void init_chain()
          Init the Service.
abstract  void message_ack(int sequence, java.lang.String response)
          Manage an NACK message.
abstract  void message_chain(ActorMessage e)
          Client base does not handle this kind of message.
abstract  void message_log(java.lang.String logEntry)
          Manage an LOG message.
abstract  void message_nack(int sequence, java.lang.String response)
          Manage an ACK message.
abstract  void quit_chain()
          The service is going.
 void recieve()
          Give the client a chance to handle inbound messages.
 void send(ActorMessage message)
          Send a message.
 void start(java.lang.String host, java.lang.String port, java.lang.String serviceClass, SystemInterface si)
          Start a session.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected Logger logger
Usable local logger.


si

protected SystemInterface si
The System Interface

Constructor Detail

ActorClientBase

public ActorClientBase()
Method Detail

init_chain

public abstract void init_chain()
                         throws java.lang.Throwable
Init the Service.

Throws:
java.lang.Throwable

quit_chain

public abstract void quit_chain()
                         throws java.lang.Throwable
The service is going.

Throws:
java.lang.Throwable

message_chain

public abstract void message_chain(ActorMessage e)
                            throws java.lang.Throwable
Client base does not handle this kind of message. Implementing class should. Letting exceptions out of this method will generally foul the client for good.

Parameters:
e - A received message.
Throws:
java.lang.Throwable

message_ack

public abstract void message_ack(int sequence,
                                 java.lang.String response)
                          throws java.lang.Throwable
Manage an NACK message. Letting exceptions out of this method will generally foul the client for good.

Throws:
java.lang.Throwable

message_nack

public abstract void message_nack(int sequence,
                                  java.lang.String response)
                           throws java.lang.Throwable
Manage an ACK message. Letting exceptions out of this method will generally foul the client for good.

Throws:
java.lang.Throwable

message_log

public abstract void message_log(java.lang.String logEntry)
                          throws java.lang.Throwable
Manage an LOG message. Letting exceptions out of this method will generally foul the client for good.

Throws:
java.lang.Throwable

start

public void start(java.lang.String host,
                  java.lang.String port,
                  java.lang.String serviceClass,
                  SystemInterface si)
           throws java.lang.Throwable
Start a session. If the session cannot be establish, it will throw an exception.

Parameters:
host - The host to connect to.
port - The target port.
serviceClass - The class name of the service at the distant end.
si - The system interface
Throws:
java.lang.Throwable

recieve

public void recieve()
             throws java.lang.Throwable
Give the client a chance to handle inbound messages. It is a sort of yield. This will automatically happen after a send.

Throws:
java.lang.Throwable

send

public void send(ActorMessage message)
          throws java.lang.Throwable
Send a message.

Parameters:
message - the message.
Throws:
java.lang.Throwable


Things.