Saros
Distributed Collaborative Editing and Distributed Party Programming
de.fu_berlin.inf.dpp.project.internal.ActivitySequencer Class Reference

Inherits Startable.

List of all members.

Classes

class  ActivityBuffer< T >
class  SequencedActivities

Public Member Functions

 ActivitySequencer (final ISarosSession sarosSession, final ITransmitter transmitter, final IReceiver receiver, final DispatchThreadContext threadContext)
void start ()
void stop ()
void setCallback (IActivitySequencerCallback callback)
void sendActivity (List< User > recipients, final IActivity activity)
void registerUser (User user)
void unregisterUser (User user)
void flush (User user)

Package Functions

boolean isUserRegistered (User user)

Detailed Description

The ActivitySequencer is responsible for making sure that transformed IActivity activities} are sent and received in the right order.

Author:
rdjemili
coezbek
marrin

Constructor & Destructor Documentation

de.fu_berlin.inf.dpp.project.internal.ActivitySequencer.ActivitySequencer ( final ISarosSession  sarosSession,
final ITransmitter  transmitter,
final IReceiver  receiver,
final DispatchThreadContext  threadContext 
)

Member Function Documentation

void de.fu_berlin.inf.dpp.project.internal.ActivitySequencer.flush ( User  user)

Waits until all buffered activities for the specific user are sent. Calling sendActivity at the same time may or may not ignore those new activities.

Parameters:
user
boolean de.fu_berlin.inf.dpp.project.internal.ActivitySequencer.isUserRegistered ( User  user) [package]

For testing purposes only.

Parameters:
user
Returns:
void de.fu_berlin.inf.dpp.project.internal.ActivitySequencer.registerUser ( User  user)

Registers a user with the sequencer allowing the sending and receiving to and from this user. The local user of a session does not need to be registered as it is always allowed to send activities to the local user itself.

Parameters:
user
void de.fu_berlin.inf.dpp.project.internal.ActivitySequencer.sendActivity ( List< User recipients,
final IActivity  activity 
)

Sends an activity to the given recipients.

void de.fu_berlin.inf.dpp.project.internal.ActivitySequencer.setCallback ( IActivitySequencerCallback  callback)
void de.fu_berlin.inf.dpp.project.internal.ActivitySequencer.start ( )

Starts the sequencer. After the sequencer is started activities can be send and received. The sequencer can only be started once.

Exceptions:
IllegalStateExceptionif the sequencer is already started
See also:
stop()
void de.fu_berlin.inf.dpp.project.internal.ActivitySequencer.stop ( )

Stops the sequencer. After the sequencer is stopped activities can no longer be send and received.

Exceptions:
IllegalStateExceptionif the sequencer is not started
See also:
start()
void de.fu_berlin.inf.dpp.project.internal.ActivitySequencer.unregisterUser ( User  user)

Unregisters a user from the sequencer disallowing the sending and receiving to and from this user.

Parameters:
user
 All Classes Namespaces Files Functions Variables Enumerations