org.jacorb.orb

Class ORB

Implemented Interfaces:
Configurable, EventListener, POAListener

public final class ORB
extends ORBSingleton
implements POAListener, Configurable

Version:
$Id: ORB.java,v 1.119 2004/05/06 12:40:00 nicolas Exp $

Author:
Gerald Brose, FU Berlin

Field Summary

String[]
_args
command like args
java.applet.Applet
applet
protected Map
boxedValueHelpers
Maps repository ids (strings) of boxed value types to BoxedValueHelper instances for those types.
static String
orb_id
protected 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(String key_name, String full_path)
addObjectKey is a proprietary method that allows the internal objectKeyMap to be altered programmatically.
void
addRequest(Request req)
void
configure(Configuration myConfiguration)
configure the ORB
ContextList
create_context_list()
Environment
create_environment()
ExceptionList
create_exception_list()
NVList
create_list(int count)
NamedValue
create_named_value(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()
Applet
getApplet()
BasicAdapter
getBasicAdapter()
used from the POA
BoxedValueHelper
getBoxedValueHelper(String repId)
Returns a BoxedValueHelper for the type specified by repId, or null if no such BoxedValueHelper can be found.
ClientConnectionManager
getClientConnectionManager()
org.jacorb.config.Configuration
getConfiguration()
Some parts of JacORB cannot be elegantly configured from the outside and need access to the ORB's configuration retrieve config settings.
GIOPConnectionManager
getGIOPConnectionManager()
InterceptorManager
getInterceptorManager()
Get the InterceptorManager, if present.
Current
getPOACurrent()
getPOACurrent
Object
getReference(POA poa, byte[] object_key, String rep_id, boolean _transient)
called by POA to create an IOR
POA
getRootPOA()
TransportManager
getTransportManager()
Context
get_default_context()
Request
get_next_response()
boolean
get_service_information(short service_type, ServiceInformationHolder service_information)
Object
get_value_def(String repid)
always return a ValueDef or throw BAD_PARAM if not repid of a value
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.
String
id()
Overrides id() in org.omg.CORBA_2_5.ORB
boolean
isApplet()
String[]
list_initial_services()
ValueFactory
lookup_value_factory(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"
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(String id, Object obj)
Register a reference, that will be returned on subsequent calls to resove_initial_references(id).
ValueFactory
register_value_factory(String id, ValueFactory factory)
void
removeRequest(Request req)
Object
resolve_initial_references(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(String[] args, java.util.Properties props)
called from ORB.init(), entry point for initialization.
protected void
set_parameters(java.applet.Applet app, java.util.Properties props)
Initialization method, called from within the super class org.omg.CORBA.ORB
void
shutdown(boolean wait_for_completion)
Object
string_to_object(String str)
void
turnOnBiDirGIOP()
void
unregister_value_factory(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

configure, create_abstract_interface_tc, create_alias_tc, create_any, create_array_tc, create_context_list, create_enum_tc, create_environment, create_exception_list, create_exception_tc, create_fixed_tc, create_interface_tc, create_list, create_local_interface_tc, create_named_value, create_native_tc, create_operation_list, create_operation_list, create_output_stream, 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_default_context, get_next_response, get_primitive_tc, legalNameChar, legalStartChar, list_initial_services, object_to_string, perform_work, poll_next_response, resolve_initial_references, run, send_multiple_requests_deferred, send_multiple_requests_oneway, set_parameters, set_parameters, shutdown, string_to_object, work_pending

Methods inherited from class org.omg.CORBA_2_5.ORB

create_local_interface_tc, id, register_initial_reference

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

connect, create_abstract_interface_tc, create_alias_tc, create_any, create_array_tc, create_context_list, create_enum_tc, create_environment, create_exception_list, create_exception_tc, create_fixed_tc, create_interface_tc, create_list, create_local_interface_tc, create_named_value, create_native_tc, create_operation_list, create_operation_list, create_output_stream, create_policy, 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, destroy, disconnect, get_current, get_default_context, get_next_response, get_primitive_tc, get_service_information, init, init, init, list_initial_services, object_to_string, perform_work, poll_next_response, resolve_initial_references, run, send_multiple_requests_deferred, send_multiple_requests_oneway, set_parameters, set_parameters, shutdown, string_to_object, work_pending

Field Details

_args

public String[] _args
command like args


applet

public java.applet.Applet applet


boxedValueHelpers

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


orb_id

public static final String orb_id


valueFactories

protected 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().

Constructor Details

ORB

public ORB()

Method Details

_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


addObjectKey

public void addObjectKey(String key_name,
                         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


addRequest

public void addRequest(Request req)


configure

public void configure(Configuration myConfiguration)
            throws ConfigurationException
configure the ORB
Overrides:
configure in interface ORBSingleton


create_context_list

public ContextList create_context_list()
Overrides:
create_context_list in interface ORBSingleton


create_environment

public Environment create_environment()
Overrides:
create_environment in interface ORBSingleton


create_exception_list

public ExceptionList create_exception_list()
Overrides:
create_exception_list in interface ORBSingleton


create_list

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


create_named_value

public NamedValue create_named_value(String name,
                                     Any value,
                                     int flags)
Overrides:
create_named_value in interface ORBSingleton


create_operation_list

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


create_operation_list

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


create_output_stream

public OutputStream create_output_stream()
Overrides:
create_output_stream in interface ORBSingleton


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 interface 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


destroy

public void destroy()
Overrides:
destroy in interface ORB


getApplet

public Applet getApplet()


getBasicAdapter

public BasicAdapter getBasicAdapter()
used from the POA

Returns:
the basic adapter used by this ORB instance


getBoxedValueHelper

public BoxedValueHelper getBoxedValueHelper(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.


getClientConnectionManager

public ClientConnectionManager getClientConnectionManager()


getConfiguration

public org.jacorb.config.Configuration getConfiguration()
Some parts of JacORB cannot be elegantly configured from the outside and need access to the ORB's configuration retrieve config settings. This method should only be used in those restricted cases!


getGIOPConnectionManager

public GIOPConnectionManager getGIOPConnectionManager()


getInterceptorManager

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

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


getPOACurrent

public Current getPOACurrent()
getPOACurrent


getReference

public Object getReference(POA poa,
                           byte[] object_key,
                           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


getTransportManager

public TransportManager getTransportManager()


get_default_context

public Context get_default_context()
Overrides:
get_default_context in interface ORBSingleton


get_next_response

public Request get_next_response()
Overrides:
get_next_response in interface ORBSingleton


get_service_information

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


get_value_def

public Object get_value_def(String repid)
            throws BAD_PARAM
always return a ValueDef or throw BAD_PARAM if not repid of a value
Overrides:
get_value_def in interface ORB


hasClientRequestInterceptors

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


hasPolicyFactoryForType

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


hasRequestInterceptors

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


hasServerRequestInterceptors

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


id

public String id()
Overrides id() in org.omg.CORBA_2_5.ORB
Overrides:
id in interface ORB


isApplet

public boolean isApplet()

Returns:
- true if ORB is initialized by an applet and appligator use is switched on


list_initial_services

public String[] list_initial_services()
Overrides:
list_initial_services in interface ORBSingleton


lookup_value_factory

public ValueFactory lookup_value_factory(String id)
Overrides:
lookup_value_factory in interface ORB


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.


object_to_string

public String object_to_string(Object obj)
Overrides:
object_to_string in interface ORBSingleton


perform_work

public void perform_work()
Overrides:
perform_work in interface 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


poll_next_response

public boolean poll_next_response()
Overrides:
poll_next_response in interface ORBSingleton


referenceCreated

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


register_initial_reference

public void register_initial_reference(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 interface 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.


register_value_factory

public ValueFactory register_value_factory(String id,
                                           ValueFactory factory)
Overrides:
register_value_factory in interface ORB


removeRequest

public void removeRequest(Request req)


resolve_initial_references

public Object resolve_initial_references(String identifier)
            throws InvalidName
resolve_initial_references
Overrides:
resolve_initial_references in interface ORBSingleton


run

public void run()
Overrides:
run in interface ORBSingleton


send_multiple_requests_deferred

public void send_multiple_requests_deferred(Request req)
Overrides:
send_multiple_requests_deferred in interface ORBSingleton


send_multiple_requests_oneway

public void send_multiple_requests_oneway(Request req)
Overrides:
send_multiple_requests_oneway in interface ORBSingleton


set_delegate

public void set_delegate(java.lang.Object wrapper)
called by org.jacorb.poa.RequestProcessor
Overrides:
set_delegate in interface ORB


set_parameters

protected void set_parameters(String[] args,
                              java.util.Properties props)
called from ORB.init(), entry point for initialization.
Overrides:
set_parameters in interface 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 interface ORBSingleton


shutdown

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


string_to_object

public Object string_to_object(String str)
Overrides:
string_to_object in interface ORBSingleton


turnOnBiDirGIOP

public void turnOnBiDirGIOP()


unregister_value_factory

public void unregister_value_factory(String id)
Overrides:
unregister_value_factory in interface ORB


useBiDirGIOP

public boolean useBiDirGIOP()


useProxy

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


work_pending

public boolean work_pending()
Overrides:
work_pending in interface ORBSingleton