public class SessionManager
extends java.lang.Object
implements java.lang.Runnable
SessionManager
is responsible for enforcing the
MultilateralProtocol
during the Session
. This is the entry
point for the negotiation algorithm. The protocol and session parameters are
passed on from the GUI.Constructor and Description |
---|
SessionManager(java.util.List<NegotiationPartyInternal> theparties,
MultilateralProtocol protocol,
Session session,
ExecutorWithTimeout exec)
Initializes a new instance of the
SessionManager object. |
Modifier and Type | Method and Description |
---|---|
void |
addLoggingListener(MultipartyNegotiationEventListener eventListener)
Adds a listener to the logging events.
|
void |
run()
Run and wait for completion.
|
void |
runAndWait()
Runs the negotiation session and wait for it to complete.
|
public SessionManager(java.util.List<NegotiationPartyInternal> theparties, MultilateralProtocol protocol, Session session, ExecutorWithTimeout exec)
SessionManager
object. After
initialization this SessionManager
can be run()
.theparties
- The parties to use in this session (including agents and
optionally mediators)protocol
- The protocol to use for this session.session
- A session object containing preset information (can also be a
new instance)exec
- the executor to use when runningpublic void run()
RuntimeException
.run
in interface java.lang.Runnable
public void runAndWait() throws ActionException, java.lang.InterruptedException, java.util.concurrent.ExecutionException, NegotiationPartyTimeoutException
ActionException
java.lang.InterruptedException
java.util.concurrent.ExecutionException
NegotiationPartyTimeoutException
public void addLoggingListener(MultipartyNegotiationEventListener eventListener)
eventListener
- The instance listening to logging events