org.atmosphere.nettosphere
Class Config.Builder

java.lang.Object
  extended by org.atmosphere.nettosphere.Config.Builder
Enclosing class:
Config

public static final class Config.Builder
extends Object


Constructor Summary
Config.Builder()
           
 
Method Summary
 Config.Builder broadcaster(Class<org.atmosphere.cpr.Broadcaster> broadcasterClass)
          Configure the default Broadcaster
 Config.Builder broadcasterCache(Class<? extends org.atmosphere.cpr.BroadcasterCache> broadcasterCache)
          Configure the default BroadcasterCache
 Config.Builder broadcasterFactory(org.atmosphere.cpr.BroadcasterFactory broadcasterFactory)
          Configure the default BroadcasterFactory
 Config build()
          Build an instance of this class.
 Config.Builder configFile(String atmosphereDotXmlPath)
          The path location of the atmosphere.xml file.
 Config.Builder handler(Handler handler)
          Add an Handler mapped to the default, which is '/*'
 Config.Builder handler(String path, Handler handler)
          Add an Handler that will be mapped to the specified path
 Config.Builder host(String host)
          The server's host
 Config.Builder initParam(String name, String value)
          Add some init param
 Config.Builder interceptor(org.atmosphere.cpr.AtmosphereInterceptor interceptor)
          Add an AtmosphereInterceptor
 Config.Builder port(int port)
          The server's port
 Config.Builder resource(Class<?> c)
          Add a Jersey/JAX RS resource.
 Config.Builder resource(String staticResourcePath)
          The path location of static resource (e.g html)
 Config.Builder resource(String path, org.atmosphere.cpr.AtmosphereHandler c)
          Add an AtmosphereHandler that will be mapped to the specified path
 Config.Builder resource(String path, Class<?> c)
          Add an Jersey/JAX RS that will be mapped to the specified path
 Config.Builder resource(String path, javax.servlet.Servlet c)
          Add an Servlet that will be mapped to the specified path
 Config.Builder webSocketProtocol(Class<? extends org.atmosphere.websocket.WebSocketProtocol> webSocketProtocol)
          Configure the default WebSocketProtocol
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Config.Builder

public Config.Builder()
Method Detail

resource

public Config.Builder resource(String staticResourcePath)
The path location of static resource (e.g html)

Parameters:
staticResourcePath -
Returns:

configFile

public Config.Builder configFile(String atmosphereDotXmlPath)
The path location of the atmosphere.xml file.

Parameters:
atmosphereDotXmlPath - path location of the atmosphere.xml file.
Returns:
this

host

public Config.Builder host(String host)
The server's host

Parameters:
host - server's host
Returns:
this

port

public Config.Builder port(int port)
The server's port

Parameters:
port - server's port
Returns:
this

initParam

public Config.Builder initParam(String name,
                                String value)
Add some init param

Parameters:
name - the name
value - the value
Returns:
this

resource

public Config.Builder resource(String path,
                               org.atmosphere.cpr.AtmosphereHandler c)
Add an AtmosphereHandler that will be mapped to the specified path

Parameters:
path - a mapping path
c - an AtmosphereHandler
Returns:
this

resource

public Config.Builder resource(String path,
                               javax.servlet.Servlet c)
Add an Servlet that will be mapped to the specified path

Parameters:
path - a mapping path
c - an Servlet
Returns:
this

handler

public Config.Builder handler(Handler handler)
Add an Handler mapped to the default, which is '/*'

Parameters:
handler - Handler
Returns:
this

handler

public Config.Builder handler(String path,
                              Handler handler)
Add an Handler that will be mapped to the specified path

Parameters:
handler - Handler
Returns:
this

resource

public Config.Builder resource(Class<?> c)
Add a Jersey/JAX RS resource.

Parameters:
c - a Jersey/JAX RS resource.
Returns:
this

resource

public Config.Builder resource(String path,
                               Class<?> c)
Add an Jersey/JAX RS that will be mapped to the specified path

Parameters:
path - a mapping path
c - an Jersey/JAX RS
Returns:
this

broadcaster

public Config.Builder broadcaster(Class<org.atmosphere.cpr.Broadcaster> broadcasterClass)
Configure the default Broadcaster

Parameters:
broadcasterClass - a Broadcaster
Returns:
this

broadcasterFactory

public Config.Builder broadcasterFactory(org.atmosphere.cpr.BroadcasterFactory broadcasterFactory)
Configure the default BroadcasterFactory

Parameters:
broadcasterFactory - a BroadcasterFactory's class
Returns:
this

broadcasterCache

public Config.Builder broadcasterCache(Class<? extends org.atmosphere.cpr.BroadcasterCache> broadcasterCache)
Configure the default BroadcasterCache

Parameters:
broadcasterCache - a BroadcasterCache's class
Returns:
this

webSocketProtocol

public Config.Builder webSocketProtocol(Class<? extends org.atmosphere.websocket.WebSocketProtocol> webSocketProtocol)
Configure the default WebSocketProtocol

Parameters:
webSocketProtocol - a WebSocketProtocol's class
Returns:
this

interceptor

public Config.Builder interceptor(org.atmosphere.cpr.AtmosphereInterceptor interceptor)
Add an AtmosphereInterceptor

Parameters:
interceptor - an AtmosphereInterceptor
Returns:

build

public Config build()
Build an instance of this class.

Returns:


Copyright © 2012. All Rights Reserved.