public interface AtmosphereResourceFactory extends AtmosphereConfigAware
AtmosphereResource
instances. You can use this factory to create, remove and find
AtmosphereResource
instances that are associated with one or several Broadcaster
s.Modifier and Type | Interface and Description |
---|---|
static interface |
AtmosphereResourceFactory.Async
An interface to use in order to retrieve an
AtmosphereResource inside a cluster. |
void configure(AtmosphereConfig config)
AtmosphereConfigAware
configure
in interface AtmosphereConfigAware
config
- AtmosphereConfig
AtmosphereResource create(AtmosphereConfig config, AtmosphereRequest request, AtmosphereResponse response, AsyncSupport<?> a)
AtmosphereResourceImpl
config
- an AtmosphereConfig
request
- an AtmosphereResponse
a
- AsyncSupport
AtmosphereResourceImpl
AtmosphereResource create(AtmosphereConfig config, Broadcaster broadcaster, AtmosphereRequest request, AtmosphereResponse response, AsyncSupport<?> a, AtmosphereHandler handler)
AtmosphereResourceImpl
.config
- an AtmosphereConfig
broadcaster
- a Broadcaster
response
- an AtmosphereResponse
a
- AsyncSupport
handler
- an AtmosphereHandler
AtmosphereResourceImpl
AtmosphereResource create(AtmosphereConfig config, Broadcaster broadcaster, AtmosphereRequest request, AtmosphereResponse response, AsyncSupport<?> a, AtmosphereHandler handler, AtmosphereResource.TRANSPORT t)
AtmosphereResourceImpl
.config
- an AtmosphereConfig
broadcaster
- a Broadcaster
response
- an AtmosphereResponse
a
- AsyncSupport
handler
- an AtmosphereHandler
t
- an AtmosphereResource.TRANSPORT
AtmosphereResourceImpl
AtmosphereResource create(AtmosphereConfig config, Broadcaster broadcaster, AtmosphereResponse response, AsyncSupport<?> a, AtmosphereHandler handler)
AtmosphereResourceImpl
.config
- an AtmosphereConfig
broadcaster
- a Broadcaster
response
- an AtmosphereResponse
a
- AsyncSupport
handler
- an AtmosphereHandler
AtmosphereResourceImpl
AtmosphereResource create(AtmosphereConfig config, Broadcaster broadcaster, AtmosphereResponse response, AsyncSupport<?> a, AtmosphereHandler handler, AtmosphereResource.TRANSPORT t)
AtmosphereResource create(AtmosphereConfig config, AtmosphereResponse response, AsyncSupport<?> a)
AtmosphereResourceImpl
.config
- an AtmosphereConfig
response
- an AtmosphereResponse
a
- AsyncSupport
AtmosphereResourceImpl
AtmosphereResource create(AtmosphereConfig config, String uuid)
AtmosphereResource
associated with the uuid.config
- an AtmosphereConfig
uuid
- a String representing a UUIDAtmosphereResource create(AtmosphereConfig config, String uuid, AtmosphereRequest request)
AtmosphereResource
associated with the uuid.config
- an AtmosphereConfig
uuid
- a String representing a UUIDrequest
- a AtmosphereRequest
AtmosphereResource remove(String uuid)
AtmosphereResource
from all instances of Broadcaster
.uuid
- the AtmosphereResource.uuid()
AtmosphereResource
, or null if not found.AtmosphereResource find(String uuid)
AtmosphereResource
based on its AtmosphereResource.uuid()
.uuid
- the AtmosphereResource.uuid()
AtmosphereResource
, or null if not found.void locate(String uuid, AtmosphereResourceFactory.Async async)
AtmosphereResource
, based on its AtmosphereResource.uuid()
, in a
cluster. If the AtmosphereResource
is available in the cluster, the AtmosphereResourceFactory.Async.available(org.atmosphere.cpr.AtmosphereResource)
callback will be invoked. If not, the org.atmosphere.cpr.AtmosphereResourceFactory.Async#notAvailable
uuid
- the AtmosphereResource.uuid()
async
- an AtmosphereResourceFactory.Async
@Deprecated Set<Broadcaster> broadcasters(String uuid)
find(String)
.broadcasters() insteadBroadcaster
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.uuid
- the AtmosphereResource.uuid()
Broadcaster
associated with a AtmosphereResource.uuid()
void registerUuidForFindCandidate(AtmosphereResource r)
AtmosphereResource
for being a candidate to find(String)
operation.r
- AtmosphereResource
void unRegisterUuidForFindCandidate(AtmosphereResource r)
AtmosphereResource
for being a candidate to find(String)
operation.r
- AtmosphereResource
void destroy()
ConcurrentMap<String,AtmosphereResource> resources()
Collection<AtmosphereResource> findAll()
Copyright © 2016. All rights reserved.