Package org.red5.server.adapter
Class ApplicationAdapter
java.lang.Object
org.red5.server.adapter.AbstractScopeAdapter
org.red5.server.adapter.StatefulScopeWrappingAdapter
org.red5.server.adapter.MultiThreadedApplicationAdapter
org.red5.server.adapter.ApplicationAdapter
- All Implemented Interfaces:
IEventHandler
,IAttributeStore
,ISchedulingService
,IScopeAware
,IScopeHandler
,IScopeService
,IBroadcastStreamService
,IOnDemandStreamService
,IStreamSecurityService
,ISubscriberStreamService
,IStreamAwareScopeHandler
,ApplicationMXBean
,AttributeStoreMXBean
Base class for applications, takes care that callbacks are executed single-threaded. If you want to have maximum performance, use
MultiThreadedApplicationAdapter
instead.
Using this class may lead to problems if accepting a client in the Connect
or Join
methods takes too
long, so using the multi-threaded version is preferred.- Author:
- The Red5 Project, Joachim Bauch (jojo@struktur.de), Paul Gregoire (mondain@gmail.com)
-
Field Summary
Fields inherited from class org.red5.server.adapter.MultiThreadedApplicationAdapter
log, logger, schedulingService
Fields inherited from class org.red5.server.adapter.StatefulScopeWrappingAdapter
plugins, scope
Fields inherited from interface org.red5.server.api.service.IBroadcastStreamService
BROADCAST_STREAM_SERVICE
Fields inherited from interface org.red5.server.api.service.IOnDemandStreamService
BEAN_NAME
Fields inherited from interface org.red5.server.api.scheduling.ISchedulingService
BEAN_NAME
Fields inherited from interface org.red5.server.api.service.IStreamSecurityService
BEAN_NAME
Fields inherited from interface org.red5.server.api.service.ISubscriberStreamService
BEAN_NAME
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
connect
(IConnection conn, IScope scope, Object[] params) Returns connection result for given scope and parameters.void
disconnect
(IConnection conn, IScope scope) Returns disconnection result for given scope and parameters.boolean
Adds client to scope.void
Disconnects client from scope.boolean
Starts scope.void
Stops scope handling (that is, stops application if given scope is app level scope and stops room handling if given scope has lower scope level).Methods inherited from class org.red5.server.adapter.MultiThreadedApplicationAdapter
addListener, addScheduledJob, addScheduledJobAfterDelay, addScheduledOnceJob, addScheduledOnceJob, appConnect, appDisconnect, appJoin, appLeave, appStart, appStop, connect, FCPublish, FCSubscribe, FCUnpublish, FCUnpublish, getBroadcastStream, getBroadcastStreamNames, getClientTTL, getGhostConnsCleanupPeriod, getListeners, getOnDemandStream, getScheduledJobNames, getStreamLength, getStreamPlaybackSecurity, getStreamPublishSecurity, getSubscriberStream, handleEvent, hasBroadcastStream, hasOnDemandStream, measureBandwidth, measureBandwidth, pauseScheduledJob, registerStreamPlaybackSecurity, registerStreamPublishSecurity, rejectClient, rejectClient, removeListener, removeScheduledJob, resumeScheduledJob, roomConnect, roomDisconnect, roomJoin, roomLeave, roomStart, roomStop, setClientTTL, setGhostConnsCleanupPeriod, startTransmit, stopTransmit, stopTransmit, streamBroadcastClose, streamBroadcastStart, streamPlayItemPause, streamPlayItemPlay, streamPlayItemResume, streamPlayItemSeek, streamPlayItemStop, streamPublishStart, streamRecordStart, streamRecordStop, streamSubscriberClose, streamSubscriberStart, unregisterStreamPlaybackSecurity, unregisterStreamPublishSecurity
Methods inherited from class org.red5.server.adapter.StatefulScopeWrappingAdapter
createChildScope, getAttribute, getAttribute, getAttributeNames, getAttributes, getChildScope, getChildScopeNames, getClients, getConnections, getContext, getDepth, getName, getParent, getPath, getPlugins, getResource, getResources, getScope, hasAttribute, hasChildScope, hasParent, lookupConnections, removeAttribute, removeAttributes, setAttribute, setAttributes, setAttributes, setPlugins, setScope, size
Methods inherited from class org.red5.server.adapter.AbstractScopeAdapter
addChildScope, checkBandwidth, checkBandwidthUp, removeChildScope, serviceCall, setCanCallService, setCanConnect, setCanStart, setJoin
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.red5.server.api.scope.IScopeHandler
addChildScope, removeChildScope, serviceCall
-
Field Details
-
lock
-
-
Constructor Details
-
ApplicationAdapter
public ApplicationAdapter()
-
-
Method Details
-
start
Starts scope. Scope can be both application or room level.- Specified by:
start
in interfaceIScopeHandler
- Overrides:
start
in classMultiThreadedApplicationAdapter
- Parameters:
scope
- Scope object- Returns:
true
if scope can be started,false
otherwise. SeeAbstractScopeAdapter.start(IScope)
for details.
-
stop
Stops scope handling (that is, stops application if given scope is app level scope and stops room handling if given scope has lower scope level). This method callsMultiThreadedApplicationAdapter.appStop(IScope)
orMultiThreadedApplicationAdapter.roomStop(IScope)
handlers respectively.- Specified by:
stop
in interfaceIScopeHandler
- Overrides:
stop
in classMultiThreadedApplicationAdapter
- Parameters:
scope
- Scope to stop
-
connect
Returns connection result for given scope and parameters. Whether the scope is room or app level scope, this method distinguishes it and acts accordingly. You overrideMultiThreadedApplicationAdapter.appConnect(IConnection, Object[])
orMultiThreadedApplicationAdapter.roomConnect(IConnection, Object[])
in your application to make it act the way you want.- Specified by:
connect
in interfaceIScopeHandler
- Overrides:
connect
in classMultiThreadedApplicationAdapter
- Parameters:
conn
- Connection objectscope
- Scopeparams
- List of params passed to connection handler- Returns:
true
if connect is successful,false
otherwise
-
disconnect
Returns disconnection result for given scope and parameters. Whether the scope is room or app level scope, this method distinguishes it and acts accordingly.- Specified by:
disconnect
in interfaceIScopeHandler
- Overrides:
disconnect
in classMultiThreadedApplicationAdapter
- Parameters:
conn
- Connection objectscope
- Scope
-
join
Adds client to scope. Scope can be both application or room. Can be applied to both application scope and scopes of lower level. This method callsMultiThreadedApplicationAdapter.appJoin(IClient, IScope)
orMultiThreadedApplicationAdapter.roomJoin(IClient, IScope)
handlers respectively.- Specified by:
join
in interfaceIScopeHandler
- Overrides:
join
in classMultiThreadedApplicationAdapter
- Parameters:
client
- Client objectscope
- Scope object- Returns:
true
to allow,false
to deny connection
-
leave
Disconnects client from scope. Can be applied to both application scope and scopes of lower level. This method callsMultiThreadedApplicationAdapter.appLeave(IClient, IScope)
orMultiThreadedApplicationAdapter.roomLeave(IClient, IScope)
handlers respectively.- Specified by:
leave
in interfaceIScopeHandler
- Overrides:
leave
in classMultiThreadedApplicationAdapter
- Parameters:
client
- Client objectscope
- Scope object
-