BEA WebLogic Enterprise 4.2    Developer Center     

        HOME   |   SITE MAP   |   SEARCH   |   CONTACT   |   GLOSSARY  |   PDF FILES |   WHAT'S NEW 
 
        JAVA REFERENCE    |   TABLE OF CONTENTS   |   PREVIOUS TOPIC   |   NEXT TOPIC  

TP Framework


This chapter contains the following topics:

The WebLogic Enterprise TP Framework provides a programming framework that enables users to create servers for high-performance TP applications. This chapter describes the architecture of and interfaces in the TP Framework. Information about the TP Framework API is in the Java API Reference. Information about how to use this API can be found in Creating Java Server Applications.

The TP Framework consists of:

TP Framework Interfaces

The TP Framework supports the following interfaces:

Tobj_Servant Interface

The com.beasys.Tobj_Servant interface defines operations that allow a CORBA object to assist in the management of its state. Every implementation skeleton generated by the IDL compiler automatically inherits from the com.beasys.Tobj_Servant class. The com.beasys.Tobj_Servant class contains two virtual methods, activate_object and deactivate_object, that can be redefined by the programmer.

Whenever a request comes in for an inactive CORBA object, the object is activated and the activate_object method is invoked on the servant. When the CORBA object is deactivated, the deactivate_object method is invoked on the servant. The timing of deactivation is driven by the implementation's activation policy. When deactivate_object is invoked, the TP Framework passes in a reason code to indicate why the call was made.

Note: The activate_object and deactivate_object methods are the only methods that the TP Framework guarantees will be invoked for CORBA object activation and deactivation. The servant class constructor and destructor may or may not be invoked at activation or deactivation time. Therefore, the server-application code must not do any state handling for CORBA objects in either the constructor or destructor of the servant class.

Server Interface

The com.beasys.Tobj.Server interface provides callback methods that can be used for application-specific server initialization and termination logic. The com.beasys.Tobj.Server class is a Java class.

Note: Unlike implementing C++ server applications with the WebLogic Enterprise system, when you are implementing Java server applications with the WebLogic Enterprise system, you must provide definitions for the com.beasys.Tobj.Server.initialize and com.beasys.Tobj.Server.release methods. The TP Framework provides default versions of these methods.

TP Interface

The com.beasys.Tobj.TP interface 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.

The purpose of this interface is to provide high-level calls that application code can call, instead of calls to underlying APIs provided by the Portable Object Adapter (POA), the CORBAservices Naming Service, and the BEA TUXEDO system. By using these calls, programmers can learn a simpler API and are spared the complexity of the underlying APIs.

The com.beasys.Tobj.TP interface implicitly uses two features of the WebLogic Enterprise software that extend the CORBA APIs:

Usage Notes

During server application initialization, the application constructs the object reference for an application factory. It then invokes the register_factory method, passing in the factory's object reference together with a factory id field. On server release (shutdown), the application uses the unregister_factory method to unregister the factory.

TransactionalObject Interface Not Enforced

The org.omg.CosTransactions.TransactionalObject interface was formerly used to indicate that an object was transactional. In the previous version of the WebLogic Enterprise software, if a transactional invocation was done on an object that did not descend from the org.omg.CosTransactions.TransactionalObject interface, an exception was raised. Therefore, in the previous version, an object had to descend from the org.omg.CosTransactions.TransactionalObject interface to be eligible to participate in transactions. This behavior was enforced by the TP Framework.

However, in version 2.1 of the WebLogic Enterprise software, this interface is deprecated. Therefore, the use of this interface is now optional and no enforcement of descent from this interface is done for objects infected with transactions. By specifying the never or ignore transaction policies, the programmer can specify that an object is not to be infected by transactions. There is no interface enforcement for eligibility for transactions. The only indicator is the transaction policy.

Note: The CORBAservices Object Transaction Service does not require that all requests be performed within the scope of a transaction. It is up to each object to determine its behavior when invoked outside the scope of a transaction; an object that requires a transaction context can raise a standard exception.

Transactions Usage Notes

The following sections provide some information about how to use transactions.

Transaction Termination

In general, the handling of the outcome of a transaction is the responsibility of the initiator. Therefore, the following is true:

The following behavior is enforced by the WebLogic Enterprise system:

Transaction Suspend and Resume

The CORBA object must follow strict rules with respect to suspending and resuming a transaction within a method invocation. These rules and the error conditions that result from their violation are described in this section.

When a CORBA object method begins execution, it can be in one of the following three states with respect to transactions:

Restrictions

The following restrictions apply to WebLogic Enterprise transactions:

Voting on Transaction Outcome

CORBA objects can affect transaction outcome during two stages of transaction processing:


Copyright © 1999 BEA Systems, Inc. All Rights Reserved.
Required browser version: Netscape Communicator version 4.0 or higher, or Microsoft Internet Explorer version 4.0 or higher.
Last update: July 01, 1999.