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 ([email protected]), Paul Gregoire ([email protected])
-
Field Summary
FieldsFields inherited from class org.red5.server.adapter.MultiThreadedApplicationAdapter
log, logger, schedulingServiceFields inherited from class org.red5.server.adapter.StatefulScopeWrappingAdapter
plugins, scopeFields inherited from interface org.red5.server.api.service.IBroadcastStreamService
BROADCAST_STREAM_SERVICEFields inherited from interface org.red5.server.api.service.IOnDemandStreamService
BEAN_NAMEFields inherited from interface org.red5.server.api.scheduling.ISchedulingService
BEAN_NAMEFields inherited from interface org.red5.server.api.service.IStreamSecurityService
BEAN_NAMEFields inherited from interface org.red5.server.api.service.ISubscriberStreamService
BEAN_NAME -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanconnect(IConnection conn, IScope scope, Object[] params) Returns connection result for given scope and parameters.voiddisconnect(IConnection conn, IScope scope) Returns disconnection result for given scope and parameters.booleanAdds client to scope.voidDisconnects client from scope.booleanStarts scope.voidStops 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, unregisterStreamPublishSecurityMethods 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, sizeMethods inherited from class org.red5.server.adapter.AbstractScopeAdapter
addChildScope, checkBandwidth, checkBandwidthUp, removeChildScope, serviceCall, setCanCallService, setCanConnect, setCanStart, setJoinMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
startin interfaceIScopeHandler- Overrides:
startin classMultiThreadedApplicationAdapter- Parameters:
scope- Scope object- Returns:
trueif scope can be started,falseotherwise. 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:
stopin interfaceIScopeHandler- Overrides:
stopin 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:
connectin interfaceIScopeHandler- Overrides:
connectin classMultiThreadedApplicationAdapter- Parameters:
conn- Connection objectscope- Scopeparams- List of params passed to connection handler- Returns:
trueif connect is successful,falseotherwise
-
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:
disconnectin interfaceIScopeHandler- Overrides:
disconnectin 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:
joinin interfaceIScopeHandler- Overrides:
joinin 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:
leavein interfaceIScopeHandler- Overrides:
leavein classMultiThreadedApplicationAdapter- Parameters:
client- Client objectscope- Scope object
-