org.cometd.bayeux.server
Interface BayeuxServer

All Superinterfaces:
Bayeux

public interface BayeuxServer
extends Bayeux

The Bayeux Server interface.

An instance of the BayeuxServer interface is available to webapplications from via the "org.cometd.bayeux" attribute of the javax.servlet.ServletContext.

The BayeuxServer API gives access to the ServerSessions via the getSession(String) method. It also allows new LocalSession to be created within the server using the newLocalSession(String) method.

ServerChannel instances may be accessed via the getChannel(String) method, but the server has no direct relationship with SessionChannels or ClientSession. If subscription semantics is required, then the newLocalSession(String) method should be used to create a LocalSession that can subscribe and publish like a remote bayeux session.


Nested Class Summary
static interface BayeuxServer.BayeuxServerListener
           
static interface BayeuxServer.ChannelListener
           
static interface BayeuxServer.Extension
          Extension API for bayeux server.
static interface BayeuxServer.SessionListener
           
static interface BayeuxServer.SubscriptionListener
           
 
Field Summary
static java.lang.String ATTRIBUTE
          ServletContext attribute name used to obtain the Bayeux object
 
Method Summary
 void addExtension(BayeuxServer.Extension extension)
          Adds the given extension to this bayeux object.
 void addListener(BayeuxServer.BayeuxServerListener listener)
           
 ServerChannel getChannel(java.lang.String channelId)
           
 ServerChannel getChannel(java.lang.String channelId, boolean create)
           
 java.lang.Object getCurrentTransport()
          Get the current transport for the current thread.
 SecurityPolicy getSecurityPolicy()
           
 ServerSession getSession(java.lang.String clientId)
          Get a server session my ID
 LocalSession newLocalSession(java.lang.String idHint)
          Create a local session.
 ServerMessage.Mutable newMessage()
          Create a new Message.
 void removeListener(BayeuxServer.BayeuxServerListener listener)
           
 void setSecurityPolicy(SecurityPolicy securityPolicy)
           
 
Methods inherited from interface org.cometd.bayeux.Bayeux
getAllowedTransports, getKnownTransportNames, getOption, getOptionNames, getTransport, setOption
 

Field Detail

ATTRIBUTE

static final java.lang.String ATTRIBUTE
ServletContext attribute name used to obtain the Bayeux object

See Also:
Constant Field Values
Method Detail

addExtension

void addExtension(BayeuxServer.Extension extension)
Adds the given extension to this bayeux object.

Parameters:
extension - the extension to add
See Also:
#removeExtension(Extension)

addListener

void addListener(BayeuxServer.BayeuxServerListener listener)
Parameters:
listener -

removeListener

void removeListener(BayeuxServer.BayeuxServerListener listener)
Parameters:
listener -

getChannel

ServerChannel getChannel(java.lang.String channelId)
Parameters:
channelId -
Returns:

getChannel

ServerChannel getChannel(java.lang.String channelId,
                         boolean create)
Parameters:
channelId -
create -
Returns:

getSession

ServerSession getSession(java.lang.String clientId)
Get a server session my ID

Parameters:
clientId - the ID
Returns:
the server session or null if no such valid session exists.

newLocalSession

LocalSession newLocalSession(java.lang.String idHint)
Create a local session. A Local session is a server-side ClientSession. This allows the server to have special clients resident within the same JVM.

Parameters:
idHint - A hint to be included in the unique client ID.
Returns:
A new LocalSession

newMessage

ServerMessage.Mutable newMessage()
Create a new Message.

Returns:
A new or recycled message instance.

getSecurityPolicy

SecurityPolicy getSecurityPolicy()
Returns:

setSecurityPolicy

void setSecurityPolicy(SecurityPolicy securityPolicy)
Parameters:
securityPolicy -

getCurrentTransport

java.lang.Object getCurrentTransport()
Get the current transport for the current thread. A transport object will be:



Copyright © 2010 Dojo Foundation. All Rights Reserved.