![]() | Using XMLink | ![]() ![]() ![]() ![]() |
This appendix discusses the changes in XMLink.
XMLink 3.1 | ![]() |
XMLink 3.0 | ![]() |
J2C 1.5 supports the notion of resource adapter properties, in addition to connection factory properties. For XMLink 3.0, several of XMLink 2.60's connection factory properties (actually properties of For a current list of Connection Factory properties, refer to "Setting Properties on a Connection Factory."
The default setting for If Also, in the non-managed environment, XMLink 3.0 contains improved XML support:
Changes to Connection Factory Properties
ManagedConnectionFactoryImpl
) were replaced with resource adapter properties. These are properties of the new ResourceAdapterImpl
class.
No Default Setting for XMLink.tconn
XMLink.tconn
has been removed in XMLink 3.0, in favor of specifying the ConnectionType
connection factory property. However, support is still available for setting this property either in the JVM or on the command line.
XMLink.tconn
is used, the native library is loaded when Tuxedo.class
is loaded. Otherwise, using ConnectionType
, the resource adapter is loaded only when it is started by the J2EE Application Server. For WebSphere 6, the administrative console does not let the user control starting and stopping the resource adapter, but some J2EE Application Servers support that.
ResourceAdapter.start
is not called, so XMLink.tconn
must be used.
Improved XML support
getXML()
method is available on all Record classes.
This method returns a String
containing the record contents in XML. The String
is suitable for use with XMLink's XMLConnector
class.
RecordFactoryImpl
contains a new method:
The public Record createRecordFromXML(String xml)
String
xml
must be in the form supported by XMLConnector
. Any type of XMLink Record may be created this way and initialized with data.
setOutputEncoding()
public Result processResult(InputStream in)
throws ResourceException, SAXException, IOException
XMLConnector.Result
has the public properties serviceName
, tuxBuffer
, error
, userReturnCode
, xaction
and next
. There are also set
and get
methods for these properties. The get
methods are as follows:
public String getServiceName()
getServiceName()
returns the value of a servicename attribute for either a returndata or error tag.
public TuxBuffer getTuxBuffer()
getTuxBuffer()
returns the data within an FMLRecord
, FML32Record
, STRINGRecord
, CARRAYRecord
, or JAMFLEXRecord
tag as an instance of TuxBuffer
.
public Throwable getError()
getError()
returns the contents of an error tag as a throwable. The throwable may actually be an instance of TuxedoException
.
public long getUserReturnCode()
getUserReturnCode()
returns the data within a UserReturnCode
tag as a long
. It is assumed that a return of 0 has no particular significance, and is not indicative of the presence of a UserReturnCode tag in the input stream.
public int getXaction()
getXaction
returns an int
. If this int
is 0, no xaction
tag was read from the input. Otherwise, it will have one of the following values:
XMLConnector.Result.BEGIN
XMLConnector.Result.COMMIT
XMLConnector.Result.ABORT
public Result getNext()
XMLink 2.6 | ![]() |
The features for XMLink 2.6 include:
Using the new Java strings are in Unicode. By default, XMLink passes to Tuxedo only the low order byte of each Unicode character. For characters in English and other European languages, this is sufficient since only the low order byte is significant.
Since other languages may need additional support, each of XMLink's Embedded FML
addIn
method on FML32Record
allows you to create embedded FML for Oracle Tuxedo versions 7.1 and higher which contain support for this feature:
public void addIn(String name, FML32Record value)
Character Encoding Support
Record
classes offers setEncoding()
and getEncoding()
methods. The default encoding is ISO-8859-1
, which is a single byte per character encoding. A multibyte encoding, such as UTF8,
can be used for foreign characters. The Tuxedo server must be able to support and decode/encode according to the specified encoding setting.
XMLink 2.1 | ![]() |
For XMLink 2.1, a new Resource Adapter archive was added for use specifically with Tuxedo 6.5, Tconn6.rar
.
XMLink 2.0 | ![]() |
For XMLink version 1.1, the documentation contained the following code to demonstrate a connection to a Java client:
ManagedConnectionFactoryImpl mcf =
new ManagedConnectionFactoryImpl();
javax.resource.ConnectionFactory cxf =
(javax.resource.ConnectionFactory)mcf.createConnectionFactory();
// get a connection
javax.resource.Connection cx = cxf.getConnection();
In XMLink 2.0, it is recommended to change the code as follows to incorporate the changes made for JNDI lookups:
// get an initial JNDI naming context
javax.naming.Context initctx = new InitialContext();
// do JNDI lookup to get connection factory
// note that lookup doesn't return a ConnectionFactory,
// so a cast is needed
javax.resource.ConnectionFactory cxf =
(javax.resource.ConnectionFactory)initctx.lookup("TConn");
// get a connection
Connection cx = cxf.getConnection();
XMLink's directory structure has changed in version 2.0, and a Resource Adapter Archive (Tconn.rar
) has been added for use with WebSphere.
Also tconnxmlout.jar
is available, a WebSphere deployable JAR file which can be imported into an Enterprise Application for XML connectivity to the resource adapter from an EJB.
More properties are available in XMLink 2.0 for connections and connection factories which correspond to settings in an Oracle Tuxedo configuration. If you are using WebSphere, you can set those properties in the WebSphere Administrative Console. For an explanation of the each property, refer to Oracle Tuxedo documentation.
To facilitate deployment in a non-managed environment, a new class was added, TConnTool
. The class supports a set of methods that can be used to build a customized deployment tool. It also includes a main()
that supports a rudimentary command line interface. For more information, see "Deploying in a Non-managed Environment."