org.atmosphere.grizzly
Class AtmosphereSpadeServer

java.lang.Object
  extended by org.atmosphere.grizzly.AtmosphereSpadeServer

public final class AtmosphereSpadeServer
extends Object

Simple Atmosphere REST based Server builder:

AtmosphereSpadeServer.build("http://localhost:8080/","org.foo.bar").start()

which listen on localhost:8080 for resources starting with package org.foo.bar.

Author:
Jean-francois Arcand

Method Summary
 AtmosphereSpadeServer addAtmosphereHandler(String mapping, AtmosphereHandler h)
          Add an AtmosphereHandler
static AtmosphereSpadeServer build(String u)
          Create a AtmosphereSpadeServer which listen based using the URI u.
static AtmosphereSpadeServer build(String u, com.sun.grizzly.SSLConfig sslConfig)
          Create a AtmosphereSpadeServer which listen based on the 'u' for requests for resources defined under the resources package.
static AtmosphereSpadeServer build(String u, String resourcesPackage)
          Create a AtmosphereSpadeServer which listen based on the 'u' for requests for resources defined under the resources package.
static AtmosphereSpadeServer build(String u, String resourcesPackage, com.sun.grizzly.SSLConfig sslConfig)
          Create a AtmosphereSpadeServer which listen based on the 'u' for requests for resources defined under the resources package.
 void setResourcePackage(String resourcePackage)
          Set the resource package name.
 AtmosphereSpadeServer start()
          Start the AtmosphereSpadeServer
 AtmosphereSpadeServer stop()
          Stop the AtmosphereSpadeServer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

build

public static AtmosphereSpadeServer build(String u)
Create a AtmosphereSpadeServer which listen based using the URI u.

Parameters:
u - The URI the server listen for requests
Returns:
an instance of AtmosphereSpadeServer

build

public static AtmosphereSpadeServer build(String u,
                                          String resourcesPackage)
Create a AtmosphereSpadeServer which listen based on the 'u' for requests for resources defined under the resources package.

Parameters:
u - The URI the server listen for requests
resourcesPackage - The resources package name.
Returns:
an instance of AtmosphereSpadeServer

build

public static AtmosphereSpadeServer build(String u,
                                          com.sun.grizzly.SSLConfig sslConfig)
Create a AtmosphereSpadeServer which listen based on the 'u' for requests for resources defined under the resources package.

Parameters:
u - The URI the server listen for requests
sslConfig - The SSLConfig
Returns:
an instance of AtmosphereSpadeServer

build

public static AtmosphereSpadeServer build(String u,
                                          String resourcesPackage,
                                          com.sun.grizzly.SSLConfig sslConfig)
Create a AtmosphereSpadeServer which listen based on the 'u' for requests for resources defined under the resources package.

Parameters:
u - The URI the server listen for requests
resourcesPackage - The resources package name.
sslConfig - The SSLConfig
Returns:

addAtmosphereHandler

public AtmosphereSpadeServer addAtmosphereHandler(String mapping,
                                                  AtmosphereHandler h)
Add an AtmosphereHandler


setResourcePackage

public void setResourcePackage(String resourcePackage)
Set the resource package name.


start

public AtmosphereSpadeServer start()
                            throws IOException
Start the AtmosphereSpadeServer

Returns:
Throws:
IOException

stop

public AtmosphereSpadeServer stop()
                           throws IOException
Stop the AtmosphereSpadeServer

Returns:
Throws:
IOException


Copyright © 2011. All Rights Reserved.