FileDocCategorySizeDatePackage
Connector.javaAPI DocJMF 2.1.1e4064Mon May 12 12:20:48 BST 2003com.sun.media

Connector

public interface Connector
Defines common interface to input and output Connectors. Inter Module Connection is made of InputConnector and OutputConnector and is essentially a cyclic queue of references to Buffer Objects.
The queue is constructed at the Connectors connectTo() method, so the suggested size should be set before that.

Note that these connectors are almost symetrical so they can support both push and pull connection.
In addition the two threads sync. mechanism is also supported by this suggested API.
see
Module
see
InputConnector
see
OutputConnector
see
javax.media.Format

Fields Summary
public static int
ProtocolPush
constant to indicate that this connector runs on "Push" protocol. meaning writing to this connector is propagated to the connected InputConnector.
public static int
ProtocolSafe
constant to indicate that this connector runs on "Safe" protocol. meaning reading and writing from this connection is done using thread safe monitor.
Constructors Summary
Methods Summary
public java.lang.ObjectgetCircularBuffer()
returns the circular buffer Object which is locked (by wait()/notify() )during safe data transfer.
This method should not really be part of the API, but it is put here in order to remove implementation dependencies.

public javax.media.FormatgetFormat()
The selected format. If setFormat() has not been called, getFormat() will return null.

return
the currently selected format.

public com.sun.media.ModulegetModule()
Returns the Module which registered this Connector.

public java.lang.StringgetName()
returns the name of this Connector in the owning Module

public intgetProtocol()
returns the data transfer protocol used by this connector.
either ProtocolPush, ProtocolSafe

public intgetSize()
gets the minimum number of buffer objects this Connector should create.

public voidreset()
restores this Connector to its initial state: removes all the buffer locks. this method is typically called when the owning Module is requested to reset.

public voidsetCircularBuffer(java.lang.Object circularBuffer)
Sets the circular buffer object of the connection. This method is called only by the OutputConnector.connectTo() method.
This method should not really be part of the API, but it is put here in order to remove implementation dependencies.

param
circularBuffer the circular buffer used by this Connection

public voidsetFormat(javax.media.Format format)
Selects a format for this Connector (the default is null). The setFormat() method is typically called by the Manager as part of the Connector connection method call. The connector should delegate this call to its owning Module.

public voidsetModule(com.sun.media.Module module)
sets the Module which registered this Connector.

public voidsetName(java.lang.String name)
sets the name of this Connector. Called by the owning Module registerConnector() method

public voidsetProtocol(int protocol)
determines the data transfer protocol used by this connector.
Perhaps the only way to change the protocol is in the constructor ?

param
protocol either ProtocolPush, ProtocolSafe

public voidsetSize(int numOfBufferObjects)
sets the minimum number of buffer objects this Connector should create. The default value should be one buffer object.