org.mobicents.media.server.impl.resource
Class Multiplexer

java.lang.Object
  extended by org.mobicents.media.server.impl.BaseComponent
      extended by org.mobicents.media.server.impl.AbstractSink
          extended by org.mobicents.media.server.impl.AbstractSinkSet
              extended by org.mobicents.media.server.impl.resource.Multiplexer
All Implemented Interfaces:
java.io.Serializable, org.mobicents.media.Component, org.mobicents.media.MediaSink, org.mobicents.media.Outlet

public class Multiplexer
extends AbstractSinkSet
implements org.mobicents.media.Outlet

Combines several signals for transmission over a single medium. A demultiplexor completes the process by separating multiplexed signals from a transmission line. Frequently a multiplexor and demultiplexor are combined into a single device capable of processing both outgoing and incoming signals.
Multiplexer combines data and sends them, it is used as output for components.

Author:
Oleg Kulikov
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.mobicents.media.server.impl.AbstractSink
otherParty
 
Constructor Summary
Multiplexer(java.lang.String name)
          Creates new instance of multiplexer.
 
Method Summary
 void connect(org.mobicents.media.MediaSink sink)
           
 AbstractSink createSink(org.mobicents.media.MediaSource otherParty)
           
 void destroySink(AbstractSink sink)
           
 void disconnect(org.mobicents.media.MediaSink sink)
           
 org.mobicents.media.Format[] getFormats()
          (Non Java-doc).
 org.mobicents.media.MediaSource getOutput()
          (Non Java-doc).
 boolean isAcceptable(org.mobicents.media.Format fmt)
          (Non Java-doc).
 void onMediaTransfer(org.mobicents.media.Buffer buffer)
          This methos is called when new portion of media arrives.
 void setConnection(org.mobicents.media.server.spi.Connection connection)
           
 void setEndpoint(org.mobicents.media.server.spi.Endpoint endpoint)
           
 void start()
          (Non Java-doc).
 void stop()
          (Non Java-doc).
 
Methods inherited from class org.mobicents.media.server.impl.AbstractSinkSet
connect, disconnect, getActiveSinkCount, getStreams, isMultipleConnectionsAllowed
 
Methods inherited from class org.mobicents.media.server.impl.AbstractSink
connect, disconnect, failed, getBytesReceived, getPacketsReceived, isConnected, isStarted, receive, resetStats, started, stopped
 
Methods inherited from class org.mobicents.media.server.impl.BaseComponent
addListener, getConnection, getEndpoint, getId, getName, getResourceType, removeListener, sendEvent, setResourceType, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.mobicents.media.Component
addListener, getConnection, getEndpoint, getId, getName, removeListener, resetStats
 
Methods inherited from interface org.mobicents.media.MediaSink
connect, disconnect, getBytesReceived, getPacketsReceived, isConnected, isStarted, receive
 

Constructor Detail

Multiplexer

public Multiplexer(java.lang.String name)
Creates new instance of multiplexer.

Parameters:
name - the name of the multiplexer to be created.
Method Detail

connect

public void connect(org.mobicents.media.MediaSink sink)
Specified by:
connect in interface org.mobicents.media.Outlet

disconnect

public void disconnect(org.mobicents.media.MediaSink sink)
Specified by:
disconnect in interface org.mobicents.media.Outlet

createSink

public AbstractSink createSink(org.mobicents.media.MediaSource otherParty)
Specified by:
createSink in class AbstractSinkSet

start

public void start()
Description copied from class: AbstractSink
(Non Java-doc).

Specified by:
start in interface org.mobicents.media.Component
Overrides:
start in class AbstractSink
See Also:
Component.start().

stop

public void stop()
Description copied from class: AbstractSink
(Non Java-doc).

Specified by:
stop in interface org.mobicents.media.Component
Overrides:
stop in class AbstractSink
See Also:
Component.stop().

getOutput

public org.mobicents.media.MediaSource getOutput()
(Non Java-doc).

Specified by:
getOutput in interface org.mobicents.media.Outlet
See Also:
Outlet.getOutput().

getFormats

public org.mobicents.media.Format[] getFormats()
(Non Java-doc).

Specified by:
getFormats in interface org.mobicents.media.MediaSink
See Also:
MediaSource.getFormats().

setConnection

public void setConnection(org.mobicents.media.server.spi.Connection connection)
Specified by:
setConnection in interface org.mobicents.media.Component
Overrides:
setConnection in class BaseComponent

setEndpoint

public void setEndpoint(org.mobicents.media.server.spi.Endpoint endpoint)
Specified by:
setEndpoint in interface org.mobicents.media.Component
Overrides:
setEndpoint in class BaseComponent

isAcceptable

public boolean isAcceptable(org.mobicents.media.Format fmt)
(Non Java-doc).

Specified by:
isAcceptable in interface org.mobicents.media.MediaSink
See Also:
MediaSink.isAcceptable(org.mobicents.media.Format)

onMediaTransfer

public void onMediaTransfer(org.mobicents.media.Buffer buffer)
                     throws java.io.IOException
Description copied from class: AbstractSink
This methos is called when new portion of media arrives.

Specified by:
onMediaTransfer in class AbstractSink
Parameters:
buffer - the new portion of media data.
Throws:
java.io.IOException

destroySink

public void destroySink(AbstractSink sink)
Specified by:
destroySink in class AbstractSinkSet


Copyright © 2009. All Rights Reserved.