|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.commonreality.participant.impl.AbstractParticipant
public abstract class AbstractParticipant
Skeleton participant that handles the majority of tasks. A participants life cycle works like this: Sometime after instantiation, connect will be called which will establish the connection to CommonReality. When common reality is ready to start, it will signal that all sensors and agents should initialize. afetr initializing, start will be signaled. suspend and resume may be called while running The simulation will run for some amount of time, until stop will be called. then either reset or shutdown may be called. shutdown should then disconnect.
| Constructor Summary | |
|---|---|
AbstractParticipant(IIdentifier.Type type)
|
|
| Method Summary | |
|---|---|
void |
addClientService(org.commonreality.mina.transport.IMINATransportProvider transport,
org.commonreality.mina.protocol.IMINAProtocolConfiguration configuration,
java.net.SocketAddress address)
specify what transport, protocol and address we can use to connect to another participant (usually, just common reality) |
void |
addServerService(org.commonreality.mina.transport.IMINATransportProvider transport,
org.commonreality.mina.protocol.IMINAProtocolConfiguration configuration,
java.net.SocketAddress address)
specify what transport, protocol and address we can accessed on |
void |
configure(java.util.Map<java.lang.String,java.lang.String> options)
|
void |
connect()
|
void |
disconnect()
|
abstract IAddressingInformation |
getAddressingInformation()
|
IAfferentObjectManager |
getAfferentObjectManager()
|
IAgentObjectManager |
getAgentObjectManager()
|
IClock |
getClock()
return the clock that this participant has access to |
abstract ICredentials |
getCredentials()
|
IEfferentCommandManager |
getEfferentCommandManager()
|
IEfferentObjectManager |
getEfferentObjectManager()
|
IIdentifier |
getIdentifier()
we don't have a valid identifier until we have connected to reality |
abstract java.lang.String |
getName()
|
IRealObjectManager |
getRealObjectManager()
|
ISensorObjectManager |
getSensorObjectManager()
|
void |
initialize()
called in response to a command from Reality to get everything ready to run. |
boolean |
isConnected()
|
boolean |
isInitialized()
|
boolean |
isStarted()
|
boolean |
isSuspended()
|
void |
reset(boolean clockWillBeReset)
called when we are to reset to a post-initialize state. |
void |
resume()
|
java.util.concurrent.Future<IAcknowledgement> |
send(IMessage message)
send a message to common reality. |
void |
setIdentifier(IIdentifier identifier)
called after the connection has been established.. |
void |
shutdown()
|
void |
start()
called to actually start this participant |
void |
stop()
called when this participant needs to stop |
void |
suspend()
|
void |
waitForConnection()
|
void |
waitForInitialization()
|
void |
waitForResumption()
|
void |
waitForStart()
|
void |
waitForStop()
|
void |
waitForSuspension()
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractParticipant(IIdentifier.Type type)
| Method Detail |
|---|
public IEfferentCommandManager getEfferentCommandManager()
getEfferentCommandManager in interface IParticipantpublic IRealObjectManager getRealObjectManager()
getRealObjectManager in interface IParticipantpublic abstract IAddressingInformation getAddressingInformation()
public abstract ICredentials getCredentials()
public abstract java.lang.String getName()
public void addServerService(org.commonreality.mina.transport.IMINATransportProvider transport,
org.commonreality.mina.protocol.IMINAProtocolConfiguration configuration,
java.net.SocketAddress address)
service - address -
public void addClientService(org.commonreality.mina.transport.IMINATransportProvider transport,
org.commonreality.mina.protocol.IMINAProtocolConfiguration configuration,
java.net.SocketAddress address)
service - address - public void setIdentifier(IIdentifier identifier)
identifier - public IIdentifier getIdentifier()
getIdentifier in interface IIdentifiableIIdentifiable.getIdentifier()public final boolean isInitialized()
isInitialized in interface IParticipant
public final void waitForInitialization()
throws java.lang.InterruptedException
java.lang.InterruptedExceptionpublic final boolean isStarted()
isStarted in interface IParticipant
public final void waitForStart()
throws java.lang.InterruptedException
waitForStart in interface IParticipantjava.lang.InterruptedException
public final void waitForStop()
throws java.lang.InterruptedException
waitForStop in interface IParticipantjava.lang.InterruptedExceptionpublic final boolean isSuspended()
isSuspended in interface IParticipant
public final void waitForSuspension()
throws java.lang.InterruptedException
waitForSuspension in interface IParticipantjava.lang.InterruptedException
public final void waitForResumption()
throws java.lang.InterruptedException
waitForResumption in interface IParticipantjava.lang.InterruptedExceptionpublic final boolean isConnected()
isConnected in interface IParticipant
public final void waitForConnection()
throws java.lang.InterruptedException
waitForConnection in interface IParticipantjava.lang.InterruptedException
public void configure(java.util.Map<java.lang.String,java.lang.String> options)
throws java.lang.Exception
configure in interface IParticipantjava.lang.Exception
public void initialize()
throws java.lang.Exception
initialize in interface IParticipantjava.lang.Exception
public void start()
throws java.lang.Exception
start in interface IParticipantjava.lang.Exception
public void stop()
throws java.lang.Exception
stop in interface IParticipantjava.lang.Exception
public void suspend()
throws java.lang.Exception
suspend in interface IParticipantjava.lang.Exception
public void resume()
throws java.lang.Exception
resume in interface IParticipantjava.lang.Exception
public void reset(boolean clockWillBeReset)
throws java.lang.Exception
reset in interface IParticipantjava.lang.Exception
public void shutdown()
throws java.lang.Exception
shutdown in interface IParticipantjava.lang.Exception
public void connect()
throws java.lang.Exception
connect in interface IParticipantjava.lang.ExceptionIParticipant.connect()
public void disconnect()
throws java.lang.Exception
disconnect in interface IParticipantjava.lang.Exceptionpublic IClock getClock()
getClock in interface IParticipantpublic java.util.concurrent.Future<IAcknowledgement> send(IMessage message)
send in interface IParticipantmessage -
public ISensorObjectManager getSensorObjectManager()
getSensorObjectManager in interface IParticipantpublic IAfferentObjectManager getAfferentObjectManager()
getAfferentObjectManager in interface IParticipantpublic IEfferentObjectManager getEfferentObjectManager()
getEfferentObjectManager in interface IParticipantpublic IAgentObjectManager getAgentObjectManager()
getAgentObjectManager in interface IParticipant
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||