org.objectweb.david.libs.binding.orbs.echannel
Class EventChannelFactory

java.lang.Object
  extended byorg.omg.CORBA.ORB
      extended byorg.omg.CORBA_2_3.ORB
          extended byorg.objectweb.david.libs.binding.orbs.ORBSingletonClass
              extended byorg.objectweb.david.libs.binding.orbs.ORBClass
                  extended byorg.objectweb.david.libs.binding.orbs.echannel.EventChannelFactory
All Implemented Interfaces:
Constants, DavidMarshallerFactory, NamingContext

public class EventChannelFactory
extends ORBClass
implements NamingContext

The EventChannelFactory service allows the construction of EventChannels providing best-effort unreliable and unordered event dissemination. It relies on the RTP protocol on top of IP multicast.


Field Summary
 
Fields inherited from class org.objectweb.david.libs.binding.orbs.ORBClass
domain, initial_services_context, marshaller_factory, stub_factory
 
Fields inherited from interface org.objectweb.david.libs.binding.orbs.Constants
corba_object_id, corba_prefix, TC_any, TC_boolean, TC_char, TC_double, TC_float, TC_long, TC_longdouble, TC_longlong, TC_null, TC_Object, TC_octet, TC_Principal, TC_short, TC_string, tc_table, TC_TypeCode, TC_ulong, TC_ulonglong, TC_ushort, TC_void, TC_wchar, TC_wstring
 
Constructor Summary
EventChannelFactory(ChunkFactory chunk_factory, org.objectweb.jonathan.apis.kernel.ClassPathFinder classpath_finder)
          Constructs a new instance of EventChannelFactory.
 
Method Summary
 void bindConsumer(EBinder.EId id, java.lang.Object consumer, java.lang.Object channel_proxy)
           
static void bindConsumer(java.lang.Object consumer, java.lang.Object channel_proxy)
          Binds a consumer object to the event channel represented by the provided_proxy parameter.
 Identifier decode(byte[] data, int offset, int length)
          Returns an identifier, decoded from a byte array portion.
 Identifier decode(UnMarshaller u)
          Returns an identifier, decoded using an UnMarshaller;
 Identifier export(java.lang.Object itf, org.objectweb.jonathan.apis.kernel.Context hints)
          This operation has no meaning in this context: an InternalException is always thrown.
 org.omg.CORBA.Object newEventChannel(java.lang.String address, int port, java.lang.String type)
          Constructs and returns a new EventChannel.
 void setMarshallerFactory(DavidStreamFactory marshaller_factory)
           
 
Methods inherited from class org.objectweb.david.libs.binding.orbs.ORBClass
connect, create_any, create_output_stream, disconnect, get_next_response, list_initial_services, newMarshaller, newUnMarshaller, object_to_string, perform_work, poll_next_response, resolve_initial_references, run, send_multiple_requests_deferred, send_multiple_requests_oneway, setDomain, setInitialServicesContext, setStubFactory, shutdown, string_to_object, work_pending
 
Methods inherited from class org.objectweb.david.libs.binding.orbs.ORBSingletonClass
create_alias_tc, create_array_tc, create_context_list, create_enum_tc, create_environment, create_exception_list, create_exception_tc, create_interface_tc, create_list, create_named_value, create_operation_list, create_recursive_sequence_tc, create_recursive_tc, create_sequence_tc, create_string_tc, create_struct_tc, create_union_tc, create_value_box_tc, create_value_tc, create_wstring_tc, get_default_context, get_primitive_tc, set_parameters, set_parameters, setDefault
 
Methods inherited from class org.omg.CORBA_2_3.ORB
get_value_def, lookup_value_factory, register_value_factory, set_delegate, unregister_value_factory
 
Methods inherited from class org.omg.CORBA.ORB
create_abstract_interface_tc, create_fixed_tc, create_native_tc, create_operation_list, create_policy, get_current, get_service_information, init, init, init
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EventChannelFactory

public EventChannelFactory(ChunkFactory chunk_factory,
                           org.objectweb.jonathan.apis.kernel.ClassPathFinder classpath_finder)
Constructs a new instance of EventChannelFactory.

This method should not be called directly by an application: It is here only to let EventChannelFactory be instanciated when one of the org.omg.CORBA.ORB.init(...) methods is called.

Method Detail

setMarshallerFactory

public void setMarshallerFactory(DavidStreamFactory marshaller_factory)
Overrides:
setMarshallerFactory in class ORBClass

export

public Identifier export(java.lang.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:
naming_context.export(org.objectweb.jonathan.model.name)

newEventChannel

public org.omg.CORBA.Object newEventChannel(java.lang.String address,
                                            int port,
                                            java.lang.String type)
                                     throws org.objectweb.jonathan.apis.kernel.JonathanException
Constructs and returns a new EventChannel.

type must the scoped name of the expected channel object type (not the operations type). The channel type must not be "org.omg.CORBA.Object".

Parameters:
address - the IP multicast address to use
port - the port number to use
type - the type of the EventChannel
Returns:
an EventChannel
Throws:
org.objectweb.jonathan.apis.kernel.JonathanException - thrown if something goes wrong

bindConsumer

public static void bindConsumer(java.lang.Object consumer,
                                java.lang.Object channel_proxy)
                         throws org.objectweb.jonathan.apis.kernel.JonathanException
Binds a consumer object to the event channel represented by the provided_proxy parameter.

Parameters:
consumer - a consumer object;
channel_proxy - a channel proxy.
Throws:
org.objectweb.jonathan.apis.kernel.JonathanException - if something goes wrong.

decode

public Identifier decode(byte[] data,
                         int offset,
                         int length)
                  throws org.objectweb.jonathan.apis.kernel.JonathanException
Returns an identifier, decoded from a byte array portion.

Specified by:
decode in interface NamingContext
Parameters:
data - the data to decode;
offset - the starting point of the valid data in data;
length - the number of relevant bytes in data;
Returns:
a decoded Identifier.
Throws:
org.objectweb.jonathan.apis.kernel.JonathanException - if something goes wrong.

decode

public Identifier decode(UnMarshaller u)
                  throws org.objectweb.jonathan.apis.kernel.JonathanException
Returns an identifier, decoded using an UnMarshaller;

Specified by:
decode in interface NamingContext
Parameters:
u - an unmarshaller;
Returns:
a decoded Identifier.
Throws:
org.objectweb.jonathan.apis.kernel.JonathanException - if something goes wrong.

bindConsumer

public void bindConsumer(EBinder.EId id,
                         java.lang.Object consumer,
                         java.lang.Object channel_proxy)
                  throws org.objectweb.jonathan.apis.kernel.JonathanException
Throws:
org.objectweb.jonathan.apis.kernel.JonathanException