org.jacorb.orb
Class ORB

java.lang.Object
  extended byorg.omg.CORBA.ORB
      extended byorg.omg.CORBA_2_3.ORB
          extended byorg.omg.CORBA_2_5.ORB
              extended byorg.jacorb.orb.ORBSingleton
                  extended byorg.jacorb.orb.ORB
All Implemented Interfaces:
EventListener, POAListener

public final class ORB
extends ORBSingleton
implements POAListener

Version:
$Id: ORB.java,v 1.115 2004/02/06 14:37:19 gerald Exp $
Author:
Gerald Brose, FU Berlin

Field Summary
 java.lang.String[] _args
          command like args
 java.applet.Applet applet
           
protected  java.util.Map boxedValueHelpers
          Maps repository ids (strings) of boxed value types to BoxedValueHelper instances for those types.
static java.lang.String orb_id
           
protected  java.util.Map valueFactories
          Maps repository ids (strings) to objects that implement org.omg.CORBA.portable.ValueFactory.
 
Constructor Summary
ORB()
           
 
Method Summary
 Object _getObject(ParsedIOR pior)
          This version of _getObject is used for references that have arrived over the network and is called from CDRInputStream.
 void addObjectKey(java.lang.String key_name, java.lang.String full_path)
          addObjectKey is a proprietary method that allows the internal objectKeyMap to be altered programmatically.
 void addRequest(Request req)
           
 ContextList create_context_list()
           
 Environment create_environment()
           
 ExceptionList create_exception_list()
           
 NVList create_list(int count)
           
 NamedValue create_named_value(java.lang.String name, Any value, int flags)
           
 NVList create_operation_list(Object obj)
           
 NVList create_operation_list(OperationDef oper)
           
 OutputStream create_output_stream()
           
 Policy create_policy(int type, Any value)
          This method creates a policy with the given type and the given value.
 void destroy()
           
 Context get_default_context()
           
 Request get_next_response()
           
 boolean get_service_information(short service_type, ServiceInformationHolder service_information)
           
 Object get_value_def(java.lang.String repid)
          always return a ValueDef or throw BAD_PARAM if not repid of a value
 java.applet.Applet getApplet()
           
 BasicAdapter getBasicAdapter()
          used from the POA
 BoxedValueHelper getBoxedValueHelper(java.lang.String repId)
          Returns a BoxedValueHelper for the type specified by repId, or null if no such BoxedValueHelper can be found.
 ClientConnectionManager getClientConnectionManager()
           
 GIOPConnectionManager getGIOPConnectionManager()
           
 InterceptorManager getInterceptorManager()
          Get the InterceptorManager, if present.
 Current getPOACurrent()
          getPOACurrent
 Object getReference(POA poa, byte[] object_key, java.lang.String rep_id, boolean _transient)
          called by POA to create an IOR
 POA getRootPOA()
           
 TransportManager getTransportManager()
           
 boolean hasClientRequestInterceptors()
          Test, if the ORB has ClientRequestInterceptors
Called by Delegate.
 boolean hasPolicyFactoryForType(int type)
          Tests if a policy factory is present for the given type.
 boolean hasRequestInterceptors()
          Test, if the ORB has client or server side interceptors.
 boolean hasServerRequestInterceptors()
          Test, if the ORB has ServerRequestInterceptors
Called by poa.RequestProcessor.
 java.lang.String id()
          Overrides id() in org.omg.CORBA_2_5.ORB
 boolean isApplet()
           
 java.lang.String[] list_initial_services()
           
 ValueFactory lookup_value_factory(java.lang.String id)
           
 byte[] mapObjectKey(byte[] originalKey)
          Map an object key to another, as defined by the value of a corresponding configuration property in the properties file, e.g. map "NameService" to "StandardNS/NameServer-POA/_root"
 java.lang.String object_to_string(Object obj)
           
 void perform_work()
           
 void poaCreated(POA poa)
          An operation from the POAListener interface.
 void poaStateChanged(POA poa, int new_state)
           
 boolean poll_next_response()
           
 void referenceCreated(Object o)
           
 void register_initial_reference(java.lang.String id, Object obj)
          Register a reference, that will be returned on subsequent calls to resove_initial_references(id).
 ValueFactory register_value_factory(java.lang.String id, ValueFactory factory)
           
 void removeRequest(Request req)
           
 Object resolve_initial_references(java.lang.String identifier)
          resolve_initial_references
 void run()
           
 void send_multiple_requests_deferred(Request[] req)
           
 void send_multiple_requests_oneway(Request[] req)
           
 void set_delegate(java.lang.Object wrapper)
          called by org.jacorb.poa.RequestProcessor
protected  void set_parameters(java.applet.Applet app, java.util.Properties props)
          Initialization method, called from within the super class org.omg.CORBA.ORB
protected  void set_parameters(java.lang.String[] args, java.util.Properties props)
          called from ORB.init()
 void shutdown(boolean wait_for_completion)
           
 Object string_to_object(java.lang.String str)
           
 void turnOnBiDirGIOP()
           
 void unregister_value_factory(java.lang.String id)
           
 boolean useBiDirGIOP()
           
 void useProxy()
          forces the use of a proxy (by using a dummy applet)
 boolean work_pending()
           
 
Methods inherited from class org.jacorb.orb.ORBSingleton
create_abstract_interface_tc, create_alias_tc, create_any, create_array_tc, create_enum_tc, create_exception_tc, create_fixed_tc, create_interface_tc, create_local_interface_tc, create_native_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_current, get_primitive_tc, legalNameChar, legalStartChar
 
Methods inherited from class org.omg.CORBA.ORB
connect, create_recursive_sequence_tc, disconnect, init, init, init
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

valueFactories

protected java.util.Map valueFactories
Maps repository ids (strings) to objects that implement org.omg.CORBA.portable.ValueFactory. This map is used by register/unregister_value_factory() and lookup_value_factory().


boxedValueHelpers

protected java.util.Map boxedValueHelpers
Maps repository ids (strings) of boxed value types to BoxedValueHelper instances for those types.


_args

public java.lang.String[] _args
command like args


applet

public java.applet.Applet applet

orb_id

public static final java.lang.String orb_id
See Also:
Constant Field Values
Constructor Detail

ORB

public ORB()
Method Detail

id

public java.lang.String id()
Overrides id() in org.omg.CORBA_2_5.ORB

Overrides:
id in class ORB

useBiDirGIOP

public boolean useBiDirGIOP()

turnOnBiDirGIOP

public void turnOnBiDirGIOP()

_getObject

public Object _getObject(ParsedIOR pior)
This version of _getObject is used for references that have arrived over the network and is called from CDRInputStream. It removes stale cache entries


getClientConnectionManager

public ClientConnectionManager getClientConnectionManager()

getGIOPConnectionManager

public GIOPConnectionManager getGIOPConnectionManager()

create_policy

public Policy create_policy(int type,
                            Any value)
                     throws PolicyError
This method creates a policy with the given type and the given value.

Overrides:
create_policy in class ORB
Parameters:
type - The policies type.
value - The policies value.
Throws:
PolicyError - There is no PolicyFactory for the given type or the policy creation failed.
See Also:
PolicyFactory

hasPolicyFactoryForType

public boolean hasPolicyFactoryForType(int type)
Tests if a policy factory is present for the given type.


create_context_list

public ContextList create_context_list()
Overrides:
create_context_list in class ORBSingleton

create_environment

public Environment create_environment()
Overrides:
create_environment in class ORBSingleton

create_output_stream

public OutputStream create_output_stream()
Overrides:
create_output_stream in class ORBSingleton

get_default_context

public Context get_default_context()
Overrides:
get_default_context in class ORBSingleton

getBasicAdapter

public BasicAdapter getBasicAdapter()
used from the POA

Returns:
the basic adapter used by this ORB instance

getPOACurrent

public Current getPOACurrent()
getPOACurrent


getReference

public Object getReference(POA poa,
                           byte[] object_key,
                           java.lang.String rep_id,
                           boolean _transient)
called by POA to create an IOR

Parameters:
poa - the calling POA
object_key -
rep_id -
_transient - is the new reference transient or persistent
Returns:
a new CORBA Object reference

getRootPOA

public POA getRootPOA()
               throws INITIALIZE
Throws:
INITIALIZE

isApplet

public boolean isApplet()
Returns:
- true if ORB is initialized by an applet and appligator use is switched on

getApplet

public java.applet.Applet getApplet()

list_initial_services

public java.lang.String[] list_initial_services()
Overrides:
list_initial_services in class ORBSingleton

poaCreated

public void poaCreated(POA poa)
An operation from the POAListener interface. Whenever a new POA is created, the ORB is notified.

Specified by:
poaCreated in interface POAListener

poaStateChanged

public void poaStateChanged(POA poa,
                            int new_state)
Specified by:
poaStateChanged in interface POAListener

referenceCreated

public void referenceCreated(Object o)
Specified by:
referenceCreated in interface POAListener

get_service_information

public boolean get_service_information(short service_type,
                                       ServiceInformationHolder service_information)
Overrides:
get_service_information in class ORB

resolve_initial_references

public Object resolve_initial_references(java.lang.String identifier)
                                  throws InvalidName
resolve_initial_references

Overrides:
resolve_initial_references in class ORBSingleton
Throws:
InvalidName

register_initial_reference

public void register_initial_reference(java.lang.String id,
                                       Object obj)
                                throws InvalidName
Register a reference, that will be returned on subsequent calls to resove_initial_references(id).
The references "RootPOA", "POACurrent" and "PICurrent" can be set, but will not be resolved with the passed in references.

Overrides register_initial_reference() in org.omg.CORBA_2_5.ORB

Overrides:
register_initial_reference in class ORB
Parameters:
id - The references human-readable id, e.g. "MyService".
obj - The objects reference.
Throws:
InvalidName - A reference with id has already been registered.

run

public void run()
Overrides:
run in class ORBSingleton

send_multiple_requests_oneway

public void send_multiple_requests_oneway(Request[] req)
Overrides:
send_multiple_requests_oneway in class ORBSingleton

send_multiple_requests_deferred

public void send_multiple_requests_deferred(Request[] req)
Overrides:
send_multiple_requests_deferred in class ORBSingleton

poll_next_response

public boolean poll_next_response()
Overrides:
poll_next_response in class ORBSingleton

get_next_response

public Request get_next_response()
Overrides:
get_next_response in class ORBSingleton

addRequest

public void addRequest(Request req)

removeRequest

public void removeRequest(Request req)

set_parameters

protected void set_parameters(java.lang.String[] args,
                              java.util.Properties props)
called from ORB.init()

Overrides:
set_parameters in class ORBSingleton

set_parameters

protected void set_parameters(java.applet.Applet app,
                              java.util.Properties props)
Initialization method, called from within the super class org.omg.CORBA.ORB

Overrides:
set_parameters in class ORBSingleton

shutdown

public void shutdown(boolean wait_for_completion)
Overrides:
shutdown in class ORBSingleton

destroy

public void destroy()
Overrides:
destroy in class ORB

string_to_object

public Object string_to_object(java.lang.String str)
Overrides:
string_to_object in class ORBSingleton

get_value_def

public Object get_value_def(java.lang.String repid)
                     throws BAD_PARAM
always return a ValueDef or throw BAD_PARAM if not repid of a value

Overrides:
get_value_def in class ORB
Throws:
BAD_PARAM

set_delegate

public void set_delegate(java.lang.Object wrapper)
called by org.jacorb.poa.RequestProcessor

Overrides:
set_delegate in class ORB

useProxy

public void useProxy()
forces the use of a proxy (by using a dummy applet)


object_to_string

public java.lang.String object_to_string(Object obj)
Overrides:
object_to_string in class ORBSingleton

perform_work

public void perform_work()
Overrides:
perform_work in class ORBSingleton

work_pending

public boolean work_pending()
Overrides:
work_pending in class ORBSingleton

register_value_factory

public ValueFactory register_value_factory(java.lang.String id,
                                           ValueFactory factory)
Overrides:
register_value_factory in class ORB

unregister_value_factory

public void unregister_value_factory(java.lang.String id)
Overrides:
unregister_value_factory in class ORB

lookup_value_factory

public ValueFactory lookup_value_factory(java.lang.String id)
Overrides:
lookup_value_factory in class ORB

getBoxedValueHelper

public BoxedValueHelper getBoxedValueHelper(java.lang.String repId)
Returns a BoxedValueHelper for the type specified by repId, or null if no such BoxedValueHelper can be found. This method uses an internal cache of BoxedValueHelpers so that each class needs only be looked up once.

Parameters:
repId - the repository id of the type for which a BoxedValueHelper should be returned. It is assumed that repId is the repository id of a boxed value type. Otherwise, the result will be null.
Returns:
an instance of the BoxedValueHelper class that corresponds to repId.

hasClientRequestInterceptors

public boolean hasClientRequestInterceptors()
Test, if the ORB has ClientRequestInterceptors
Called by Delegate.


hasServerRequestInterceptors

public boolean hasServerRequestInterceptors()
Test, if the ORB has ServerRequestInterceptors
Called by poa.RequestProcessor.


hasRequestInterceptors

public boolean hasRequestInterceptors()
Test, if the ORB has client or server side interceptors.


getInterceptorManager

public InterceptorManager getInterceptorManager()
Get the InterceptorManager, if present.

Returns:
the InterceptorManager, or null, if none is present.

getTransportManager

public TransportManager getTransportManager()

create_exception_list

public ExceptionList create_exception_list()
Overrides:
create_exception_list in class ORBSingleton

create_list

public NVList create_list(int count)
Overrides:
create_list in class ORBSingleton

create_named_value

public NamedValue create_named_value(java.lang.String name,
                                     Any value,
                                     int flags)
Overrides:
create_named_value in class ORBSingleton

create_operation_list

public NVList create_operation_list(Object obj)
Overrides:
create_operation_list in class ORBSingleton

create_operation_list

public NVList create_operation_list(OperationDef oper)
Overrides:
create_operation_list in class ORBSingleton

addObjectKey

public void addObjectKey(java.lang.String key_name,
                         java.lang.String full_path)
addObjectKey is a proprietary method that allows the internal objectKeyMap to be altered programmatically. The objectKeyMap allows more readable corbaloc URLs by mapping the actual object key to an arbitary string. See the jacorb.properties file for more information.

Parameters:
key_name - a String value e.g. NameService
full_path - an String value e.g. file:/home/rnc/NameSingleton.ior

mapObjectKey

public byte[] mapObjectKey(byte[] originalKey)
Map an object key to another, as defined by the value of a corresponding configuration property in the properties file, e.g. map "NameService" to "StandardNS/NameServer-POA/_root"

Parameters:
originalKey - a byte[] value containing the original key.
Returns:
a byte[] value containing the mapped key, if a mapping is defined, originalKey otherwise.