org.openorb.orb.core
Class ORB

java.lang.Object
  extended byorg.omg.CORBA.ORB
      extended byorg.omg.CORBA_2_3.ORB
          extended byorg.openorb.orb.core.ORBSingleton
              extended byorg.openorb.orb.core.ORB

public class ORB
extends ORBSingleton

This class provides all required operations and structures for the org.openorb implementation.

Author:
Chris Wood, Jerome Daniel, Michael Rumpf, Alex Andrushchak

Constructor Summary
ORB()
          Orb instances must be created through ORB.init().
 
Method Summary
 void addInitialReference(java.lang.String name, org.omg.CORBA.Object target)
          Register an initial reference.
 void addServiceInformation(short service_type, org.omg.CORBA.ServiceInformation service_information)
          Add service information.
 void connect(org.omg.CORBA.Object obj)
          Connect an object to the adapter.
 org.omg.CORBA.ContextList create_context_list()
          Create a context list.
 org.omg.CORBA.Environment create_environment()
          Create an environment.
 org.omg.CORBA.ExceptionList create_exception_list()
          Create an exception list.
 org.omg.CORBA.NVList create_list(int count)
          Create a named value list.
 org.omg.CORBA.NamedValue create_named_value(java.lang.String name, org.omg.CORBA.Any value, int flags)
          Create a named value.
 org.omg.CORBA.portable.OutputStream create_output_stream()
          Create an output stream.
 org.omg.CORBA.Policy create_policy(int policy_type, org.omg.CORBA.Any val)
          This operations creates a CORBA policy.
 void destroy()
          Destroy the ORB.
 void disconnect(org.omg.CORBA.Object obj)
          Disconnect an object from the adapter.
protected  void finalize()
          A finalizer which will call shutdown.
 org.omg.CORBA.Context get_default_context()
          Return default context.
 org.omg.CORBA.Request get_next_response()
          Get the next response.
 boolean get_service_information(short service_type, org.omg.CORBA.ServiceInformationHolder service_information)
          Return the service informaton.
 java.lang.Object getFeature(java.lang.String feature)
          This operation is used to get an OpenORB feature reference.
protected  byte[] getKeyFromString(java.lang.String str)
          Get an object key from a stringified object key.
 ORBLoader getLoader()
          This operation returns the configurator used by this ORB instance.
 CurrentImpl getPICurrent()
          Returns the PICurrent implementation.
 java.lang.String getURLCodeBase()
          Return the value for the property openorb.URLCodeBase.
 java.lang.String[] list_initial_services()
          Return as a string sequence all available initial services.
 org.omg.CORBA.portable.ValueFactory lookup_value_factory(java.lang.String id)
          This function is used to find a value factory.
 java.lang.String object_to_string(org.omg.CORBA.Object obj)
          Convert an object reference to a string.
 void perform_work()
          Perform all current work.
 boolean poll_next_response()
          Poll next response
 org.omg.CORBA.portable.ValueFactory register_value_factory(java.lang.String id, org.omg.CORBA.portable.ValueFactory factory)
          This function is used to register a value factory.
 org.omg.CORBA.portable.ValueFactory register_value_factory(java.lang.String id, org.omg.CORBA.portable.ValueFactory factory, Configuration config)
          This function is used to register a value factory with a supplied configuration.
 org.omg.CORBA.Object resolve_initial_references(java.lang.String object_name)
          Return an initial reference.
 void run()
          Run the server side.
protected  org.omg.CORBA.Object scan_url_body(java.lang.String addr, byte[] key)
          Method scan_url_body.
protected  org.omg.CORBA.Object scan_url_loc(java.lang.String loc)
          This function scans a CORBA URL iioploc to extract reference information.
protected  org.omg.CORBA.Object scan_url_name(java.lang.String loc)
          This function scans a CORBA URL corbaname to extract reference information.
 void send_multiple_requests_deferred(org.omg.CORBA.Request[] req)
          Send multiple deferred requests.
 void send_multiple_requests_oneway(org.omg.CORBA.Request[] req)
          Send multiple oneway requests.
 void set_delegate(java.lang.Object wrapper)
          This function is used to set a delegate.
protected  void set_parameters(java.applet.Applet app, java.util.Properties properties)
          Set the ORB parameters for applet.
protected  void set_parameters(java.lang.String[] args, java.util.Properties properties)
          Set the ORB parameters.
 void setFeature(java.lang.String feature, java.lang.Object reference)
          This operation is used to set an OpenORB feature reference.
 void shutdown(boolean wait_for_completion)
          Stop the orb ( and the object adapter if required )
 org.omg.CORBA.Object string_to_object(java.lang.String str)
          Convert a string to an object reference.
 void unregister_value_factory(java.lang.String id)
          This function is used to unregister a value factory.
 boolean work_pending()
          Check if some work is pending.
 
Methods inherited from class org.openorb.orb.core.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_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, enableLogging, get_primitive_tc, getLogger
 
Methods inherited from class org.omg.CORBA_2_3.ORB
get_value_def
 
Methods inherited from class org.omg.CORBA.ORB
create_operation_list, get_current, init, init, init
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ORB

public ORB()
Orb instances must be created through ORB.init().

Method Detail

setFeature

public void setFeature(java.lang.String feature,
                       java.lang.Object reference)
This operation is used to set an OpenORB feature reference.

Parameters:
feature -
reference -

getFeature

public java.lang.Object getFeature(java.lang.String feature)
This operation is used to get an OpenORB feature reference.

Parameters:
feature -
Returns:
Object

getLoader

public ORBLoader getLoader()
This operation returns the configurator used by this ORB instance.

Returns:
ORBLoader

getPICurrent

public CurrentImpl getPICurrent()
Returns the PICurrent implementation. The PICurrent must be resolved with every invocation both at the client and server end, so it's avalable from this operation for optimization reasons.

Returns:
CurrentImpl

addInitialReference

public void addInitialReference(java.lang.String name,
                                org.omg.CORBA.Object target)
Register an initial reference.

Parameters:
name -
target -

addServiceInformation

public void addServiceInformation(short service_type,
                                  org.omg.CORBA.ServiceInformation service_information)
Add service information.

Parameters:
service_type -
service_information -

getURLCodeBase

public java.lang.String getURLCodeBase()
Return the value for the property openorb.URLCodeBase.


resolve_initial_references

public org.omg.CORBA.Object resolve_initial_references(java.lang.String object_name)
                                                throws org.omg.CORBA.ORBPackage.InvalidName
Return an initial reference. This method tries to find a reference from the following locations in the following order:
  1. internal initial reference table
  2. -ORBInitRef parameter
  3. -ORBDefaultInitRef

Overrides:
resolve_initial_references in class ORBSingleton
Parameters:
object_name -
Returns:
Object
Throws:
org.omg.CORBA.ORBPackage.InvalidName

list_initial_services

public java.lang.String[] list_initial_services()
Return as a string sequence all available initial services.

Overrides:
list_initial_services in class ORBSingleton
Returns:
String[]

run

public void run()
Run the server side.

Overrides:
run in class ORBSingleton

shutdown

public void shutdown(boolean wait_for_completion)
Stop the orb ( and the object adapter if required )

Overrides:
shutdown in class ORBSingleton
Parameters:
wait_for_completion -

destroy

public void destroy()
Destroy the ORB. It shall shutdown the ORB and release resources.


finalize

protected void finalize()
A finalizer which will call shutdown.


work_pending

public boolean work_pending()
Check if some work is pending.

Overrides:
work_pending in class ORBSingleton
Returns:
boolean

perform_work

public void perform_work()
Perform all current work.

Overrides:
perform_work in class ORBSingleton

create_output_stream

public org.omg.CORBA.portable.OutputStream create_output_stream()
Create an output stream.

Overrides:
create_output_stream in class ORBSingleton
Returns:
OutputStream

create_list

public org.omg.CORBA.NVList create_list(int count)
Create a named value list.

Overrides:
create_list in class ORBSingleton
Parameters:
count -
Returns:
NVList

create_named_value

public org.omg.CORBA.NamedValue create_named_value(java.lang.String name,
                                                   org.omg.CORBA.Any value,
                                                   int flags)
Create a named value.

Overrides:
create_named_value in class ORBSingleton
Parameters:
name -
value -
flags -
Returns:
NamedValue

create_exception_list

public org.omg.CORBA.ExceptionList create_exception_list()
Create an exception list.

Overrides:
create_exception_list in class ORBSingleton
Returns:
ExceptionList

create_context_list

public org.omg.CORBA.ContextList create_context_list()
Create a context list.

Overrides:
create_context_list in class ORBSingleton
Returns:
ContextList

get_default_context

public org.omg.CORBA.Context get_default_context()
Return default context.

Overrides:
get_default_context in class ORBSingleton
Returns:
Context

create_environment

public org.omg.CORBA.Environment create_environment()
Create an environment.

Overrides:
create_environment in class ORBSingleton
Returns:
Environment

connect

public void connect(org.omg.CORBA.Object obj)
Connect an object to the adapter.

Overrides:
connect in class ORBSingleton
Parameters:
obj -

disconnect

public void disconnect(org.omg.CORBA.Object obj)
Disconnect an object from the adapter.

Overrides:
disconnect in class ORBSingleton
Parameters:
obj -

object_to_string

public java.lang.String object_to_string(org.omg.CORBA.Object obj)
Convert an object reference to a string.

Overrides:
object_to_string in class ORBSingleton
Parameters:
obj -
Returns:
String

string_to_object

public org.omg.CORBA.Object string_to_object(java.lang.String str)
Convert a string to an object reference.

Overrides:
string_to_object in class ORBSingleton
Parameters:
str -
Returns:
Object

send_multiple_requests_oneway

public void send_multiple_requests_oneway(org.omg.CORBA.Request[] req)
Send multiple oneway requests.

Overrides:
send_multiple_requests_oneway in class ORBSingleton
Parameters:
req -

send_multiple_requests_deferred

public void send_multiple_requests_deferred(org.omg.CORBA.Request[] req)
Send multiple deferred requests.

Overrides:
send_multiple_requests_deferred in class ORBSingleton
Parameters:
req -

poll_next_response

public boolean poll_next_response()
Poll next response

Overrides:
poll_next_response in class ORBSingleton
Returns:
boolean

get_next_response

public org.omg.CORBA.Request get_next_response()
Get the next response. If poll_next_response would return true then the first completed request will be returned, otherwise the oldest and first request will be waited for and returned.

Overrides:
get_next_response in class ORBSingleton
Returns:
Request

set_parameters

protected void set_parameters(java.lang.String[] args,
                              java.util.Properties properties)
Set the ORB parameters.

Overrides:
set_parameters in class ORBSingleton
Parameters:
args -
properties -

set_parameters

protected void set_parameters(java.applet.Applet app,
                              java.util.Properties properties)
Set the ORB parameters for applet.

Overrides:
set_parameters in class ORBSingleton
Parameters:
app -
properties -

register_value_factory

public org.omg.CORBA.portable.ValueFactory register_value_factory(java.lang.String id,
                                                                  org.omg.CORBA.portable.ValueFactory factory,
                                                                  Configuration config)
This function is used to register a value factory with a supplied configuration. This method is a non-standard extension supporting value factories that implement Avalon lifecycle methods.

Parameters:
id - The IDL valuetype identifier.
factory - The value factory instance.
config - The factory configuration.
Returns:
The registered value factory.

register_value_factory

public org.omg.CORBA.portable.ValueFactory register_value_factory(java.lang.String id,
                                                                  org.omg.CORBA.portable.ValueFactory factory)
This function is used to register a value factory.

Overrides:
register_value_factory in class ORBSingleton
Parameters:
id - the IDL valuetype identifier
factory - the value factory instance
Returns:
ValueFactory

unregister_value_factory

public void unregister_value_factory(java.lang.String id)
This function is used to unregister a value factory.

Overrides:
unregister_value_factory in class ORBSingleton
Parameters:
id -

lookup_value_factory

public org.omg.CORBA.portable.ValueFactory lookup_value_factory(java.lang.String id)
This function is used to find a value factory.

Overrides:
lookup_value_factory in class ORBSingleton
Parameters:
id - The type id of the value type.
Returns:
ValueFactory The value factory if one was found, or null otherwise.

set_delegate

public void set_delegate(java.lang.Object wrapper)
This function is used to set a delegate.

Overrides:
set_delegate in class ORBSingleton
Parameters:
wrapper -

get_service_information

public boolean get_service_information(short service_type,
                                       org.omg.CORBA.ServiceInformationHolder service_information)
Return the service informaton.

Overrides:
get_service_information in class ORBSingleton
Parameters:
service_type -
service_information -
Returns:
boolean

create_policy

public org.omg.CORBA.Policy create_policy(int policy_type,
                                          org.omg.CORBA.Any val)
                                   throws org.omg.CORBA.PolicyError
This operations creates a CORBA policy.

Overrides:
create_policy in class ORBSingleton
Parameters:
policy_type -
val -
Returns:
Policy
Throws:
org.omg.CORBA.PolicyError

scan_url_loc

protected org.omg.CORBA.Object scan_url_loc(java.lang.String loc)
This function scans a CORBA URL iioploc to extract reference information.

Parameters:
loc -
Returns:
Object

scan_url_body

protected org.omg.CORBA.Object scan_url_body(java.lang.String addr,
                                             byte[] key)
Method scan_url_body.

Parameters:
addr -
key -
Returns:
Object

scan_url_name

protected org.omg.CORBA.Object scan_url_name(java.lang.String loc)
This function scans a CORBA URL corbaname to extract reference information. This method is only called when a corbaname URL is passed to string_to_object. Therefore the runtime dependency to the NamingService surfaces only in this case.

Parameters:
loc - The corbaname URL without the prefix "corbaname:".
Returns:
The object retrieved from the location specified by loc.

getKeyFromString

protected byte[] getKeyFromString(java.lang.String str)
Get an object key from a stringified object key.

Parameters:
str -
Returns:
byte[]