|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.beasys.Tobj.TP
Supplies a set of service methods that can be invoked by application code. This is the only interface in the TP Framework that can safely be invoked by application code. All other interfaces have callback methods that are intended to be invoked only by system code.
Constructor Summary | |
TP()
|
Method Summary | |
static Tobj_Bootstrap |
bootstrap()
Returns a com.beasys.Tobj_Bootstrap object. |
static void |
close_xa_rm()
Closes the XA resource manager to which the invoking process is linked. |
static org.omg.CORBA.Object |
create_active_object_reference(java.lang.String interfaceName,
java.lang.String stroid,
Tobj_Servant servant)
Creates an object reference and pre-activates an object. |
static org.omg.CORBA.Object |
create_object_reference(java.lang.String interfaceName,
java.lang.String stroid,
org.omg.CORBA.NVList criteria)
Creates an object reference. |
static void |
deactivateEnable()
Enables application-controlled deactivation of CORBA objects. |
static java.lang.String |
get_object_id(org.omg.CORBA.Object objp)
Allows a server to retrieve the string object id contained in an object reference that was created by the TP Framework. |
static org.omg.CORBA.Object |
get_object_reference()
Returns a reference to the current object. |
static int |
open_xa_rm()
Opens the XA resource manager to which the invoking process is linked. |
static org.omg.CORBA.ORB |
orb()
Returns an ORB object. |
static void |
register_factory(org.omg.CORBA.Object objp,
java.lang.String id)
Locates the WLE FactoryFinder object and registers an WLE factory. |
static void |
unregister_factory(org.omg.CORBA.Object objp,
java.lang.String id)
Locates the WLE FactoryFinder object and removes an WLE factory. |
static int |
userlog(java.lang.String str)
Writes a message to the user log (ULOG) file. |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public TP()
Method Detail |
public static org.omg.CORBA.Object create_object_reference(java.lang.String interfaceName, java.lang.String stroid, org.omg.CORBA.NVList criteria) throws InvalidInterface, InvalidObjectId
Ordinarily, the server application calls this method in two places:
For examples of how and when to call the create_object_reference method, see Creating Java Server Applications.
interfaceName
- Specifies a character string that contains the
fully qualified interface name for the object.
stroid
- Specifies the object ID in string format. The object
ID uniquely identifies this instance of the class. It is up to the
programmer to decide what information to place in the object ID.
One possibility would be to use the object ID to hold a database key.
Choosing the value of an object identifier, and the degree of
uniqueness, is part of the application design. The WLE software cannot
guarantee any uniqueness in object references, since object references
may be legitimately copied and shared outside the WLE domain
(for example, by passing the object reference as a string).
criteria
- Specifies a list of named values that can be used to
provide factory-based routing for the object reference. The use of
factory-based routing is optional and is dependent on the use of this
argument. If you do not want to use factory-based routing, you can
pass a value of 0 (zero) for this argument.public static org.omg.CORBA.Object create_active_object_reference(java.lang.String interfaceName, java.lang.String stroid, Tobj_Servant servant) throws IllegalOperation, InvalidInterface, InvalidObjectId, InvalidServant, ObjectAlreadyActive, ServantAlreadyActive
Ordinarily, the server application calls this method in two places:
This method allows an application to activate an object explicitly before its first invocation. (For reasons you might do this, see the section "Explicit Activation" in the Java TP Framework Reference.) The user first creates a servant and sets its state before calling create_active_object_reference. The TP Framework then puts the object into the Active Object Map (that is, associates the servant with an ObjectId). Then, when the first invocation is made, the TP Framework immediately directs the request to the process that created the object reference and then to the existing servant bypassing the call to the servant’s activate_object method (just as if this were the second or later invocation on the object).
The object so activated must be for an interface that was declared with the process activation policy; otherwise an exception is raised.
If the object is deactivated, the use of an object reference held by a client might cause the object to be activated again in some other process. For a discussion of situations in which this might be a problem and what to do about it, see the section "Explicit Activation" in the Java TP Framework Reference.
Caution: When you preactivate objects in an interface, it can lead to the following problem.
Problem Statement:
interfaceName
- Specifies a character string that contains the fully qualified interface name for the object.
stroid
- Specifies the object ID in string format. The object ID uniquely identifies this instance of the class. It is up to the programmer to decide what
information to place in the object ID. One possibility would be to use the object ID to hold a database key. Choosing the value of an object identifier,
and the degree of uniqueness, is part of the application design. The WLE software cannot guarantee any uniqueness in object references, since object
references may be legitimately copied and shared outside the WLE domain (for example, by passing the object reference as a string).
servant
- A pointer to a servant that the application has already created and initialized.public static org.omg.CORBA.Object get_object_reference() throws NilObject
Note: If the get_object_reference method is invoked from within either the com.beasys.com.Tobj.Server.initialize or com.beasys.com.Tobj.Server.release methods, it is considered to be invoked outside the scope of an application's CORBA object execution.
public static java.lang.String get_object_id(org.omg.CORBA.Object objp) throws InvalidObject
public static void register_factory(org.omg.CORBA.Object objp, java.lang.String id) throws InvalidObject, InvalidName, RegistrarNotAvailable, CannotProceed, OverFlow
objp
- Specifies the object reference that was created for
an application factory using the
com.beasys.Tobj.TP.create_object_reference method.
id
- Specifies a string identifier that is used to identify
the application factory. For some suggestions as to the composition
of this string, see Creating Java Server Applications.public static void unregister_factory(org.omg.CORBA.Object objp, java.lang.String id) throws InvalidObject, InvalidName, RegistrarNotAvailable, CannotProceed, OverFlow
objp
- Specifies the object reference that was created for
an application factory using the
com.beasys.Tobj.TP.create_object_reference method.
id
- Specifies a string identifier that is used to identify
the application factory. For some suggestions as to the composition
of this string, see Creating Java Server Applications.public static int open_xa_rm() throws RMfailed
Note: The functionality of this method is also provided by the com.beasys.Tobj.TransactionCurrent.open_xa_rm method. However, the open_xa_rm method provides a more convenient way for a server application to open a resource manager because there is no need to obtain an object reference to the TransactionCurrent object. A reference to the TransactionCurrent object can be obtained from the Bootstrap object.
This method should be invoked once from the com.beasys.Tobj.Server.initialize method for each server that participates in a global transaction. This includes servers that are linked with an XA resource manager, as well as servers that participate in a global transaction, but are not actually linked with an XA-compliant resource manager.
The open_xa_rm method should be invoked in place of an open invocation that is specific to a resource manager. Because resource managers differ in their initialization semantics, the specific information needed to open a particular resource manager is placed in the OPENINFO parameter in the GROUPS section of the UBBCONFIG file.
The format of the OPENINFO string is dependent on the requirements of the database vendor providing the underlying resource manager. For more information about the OPENINFO parameter, see the ubbconfig(5) reference page in the BEA TUXEDO Reference and the Administration Guide. Also, refer to database vendor documentation for information about how to develop and install applications that use the XA libraries.
Note: Only one resource manager can be linked to the invoking process.
public static void close_xa_rm() throws RMfailed, org.omg.CORBA.BAD_INV_ORDER
Note: The functionality of this call is also provided by the com.beasys.Tobj.TransactionCurrent.close_xa_rm method. The com.beasys.Tobj.TP.close_xa_rm method provides a more convenient way for a server application to close a resource manager because there is no need to obtain an object reference to the TransactionCurrent object. A reference to the TransactionCurrent object can be obtained from the Bootstrap object.
This method should be invoked once from the com.beasys.Tobj.Server.release method for each server that is involved in global transactions. This includes servers that are linked with an XA resource manager, as well as servers that are involved in global transactions, but are not actually linked with an XA-compliant resource manager.
The com.beasys.Tobj.close_xa_rm method should be invoked in place of a close invocation that is specific to the resource manager. Because resource managers differ in their termination semantics, the specific information needed to close a particular resource manager is placed in the CLOSEINFO parameter in the GROUPS section of the UBBCONFIG file.
The format of the CLOSEINFO string is dependent on the requirements of the database vendor providing the underlying resource manager. For more information about the CLOSEINFO parameter, see the ubbconfig(5) reference page in the BEA TUXEDO Reference online document and the Administration Guide. Also, refer to database vendor documentation for information about how to develop and install applications that use the XA libraries.
public static void deactivateEnable() throws IllegalOperation
The following usage guidelines apply:
Note: When it is invoked from within the method of an object that has its activation policy set to method, the effect is the same as the normal behavior of such objects (effectively, a NO-OP). When it is invoked within the method of an object that has its activation policy set to transaction, an IllegalOperation exception is raised. This is because deactivation of such objects may interfere with their correct notification of transaction completion by the WLE transaction manager.
public static org.omg.CORBA.ORB orb()
public static Tobj_Bootstrap bootstrap()
Caution: Because the TP Framework owns the com.beasys.Tobj_Bootstrap object, server application code must not dispose of the Bootstrap object.
public static int userlog(java.lang.String str)
It is recommended that the server applications limit their use of userlog() messages to messages that can be used to help debug application errors; flooding the ULOG file with incidental information can make it difficult to spot actual errors.
str
- The message to be written to the ULOG.Example:
The following example shows how to use the userlog method:
userlog ("System exception caught: %s", e.get_id());
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |