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
Modifier and TypeFieldDescriptionprivate IClientBroadcastStream
Broadcasting stream associated with this scopeprivate AtomicInteger
Number of components.private final InMemoryPushPushPipe
Simple in memory push pipe, triggered by an active provider to push messages to consumerprivate boolean
Whether 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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Register pipe connection event listener with this scope's pipe.Returns the client broadcast streamGetter for pipe consumersGetter for providers listvoid
Pipe connection event handlerPull message from pipepullMessage
(long wait) Pull message with timeoutvoid
pushMessage
(IMessage message) Push a message to this output endpoint.void
Unregisters pipe connection event listener with this scope's pipevoid
sendOOBControlMessage
(IConsumer consumer, OOBControlMessage oobCtrlMsg) Send out-of-band ("special") control messagevoid
sendOOBControlMessage
(IProvider provider, OOBControlMessage oobCtrlMsg) Send out-of-band ("special") control messagevoid
setClientBroadcastStream
(IClientBroadcastStream clientBroadcastStream) Sets the client broadcast streamboolean
Connect scope's pipe to given consumerboolean
Connect scope's pipe with given providertoString()
boolean
unsubscribe
(IConsumer consumer) Disconnects scope's pipe from given consumerboolean
unsubscribe
(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, setSecurityHandlers
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.red5.server.api.scope.IBasicScope
getDepth, getName, getParent, getPath, getStore, getType, hasParent, isConnectionAllowed, isScopeAllowed, isValid, setKeepDelay, setSecurityHandlers
Methods inherited from interface org.red5.server.api.event.IEventDispatcher
dispatchEvent
Methods inherited from interface org.red5.server.api.event.IEventHandler
handleEvent
Methods inherited from interface org.red5.server.api.event.IEventListener
notifyEvent
Methods 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:
addPipeConnectionListener
in interfaceIPipe
- Parameters:
listener
- Pipe connection event listener- See Also:
-
removePipeConnectionListener
Unregisters pipe connection event listener with this scope's pipe- Specified by:
removePipeConnectionListener
in interfaceIPipe
- Parameters:
listener
- Pipe connection event listener- See Also:
-
pullMessage
Pull message from pipe- Specified by:
pullMessage
in interfaceIMessageInput
- Returns:
- Message object
- See Also:
-
pullMessage
Pull message with timeout- Specified by:
pullMessage
in interfaceIMessageInput
- Parameters:
wait
- Timeout- Returns:
- Message object
- See Also:
-
subscribe
Connect scope's pipe to given consumer- Specified by:
subscribe
in interfaceIMessageInput
- Parameters:
consumer
- ConsumerparamMap
- Parameters passed with connection- Returns:
- true on success, false otherwise
-
unsubscribe
Disconnects scope's pipe from given consumer- Specified by:
unsubscribe
in interfaceIMessageInput
- Parameters:
consumer
- Consumer- Returns:
- true on success, false otherwise
-
getConsumers
Getter for pipe consumers- Specified by:
getConsumers
in interfaceIMessageInput
- Returns:
- Pipe consumers
-
sendOOBControlMessage
Send out-of-band ("special") control message- Specified by:
sendOOBControlMessage
in 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:
pushMessage
in 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:
subscribe
in interfaceIMessageOutput
- Parameters:
provider
- ProviderparamMap
- Parameters passed on connection- Returns:
- true on success, false otherwise
-
unsubscribe
Disconnects scope's pipe from given provider- Specified by:
unsubscribe
in interfaceIMessageOutput
- Parameters:
provider
- Provider- Returns:
- true on success, false otherwise
-
getProviders
Getter for providers list- Specified by:
getProviders
in interfaceIMessageOutput
- Returns:
- List of providers
-
sendOOBControlMessage
Send out-of-band ("special") control message- Specified by:
sendOOBControlMessage
in interfaceIMessageOutput
- Parameters:
provider
- Provider, may be used in concrete implementationsoobCtrlMsg
- Out-of-band control message
-
onPipeConnectionEvent
Pipe connection event handler- Specified by:
onPipeConnectionEvent
in interfaceIPipeConnectionListener
- Parameters:
event
- Pipe connection event
-
getClientBroadcastStream
Returns the client broadcast stream- Specified by:
getClientBroadcastStream
in interfaceIBroadcastScope
-
setClientBroadcastStream
Sets the client broadcast stream- Specified by:
setClientBroadcastStream
in interfaceIBroadcastScope
- Parameters:
clientBroadcastStream
- stream
-
toString
-