public abstract class AbstractAgent extends AbstractParticipant implements IAgent
IParticipant.State
Constructor and Description |
---|
AbstractAgent() |
Modifier and Type | Method and Description |
---|---|
void |
connect()
connect
|
protected IAgentObject |
createAgent(IIdentifier identifier) |
protected IEfferentCommandManager |
createEfferentCommandManager()
overriden to provide a
RequestableEfferentCommandManager so
that agents can create new IEfferentCommand s on the fly. |
protected ISensorObjectManager |
createSensorObjectManager() |
void |
disconnect()
disconnect, reverting to unknown
|
IAddressingInformation |
getAddressingInformation()
by default, we dont accept connections so return null
|
ICredentials |
getCredentials() |
abstract java.lang.String |
getName() |
protected void |
sensorAdded(ISensorObject sensor)
callback in response to a sensor change.
|
protected void |
sensorRemoved(ISensorObject sensor)
callback in response to a sensor change.
|
protected void |
sensorUpdated(ISensorObject sensor)
callback in response to a sensor change.
|
void |
setCredentials(ICredentials credentials) |
void |
setIdentifier(IIdentifier identifier)
called after the connection has been established..
|
void |
shutdown()
shutdown the participant if it is stopped and disconnect
|
addClientService, addServerService, checkState, clearObjectManagers, configure, createAfferentObjectManager, createAgentObjectManager, createEfferentObjectManager, createIOExecutorService, createIOHandler, createNotificationManager, createRealObjectManager, disconnect, getAfferentObjectManager, getAgentObjectManager, getCentralThreadFactory, getClock, getCommonRealityIdentifier, getEfferentCommandManager, getEfferentObjectManager, getIdentifier, getIOExecutor, getIOHandler, getIOThreadFactory, getNotificationManager, getPeriodicExecutor, getRealObjectManager, getSensorObjectManager, getServerAddressInformation, getState, initialize, reset, resume, send, setClock, setCommonRealityIdentifier, shutdown, start, stateMatches, stop, suspend, waitForState, waitForState
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
configure, disconnect, getAfferentObjectManager, getAgentObjectManager, getClock, getEfferentCommandManager, getEfferentObjectManager, getNotificationManager, getRealObjectManager, getSensorObjectManager, getState, initialize, reset, resume, send, shutdown, start, stateMatches, stop, suspend, waitForState, waitForState
getIdentifier
public ICredentials getCredentials()
getCredentials
in class AbstractParticipant
AbstractParticipant.getCredentials()
public abstract java.lang.String getName()
getName
in class AbstractParticipant
AbstractParticipant.getName()
public void setCredentials(ICredentials credentials)
setCredentials
in interface IAgent
IAgent.setCredentials(org.commonreality.message.credentials.ICredentials)
public IAddressingInformation getAddressingInformation()
getAddressingInformation
in class AbstractParticipant
AbstractParticipant.getAddressingInformation()
protected IAgentObject createAgent(IIdentifier identifier)
protected IEfferentCommandManager createEfferentCommandManager()
RequestableEfferentCommandManager
so
that agents can create new IEfferentCommand
s on the fly.createEfferentCommandManager
in class AbstractParticipant
protected ISensorObjectManager createSensorObjectManager()
createSensorObjectManager
in class AbstractParticipant
protected void sensorAdded(ISensorObject sensor)
sensor
- protected void sensorRemoved(ISensorObject sensor)
sensor
- protected void sensorUpdated(ISensorObject sensor)
sensor
- public void setIdentifier(IIdentifier identifier)
AbstractParticipant
setIdentifier
in class AbstractParticipant
public void shutdown() throws java.lang.Exception
IParticipant
shutdown
in interface IParticipant
shutdown
in class AbstractParticipant
java.lang.Exception
public void connect() throws java.lang.Exception
IParticipant
connect
in interface IParticipant
connect
in class AbstractParticipant
java.lang.Exception
IParticipant.connect()
public void disconnect() throws java.lang.Exception
IParticipant
disconnect
in interface IParticipant
disconnect
in class AbstractParticipant
java.lang.Exception