|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.omg.CORBA.ORB
public abstract class ORB
A central class in CORBA implementation, responsible for sending and handling remote invocations. ORB also works as a factory for creating instances of certain CORBA classes. Despite the core library contains the fully working CORBA implementation, it also provides a simple way to plug-in the alternative CORBA support. This is done by replacing the ORB. The alternative ORB can be specified via properties, passed to ORB.Init(...). When creating an ORB instance, the class name is searched in the following locations:
1. Applet parameter or application string array, if any.
2. The properties parameter, if any.
3. The System properties.
4. The orb.properties file located in the user.home directory (if any).
5. The orb.properties file located in the java.home/lib directory (if any).
org.omg.CORBA.ORBClass | The class, implementing the functional ORB, returned by
init(Applet, Properties) or init(String[], Properties)
|
org.omg.CORBA.ORBSingletonClass | The class, implementing the restricted ORB, returned by init() .
|
org.omg.CORBA.ORBInitRef | Specifies the initial reference, accessible by name with the method
resolve_initial_references(String) . |
org.omg.CORBA.ORBid | Specifies the name (ORB Id) of this ORB. The ORB Id is later accessible
by ObjectReferenceTemplate.orb_id() . The default value includes the
hashcode of the ORB instance that is normally different for each ORB.
|
org.omg.CORBA.ServerId | Specifies the name (Server Id) of this server. This property assigns
value to the static field, ensuring that all ORB's on the same jre
have the same Server Id. It is normally set as the system property. The
server Id is later accessible as ObjectReferenceTemplate.server_id() .
|
gnu.CORBA.ListenerPort | Specifies that this ORB should serve all its objects on a single port (for example, "1234") or on a specified port range (for example, "1100-1108"). The property is used when working with firewals and serves as a replacement for the proprietary properties like com.ibm.CORBA.ListenerPort or com.sun.CORBA.POA.ORBPersistentServerPort. The specified port or range should not overlap with the values, specified for other ORB's. |
gnu.Corba.SocketFactory | Sets the user-defined server and client socket factory for the ORB being currently instantiated. Serves as a replacement of the proprietary property com.sun.CORBA.connection.ORBSocketFactoryClass. To have multiple types of sockets, instantiate several ORB's with this property each time set to the different value. The factory must implement gnu.CORBA.interfaces.SocketFactory. |
The command line accepts the same properties as a keys. When
specifying in the command line, the prefix org.omg.CORBA can be omitted, for
instance -ORBInitRef NameService=IOR:aabbccdd....
Constructor Summary | |
---|---|
ORB()
|
Method Summary | |
---|---|
void |
connect(Object object)
Connect the given CORBA object to this ORB. |
TypeCode |
create_abstract_interface_tc(String id,
String name)
Create a typecode for an abstract interface. |
abstract TypeCode |
create_alias_tc(String id,
String name,
TypeCode typecode)
Create alias typecode for the given typecode. |
abstract Any |
create_any()
Create an instance of the CORBA Any with the type, intialised
to TCKind.tk_null |
abstract TypeCode |
create_array_tc(int length,
TypeCode element_type)
Create a typecode, defining an array of the given elements. |
DynAny |
create_basic_dyn_any(TypeCode t)
Deprecated. Use DynAnyFactory |
abstract ContextList |
create_context_list()
Creates an empty CORBA ContextList . |
DynAny |
create_dyn_any(Any a)
Deprecated. Use DynAnyFactory |
DynArray |
create_dyn_array(TypeCode t)
Deprecated. Use DynAnyFactory |
DynEnum |
create_dyn_enum(TypeCode t)
Deprecated. Use DynAnyFactory |
DynSequence |
create_dyn_sequence(TypeCode t)
Deprecated. Use DynAnyFactory |
DynStruct |
create_dyn_struct(TypeCode t)
Deprecated. Use DynAnyFactory |
DynUnion |
create_dyn_union(TypeCode t)
Deprecated. Use DynAnyFactory |
abstract TypeCode |
create_enum_tc(String id,
String name,
String[] members)
Create a typecode, defining the given enumeration. |
abstract Environment |
create_environment()
Create an environment (container for exceptions). |
abstract ExceptionList |
create_exception_list()
Creates an empty exception list. |
abstract TypeCode |
create_exception_tc(String id,
String name,
StructMember[] members)
Create the exception typecode. |
TypeCode |
create_fixed_tc(short digits,
short scale)
Creates a TypeCode object for CORBA fixed that is
mapped to java BigDecimal . |
abstract TypeCode |
create_interface_tc(String id,
String name)
Creates a typecode, representing the IDL interface. |
abstract NVList |
create_list(int count)
Create an instance of a new NVList . |
abstract NamedValue |
create_named_value(String name,
Any any,
int flags)
Create a new named value. |
TypeCode |
create_native_tc(String id,
String name)
Create a typecode for a native interface. |
NVList |
create_operation_list(Object operation_definition)
This should create the list, initialised with the argument descriptions for the given operation definition (CORBA OperationDef ). |
abstract OutputStream |
create_output_stream()
Create a new CDR output stream, where the parameter values can be written during the method invocation. |
Policy |
create_policy(int type,
Any value)
Creates the new policy of the specified type, having the given value. |
abstract TypeCode |
create_recursive_sequence_tc(int bound,
int offset)
Deprecated. It is easier and clearler to use a combination of create_recursive_tc and create_sequence_tc instead. |
TypeCode |
create_recursive_tc(String id)
Create a typecode which serves as a placeholder for typcode, containing recursion. |
abstract TypeCode |
create_sequence_tc(int bound,
TypeCode element_type)
Create typecode, defining the sequence of the elements, having the given type. |
abstract TypeCode |
create_string_tc(int bound)
Create a TypeCode, representing the CORBA string . |
abstract TypeCode |
create_struct_tc(String id,
String name,
StructMember[] members)
Create the typecode, defining the given IDL structure. |
abstract TypeCode |
create_union_tc(String id,
String name,
TypeCode discriminator,
UnionMember[] members)
Create the typecode, defining the given IDL union. |
TypeCode |
create_value_box_tc(String id,
String name,
TypeCode boxed_type)
Create value box typecode. |
TypeCode |
create_value_tc(String id,
String name,
short type_modifier,
TypeCode concrete_base,
ValueMember[] members)
Create IDL value type code. |
abstract TypeCode |
create_wstring_tc(int bound)
Create a TypeCode, representing the CORBA wstring . |
void |
destroy()
Destroy this server, releasing the occupied resources. |
void |
disconnect(Object object)
Disconnect the given CORBA object from this ORB. |
Current |
get_current()
Deprecated. since 1.2, use resolve_initial_references(java.lang.String) . |
abstract Context |
get_default_context()
Get the default context of this ORB. |
abstract Request |
get_next_response()
Get the next instance with a response being received. |
abstract TypeCode |
get_primitive_tc(TCKind tcKind)
Return thg typecode, representing the given primitive object type. |
boolean |
get_service_information(short service_type,
ServiceInformationHolder service_info)
This should return the information about the CORBA facilities and services, available from this ORB. |
static ORB |
init()
Returns so-called Singleton ORB, a highly restricted version that cannot communicate over network. |
static ORB |
init(Applet applet,
Properties props)
Creates the working instance of ORB for an applet. |
static ORB |
init(String[] args,
Properties props)
Creates the working instance of ORB for a standalone application. |
abstract String[] |
list_initial_services()
List the initially available CORBA objects (services). |
abstract String |
object_to_string(Object forObject)
Get the IOR reference string for the given object. |
void |
perform_work()
This should perform the implementation dependent unit of work in the main thread. |
abstract boolean |
poll_next_response()
Find if any of the requests that have been previously sent with send_multiple_requests_deferred(org.omg.CORBA.Request[]) , have a response yet. |
abstract Object |
resolve_initial_references(String name)
Find and return the easily accessible CORBA object, addressed by name. |
void |
run()
Start listening on the input socket. |
abstract void |
send_multiple_requests_deferred(Request[] requests)
Send multiple prepared requests expecting to get a reply. |
abstract void |
send_multiple_requests_oneway(Request[] requests)
Send multiple prepared requests one way, do not caring about the answer. |
protected abstract void |
set_parameters(Applet app,
Properties props)
Set the ORB parameters. |
protected abstract void |
set_parameters(String[] para,
Properties props)
Set the ORB parameters. |
void |
shutdown(boolean wait_for_completion)
Shutdown the ORB server. |
abstract Object |
string_to_object(String IOR)
Find and return the CORBA object, addressed by the given string representation. |
boolean |
work_pending()
Checks if the ORB needs the main thread to perform some work. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ORB()
Method Detail |
---|
public void connect(Object object)
NO_IMPLEMENT
.
object
- the org.omg.CORBA.Object to connect.public void disconnect(Object object)
OBJECT_NOT_EXIST
. The object, however, is not
destroyed and can receive the local invocations.
This method is implemented in the derived Gnu Classpah classes,
returned by ORB.init(..). In this abstract class, the implementation
just throws NO_IMPLEMENT
.
object
- the object to disconnect.public abstract TypeCode create_recursive_sequence_tc(int bound, int offset)
bound
- the maximal expected number of the nested components
on each node; 0 if not limited.offset
- the position of the field in the returned structure
that contains the sequence of the structures of the same field.
The members before this field are intialised using parameterless
StructMember constructor.
offset
position defines an array of the identical
structures.create_recursive_tc(String)
,
create_sequence_tc(int, TypeCode)
public abstract TypeCode create_alias_tc(String id, String name, TypeCode typecode)
public abstract Any create_any()
Any
with the type, intialised
to TCKind.tk_null
public abstract TypeCode create_array_tc(int length, TypeCode element_type)
length
- the size of arrayelement_type
- the array component type.
public abstract ContextList create_context_list()
ContextList
.
public DynAny create_basic_dyn_any(TypeCode t) throws InconsistentTypeCode
DynAnyFactory
DynAny
and derived interfaces
has never been implemented in Sun's java releases,
at least till v1.4 inclusive.
Since v1.4 this stil missing implementation was replaced
by the new DynamicAny package.
NO_IMPLEMENT,
- always.
InconsistentTypeCode
public DynAny create_dyn_any(Any a)
DynAnyFactory
DynAny
and derived interfaces
has never been implemented in Sun's java releases,
at least till v1.4 inclusive.
Since v1.4 this stil missing implementation was replaced
by the new DynamicAny package.
NO_IMPLEMENT,
- always.public DynArray create_dyn_array(TypeCode t) throws InconsistentTypeCode
DynAnyFactory
DynArray
has never been implemented in Sun's java releases,
at least till v1.4 inclusive.
Since v1.4 this stil missing implementation was replaced
by the new DynamicAny package.
NO_IMPLEMENT,
- always.
InconsistentTypeCode
public DynEnum create_dyn_enum(TypeCode t) throws InconsistentTypeCode
DynAnyFactory
DynEnum
has never been implemented in Sun's java releases,
at least till v1.4 inclusive.
Since v1.4 this stil missing implementation was replaced
by the new DynamicAny package.
NO_IMPLEMENT,
- always.
InconsistentTypeCode
public DynSequence create_dyn_sequence(TypeCode t) throws InconsistentTypeCode
DynAnyFactory
DynSequence
has never been implemented in Sun's java releases,
at least till v1.4 inclusive.
Since v1.4 this stil missing implementation was replaced
by the new DynamicAny package.
NO_IMPLEMENT,
- always.
InconsistentTypeCode
public DynStruct create_dyn_struct(TypeCode t) throws InconsistentTypeCode
DynAnyFactory
DynStruct
and derived interfaces
has never been implemented in Sun's java releases,
at least till v1.4 inclusive.
Since v1.4 this stil missing implementation was replaced
by the new DynamicAny package.
NO_IMPLEMENT,
- always.
InconsistentTypeCode
public DynUnion create_dyn_union(TypeCode t) throws InconsistentTypeCode
DynAnyFactory
DynUnion
and derived interfaces
has never been implemented in Sun's java releases,
at least till v1.4 inclusive.
Since v1.4 this stil missing implementation was replaced
by the new DynamicAny package.
NO_IMPLEMENT,
- always.
InconsistentTypeCode
public abstract TypeCode create_enum_tc(String id, String name, String[] members)
id
- the id.name
- the name.members
- the memebers
public abstract Environment create_environment()
public abstract ExceptionList create_exception_list()
public abstract TypeCode create_exception_tc(String id, String name, StructMember[] members)
id
- the id of exception.name
- the name of exception.members
- the members of exception.public TypeCode create_fixed_tc(short digits, short scale)
fixed
that is
mapped to java BigDecimal
.
digits
- the number of digits in that fixed
.scale
- the number of digits after the decimal point.
public abstract TypeCode create_interface_tc(String id, String name)
id
- the interface repository id.name
- the interface name.
public abstract NVList create_list(int count)
NVList
.
count
- the initial size of the list. If more elements are added,
the list automatically expands.
public abstract NamedValue create_named_value(String name, Any any, int flags)
name
- the name of the named valueany
- the content of the named value.flags
- the flags of the named value
public abstract void send_multiple_requests_oneway(Request[] requests)
requests
- the prepared array of requests.Request.send_oneway()
public abstract void send_multiple_requests_deferred(Request[] requests)
requests
- the prepared array of requests.poll_next_response()
,
get_next_response()
,
Request.send_deferred()
public abstract boolean poll_next_response()
send_multiple_requests_deferred(org.omg.CORBA.Request[])
, have a response yet.
public abstract Request get_next_response() throws WrongTransaction
WrongTransaction
- If the method was called from the transaction
scope different than the one, used to send the request. The exception
can be raised only if the request is implicitly associated with some
particular transaction.public abstract OutputStream create_output_stream()
public NVList create_operation_list(Object operation_definition)
OperationDef
).
The information should be obtained from the interface repository.
However this method is oficially documented as not implemented at least
till v1.4 inclusive.
operation_definition
- the operation definition, must be
CORBA OperationDef
.
NO_IMPLEMENT,
- always.public Policy create_policy(int type, Any value) throws PolicyError
Creates the new policy of the specified type, having the given value.
This method looks for the policy factory that was previously registered
during ORB initialization by
org.omg.PortableInterceptor
.
If the suitable factory is found, this factory creates the requested policy,
otherwise the PolicyError is thrown.
The POA policies should be created by POA, not by this method.
type
- the policy type.value
- the policy value, wrapped into Any.
PolicyError
- if the ORB fails to instantiate the policy object.
NO_IMPLEMENT
- always (in this class). Overridden in derived classes
returned by ORB.init(..).ORBInitInfoOperations.register_policy_factory(int, org.omg.PortableInterceptor.PolicyFactory)
,
PolicyFactoryOperations
public abstract TypeCode create_sequence_tc(int bound, TypeCode element_type)
bound
- the maximal length of the sequence, 0 if not restricted.element_type
- the sequence element type.
public abstract TypeCode create_string_tc(int bound)
string
.
bound
- the maximal length of the string, 0 is unlimited.
public abstract TypeCode create_struct_tc(String id, String name, StructMember[] members)
id
- the Id of this type.name
- the name of this type.members
- the member list.
public abstract TypeCode create_union_tc(String id, String name, TypeCode discriminator, UnionMember[] members)
id
- the Id of this type.name
- the name of this type.discriminator
- the union discriminator.members
- the member list.
public abstract TypeCode create_wstring_tc(int bound)
wstring
.
bound
- the maximal length of the string, 0 is unlimited.
public TypeCode create_abstract_interface_tc(String id, String name)
id
- the id of the abstract interface.name
- the name of the abstract interface.
public TypeCode create_native_tc(String id, String name)
id
- the id of the native interface.name
- the name of the native interface.
public TypeCode create_recursive_tc(String id)
id
- the id of the recursive typecode, for that this typecode
serves as a placeholder.public TypeCode create_value_box_tc(String id, String name, TypeCode boxed_type)
public TypeCode create_value_tc(String id, String name, short type_modifier, TypeCode concrete_base, ValueMember[] members)
public Current get_current()
resolve_initial_references(java.lang.String)
.
Current
is very general interface, with no fields and
operations defined. This method is not implemented in Suns
releases at least till v1.5 inclusive. To obtain the
Current
, use
resolve_initial_references(java.lang.String)
, passing "POACurrent".
NO_IMPLEMENT
- always.public boolean get_service_information(short service_type, ServiceInformationHolder service_info)
service_type
- a type of the service being requested. The OMG
specification currently defines only one value, 1, for security
related services.service_info
- a holder, where the returned information should
be stored.
NO_IMPLEMENT
- always.public abstract Context get_default_context()
NO_IMPLEMENT
- for the Singleton ORB, returned by
the parameterless init()
.public abstract TypeCode get_primitive_tc(TCKind tcKind)
tcKind
- the kind of the primitive typecode.
public static ORB init()
Any
, ContextList
, NVList
and
OutputStream
that writes to an
internal buffer.
All other methods throw the NO_IMPLEMENT
exception, additionally
printing the error message about the potential attempt to violate
the security rules.
The implementing ORB class, used in this method, is found as described
in the header.
public static ORB init(Applet applet, Properties props)
applet
- the applet. The property org.omg.CORBA.ORBClass,
if present, defines the used ORB implementation class. If this
property is not present, the ORB class is found as described in the
class header.props
- the properties, may be null
.
public static ORB init(String[] args, Properties props)
args
- the parameters, passed to the applications
main(String[] args)
method, may be null
. The
parameter -org.omg.CORBA.ORBClass props
- application specific properties, may be null
.
public abstract String[] list_initial_services()
resolve_initial_references(String)
public abstract Object resolve_initial_references(String name) throws InvalidName
narrow(Object)
method
of its helper. The method resolves the following string values,
returning the working objects:
String | Object class | Object use |
---|---|---|
NameService | NamingContextExt |
Finds (usually remote) object by its name. |
RootPOA | POA |
Holds the POA tree for this ORB, where since 1.4 all servants should be connected. |
RootPOAManager | POAManager
| Regulates (suspends/resumes) the root POA activity |
POACurrent | Current
| Informs the current thread about the Id and POA of the
object being currently served (the methods of
Current return different values for
different threads).
|
CodecFactory | Codec |
Encodes/decodes IDL data types into/from byte arrays. |
DynAnyFactory | DynAnyFactory |
Creates DynAny's. |
PICurrent | Current |
Contains multiple slots where an interceptor can rememeber the request - specific values between subsequent calls of the interceptor methods. |
name
- the object name.
InvalidName
- if the given name
is not associated with the known object.public abstract String object_to_string(Object forObject)
forObject
- the CORBA object
string_to_object(String)
public void perform_work()
public boolean work_pending()
public abstract Object string_to_object(String IOR)
Find and return the CORBA object, addressed by the given
string representation. The object can be (an usually is)
located on a remote computer, possibly running a different
(not necessary java) CORBA implementation. The returned
object is typically casted to the more specific reference
using the narrow(Object)
method of its helper.
This function supports the following input formats:
1. IOR reference (ior:nnnnn ..), usually computer generated.
2. corbaloc:[iiop][version.subversion@]:host[:port]/key
defines similar information as IOR reference, but is more human readable.
This type of reference may also contain multiple addresses (see
OMG documentation for complete format).
3. corbaloc:rir:/name defines internal reference on this
ORB that is resolved using resolve_initial_references(java.lang.String)
, passing
the given name as parameter.
4. corbaname:rir:#name states that the given name
must be resolved using the naming service, default for this ORB.
5. corbaname:[iiop][version.subversion@]:host[:port]#name
states that the name must be resolved using the naming service
that runs on the given host at the given port. The ORB expects to find
there the NamingContext
under the key
"NameService.
7. file://[file name] Read the object definition string from the
file system
8. http://[url] Read the object definition string from the provided
url.
9. ftp://[url] Read the object definition string from the provided
url.
The default port is always 2809. The default iiop version is 1.0 that now may not always be supported, so we would recommend to specify the version explicitly.
The examples of the corbaloc and corbaname addresses:
corbaname:rir:#xobj - ask local naming service for "xobj".
corbaname:rir:/NameService#xobj - same (long form).
corbaname:iiop:1.2@localhost:900#xobj - same, assuming that the naming
service runs at port 900 on the local host and supports iiop 1.2.
corbaname:iiop:localhost#xobj - same, assuming that the naming
service runs at port 2809 on the local host and supports iiop 1.0.
corbaloc::gnu.xxx.yy/Prod/TradingService - the object exists on the
host gnu.xxx.yy, port 2809 having the key "Prod/TradingService". Its ORB
supports iiop 1.0.
corbaloc::gnu.xxx.yy/Prod/TradingService:801 - the object exists on the
host gnu.xxx.yy, port 801 having the key "Prod/TradingService". Its ORB
supports iiop 1.0 (iiop keyword ommitted).
corbaloc:iiop:1.1@gnu.xxx.yy/Prod/TradingService - the object exists on the
host gnu.xxx.yy, port 801 having the key "Prod/TradingService". Its ORB
supports iiop 1.1.
corbaloc:rir:/NameService - the default naming service.
IOR
- the object IOR representation string.
BAD_PARAM
- if the string being parsed is invalid.
DATA_CONVERSION
- if the string being parsed contains unsupported
prefix or protocol.object_to_string(org.omg.CORBA.Object)
public void run()
shutdown(boolean)
is called and shutdown process is completed.
public void shutdown(boolean wait_for_completion)
wait_for_completion
- if true, the current thread is
suspended untile the shutdown process is complete.public void destroy()
protected abstract void set_parameters(String[] para, Properties props)
init(String[], Properties)
.
para
- the parameters, that were passed as the parameters
to the main(String[] args)
method of the current standalone
application.props
- application specific properties that were passed
as a second parameter in init(String[], Properties)
).
Can be null
.protected abstract void set_parameters(Applet app, Properties props)
init(Applet, Properties)
.
app
- the current applet.props
- application specific properties, passed as the second
parameter in init(Applet, Properties)
.
Can be null
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |