cz.cuni.amis.pogamut.base.communication.command.impl
Class Act

Package class diagram package Act
java.lang.Object
  extended by cz.cuni.amis.pogamut.base.communication.command.impl.Act
All Implemented Interfaces:
IJMXEnabled, IAct, IComponent

public final class Act
extends Object
implements IComponent, IAct, IJMXEnabled

TODO!

Ignores IComponentControlHelper.startPaused(), performs IComponentControlHelper.start() in both start cases.

Author:
Jimmy

Field Summary
static cz.cuni.amis.utils.token.Token COMPONENT_ID
           
static String DEFAULT_LINE_END
          Default termination of commands.
 
Constructor Summary
Act(IWorldWriterProvider writerProvider, ICommandSerializer serializer, IComponentBus eventBus, IAgentLogger logger)
           
 
Method Summary
 void act(CommandMessage command)
          Sends command through the writer.
 void addCommandListener(Class commandClass, ICommandListener listener)
          Attach listener to outgoing commands from body.
 void enableJMX(MBeanServer mBeanServer, ObjectName parent)
          Method for starting the JMX extension of the class.
 cz.cuni.amis.utils.token.Token getComponentId()
          Unique identification of the component.
 LogCategory getLog()
           
 boolean isCommandListening(Class commandClass, ICommandListener listener)
          Whether the listener is listening for commands of commandClass.
 void removeCommandListener(Class commandClass, ICommandListener listener)
          Remove the listener to outgoing commands.
protected  void sendCommand(CommandMessage command)
          Provides the implementation how to send 'command' through 'this.writer'.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

COMPONENT_ID

public static final cz.cuni.amis.utils.token.Token COMPONENT_ID

DEFAULT_LINE_END

public static final String DEFAULT_LINE_END
Default termination of commands.

See Also:
Constant Field Values
Constructor Detail

Act

@Inject
public Act(IWorldWriterProvider writerProvider,
                  ICommandSerializer serializer,
                  IComponentBus eventBus,
                  IAgentLogger logger)
Method Detail

getComponentId

public cz.cuni.amis.utils.token.Token getComponentId()
Description copied from interface: IComponent
Unique identification of the component.

Specified by:
getComponentId in interface IComponent
Returns:

getLog

public LogCategory getLog()

sendCommand

protected void sendCommand(CommandMessage command)
Provides the implementation how to send 'command' through 'this.writer'.


act

public void act(CommandMessage command)
Sends command through the writer.

Specified by:
act in interface IAct
Parameters:
command -
Throws:
CommunicationException

addCommandListener

public void addCommandListener(Class commandClass,
                               ICommandListener listener)
Description copied from interface: IAct
Attach listener to outgoing commands from body.

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

Specified by:
addCommandListener in interface IAct
Parameters:
commandClass - which command you want to listen to

isCommandListening

public boolean isCommandListening(Class commandClass,
                                  ICommandListener listener)
Description copied from interface: IAct
Whether the listener is listening for commands of commandClass.

Specified by:
isCommandListening in interface IAct
Returns:

removeCommandListener

public void removeCommandListener(Class commandClass,
                                  ICommandListener listener)
Description copied from interface: IAct
Remove the listener to outgoing commands.

Specified by:
removeCommandListener in interface IAct
Parameters:
commandClass - which command you want to listen to

enableJMX

public void enableJMX(MBeanServer mBeanServer,
                      ObjectName parent)
Description copied from interface: IJMXEnabled
Method for starting the JMX extension of the class.

Object should register whatever objects it wants to expose via JMX.

Specified by:
enableJMX in interface IJMXEnabled
Parameters:
mBeanServer - server where the MBean of agent is registered
parent - parent's ObjectName, should be used as base of name of the registered MBean

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2012 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.