cz.cuni.amis.pogamut.base.communication.command
Interface IAct

All Superinterfaces:
IComponent
All Known Subinterfaces:
IJNIAct
All Known Implementing Classes:
Act

public interface IAct
extends IComponent

IAct provides a way to send command messages to the world allowing you to attach listeners to outgoing commands.


Method Summary
 void act(CommandMessage command)
          Execute an action in the world.
 void addCommandListener(java.lang.Class commandClass, ICommandListener listener)
          Attach listener to outgoing commands from body.
 boolean isCommandListening(java.lang.Class commandClass, ICommandListener listener)
          Whether the listener is listening for commands of commandClass.
 void removeCommandListener(java.lang.Class commandClass, ICommandListener listener)
          Remove the listener to outgoing commands.
 
Methods inherited from interface cz.cuni.amis.pogamut.base.component.IComponent
getComponentId
 

Method Detail

act

void act(CommandMessage command)
         throws ComponentNotRunningException,
                ComponentPausedException
Execute an action in the world.

May block.

Should serialize the command object and send it through the writer that is usually provided by IWorldWriterProvider.

Throws:
ComponentNotRunningException
ComponentPausedException

addCommandListener

void addCommandListener(java.lang.Class commandClass,
                        ICommandListener listener)
Attach listener to outgoing commands from body.

After the command is sent to the world, listener will be notified.

Parameters:
commandClass - which command you want to listen to
listener -

isCommandListening

boolean isCommandListening(java.lang.Class commandClass,
                           ICommandListener listener)
Whether the listener is listening for commands of commandClass.

Parameters:
commandClass -
listener -
Returns:

removeCommandListener

void removeCommandListener(java.lang.Class commandClass,
                           ICommandListener listener)
Remove the listener to outgoing commands.

Parameters:
commandClass - which command you want to listen to
listener -