org.objectweb.david.libs.binding.orbs
Class ORBClass

java.lang.Object
  |
  +--org.omg.CORBA.ORB
        |
        +--org.objectweb.david.libs.binding.orbs.ORBSingletonClass
              |
              +--org.objectweb.david.libs.binding.orbs.ORBClass
All Implemented Interfaces:
Constants, DavidMarshallerFactory
Direct Known Subclasses:
EventChannelFactory, IIOPORB

public abstract class ORBClass
extends ORBSingletonClass
implements DavidMarshallerFactory

This class is an extension of the standard CORBA ORB class, implementing the protocol independent features of a CORBA ORB.


Field Summary
protected  NamingContext domain
           
protected  DavidStreamFactory marshaller_factory
           
protected  Context orb_context
           
protected  String orb_context_name
           
protected  StubFactory 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
protected ORBClass()
           
protected ORBClass(String _orb_context_name)
          Constructs a new instance of ORBClass.
 
Method Summary
 void connect(Object obj)
          Exports the provided object to a default adapter of type SimpleAdapter.
 Any create_any()
           
 OutputStream create_output_stream()
          Create a new org.omg.CORBA.portable.OutputStream into which IDL method parameters can be marshalled during method invocation.
 void disconnect(Object obj)
          Unexports the provided object.
 Request get_next_response()
          Get the next request instance for which a response has been received.
protected abstract  void initialize()
          Initialises the target instance of ORBClass.
protected  void initialize(Context _orb_context)
          Should be called by subclasses when initializing the ORB (not via ORB.init()).
 String[] list_initial_services()
          Return a list of the initially available CORBA object references, such as the NameService and InterfaceRepository.
 DavidMarshaller newMarshaller()
          Returns a new marshaller.
 DavidUnMarshaller newUnMarshaller()
          Returns a new unmarshaller.
 String object_to_string(Object object)
          Returns a stringified IOR corresponding to the specified CORBA Object.
 void perform_work()
          This operation does nothing.
 boolean poll_next_response()
          Find out if any of the deferred (asynchronous) invocations have a response yet.
 Object resolve_initial_references(String name)
          Resolve a specific object reference from the set of available initial service names.
 void run()
          This operation blocks the calling thread until shutdown() is called.
 void send_multiple_requests_deferred(Request[] requests)
          Send multiple dynamic (DII) requests asynchronously.
 void send_multiple_requests_oneway(Request[] requests)
          Send multiple dynamic (DII) requests asynchronously without expecting any responses.
protected  void set_parameters(Applet app, Properties props)
          Initializes the ORB implementation with the given parameters and properties.
protected  void set_parameters(String[] args, Properties props)
          Initializes the ORB implementation with the given parameters and properties.
 void shutdown(boolean wait_for_completion)
          This operation instructs the ORB to shut down.
 Object string_to_object(String ior)
          Returns a CORBA Object correponding to the specified IOR.
 boolean work_pending()
          This operation always returns false.
 
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
 
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
 

Field Detail

orb_context_name

protected String orb_context_name

orb_context

protected Context orb_context

stub_factory

protected StubFactory stub_factory

domain

protected NamingContext domain

marshaller_factory

protected DavidStreamFactory marshaller_factory
Constructor Detail

ORBClass

protected ORBClass(String _orb_context_name)
Constructs a new instance of ORBClass.
Parameters:
_orb_context_name - the scoped name of the context containing the default orb properties

ORBClass

protected ORBClass()
Method Detail

set_parameters

protected final void set_parameters(String[] args,
                                    Properties props)
Initializes the ORB implementation with the given parameters and properties. This method is used in applications only.
Overrides:
set_parameters in class ORBSingletonClass
Parameters:
args - application strings from main() method
props - application-specific properties

set_parameters

protected final void set_parameters(Applet app,
                                    Properties props)
Initializes the ORB implementation with the given parameters and properties. This method is used in applets only.
Overrides:
set_parameters in class ORBSingletonClass
Parameters:
app - the applet
props - applet-specific properties

initialize

protected final void initialize(Context _orb_context)
Should be called by subclasses when initializing the ORB (not via ORB.init()).
Parameters:
_orb_context -  

initialize

protected abstract void initialize()
                            throws JonathanException
Initialises the target instance of ORBClass.

This method should be implemented by sub-class instances, and called when they are initialized directly by the Jonathan kernel


run

public void run()
This operation blocks the calling thread until shutdown() is called.
Overrides:
run in class ORB

shutdown

public void shutdown(boolean wait_for_completion)
This operation instructs the ORB to shut down. The ORB.run() method will return after shutdown has been called.
Overrides:
shutdown in class ORB

work_pending

public boolean work_pending()
This operation always returns false.
Overrides:
work_pending in class ORB

perform_work

public void perform_work()
This operation does nothing.
Overrides:
perform_work in class ORB

list_initial_services

public String[] list_initial_services()
Return a list of the initially available CORBA object references, such as the NameService and InterfaceRepository.
Overrides:
list_initial_services in class ORBSingletonClass
Returns:
the list of object service names

resolve_initial_references

public Object resolve_initial_references(String name)
                                  throws InvalidName
Resolve a specific object reference from the set of available initial service names.
Overrides:
resolve_initial_references in class ORBSingletonClass
Parameters:
name - the name of the initial service
Returns:
An object reference for the named object.
Throws:
InvalidName - The given name is not associated with a known service.

object_to_string

public String object_to_string(Object object)
Returns a stringified IOR corresponding to the specified CORBA Object.
Overrides:
object_to_string in class ORBSingletonClass
Parameters:
object - a CORBA object.
Returns:
a stringified IOR corresponding to 'object'.

string_to_object

public Object string_to_object(String ior)
Returns a CORBA Object correponding to the specified IOR.
Overrides:
string_to_object in class ORBSingletonClass
Parameters:
ior - a stringified IOR.
Returns:
a CORBA Object correponding to 'ior'.

create_output_stream

public OutputStream create_output_stream()
Create a new org.omg.CORBA.portable.OutputStream into which IDL method parameters can be marshalled during method invocation.
Overrides:
create_output_stream in class ORBSingletonClass

send_multiple_requests_oneway

public void send_multiple_requests_oneway(Request[] requests)
Send multiple dynamic (DII) requests asynchronously without expecting any responses.
Overrides:
send_multiple_requests_oneway in class ORBSingletonClass
Parameters:
req - an array of request objects.

send_multiple_requests_deferred

public void send_multiple_requests_deferred(Request[] requests)
Send multiple dynamic (DII) requests asynchronously.
Overrides:
send_multiple_requests_deferred in class ORBSingletonClass
Parameters:
requests - an array of request objects.

poll_next_response

public boolean poll_next_response()
Find out if any of the deferred (asynchronous) invocations have a response yet.
Overrides:
poll_next_response in class ORBSingletonClass

get_next_response

public Request get_next_response()
Get the next request instance for which a response has been received.
Overrides:
get_next_response in class ORBSingletonClass

create_any

public Any create_any()
Overrides:
create_any in class ORBSingletonClass

connect

public void connect(Object obj)
Exports the provided object to a default adapter of type SimpleAdapter.

The default adapter must be specified under the property "/david/orbs/initial_services/Connecter".

Overrides:
connect in class ORBSingletonClass
Parameters:
obj - a CORBA object reference.

disconnect

public void disconnect(Object obj)
Unexports the provided object.

This operation throws a BAD_OPERATION exception if the provided object cannot have been connected by the target ORB.

Overrides:
disconnect in class ORBSingletonClass
Parameters:
obj - a CORBA object reference.

newMarshaller

public DavidMarshaller newMarshaller()
Description copied from interface: DavidMarshallerFactory
Returns a new marshaller.
Specified by:
newMarshaller in interface DavidMarshallerFactory
Following copied from interface: org.objectweb.david.apis.presentation.DavidMarshallerFactory
Returns:
a new marshaller.

newUnMarshaller

public DavidUnMarshaller newUnMarshaller()
Description copied from interface: DavidMarshallerFactory
Returns a new unmarshaller.
Specified by:
newUnMarshaller in interface DavidMarshallerFactory
Following copied from interface: org.objectweb.david.apis.presentation.DavidMarshallerFactory
Returns:
a new unmarshaller.