org.directwebremoting.export
Class System

java.lang.Object
  extended by org.directwebremoting.export.System

public class System
extends java.lang.Object

Various functions exported by DWR to help us with various book-keeping duties.

Author:
Joe Walker [joe at getahead dot ltd dot uk]

Constructor Summary
System()
           
 
Method Summary
 void activateCallback(java.lang.String key, RealRawData data)
          Used by reverse ajax proxies to send data back to the server
 java.lang.String generateId()
          Generates and returns a new unique id suitable to use for the CSRF session cookie.
 void pageLoaded()
          A method designed to be called on page load so the client knows about the http and script sessions.
 void pageUnloaded()
          Call ScriptSession.invalidate() on the ScriptSession that called this method.
 void publish(java.lang.String topic, RealRawData data)
          Something has published to the client side 'hub' and we're getting to know about it.
 void subscribe(java.lang.String topic, java.lang.String subscriptionId)
          Ensure that the clients know about server publishes
 boolean unsubscribe(java.lang.String subscriptionId)
          Stop notifications of against a subscription id
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

System

public System()
Method Detail

generateId

public java.lang.String generateId()
Generates and returns a new unique id suitable to use for the CSRF session cookie. This method is itself exempted from CSRF checking.


pageLoaded

public void pageLoaded()
A method designed to be called on page load so the client knows about the http and script sessions. This method doesn't actually do anything however it does allow DWR's script session checking code to work


pageUnloaded

public void pageUnloaded()
Call ScriptSession.invalidate() on the ScriptSession that called this method. Used by the page unloader.


activateCallback

public void activateCallback(java.lang.String key,
                             RealRawData data)
Used by reverse ajax proxies to send data back to the server

Parameters:
key - The unique id under which a callback is registered
data - The data to decode and pass to the callback

publish

public void publish(java.lang.String topic,
                    RealRawData data)
Something has published to the client side 'hub' and we're getting to know about it.

Parameters:
topic - The topic that has been published to
data - The published data

subscribe

public void subscribe(java.lang.String topic,
                      java.lang.String subscriptionId)
Ensure that the clients know about server publishes

Parameters:
topic - The topic being subscribed to
subscriptionId - The ID to pass back to link to client side data

unsubscribe

public boolean unsubscribe(java.lang.String subscriptionId)
Stop notifications of against a subscription id

Parameters:
subscriptionId - The ID to pass back to link to client side data
Returns:
true iff someone was unsubscribed

Copyright 2008