things.thinger.service.command.local
Class LocalCommandResponder

java.lang.Object
  extended by things.thinger.service.command.local.LocalCommandResponder
All Implemented Interfaces:
CommandResponder

public class LocalCommandResponder
extends java.lang.Object
implements CommandResponder

The Local implementation Command Responder.

Version:
1.0

Version History

EPG - Initial - 10 APR 06
 
Author:
Erich P. Gatejen

Constructor Summary
LocalCommandResponder(Entity<LocalCommandInfo> originalCommand, Conduit responseConduit, WhoAmI serviceId, SystemInterface si)
          Construct.
 
Method Summary
 void add(NV item)
          Add a response.
 void done()
          Make the response done.
protected  void finalize()
          finalizer.
 void flush()
          Force the responder to flush.
 AttributeReader getCommandAttributes()
          Get the command attributes.
 SystemInterface getSystemInterface()
          Get a system interface.
 void remove(java.lang.String name)
          Remove a response for replacement, if possible.
 void reportFailure(java.lang.String message)
          Report a failure.
 void reportFailure(java.lang.String message, java.lang.String... attrib)
          Report a failure with attributes.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocalCommandResponder

public LocalCommandResponder(Entity<LocalCommandInfo> originalCommand,
                             Conduit responseConduit,
                             WhoAmI serviceId,
                             SystemInterface si)
                      throws java.lang.Throwable
Construct.

Parameters:
originalCommand -
responseConduit -
serviceId -
si -
Throws:
java.lang.Throwable
Method Detail

getCommandAttributes

public AttributeReader getCommandAttributes()
                                     throws SystemException
Get the command attributes.

Specified by:
getCommandAttributes in interface CommandResponder
Throws:
SystemException

add

public void add(NV item)
         throws SystemException
Add a response.

Specified by:
add in interface CommandResponder
Parameters:
item - the item
Throws:
SystemException

getSystemInterface

public SystemInterface getSystemInterface()
                                   throws SystemException
Get a system interface.

Specified by:
getSystemInterface in interface CommandResponder
Returns:
A system interface.
Throws:
SystemException

remove

public void remove(java.lang.String name)
            throws SystemException
Remove a response for replacement, if possible. If the reponder has been flushed, the response may have already been transmitted, and then it is too late. So be careful with this.

Specified by:
remove in interface CommandResponder
Parameters:
name - the item to replace
Throws:
SystemException

flush

public void flush()
           throws SystemException
Force the responder to flush. This should make it transmit.

Specified by:
flush in interface CommandResponder
Throws:
SystemException

done

public void done()
          throws SystemException
Make the response done. This is a TERMINAL reciept. This will flush. Any further adds or replaces will result in an exception. It'll throw an exception if we are done--either through happiness or error.

Specified by:
done in interface CommandResponder
Throws:
SystemException

reportFailure

public void reportFailure(java.lang.String message)
                   throws SystemException
Report a failure. This is a TERMINAL reciept. It'll throw an exception if we are done (TERMINAL reciept)--either through happiness or error.

Parameters:
message - the test of the failure.
Throws:
SystemException

reportFailure

public void reportFailure(java.lang.String message,
                          java.lang.String... attrib)
                   throws SystemException
Report a failure with attributes. This is a TERMINAL reciept. It'll throw an exception if we are done (TERMINAL reciept)--either through happiness or error.

Parameters:
message - the test of the failure.
attrib - Name/value pairs that will make us the attributes.
Throws:
SystemException

finalize

protected void finalize()
                 throws java.lang.Throwable
finalizer.

Overrides:
finalize in class java.lang.Object
Throws:
java.lang.Throwable


Things.