|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectthings.thinger.service.command.local.LocalCommander
public class LocalCommander
A Commander implementation intended for a local environment.
Command semantics:
Command
Some of the methods are synchronized to keep the pendingCommands safe. It might be possible to trim this some later.
- creates-[ Entity<LocalCommandInfo>(idNumber,COMMAND,ROUTINE,ConduitId.responseConduit,WhoAmI(commandIdString),id, attributeData ]
Entity(int n, Type t, Priority p, O thing, WhoAmI imposedId, WhoAmI creatorId, AttributeReader a))
- sends Entity<LocalCommandInfo> ---} myCommandConduit
[--- returns Receipt(myId, commandIdString, Receipt.Type.ACCEPTANCE, commandIdString)
Receipt(WhoAmI callerID, String theToken, Receipt.Type theType, String note)
commandIdString is the command transaction id and can be used to associate commands with responses.
CommandResponse
- gets-[ Entity<Receipt>(idNumber,COMMAND_RESPONSE,ROUTINE,Receipt,echo.Command.WhoAmI(commandIdString),id, attributeData ]
Entity(int n, Type t, Priority p, O thing, WhoAmI imposedId, WhoAmI creatorId, AttributeReader a))
Version History
EPG - Initial - 22 MAY 06
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface things.thinger.kernel.ResourceInterface |
---|
ResourceInterface.State |
Field Summary | |
---|---|
static java.lang.String |
COMMAND_ID_TAG
Command tag. |
Fields inherited from interface things.thinger.kernel.ResourceInterface |
---|
NULL_ID |
Constructor Summary | |
---|---|
LocalCommander(Conduit commandConduit,
Conduit responseConduit,
WhoAmI id)
Construct a commander. |
Method Summary | |
---|---|
void |
disposal()
Allow the disposal procecure to run. |
void |
disposeResource()
RESOURCE INTERFACE IMPLEMENTATION. |
void |
drainResponses()
Spend some time draining responses. |
WhoAmI |
getId()
RESOURCE INTERFACE IMPLEMENTATION. |
ResourceInterface.State |
getState()
RESOURCE INTERFACE IMPLEMENTATION. |
void |
initResource(WhoAmI id)
RESOURCE INTERFACE IMPLEMENTATION. |
Receipt |
issueCommand(Command commandToIssue)
This will issue a command. |
boolean |
isVerbose()
VERBOSE INTERFACE. |
boolean |
lock()
RESOURCE INTERFACE IMPLEMENTATION. |
CommandResponse |
queryResponse(Receipt commandReceipt)
Query the reponse progress a command. |
void |
screech(java.lang.String message)
VERBOSE INTERFACE. |
void |
unlock()
RESOURCE INTERFACE IMPLEMENTATION. |
void |
verboseOff()
VERBOSE INTERFACE. |
void |
verboseOn(StringPoster poster)
VERBOSE INTERFACE. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String COMMAND_ID_TAG
Constructor Detail |
---|
public LocalCommander(Conduit commandConduit, Conduit responseConduit, WhoAmI id) throws SystemException
SystemException
Method Detail |
---|
public Receipt issueCommand(Command commandToIssue) throws SystemException
issueCommand
in interface Commander
commandToIssue
- The command to issue.
SystemException
public CommandResponse queryResponse(Receipt commandReceipt) throws SystemException
queryResponse
in interface Commander
commandReceipt
- The issuance receipt.
SystemException
public void disposal() throws SystemException
This implementation will remove any references to it to it can go away for good. Any delayed command responses will get dropped and a WARNING will be logged.
disposal
in interface Commander
SystemException
public void drainResponses() throws SystemException
SystemException
public void verboseOn(StringPoster poster) throws ThingsException
verboseOn
in interface Verbose
poster
- StringPoster where to put the debug info
ThingsException
public void verboseOff()
verboseOff
in interface Verbose
public void screech(java.lang.String message)
screech
in interface Verbose
message
- The message.public boolean isVerbose()
isVerbose
in interface Verbose
public void initResource(WhoAmI id) throws SystemException
initResource
in interface ResourceInterface
id
- The id of the resource.
SystemException
WhoAmI
public void disposeResource() throws SystemException
disposeResource
in interface ResourceInterface
SystemException
public boolean lock() throws SystemException
lock
in interface ResourceInterface
SystemException
public void unlock() throws SystemException
unlock
in interface ResourceInterface
SystemException
public WhoAmI getId() throws SystemException
getId
in interface ResourceInterface
SystemException
WhoAmI
public ResourceInterface.State getState() throws SystemException
getState
in interface ResourceInterface
SystemException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |