org.atmosphere.cpr
Class AtmosphereResourceFactory

java.lang.Object
  extended by org.atmosphere.cpr.AtmosphereResourceFactory
Direct Known Subclasses:
DefaultAtmosphereResourceFactory

public abstract class AtmosphereResourceFactory
extends Object

A Factory used to manage AtmosphereResource instances. You can use this factory to create, remove and find AtmosphereResource instances that are associated with one or several Broadcasters.

Author:
Jeanfrancois Arcand

Constructor Summary
AtmosphereResourceFactory()
           
 
Method Summary
abstract  Set<Broadcaster> broadcasters(String uuid)
          Return all Broadcaster associated with a AtmosphereResource.uuid(), e.g for which Broadcaster.addAtmosphereResource(AtmosphereResource) has been called.
abstract  void configure(AtmosphereConfig config)
           
abstract  AtmosphereResource create(AtmosphereConfig config, AtmosphereRequest request, AtmosphereResponse response, AsyncSupport<?> a)
          Create an AtmosphereResourceImpl
abstract  AtmosphereResource create(AtmosphereConfig config, AtmosphereResponse response, AsyncSupport<?> a)
          Create an AtmosphereResourceImpl.
abstract  AtmosphereResource create(AtmosphereConfig config, Broadcaster broadcaster, AtmosphereRequest request, AtmosphereResponse response, AsyncSupport<?> a, AtmosphereHandler handler)
          Create an AtmosphereResourceImpl.
abstract  AtmosphereResource create(AtmosphereConfig config, Broadcaster broadcaster, AtmosphereRequest request, AtmosphereResponse response, AsyncSupport<?> a, AtmosphereHandler handler, AtmosphereResource.TRANSPORT t)
          Create an AtmosphereResourceImpl.
abstract  AtmosphereResource create(AtmosphereConfig config, Broadcaster broadcaster, AtmosphereResponse response, AsyncSupport<?> a, AtmosphereHandler handler)
          Create an AtmosphereResourceImpl.
abstract  AtmosphereResource create(AtmosphereConfig config, Broadcaster broadcaster, AtmosphereResponse response, AsyncSupport<?> a, AtmosphereHandler handler, AtmosphereResource.TRANSPORT t)
           
abstract  AtmosphereResource create(AtmosphereConfig config, String uuid)
          Create an AtmosphereResource associated with the uuid.
abstract  AtmosphereResource create(AtmosphereConfig config, String uuid, AtmosphereRequest request)
          Create an AtmosphereResource associated with the uuid.
abstract  void destroy()
           
abstract  AtmosphereResource find(String uuid)
          Find an AtmosphereResource based on its AtmosphereResource.uuid().
abstract  Collection<AtmosphereResource> findAll()
           
static AtmosphereResourceFactory getDefault()
          Deprecated. Use AtmosphereConfig.resourcesFactory()
abstract  void registerUuidForFindCandidate(AtmosphereResource r)
          Register an AtmosphereResource for being a candidate to find(String) operation.
abstract  AtmosphereResource remove(String uuid)
          Remove the AtmosphereResource from all instances of Broadcaster.
abstract  ConcurrentMap<String,AtmosphereResource> resources()
           
abstract  void unRegisterUuidForFindCandidate(AtmosphereResource r)
          Un register an AtmosphereResource for being a candidate to find(String) operation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AtmosphereResourceFactory

public AtmosphereResourceFactory()
Method Detail

getDefault

@Deprecated
public static AtmosphereResourceFactory getDefault()
Deprecated. Use AtmosphereConfig.resourcesFactory()

Use instead


configure

public abstract void configure(AtmosphereConfig config)

create

public abstract AtmosphereResource create(AtmosphereConfig config,
                                          AtmosphereRequest request,
                                          AtmosphereResponse response,
                                          AsyncSupport<?> a)
Create an AtmosphereResourceImpl

Parameters:
config - an AtmosphereConfig
request - an AtmosphereResponse
a - AsyncSupport
Returns:
an AtmosphereResourceImpl

create

public abstract AtmosphereResource create(AtmosphereConfig config,
                                          Broadcaster broadcaster,
                                          AtmosphereRequest request,
                                          AtmosphereResponse response,
                                          AsyncSupport<?> a,
                                          AtmosphereHandler handler)
Create an AtmosphereResourceImpl.

Parameters:
config - an AtmosphereConfig
broadcaster - a Broadcaster
response - an AtmosphereResponse
a - AsyncSupport
handler - an AtmosphereHandler
Returns:
an AtmosphereResourceImpl

create

public abstract AtmosphereResource create(AtmosphereConfig config,
                                          Broadcaster broadcaster,
                                          AtmosphereRequest request,
                                          AtmosphereResponse response,
                                          AsyncSupport<?> a,
                                          AtmosphereHandler handler,
                                          AtmosphereResource.TRANSPORT t)
Create an AtmosphereResourceImpl.

Parameters:
config - an AtmosphereConfig
broadcaster - a Broadcaster
response - an AtmosphereResponse
a - AsyncSupport
handler - an AtmosphereHandler
t - an AtmosphereResource.TRANSPORT
Returns:
an AtmosphereResourceImpl

create

public abstract AtmosphereResource create(AtmosphereConfig config,
                                          Broadcaster broadcaster,
                                          AtmosphereResponse response,
                                          AsyncSupport<?> a,
                                          AtmosphereHandler handler)
Create an AtmosphereResourceImpl.

Parameters:
config - an AtmosphereConfig
broadcaster - a Broadcaster
response - an AtmosphereResponse
a - AsyncSupport
handler - an AtmosphereHandler
Returns:
an AtmosphereResourceImpl

create

public abstract AtmosphereResource create(AtmosphereConfig config,
                                          Broadcaster broadcaster,
                                          AtmosphereResponse response,
                                          AsyncSupport<?> a,
                                          AtmosphereHandler handler,
                                          AtmosphereResource.TRANSPORT t)

create

public abstract AtmosphereResource create(AtmosphereConfig config,
                                          AtmosphereResponse response,
                                          AsyncSupport<?> a)
Create an AtmosphereResourceImpl.

Parameters:
config - an AtmosphereConfig
response - an AtmosphereResponse
a - AsyncSupport
Returns:
an AtmosphereResourceImpl

create

public abstract AtmosphereResource create(AtmosphereConfig config,
                                          String uuid)
Create an AtmosphereResource associated with the uuid.

Parameters:
config - an AtmosphereConfig
uuid - a String representing a UUID
Returns:

create

public abstract AtmosphereResource create(AtmosphereConfig config,
                                          String uuid,
                                          AtmosphereRequest request)
Create an AtmosphereResource associated with the uuid.

Parameters:
config - an AtmosphereConfig
uuid - a String representing a UUID
request - a AtmosphereRequest
Returns:

remove

public abstract AtmosphereResource remove(String uuid)
Remove the AtmosphereResource from all instances of Broadcaster.

Parameters:
uuid - the AtmosphereResource.uuid()
Returns:
the AtmosphereResource, or null if not found.

find

public abstract AtmosphereResource find(String uuid)
Find an AtmosphereResource based on its AtmosphereResource.uuid().

Parameters:
uuid - the AtmosphereResource.uuid()
Returns:
the AtmosphereResource, or null if not found.

broadcasters

public abstract Set<Broadcaster> broadcasters(String uuid)
Return all Broadcaster associated with a AtmosphereResource.uuid(), e.g for which Broadcaster.addAtmosphereResource(AtmosphereResource) has been called. Note that this method is not synchronized and may not return all the Broadcaster in case Broadcaster.addAtmosphereResource(AtmosphereResource) is being called concurrently.

Parameters:
uuid - the AtmosphereResource.uuid()
Returns:
all Broadcaster associated with a AtmosphereResource.uuid()

registerUuidForFindCandidate

public abstract void registerUuidForFindCandidate(AtmosphereResource r)
Register an AtmosphereResource for being a candidate to find(String) operation.

Parameters:
r - AtmosphereResource

unRegisterUuidForFindCandidate

public abstract void unRegisterUuidForFindCandidate(AtmosphereResource r)
Un register an AtmosphereResource for being a candidate to find(String) operation.

Parameters:
r - AtmosphereResource

destroy

public abstract void destroy()

resources

public abstract ConcurrentMap<String,AtmosphereResource> resources()

findAll

public abstract Collection<AtmosphereResource> findAll()


Copyright © 2014. All rights reserved.