org.persvr.remote
Class EventStream
java.lang.Object
org.persvr.remote.EventStream
- All Implemented Interfaces:
- java.util.EventListener, PropertyChangeSetListener
- Direct Known Subclasses:
- ClientConnection
public class EventStream
- extends java.lang.Object
- implements PropertyChangeSetListener
This represents a stream of events. You can subscribe to the event stream with addCallback and
publish events with the fire method.
- Author:
- Kris
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
user
public User user
streams
public static java.util.Map<java.lang.String,ClientConnection> streams
finished
protected boolean finished
started
public boolean started
connectionId
public java.lang.String connectionId
bytesSent
public int bytesSent
EventStream
public EventStream()
addSubscription
public void addSubscription(java.util.Map<java.lang.String,java.lang.String> headers)
removeSubscription
public void removeSubscription(java.util.Map<java.lang.String,java.lang.String> headers)
addCallback
public void addCallback(EventStream.EventCallback callback)
eventAvailable
public boolean eventAvailable()
removeCallback
public void removeCallback()
toString
public java.lang.String toString()
- Overrides:
toString in class java.lang.Object
take
public EventStream.Notification take(int timeoutInSeconds)
propertyChange
public void propertyChange(java.util.List<ObservedCall> evts)
- Description copied from interface:
PropertyChangeSetListener
- This method gets called when bound properties are changed.
- Specified by:
propertyChange in interface PropertyChangeSetListener
- Parameters:
evts - A PropertyChangeEvent object describing the event source
and the property that has changed.
setResponse
public void setResponse(HttpServletResponse response)
finished
public void finished()
fire
public void fire(EventStream.Notification response)
throws java.io.IOException
- Throws:
java.io.IOException