Package org.red5.server.scope
Class BroadcastScope
java.lang.Object
org.red5.server.scope.BasicScope
org.red5.server.scope.BroadcastScope
- All Implemented Interfaces:
Comparable<BasicScope>,IEventDispatcher,IEventHandler,IEventListener,IEventObservable,ICoreObject,IBasicScope,IBroadcastScope,IMessageInput,IMessageOutput,IPipe,IPipeConnectionListener
Scope type for publishing that deals with pipe connection events, like async message listening in JMS
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate IClientBroadcastStreamBroadcasting stream associated with this scopeprivate AtomicIntegerNumber of components.private final InMemoryPushPushPipeSimple in memory push pipe, triggered by an active provider to push messages to consumerprivate booleanWhether or not this "scope" has been removedFields inherited from class org.red5.server.scope.BasicScope
creation, keepDelay, keepOnDisconnect, listeners, log, name, parent, persistenceClass, persistent, securityHandlers, store, type -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidRegister pipe connection event listener with this scope's pipe.Returns the client broadcast streamGetter for pipe consumersGetter for providers listvoidPipe connection event handlerPull message from pipepullMessage(long wait) Pull message with timeoutvoidpushMessage(IMessage message) Push a message to this output endpoint.voidUnregisters pipe connection event listener with this scope's pipevoidsendOOBControlMessage(IConsumer consumer, OOBControlMessage oobCtrlMsg) Send out-of-band ("special") control messagevoidsendOOBControlMessage(IProvider provider, OOBControlMessage oobCtrlMsg) Send out-of-band ("special") control messagevoidsetClientBroadcastStream(IClientBroadcastStream clientBroadcastStream) Sets the client broadcast streambooleanConnect scope's pipe to given consumerbooleanConnect scope's pipe with given providertoString()booleanunsubscribe(IConsumer consumer) Disconnects scope's pipe from given consumerbooleanunsubscribe(IProvider provider) Disconnects scope's pipe from given providerMethods inherited from class org.red5.server.scope.BasicScope
addEventListener, compareTo, dispatchEvent, equals, getDepth, getEventListeners, getName, getParent, getPath, getStore, getType, handleEvent, hasEventListeners, hashCode, hasParent, isConnectionAllowed, isScopeAllowed, isValid, notifyEvent, removeEventListener, setKeepDelay, setSecurityHandlersMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.red5.server.api.scope.IBasicScope
getDepth, getName, getParent, getPath, getStore, getType, hasParent, isConnectionAllowed, isScopeAllowed, isValid, setKeepDelay, setSecurityHandlersMethods inherited from interface org.red5.server.api.event.IEventDispatcher
dispatchEventMethods inherited from interface org.red5.server.api.event.IEventHandler
handleEventMethods inherited from interface org.red5.server.api.event.IEventListener
notifyEventMethods inherited from interface org.red5.server.api.event.IEventObservable
addEventListener, getEventListeners, removeEventListener
-
Field Details
-
clientBroadcastStream
Broadcasting stream associated with this scope -
pipe
Simple in memory push pipe, triggered by an active provider to push messages to consumer -
compCounter
Number of components. -
removed
private volatile boolean removedWhether or not this "scope" has been removed
-
-
Constructor Details
-
BroadcastScope
Creates broadcast scope- Parameters:
parent- Parent scopename- Scope name
-
-
Method Details
-
addPipeConnectionListener
Register pipe connection event listener with this scope's pipe. A listener that wants to listen to events when provider/consumer connects to or disconnects from a specific pipe.- Specified by:
addPipeConnectionListenerin interfaceIPipe- Parameters:
listener- Pipe connection event listener- See Also:
-
removePipeConnectionListener
Unregisters pipe connection event listener with this scope's pipe- Specified by:
removePipeConnectionListenerin interfaceIPipe- Parameters:
listener- Pipe connection event listener- See Also:
-
pullMessage
Pull message from pipe- Specified by:
pullMessagein interfaceIMessageInput- Returns:
- Message object
- See Also:
-
pullMessage
Pull message with timeout- Specified by:
pullMessagein interfaceIMessageInput- Parameters:
wait- Timeout- Returns:
- Message object
- See Also:
-
subscribe
Connect scope's pipe to given consumer- Specified by:
subscribein interfaceIMessageInput- Parameters:
consumer- ConsumerparamMap- Parameters passed with connection- Returns:
- true on success, false otherwise
-
unsubscribe
Disconnects scope's pipe from given consumer- Specified by:
unsubscribein interfaceIMessageInput- Parameters:
consumer- Consumer- Returns:
- true on success, false otherwise
-
getConsumers
Getter for pipe consumers- Specified by:
getConsumersin interfaceIMessageInput- Returns:
- Pipe consumers
-
sendOOBControlMessage
Send out-of-band ("special") control message- Specified by:
sendOOBControlMessagein interfaceIMessageInput- Parameters:
consumer- Consumer, may be used in concrete implementationsoobCtrlMsg- Out-of-band control message
-
pushMessage
Push a message to this output endpoint. May block the pusher when output can't handle the message at the time.- Specified by:
pushMessagein interfaceIMessageOutput- Parameters:
message- Message to be pushed- Throws:
IOException- If message could not be pushed
-
subscribe
Connect scope's pipe with given provider- Specified by:
subscribein interfaceIMessageOutput- Parameters:
provider- ProviderparamMap- Parameters passed on connection- Returns:
- true on success, false otherwise
-
unsubscribe
Disconnects scope's pipe from given provider- Specified by:
unsubscribein interfaceIMessageOutput- Parameters:
provider- Provider- Returns:
- true on success, false otherwise
-
getProviders
Getter for providers list- Specified by:
getProvidersin interfaceIMessageOutput- Returns:
- List of providers
-
sendOOBControlMessage
Send out-of-band ("special") control message- Specified by:
sendOOBControlMessagein interfaceIMessageOutput- Parameters:
provider- Provider, may be used in concrete implementationsoobCtrlMsg- Out-of-band control message
-
onPipeConnectionEvent
Pipe connection event handler- Specified by:
onPipeConnectionEventin interfaceIPipeConnectionListener- Parameters:
event- Pipe connection event
-
getClientBroadcastStream
Returns the client broadcast stream- Specified by:
getClientBroadcastStreamin interfaceIBroadcastScope
-
setClientBroadcastStream
Sets the client broadcast stream- Specified by:
setClientBroadcastStreamin interfaceIBroadcastScope- Parameters:
clientBroadcastStream- stream
-
toString
-