Saros
Distributed Collaborative Editing and Distributed Party Programming
de.fu_berlin.inf.dpp.session.AbstractActivityProducer Class Reference
Inheritance diagram for de.fu_berlin.inf.dpp.session.AbstractActivityProducer:
de.fu_berlin.inf.dpp.session.IActivityProducer de.fu_berlin.inf.dpp.concurrent.watchdog.ConsistencyWatchdogClient de.fu_berlin.inf.dpp.concurrent.watchdog.ConsistencyWatchdogHandler de.fu_berlin.inf.dpp.concurrent.watchdog.ConsistencyWatchdogServer de.fu_berlin.inf.dpp.core.concurrent.ConsistencyWatchdogClient de.fu_berlin.inf.dpp.core.concurrent.ConsistencyWatchdogHandler de.fu_berlin.inf.dpp.core.concurrent.ConsistencyWatchdogServer de.fu_berlin.inf.dpp.core.monitoring.remote.RemoteProgressManager de.fu_berlin.inf.dpp.core.project.internal.FollowingActivitiesManager de.fu_berlin.inf.dpp.core.project.internal.PermissionManager de.fu_berlin.inf.dpp.editor.EditorManager de.fu_berlin.inf.dpp.intellij.editor.EditorManager de.fu_berlin.inf.dpp.intellij.project.SharedResourcesManager de.fu_berlin.inf.dpp.monitoring.remote.RemoteProgressManager de.fu_berlin.inf.dpp.project.internal.ChangeColorManager de.fu_berlin.inf.dpp.project.internal.FollowingActivitiesManager de.fu_berlin.inf.dpp.project.internal.PermissionManager de.fu_berlin.inf.dpp.project.SharedResourcesManager de.fu_berlin.inf.dpp.synchronize.StopManager

List of all members.

Public Member Functions

void addActivityListener (IActivityListener listener)
void removeActivityListener (IActivityListener listener)

Protected Member Functions

final void fireActivity (IActivity activity)

Detailed Description

Standard implementation of IActivityProducer, which, in addition to the interface methods, provides an easy way to notify all listeners through fireActivity().

You probably just want to inherit from this class without overriding anything. Before your fired activities can reach other Saros session participants, you need to register your producer to the Saros session -- which provides you with at least one quite attentive listener, i.e. the Saros session -- like this:

 public class MyProducer extends AbstractActivityProducer {
   ...
   void start() {
     sarosSession.addActivityProducer(this);
   }
   void stop() {
     sarosSession.removeActivityProducer(this);
   }
   void something() {
     fireActivity(new MyActivity());
   }
 }
 

However, since addActivityListener() is public, other interested listeners might also hook into the creation process of your activities -- just as you can hook into their's.


Member Function Documentation

void de.fu_berlin.inf.dpp.session.AbstractActivityProducer.addActivityListener ( IActivityListener  listener)

Registers the given listener, so it will be informed via IActivityListener#created(IActivity).

Implements de.fu_berlin.inf.dpp.session.IActivityProducer.

final void de.fu_berlin.inf.dpp.session.AbstractActivityProducer.fireActivity ( IActivity  activity) [protected]

2, Activity sending, The abstract class to extend:

But instead of implementing the IActivityProducer interface one should extend the AbstractActivityProducer class and call the fireActivity() method on newly created activities to inform all listeners.

void de.fu_berlin.inf.dpp.session.AbstractActivityProducer.removeActivityListener ( IActivityListener  listener)

Removes a listener previously registered with addActivityListener(IActivityListener).

Implements de.fu_berlin.inf.dpp.session.IActivityProducer.

 All Classes Namespaces Files Functions Variables Enumerations