3 Developing Oracle WebLogic Tuxedo Connector Service EJBs
This chapter includes the following sections:
Basic Service EJB Operation
A service application uses Java and JATMI primitives to provide the following tasks:
Parent topic: Developing Oracle WebLogic Tuxedo Connector Service EJBs
Access Service Information
Use the TPServiceInformation class to access service information sent by the Oracle Tuxedo client to run the service.
Table 3-1 JATMI TPServiceInformation Primitives
Buffer Type | Description |
---|---|
|
Use to return the service data sent from the Oracle Tuxedo Client. |
|
Use to return the service flags sent from the Oracle Tuxedo Client. |
|
Use to return the service name that was called. |
Parent topic: Basic Service EJB Operation
Buffer Messages
Use the following TypedBuffers when sending and receiving messages between your application and Oracle Tuxedo:
Table 3-2 TypedBuffers
Buffer Type | Description |
---|---|
|
Buffer type used when the data is an array of characters that terminates with the null character. Oracle Tuxedo equivalent: |
|
Buffer type used when the data is an undefined array of characters (byte array), any of which can be null. Oracle Tuxedo equivalent: |
|
Buffer type used when the data is self-defined. Each data field carries its own identifier, an occurrence number, and possibly a length indicator. Oracle Tuxedo equivalent: |
|
Buffer type similar to TypeFML but allows for larger character fields, more fields, and larger overall buffers. Oracle Tuxedo equivalent: |
|
Buffer type used when data is an XML based message. Oracle Tuxedo equivalent: XML for Tuxedo Release 7.1 and higher. |
|
Buffer type used when the application uses a Java structure to define the buffer structure using a view description file. Tuxedo equivalent: |
|
Buffer type similar to View but allows for larger character fields, more fields, and larger overall buffers. Oracle Tuxedo equivalent: |
|
Buffer type used when the data is an undefined array of characters (byte array) any of which can be null. |
|
Buffer type identical in semantics to View. Oracle Tuxedo equivalent: |
|
Buffer type identical in semantics to View. Oracle Tuxedo equivalent: |
|
Buffer type used when the data is a wide array of characters to support multi-byte characters. Oracle Tuxedo equivalent: |
Parent topic: Basic Service EJB Operation
Perform the Requested Service
Use Java code to express the logic required to provide your service.
- Return Client Messages for Request/Response Communication
- Use tpsend and tprecv for Conversational Communication
Parent topic: Basic Service EJB Operation
Return Client Messages for Request/Response Communication
Use the TuxedoReply class setReplyBuffer()
method to respond to client requests.
Parent topic: Perform the Requested Service
Use tpsend and tprecv for Conversational Communication
Use the following JATMI primitives when creating conversational servers that communicate with Oracle Tuxedo clients:
Table 3-3 Oracle WebLogic Tuxedo Connector Conversational Client Primitives
Name | Operation |
---|---|
|
Use to establish a connection to an Oracle Tuxedo conversational service. |
|
Use to abort a connection and generate a |
|
Use to receive data across an open connection from an Oracle Tuxedo application. |
|
Use to send data across a open connection to an Oracle Tuxedo application. |
Parent topic: Perform the Requested Service
Example Service EJB
The following provides an example of the TolowerBean.java
service EJB which receives a string argument, converts the string to all lower case, and returns the converted string to the client.
Example 3-1 Example Service EJB
. . . public Reply service(TPServiceInformation mydata) throws TPException { TypedString data; String lowered; TypedString return_data; log("service tolower called"); data = (TypedString) mydata.getServiceData(); lowered = data.toString().toLowerCase(); return_data = new TypedString(lowered); mydata.setReplyBuffer(return_data); return (mydata); } . . .
Parent topic: Developing Oracle WebLogic Tuxedo Connector Service EJBs