org.objectweb.jonathan.binding.echannel
Class EBinder

java.lang.Object
  extended byorg.objectweb.jonathan.binding.echannel.EBinder
All Implemented Interfaces:
NamingContext

public class EBinder
extends Object
implements NamingContext

EBinder is a binder allowing the construction of Event Channels following a publish-subscribe interaction style. EBinder is currently hardwired to work with the RTP protocol on top of Multicast IP. Thus, it offers an unreliable and unordered event disseminations service.


Nested Class Summary
 class EBinder.EId
          EId is an indentifier representing an event channel of a given type and relying on a given multicast address and port.
 
Constructor Summary
EBinder(ChunkFactory chunk_factory, MarshallerFactory marshaller_factory, NamingContext context, StubFactory stub_factory)
          Builds a new EBinder instance
 
Method Summary
 void bindConsumer(Session_Low consumer, EBinder.EId channel)
          Binds a new consumer to an event channel
 Identifier decode(byte[] data, int offset, int length)
          Decode an indentifier (an EId) representing an event channel out of the supplied array of bytes
 Identifier decode(UnMarshaller u)
          Decodes an identifier from the provided unmarshaller.
 Identifier export(Object itf, org.objectweb.jonathan.apis.kernel.Context hints)
          This operation has no meaning in this context: an InternalException is always thrown.
 EBinder.EId newId(String address, int port, String type)
          Builds a new identifier representing an event channel of a given type and relying on a givent multicast address and port
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EBinder

public EBinder(ChunkFactory chunk_factory,
               MarshallerFactory marshaller_factory,
               NamingContext context,
               StubFactory stub_factory)
Builds a new EBinder instance

Parameters:
chunk_factory - the chunk factory that the EBinder will use to construct messages
marshaller_factory - the MarshallerFactory that the EBinder will use to build messages
context - the NamingContext which uses this EBinder
stub_factory - the StubFactory to be used by this EBinder
Method Detail

export

public Identifier export(Object itf,
                         org.objectweb.jonathan.apis.kernel.Context hints)
This operation has no meaning in this context: an InternalException is always thrown.

Specified by:
export in interface NamingContext
Parameters:
itf -
hints -
Returns:
never.
See Also:
org.objectweb.jonathan.model.naming_context#export(org.objectweb.jonathan.model.name)

bindConsumer

public void bindConsumer(Session_Low consumer,
                         EBinder.EId channel)
                  throws org.objectweb.jonathan.apis.kernel.JonathanException
Binds a new consumer to an event channel

Parameters:
consumer - the interface of the consumer object to be added to the event channel
channel - the identifier representing the event channel
Throws:
org.objectweb.jonathan.apis.kernel.JonathanException - thrown if the bind operation fails

decode

public Identifier decode(byte[] data,
                         int offset,
                         int length)
                  throws org.objectweb.jonathan.apis.kernel.JonathanException
Decode an indentifier (an EId) representing an event channel out of the supplied array of bytes

Specified by:
decode in interface NamingContext
Parameters:
data - the array of bytes from which to decode the identifier
offset - the offset in bytes from which to start the decoding
length - the length in bytes of the portion of the byte array to decode
Returns:
an identifier representing the event channel
Throws:
org.objectweb.jonathan.apis.kernel.JonathanException - thrown if the decoding fails

decode

public Identifier decode(UnMarshaller u)
                  throws org.objectweb.jonathan.apis.kernel.JonathanException
Decodes an identifier from the provided unmarshaller.

Specified by:
decode in interface NamingContext
Parameters:
u - an unmarhaller;
Returns:
an identifier managed by the target naming context;
Throws:
org.objectweb.jonathan.apis.kernel.JonathanException - if something goes wrong.

newId

public EBinder.EId newId(String address,
                         int port,
                         String type)
                  throws org.objectweb.jonathan.apis.kernel.JonathanException
Builds a new identifier representing an event channel of a given type and relying on a givent multicast address and port

Parameters:
address - the multicast IP address of the event channel
port - the port number of the channel
type - the type of the channel
Returns:
an identifier representing the event channel
Throws:
org.objectweb.jonathan.apis.kernel.JonathanException - thrown if the identifier cannot be constructed with the parameters provided