Package org.atmosphere.cpr
Interface AtmosphereResourceFactory
-
- All Superinterfaces:
AtmosphereConfigAware
- All Known Implementing Classes:
DefaultAtmosphereResourceFactory
public interface AtmosphereResourceFactory extends AtmosphereConfigAware
A Factory used to manageAtmosphereResourceinstances. You can use this factory to create, remove and findAtmosphereResourceinstances that are associated with one or severalBroadcasters.- Author:
- Jeanfrancois Arcand
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceAtmosphereResourceFactory.AsyncAn interface to use in order to retrieve anAtmosphereResourceinside a cluster.
-
Method Summary
-
-
-
Method Detail
-
configure
void configure(AtmosphereConfig config)
Description copied from interface:AtmosphereConfigAwareConfigure an AtmosphereFramework object.- Specified by:
configurein interfaceAtmosphereConfigAware- Parameters:
config-AtmosphereConfig
-
create
AtmosphereResource create(AtmosphereConfig config, AtmosphereRequest request, AtmosphereResponse response, AsyncSupport<?> a)
Create anAtmosphereResourceImpl- Parameters:
config- anAtmosphereConfigrequest- anAtmosphereResponsea-AsyncSupport- Returns:
- an
AtmosphereResourceImpl
-
create
AtmosphereResource create(AtmosphereConfig config, Broadcaster broadcaster, AtmosphereRequest request, AtmosphereResponse response, AsyncSupport<?> a, AtmosphereHandler handler)
Create anAtmosphereResourceImpl.- Parameters:
config- anAtmosphereConfigbroadcaster- aBroadcasterresponse- anAtmosphereResponsea-AsyncSupporthandler- anAtmosphereHandler- Returns:
- an
AtmosphereResourceImpl
-
create
AtmosphereResource create(AtmosphereConfig config, Broadcaster broadcaster, AtmosphereRequest request, AtmosphereResponse response, AsyncSupport<?> a, AtmosphereHandler handler, AtmosphereResource.TRANSPORT t)
Create anAtmosphereResourceImpl.- Parameters:
config- anAtmosphereConfigbroadcaster- aBroadcasterresponse- anAtmosphereResponsea-AsyncSupporthandler- anAtmosphereHandlert- anAtmosphereResource.TRANSPORT- Returns:
- an
AtmosphereResourceImpl
-
create
AtmosphereResource create(AtmosphereConfig config, Broadcaster broadcaster, AtmosphereResponse response, AsyncSupport<?> a, AtmosphereHandler handler)
Create anAtmosphereResourceImpl.- Parameters:
config- anAtmosphereConfigbroadcaster- aBroadcasterresponse- anAtmosphereResponsea-AsyncSupporthandler- anAtmosphereHandler- Returns:
- an
AtmosphereResourceImpl
-
create
AtmosphereResource create(AtmosphereConfig config, Broadcaster broadcaster, AtmosphereResponse response, AsyncSupport<?> a, AtmosphereHandler handler, AtmosphereResource.TRANSPORT t)
-
create
AtmosphereResource create(AtmosphereConfig config, AtmosphereResponse response, AsyncSupport<?> a)
Create anAtmosphereResourceImpl.- Parameters:
config- anAtmosphereConfigresponse- anAtmosphereResponsea-AsyncSupport- Returns:
- an
AtmosphereResourceImpl
-
create
AtmosphereResource create(AtmosphereConfig config, java.lang.String uuid)
Create anAtmosphereResourceassociated with the uuid.- Parameters:
config- anAtmosphereConfiguuid- a String representing a UUID- Returns:
-
create
AtmosphereResource create(AtmosphereConfig config, java.lang.String uuid, AtmosphereRequest request)
Create anAtmosphereResourceassociated with the uuid.- Parameters:
config- anAtmosphereConfiguuid- a String representing a UUIDrequest- aAtmosphereRequest- Returns:
-
remove
AtmosphereResource remove(java.lang.String uuid)
Remove theAtmosphereResourcefrom all instances ofBroadcaster.- Parameters:
uuid- theAtmosphereResource.uuid()- Returns:
- the
AtmosphereResource, or null if not found.
-
find
AtmosphereResource find(java.lang.String uuid)
Find anAtmosphereResourcebased on itsAtmosphereResource.uuid().- Parameters:
uuid- theAtmosphereResource.uuid()- Returns:
- the
AtmosphereResource, or null if not found.
-
locate
void locate(java.lang.String uuid, AtmosphereResourceFactory.Async async)Locate anAtmosphereResource, based on itsAtmosphereResource.uuid(), in a cluster. If theAtmosphereResourceis available in the cluster, theAtmosphereResourceFactory.Async.available(org.atmosphere.cpr.AtmosphereResource)callback will be invoked. If not, theorg.atmosphere.cpr.AtmosphereResourceFactory.Async#notAvailable- Parameters:
uuid- theAtmosphereResource.uuid()async- anAtmosphereResourceFactory.Async
-
broadcasters
@Deprecated java.util.Set<Broadcaster> broadcasters(java.lang.String uuid)
Deprecated.Usefind(String).broadcasters() insteadReturn allBroadcasterassociated with aAtmosphereResource.uuid(), e.g for whichBroadcaster.addAtmosphereResource(AtmosphereResource)has been called. Note that this method is not synchronized and may not return all theBroadcasterin caseBroadcaster.addAtmosphereResource(AtmosphereResource)is being called concurrently.- Parameters:
uuid- theAtmosphereResource.uuid()- Returns:
- all
Broadcasterassociated with aAtmosphereResource.uuid()
-
registerUuidForFindCandidate
void registerUuidForFindCandidate(AtmosphereResource r)
Register anAtmosphereResourcefor being a candidate tofind(String)operation.- Parameters:
r-AtmosphereResource
-
unRegisterUuidForFindCandidate
void unRegisterUuidForFindCandidate(AtmosphereResource r)
Un register anAtmosphereResourcefor being a candidate tofind(String)operation.- Parameters:
r-AtmosphereResource
-
destroy
void destroy()
-
resources
java.util.concurrent.ConcurrentMap<java.lang.String,AtmosphereResource> resources()
-
findAll
java.util.Collection<AtmosphereResource> findAll()
-
-