This topic includes the following sections:
Note: | The Oracle Tuxedo CORBA Java client and Oracle Tuxedo CORBA Java client ORB were deprecated in Tuxedo 8.1 and are no longer supported in Tuxedo 9.x. All Oracle Tuxedo CORBA Java client and Oracle Tuxedo CORBA Java client ORB text references, associated code samples, etc. should only be used: |
Note: | Technical support for third party CORBA Java ORBs should be provided by their respective vendors. Oracle Tuxedo does not provide any technical support or documentation for third party CORBA Java ORBs. |
To communicate with Oracle Tuxedo objects, a client application must obtain object references. Without an object reference, there can be no communication. To solve this problem, client applications use a bootstrapping mechanism to obtain object references to objects in an Oracle Tuxedo domain.
In the Tuxedo 8.0 release and later, two bootstrapping mechanisms are supported:
Note: | The CORBA C++ client provided with Oracle Tuxedo software may use the Interoperable Naming Service bootstrapping mechanism, however, for performance reasons, this is not recommended. |
The Oracle bootstrapping mechanism uses the Bootstrap object. Bootstrap objects are local programming objects, not remote CORBA objects, in both the client and the server. When Bootstrap objects are created, their constructor requires the network address of an Oracle Tuxedo IIOP Listener/Handler. Given this information, the bootstrapping object can generate object references for the key remote objects in the Oracle Tuxedo domain. These object references can then be used to access services available in the Oracle Tuxedo domain.
Bootstrap objects are created by a client or a server application that must access object references to the following Oracle Tuxedo CORBA interfaces:
Bootstrap objects may represent the first connection to a specific Oracle Tuxedo domain depending on the format of the IIOP Listener/Handler address. If the NULL scheme Universal Resource Locator (URL) format is used (the only address format supported in releases of Oracle WebLogic Enterprise prior to version 5.1 and Oracle Tuxedo release 8.0), the Bootstrap objects represent the first connection. However, if the URL format is used, the connection will not occur until after creation of the Bootstrap object. For more information on address formats and connection times, refer to Tobj_Bootstrap.
For an Oracle Tuxedo CORBA remote client, Bootstrap objects are created with the host and the port for the Oracle Tuxedo IIOP Listener/Handler. However, for Oracle Tuxedo native client and server applications, there is no need to specify a host and port because they execute in a specific Oracle Tuxedo domain. The IIOP Listener/Handler host and the port ID are included in the Oracle Tuxedo domain configuration information.
After they are created, Bootstrap objects satisfy requests for object references for objects in a particular Oracle Tuxedo domain. Different Bootstrap objects allow the application to use multiple domains.
Using the Bootstrap object, you can obtain references to the following objects:
The SecurityCurrent object is used to establish a security context within an Oracle Tuxedo domain. The client can then obtain the PrincipalAuthenticator from the principal_authenticator
attribute of the SecurityCurrent object.
The TransactionCurrent object is used to participate in an Oracle Tuxedo transaction. The basic operations are as follows:
Begin a transaction. Future operations take place within the scope of this transaction.
End the transaction. All operations on this client application have completed successfully.
Abort the transaction. Tell all other participants to roll back.
Suspend participation in the current transaction. This operation returns an object that identifies the transaction and allows the client application to resume the transaction later.
The FactoryFinder object is used to obtain a factory. In the Oracle Tuxedo system, factories are used to create application objects. The FactoryFinder provides the following different methods to find factories:
find_factories
).id
and kind (find_one_factory
).find_one_factory_by_id
).find_factories_by_id
).list_factories
).The Interface Repository contains the interface descriptions of the CORBA objects that are implemented within the Oracle Tuxedo domain. Clients using the Dynamic Invocation Interface (DII) need a reference to the Interface Repository to be able to build CORBA request structures.
A NamingService object is used to obtain a reference to the root namespace. When you use this object, the ORB locates the root of the namespace.
The NotificationService object is used to obtain a reference to the event channel factory (CosNotifyChannelAdmin::EventChannelFactory) in the CosNotification Service. In the Oracle Tuxedo system, the EventChannelFactory is used to locate the Notification Service channel.
The Tobj_SimpleEventsService object is used to obtain a reference to the event channel factory (Tobj_SimpleEvents::ChannelFactory) in the Oracle Simple Events Service. In the Oracle Tuxedo system, the ChannelFactory is used to locate the Oracle Simple Events Service channel.
The FactoryFinder and Interface Repository objects are not implemented in the environmental objects library. However, they are specific to an Oracle Tuxedo domain and are thus conceptually similar to the SecurityCurrent and TransactionCurrent objects in use.
The Bootstrap object implies an association or “session” between the client application and the Oracle Tuxedo domain. Within the context of this association, the Bootstrap object imposes a containment relationship with the other Current objects (or contained objects); that is, the SecurityCurrent and TransactionCurrent. Current objects are valid only for this domain and only while the Bootstrap object exists.
Note: | Resolving the SecurityCurrent when using the new URL address format (corbaloc:// hostname : port_number ) is a local operation; that is, no connection is made by the client to the IIOP Listener/Handler. |
In addition, a client can have only one instance of each of the Current objects at any time. If a Current object already exists, an attempt to create another Current object does not fail. Instead, another reference to the already existing object is handed out; that is, a client application may have more than one reference to the single instance of the Current object.
To create a new instance of a Current object, the application must first invoke the destroy_current()
method on the Bootstrap object. This invalidates all of the Current objects, but does not destroy the session with the Oracle Tuxedo domain. After invoking destroy_current()
, new instances of the Current objects can be created within the Oracle Tuxedo domain using the existing Bootstrap object.
To obtain Current objects for another domain, a different Bootstrap object must be constructed. Although it is possible to have multiple Bootstrap objects at one time, only one Bootstrap object may be “active;” that is, have Current objects associated with it. Thus, an application must first invoke destroy_current()
on the “active” Bootstrap object before obtaining new Current objects on another Bootstrap object, which then becomes the active Bootstrap object.
Note: | If you want to access objects in multiple domains, either import the object to the local domain or administratively configure your application access multiple domains. For more information on multi-domain configurations configurations, see “Configuring Multiple CORBA Domains” in Using the Oracle Tuxedo Domains Component. |
Servers and native clients are inside of the Oracle Tuxedo domain; therefore, no “session” is established. However, the same containment relationships are enforced. Servers and native clients access the domain they are currently in by specifying an empty string, rather than //host:port
.
Note: | When using the Bootstrap object, client and server applications must use the Tobj_Bootstrap::resolve_initial_references() method, not the ORB::resolve_initial_references() method. |
Table 4-1 shows the types of remote clients that can use the Bootstrap object to access the other environmental objects, such as FactoryFinder, SecurityCurrent, TransactionCurrent, and InterfaceRepository. These clients are provided with the Oracle Tuxedo CORBA software. Third-party client ORBs should use the CORBA Interoperable Naming Service.
CORBA C++ client applications use the Oracle Tuxedo C++ environmental objects to access the CORBA objects in an Oracle Tuxedo domain, and the Oracle Tuxedo Object Request Broker (ORB) to process from CORBA objects. Use the Oracle Tuxedo system development commands to build these client applications (see the Oracle Tuxedo Command Reference).
|
Bootstrap objects have the following capabilities and limitations:
destroy_current()
on the Bootstrap object associated with one domain before obtaining the Current objects on another domain. Although it is possible to have multiple Bootstrap objects that establish connections to different Oracle Tuxedo domains, only one set of Current objects is valid. Attempts to obtain other Current objects without destroying the existing Current objects fail. CORBA::NO_PERMISSION
exception.
The Bootstrap object application programming interface (API) is described first in terms of the OMG Interface Definition Language (IDL) (for portability), and then in C++. The C++ descriptions add the necessary constructor to build a Bootstrap object for a particular Oracle Tuxedo domain.
Table 4-2 shows the object reference that is returned for each type ID.
Table 4-3 describes the Tobj module exceptions.
Listing 4-1 shows the C++ declarations in the Tobj_bootstrap.h
file.
#include <CORBA.h>
class Tobj_Bootstrap {
public:
Tobj_Bootstrap(CORBA::ORB_ptr orb, const char* address);
CORBA::Object_ptr resolve_initial_references(
const char* id);
void register_callback_port(CORBA::Object_ptr objref);
void destroy_current( );
};
Listing 4-2 shows the Tobj_Bootstrap.java
mapping.
package com.beasys;
public class Tobj_Bootstrap {
public Tobj_Bootstrap(org.omg.CORBA.ORB orb,
String address)
throws org.omg.CORBA.SystemException;
public class Tobj_Bootstrap {
public Tobj_Bootstrap(org.omg.CORBA.ORB orb, String address,
java.applet.Applet applet)
throws org.omg.CORBA.SystemException;
public void register_callback_port(orb.omg.CORBA.Object objref)
throws org.omg.CORBA.SystemException;
public org.omg.CORBA.Object
resolve_initial_references(String id)
throws Tobj.InvalidName,
org.omg.CORBA.SystemException;
public void destroy_current()
throws org.omg.CORBA.SystemException;
}
Listing 4-3 shows Automation Bootstrap interface mapping.
interface DITobj_Bootstrap : IDispatch
{
HRESULT Initialize(
[in] BSTR address);
HRESULT CreateObject(
[in] BSTR progid,
[out, retval] IDispatch** rtrn);
HRESULT destroy_current();
};
This section describes the C++ member functions supported by the Oracle bootstrapping mechanism.
The Bootstrap object constructor.
Tobj_Bootstrap(CORBA::ORB_ptr orb, const char* address);
throws Tobj::BAD_PARAM
org.omg.CORBA.SystemException;
string_to_object
method of orb
internally.
address
Note: | Multiple Tobj_Bootstraps going to the same domain is not supported. |
For a description of the remote clients supported by Oracle Tuxedo CORBA, see the section Types of Oracle Remote Clients Supported.
For remote clients, address
specifies the network address of an IIOP Listener/Handler through which client applications gain access to an Oracle Tuxedo domain.
The address may be specified in either of the following formats:
“//
hostname
:
port_number
”
“//#.#.#.#:port_number
”
“corbaloc://hostname
:
port_number
”
“corbalocs://hostname
:
port_number
”
In the first format, the domain finds an address for hostname using the local name resolution facilities (usually DNS). The hostname must be the remote machine, and the local name resolution facilities must unambiguously resolve hostname to the address of the remote machine.
Note: | The hostname must begin with a letter character. |
In the second format, the #.#.#.#
is in dotted decimal format. In dotted decimal format, each #
should be a number from 0 to 255. This dotted decimal number represents the IP address of the remote machine.
In both the first and second formats, port_number is the TCP port number at which the domain process listens for incoming requests. The port_number should be a number between 0 and 65535.
You can specify one or more TCP/IP addresses. You specify multiple addresses using a comma-separated list. For example:
//m1.acme:3050
//m1.acme:3050,//m2.acme:3050,//m3.acme:3051
If you specify multiple addresses, the Oracle Tuxedo software tries the addresses in order, left to right, until a connection is established. If a syntax error is detected in any of the addresses as it is being tried, a BAD_PARAM
exception is returned to the caller immediately and the Oracle Tuxedo software aborts the attempt to make a connection. For example, if the first address in the comma-separated list shown above were //m1.3050
, a syntax error would be detected and the attempt to make a connection would be aborted. If the Oracle Tuxedo software encounters the end of the address list before it tries an address that is valid, that is, a connection cannot be made to any of the addresses listed, the INVALID_DOMAIN
exception is returned to the caller. If an exception other than INVALID_DOMAIN
is raised, it is returned to the caller immediately.
Oracle Tuxedo also supports random address selection. To use random address selection, you can specify any member of an address list as a grouping of pipe-separated (|
) network addresses enclosed in parentheses. For example:
(//m1.acme:3050|//m2.acme:3050),//m1.acme:7000
When you use this format, the Oracle Tuxedo system randomly selects one of the addresses enclosed in parentheses, either //m1.acme:3050
or //m2.acme:3050
. If an exception other than INVALID_DOMAIN
is raised, it is returned to the caller immediately. If a connection cannot be made to the address selected, the next element that follows the addresses enclosed in parentheses is attempted. If the end of the string is encountered before a connection can be made, the INVALID_DOMAIN
exception is thrown to the caller.
Note: | If you specify an address list in the following format: |
Note: | (//m1.acme:3050||//m2.acme:3050),//r1.acme:7000 |
Note: | the NULL address in the pipe-separated list is considered invalid. If the Oracle Tuxedo software randomly selects the invalid address, the BAD_PARAM exception is returned to the caller and the Oracle Tuxedo software aborts the connection attempt. |
The address string can be specified either in the TOBJADDR
environment variable or in the address parameter of the Tobj_Bootstrap
constructor.
For information about the TOBJADDR
environment variable, see the section Managing Remote Client Applications in the Setting Up an Oracle Tuxedo Application. However, the address specified in Tobj_Bootstrap
always take precedence over the TOBJADDR
environment variable. To use the TOBJADDR
environment variable to specify an address string, you must specify an empty string in the Tobj_Bootstrap
address
parameter.
Note: | For C++ applications, TOBJADDR is an environment variable; for Java applications, it is a property; for Java applets, it is an HTML parameter. |
The third and fourth formats are called Uniform Resource Locator (URL) address formats and were introduced in the Oracle WebLogic Enterprise version 5.1 release. As with the NULL scheme URL address format (//hostname:port_number
), you use the URL address formats to specify the location of the IIOP Listener/Handler. However, when the corbaloc
URL address format is used, the client application’s initial connection to the IIOP Listener/Handler is deferred until authentication of the principal’s, or client’s, identity or the first user initiated operation. Using the corbalocs
URL address format has the same effect on the deferred connection time as corbaloc
, but, additionally, the client application makes its initial connection to the ISL/ISH using the Secure Sockets Layer (SSL) protocol. Table 4-4 highlights the differences between the two URL address formats.
These URL address formats are a subset of the definition of object URLs adopted by the OMG as part of the Interoperable Naming Service submission. The Oracle Tuxedo software also extends the URL format described in the OMG Interoperable Naming Service submission to support a secure form that is modeled after the URL for secure HTTP, as well as to support the randomize functionality that was added in the Oracle WebLogic Enterprise version 4.2.
The corbaloc
and corbalocs
URL schemes provide locations that are easily manipulated in both TCP/IP and DNS centric environments. These URL schemes contain a DNS-style hostname
or IP address and a port_number
. The following are some examples of the URL formats:
corbaloc://curly:1024,larry:1022,joe:1999
corbalocs://host1:1024,{host2:1022|host3:1999}
corbalocs://curly:1024,corbaloc://larry:1111,
corbalocs://ctxobj:3434,mthd:3434,corbaloc://force:1111
In the above example, if the parser reaches the URL corbaloc://force:1111
, it resets its internal state as if it had never attempted secure connections and then begins attempting unprotected connections.
Caution: | Do not mix the use of NULL scheme URL addresses (//hostname:port_number ) with corbaloc and corbalocs URL addresses. |
Note: | The Bootstrap object supplied for use with the Netscape embedded Java ORB and JavaSoft JDK ORB does not support corbaloc and corbalocs URLs. |
Note: | For more information on using the corbaloc and corbalocs URL address formats, see Using Security in CORBA Applications. |
Note: | The network address that is specified in the Bootstrap constructor or in TOBJADDR must exactly match the network address in the server application's UBBCONFIG file, both the address as well as the capitalization. If the addresses do not match, the invocation to the Bootstrap constructor will fail with the following seemingly unrelated error message:ERROR: Unofficial connection from client at For example, if the network address is specified (using the NULL URL address format) as //TRIXIE:3500 in the ISL command-line option string in the server application's UBBCONFIG file, specifying either //192.12.4.6:3500 or //trixie:3500 in the Bootstrap constructor or in TOBJADDR will cause the connection attempt to fail. On UNIX systems, use the uname -n command on the host system to determine the capitalization used. On Windows systems, see the host system's network settings in the Control Panel to determine the correct capitalization. |
Note: | The error in the previous note is deferred when the URL address format is used, that is, the error does not occur at the time of Bootstrap object construction because the connection to the ISL/ISH is deferred until later. |
For a native client, the address
parameter in the Tobj_Bootstrap
constructor must always be an empty string (not a NULL pointer). The native client connects to the application that is specified in the TUXCONFIG
environment variable. The constructor raises CORBA::BAD_PARAM
if the address is not empty.
When servers need access to the Bootstrap object, they should obtain a reference to it using the TP framework by invoking TP.bootstrap()
. Servers should not attempt to create a new instance of the Bootstrap object.
applet
(Applies to Java method only)
TOBJADDR
definition in the HTML file for the applet.
BAD_PARAM
//hostname:port_number
) is not in a valid format.
A C++ member function (or Java method) that creates Bootstrap objects.
A pointer to a newly created Bootstrap object.
Registers the joint client/server’s listening port in IIOP Handler (ISH).
void register_callback_port(CORBA::Object_ptr objref);
Parameter
objref
BAD_PARAM
IMP_LIMIT
Description
This C++ member function (or Java method) is called to notify the ISH of a listening port in the joint client/server. This method should only be used for joint client/server ORBs that do not support GIOP 1.2 bidirectional capabilities (that is GIOP 1.0 and 1.1 client ORBs). For GIOP 1.0 and 1.1, the ISH supports only one listening port per joint client/server; therefore, the register_callback_port
method should only be called once per connected joint client/server.
The following information must be given consideration when using this method:
register_callback_port
method is not invoked by the joint client/server, the callback port is not registered with the ISH and the server defaults to Asymmetric Outbound IIOP. In this case, you must start the server’s IIOP Listener (ISL) with the -O
option. The -O
option enables Asymmetric outbound IIOP; otherwise, server-to-client invocations will not be allowed by the ISL/ISH.register_callback_port
method, even when you are using a ISH that supports GIOP 1.2. register_callback_port
method before you pass the callback object reference to the server.
Acquires CORBA object references.
CORBA::Object_ptr resolve_initial_references(
const char* id);
throws Tobj::InvalidName,
org.omg.CORBA.SystemException;
Parameter
id
“FactoryFinder”
“InterfaceRepository”
“NameService”
“NotificationService”
“SecurityCurrent”
“TransactionCurrent”
“Tobj_SimpleEventsService”
InvalidName
id
is not one of the names specified above. On the server, resolve_initial_references
also raises Tobj::InvalidName
when SecurityCurrent is passed.
CORBA::NO_PERMISSION
id
is TransactionCurrent or SecurityCurrent and another Bootstrap object in the client owns the Current objects.
Description
This C++ member function (or Java method) acquires CORBA object references for the FactoryFinder, SecurityCurrent, TransactionCurrent, NotificationService, Tobj_SimpleEventsService, and InterfaceRepository objects. For the specific object reference, invoke the _narrow
function. For example, for FactoryFinder, invoke Tobj::FactoryFinder::_narrow
.
Table 4-2 shows the object reference that is returned for each type id
.
Destroys the Current objects for the domain represented by the Bootstrap object.
void destroy_current();
Raises CORBA::NO_PERMISSION
if the Bootstrap object is not the owner of the Current objects.
This C++ member function invalidates the Current objects for the domain represented by the Bootstrap object. After invoking the destroy_current()
method, the Current objects are marked as invalid. Any subsequent attempt to use the old Current objects will throw the exception CORBA::BAD_INV_ORDER
. Good programming practice is to release all Current objects before invoking destroy_current()
.
Note: | The destroy_current() method must be invoked on the Bootstrap object for the domain that currently owns the two Current objects (Transaction and Security). This also results in an implicit invocation to logoff for security and implicitly rolls back any transaction that was begun by the client. |
The application must invoke destroy_current()
before invoking resolve_initial_references
for TransactionCurrent or SecurityCurrent on another domain; otherwise, resolve_initial_references
raises CORBA::NO_PERMISSION
.
The Java Oracle bootstrapping API supports the following methods:
This section describes the Automation methods supported by the Oracle bootstrapping mechanism.
Initializes the Bootstrap object into an Oracle Tuxedo domain.
HRESULT Initialize(
[in] BSTR host);
Sub Initialize(address As String)
address
TOBJADDR
environmental variable is used.
Note: | The network address that is specified in the Bootstrap constructor or in TOBJADDR must exactly match the network address in the application's UBBCONFIG file, both the format of the address as well as the capitalization. If the addresses do not match, the invocation to the Bootstrap constructor will fail with the following seemingly unrelated error message:ERROR: Unofficial connection from client at For example, if the network address is specified as //TRIXIE:3500 in the ISL command-line option string, specifying either //192.12.4.6:3500 or //trixie:3500 in the Bootstrap constructor or in TOBJADDR will cause the connection attempt to fail. On UNIX systems, use the uname -n command on the host system to determine the capitalization used. On Windows systems, see the host system's network settings in the Control Panel to determine the correct capitalization. |
Table 4-5 describes the exceptions.
Creates an instance of a Current environmental object.
HRESULT CreateObject(
[in] BSTR progid,
[out, retval] IDispatch** rtrn);
Function CreateObject(progid As String) As Object
progid
A reference to the interface pointer of the created environmental object.
Table 4-6 describes the exceptions.
Logs out of the Oracle Tuxedo domain and invalidates the TransactionCurrent and SecurityCurrent objects.
HRESULT destroy_current();
Sub destroy_current()
This section provides the following programming examples that use Bootstrap objects.
Listing 4-5 shows how to program a Visual Basic client to use the Bootstrap object.
‘Declare the Bootstrap object
Public oBootstrap As DITobj_Bootstrap
‘Declare the FactoryFinder object
Public oBsFactoryFinder As DITobj_FactoryFinder
‘Declare factory for Registrar object
Public oRegistrarFactory As DIUniversityB_RegistrarFactory
‘Declare actual Registrar object
Public oRegistrarFactory As DIUniversityB_RegistrarFactory
....
‘Create the Bootstrap object
Set oBootstrap = CreateObject(“Tobj.Bootstrap”)
‘Connect to the
Oracle TuxedoDomain
oBootstrap.Initialize “//host:port”
‘Get the FactoryFinder for the
Oracle TuxedoDomain
Set oBSFactoryFinder = oBootstrap.CreateObject(“Tobj.FactoryFinder”)
‘Get a factory for the Registrar object
‘using the FactoryFinder method find_one_factory_by_id
Set oRegistrarFactory = oBSFactoryFinder.find_one_factory_by_id(“RegistrarFactoryID”)
'Create a Registrar object
Set oRegistrar = oRegistrarFactory.find_registrar(exc)
This topic includes the following topics:
As of release 8.0, the Oracle Tuxedo ORB supports the CORBA Naming Service bootstrapping mechanism (referred to in this document as the Interoperable Naming Service), as specified in Chapters 4 and 13 of the CORBA Specification revision 2.4.2.
This support enables ORBs that implement the Interoperable Naming Service (INS) bootstrapping mechanism to query the Oracle Tuxedo server-side ORB to get object references to initial objects such as FactoryFinder and to PrincipalAuthenticator to the Oracle Tuxedo environment. This support along with client support for interoperable initial object references enables clients to use the INS bootstrapping mechanism instead of the Oracle bootstrapping mechanism.
Note: | The CORBA C++ client provided with Oracle Tuxedo software may use the INS bootstrapping mechanism, however, for performance reasons, this is not recommended. |
Table 4-7 shows the object reference that is returned for each type ID.
As of release 8.0, Oracle Tuxedo CORBA supports the -ORBInitRef
and -ORBDefaultInitRef
command-line options. For a complete description of these options, see “ORB Initialization Member Function” on page 14-85.
The following example assumes an Oracle Tuxedo CORBA IIOP client is talking to an Oracle Tuxedo CORBA IIOP server environment:
client_app – ORBid BEA_IIOP – ORBInitRef
FactoryFinder=corbaloc::myhost:2468/FactoryFinder
Given this example, a call to ORB::resolve_initial_references
for the FactoryFinder
will result in an interoperable initial reference request being sent to the ISL/ISH on myhost
at port 2468
. Note that the case of myhost
must exactly match the case of the host specified for the ISL/ISH in the tuxconfig
file.
To use the INS bootstrapping mechanism, applications programmers must observe the following requirements:
ORB::resolve_initial_references
function, instead of the Tobj_Bootstrap::resolve_initial_references
function. For a syntactical description of ORB::resolve_initial_references
, see “CORBA::ORB::resolve_initial_references” on page 14-79.Note: | The Tobj_Bootstrap API is still supported and its behavior has not changed. |
ORB::list_initial_services
function instead of the Tobj_Bootstrap::list_initial_services
function. For a syntactical description of ORB::list_initial_services
, see “CORBA::ORB::list_initial_services” on page 14-75.As of release 8.0, Oracle Tuxedo CORBA supports an additional Uniform Resource Locator (URL) format to be used for the specification of the location for access to an Oracle Tuxedo CORBA server environment and from where to retrieve references to initial object. The new URL format both follows and extends the definition of object URLs adopted by the OMG as part of the INS specification. The URL format described in the INS specification has also been extended to support a secure form modeled after the URL for secure HTTP, as well as the ability to support the randomize functionality initially provided in Oracle WebLogic Enterprise version 5.1.
The CORBA 2.4.2 specification requires that three object URL schemes must be supported by a compliant ORB. These schemes are defined as IOR, corbaloc, and corbaname.
Note: | The new URL string formats may also be passed to the ORB::string_to_object function. |
The IOR scheme takes the form of a string that is formatted as IOR:
hex_octets
. The scheme name is IOR and the text after the ‘:’ is defined in the CORBA specification. The IOR URL scheme is robust and insulates the client from the encapsulated transport information and object key used to reference the object.
It is difficult for humans to exchange IORs through nonelectronic means because of their lengths and the text encoding of binary information. The corbaloc and corbalocs URL schemes provide stringified object references in a format that is familiar to people and similar to the popular URL schemes of FTP and HTTP. The URL schemes defined for corbaloc and corbalocs are easily manipulated in both TCP/IP and DNS centric environments. The corbaloc and corbalocs URL contains:
By default, corbaloc URLs denote objects that can be contacted over IIOP, while corbalocs URLs denote objects that can be contacted using IIOP over SSL.
Table 4-8 lists the BNF syntax for each URLs element.
|
|
Table 4-9 describes each URL element.
A comma-separated list of protocol ID, version, and address information. This list is used in an implementation-defined manner to address the object. An object may be contacted by any of the addresses and protocols. If a failure occurs using the element, the next element in the comma-separated list will be used.
|
|
A stringified object key that is not NULL-terminated. The
key_string uses the escape conventions described in RFC 2396 to map away from octet values that cannot directly be part of a URL. US-ASCII alphanumeric characters are not escaped. Characters outside this range are escaped, except for the following:
|
|
A stringified name with URL escapes as defined in the Internet Engineering Task Force (IETF) RFC 2396. These escape rules insure that URLs can be transferred via a variety of transports without undergoing changes. US-ASCII alphanumeric characters are not escaped. Characters outside this range are escaped, except for the following:
|
The following are some examples of using the new URL format:
corbaloc::555xyz.com:1024,555backup.com:1022,555last.com:1999
corbalocs::555xyz.com:1024,{555backup.com:1022|555last.com:1999}
corbaloc::1.2@555xyz.com:1111
corbalocs::1.1@24.128.122.32:1011,1.0@24.128.122.34
As an enhancement to the URL syntax described in the INS submission, Oracle Tuxedo 8.0 or later has extended the syntax to support a list of multiple URLs, each with a different scheme. The following are some examples of the extension:
corbalocs::555xyz.com:1024,corbaloc::1.2@555xyz.com:1111
corbalocs::ctxobj:3434,mthd:3434,corbaloc::force:1111
In the above example, if the parser reaches the URL corbaloc::force.com:1111
, it will reset its internal state as if it had never attempted secure connections and then begins attempting unprotected connections.
The corbaname URL scheme extends the capabilities of the corbaloc scheme to allow URLs to denote entries in a Naming Service. Resolving corbaname URLs does not require a Naming Service implementation in the ORB core. An example of a corbaname URL is:
corbaname:555objs.com#a/string/path/to/obj
This URL specifies that at host 555objs.com
, an object of type NamingContext (with an object key of NamingService) can be found, or alternatively, that an agent running at that location will return a reference to a NamingContext. The stringified name a/string/path/to/obj
is then used as the argument to the resolve
operation on that NamingContext.
A corbaname URL is similar to a corbaloc URL except that a corbaname URL also contains a stringified name that identifies a binding in a naming context. The #
character denotes the start of the stringified name.
The BNF syntax for the URL is listed in Table 4-10.
Resolution of a corbaname URL is implemented as a simple extension to corbaloc URL processing. To illustrate the implementation, we will use the following corbaname URL:
corbaname:<corbaloc_obj>[“#”<string_name>]
The resolution process is as follows:
corbaloc::<corbaloc_obj>
from the corbaname URL.CORBA::ORB::string_to_object
to obtain a CosNaming::NamingContext
object.<string_name>
to a CosNaming::Name.
CosNaming::NamingContext
, passing the CosNaming::Name
constructed.CosNaming::NamingContext::resolve
should be returned to the caller.
By following this resolution process, you eliminate the possibility of returning an object reference for a naming context that does not exist in the Naming Service. One side effect of this approach is that it requires that stubs for the Naming Service be part of the ORB core or that there be an internal mechanism for sending the request for the resolve
operation. Because of the complexity, it is recommended that stubs for the Naming Service be embedded within the ORB core.
Listing 4-6 shows an example of how a client application, using INS, gets an object reference to the FactoryFinder object. For a complete code example, see the client application in the University Sample.
// utility to get the registrar
static UniversityW::Registrar_ptr get_registrar(
CORBA::ORB_ptr orb
)
{
// Get the factory finder from the ORB:
CORBA::Object_var v_fact_finder_oref =
orb->resolve_initial_references("FactoryFinder");
// Narrow the factory finder :
Tobj::FactoryFinder_var v_fact_finder_ref =
Tobj::FactoryFinder::_narrow(v_fact_finder_oref.in());
// Use the factory finder to find the
// university's registrar factory :
CORBA::Object_var v_reg_fact_oref =
v_fact_finder_ref->find_one_factory_by_id(
UniversityW::_tc_RegistrarFactory->id()
);
// Narrow the registrar factory :
UniversityW::RegistrarFactory_var v_reg_fact_ref =
UniversityW::RegistrarFactory::_narrow(
v_reg_fact_oref.in()
);
// Return the university's registrar :
return v_reg_fact_ref->find_registrar();
}
Listing 4-7 shows an example of how a client application, using INS, gets an object reference to the PrincipalAuthenticator object. For a complete code example, see the client application in the University Sample.
// utility to log on to the security system
static SecurityLevel2::PrincipalAuthenticator_ptr logon(
CORBA::ORB_ptr orb,
const char* program_name,
UniversityW::StudentId stu_id
)
{
// Get a Principal Authenticator directly from the ORB:
CORBA::Object_var v_pa_obj =
orb->resolve_initial_references("PrincipalAuthenticator");
// Narrow the Principal Authenticator :
SecurityLevel2::PrincipalAuthenticator_var v_pa =
SecurityLevel2::PrincipalAuthenticator::_narrow(
v_pa_obj.in());
As of release 8.0, Oracle Tuxedo CORBA supports the use of the CORBA Transaction Service Interface for beginning transactions. Using the ORB::resolve_initial_references(“FactoryFinder”)
function, a client gets an object reference to a FactoryFinder. The client then uses the FactoryFinder to get a reference to a TransactionFactory, that it in turn uses to create (begin) a transaction.
Listing 4-8 shows an example of how a client application, using INS, gets an object reference to the TransactionFactory object. For a complete code example, see the client application in the University Sample.
// Get the factory finder from the ORB:
CORBA::Object_var v_fact_finder_oref =
orb->resolve_initial_references("FactoryFinder");
// Narrow the factory finder :
Tobj::FactoryFinder_var v_fact_finder_ref =
Tobj::FactoryFinder::_narrow(v_fact_finder_oref.in());
// Get the TransactionFactory from the FactoryFinder
CORBA::Object_var v_txn_fac_oref =
v_fact_finder_ref->find_one_factory_by_id(
"IDL:omg.org/CosTransactions/TransactionFactory:1.0");
// Narrow the TransactionFactory object reference
CosTransactions::TransactionFactory_var v_txn_fac_ref =
CosTransactions::TransactionFactory::_narrow(
v_txn_fac_oref.in());
The sequence of events using the INS bootstrapping mechanism is as follows:
ORB::resolve_initial_references
to get a FactoryFinder.get_terminator
method to get the transaction terminator interface.
The TransactionFactory returns objects that adhere to the standard CORBA Transaction Service interfaces instead of the Oracle delegated interfaces. This means that a third party ORB can use their ORB’s resolve_initial_references
function to get a reference to a TransactionFactory from an Oracle Tuxedo CORBA server and use stubs generated from standard OMG IDL to act on the instances returned.
For the Oracle Tuxedo 8.0 release or later, the actions of the TransactionFactory and the client’s Current are not coordinated. This means that clients should use one mechanism or the other to control and get status about transactions, not both. Also, only the interfaces and operations listed in Table 4-11 are supported. The other operations, as described in the OMG IDL, return the CORBA::NO_IMPLEMENT
exception.