The Jolt Class Library consists of object-oriented Java language classes for accessing BEA TUXEDO services and defining transactions. The Jolt Class Library package is designed to be small, simple, and easy to incorporate into your Java application. The classes for this package provide TUXEDO logon/logoff, synchronous calling, and transaction services for a client Java applet.
The Jolt Class Library reference includes the following topics:
Each class description includes information about the class constructor and class methods.
To use the following information, you need to be generally familiar with the Java programming language and object-oriented programming concepts. The reference material follows the Java standard terminology for classes and for the methods that operate on the class instances.
For information about programming the Jolt Class Library, refer to Chapter 6, "Using the Jolt Class Library." For information about the Jolt exception classes and related TUXEDO errors listed for the Jolt classes, refer to Appendix A, "Jolt Class Library Errors and Exceptions."
The Jolt classes and class methods that form the Jolt Class Library follow the Java language structure and are intended for use in Java programs. However, since the Jolt Class Library is designed for accessing TUXEDO System applications, you need to be aware of how get, set, add, and delete methods operate within the context of transaction processing.
For example, if you are working with a series of account numbers for a banking transaction and are changing the value from one account number to another account number, you must be aware of how the Jolt methods determine the position of an item in a list. Understanding how these methods work will help you avoid inadvertently reversing the order of a transaction, assigning incorrect values to an item, or deleting the wrong item.
The get, set, and setItem methods are used to obtain information about a specified item or to change information about a specified item. The add methods append a specified item to a list and the delete and deleteItem methods remove specified items. The following sections describe how these methods operate on an item in a list of items.
The set and delete methods operate on the first occurrence of an item in a list. In Jolt, the first occurrence of an item is always at position zero. For example, if you have a list of account numbers and you use a delete method, the item at position zero is deleted. For example:
Deletes the account number at position zero of the account number list.
Sets the account number at position zero to the value 3200.
The following types of methods in the Jolt Class Library are position dependent. To change a position-dependent item, you specify the location or index of the item in a list.
Jolt Methods
Methods for Handling Items
Changing the First Item Occurrence
delete
( "ACCTNUM")setInt
( "ACCTNUM", 3200) Changing Items by Item Position
set...Item
methods
For example, to set the third item in a list of account numbers to a value, you would specify the following:
The example sets the account number at position three to the value 5000. You specify an index of 2 because the index numbering starts at 0 and 2 is at the third position of the list.
To delete the first item in a list of account numbers, you would specify the following:
The example deletes the account number at position 0 and is exactly equivalent to using just the delete method. A The Jolt Class Library includes a number of get methods. However, the get methods operate differently from the other types of methods. The following three get methods retrieve information with a single value.
setIntItem
("ACCTID", 2, 5000)deleteItem
("ACCTID", 0)set...Item
(
name, 0,
value)
also works exactly as the set method.
Getting Items
All other get methods are in the form of a The example gets the credit rating for the fifth item in a list of items starting at position zero. If the item has no value for a credit rating, the get returns the default value of -1. You specify the value for the method in the The add methods append an item to the end of a list of items. Of course if your list of items is empty, an add will make the item the first one in the list. In the following example, the add method appends a name to the end of a list of names:
The JoltSessionAttributes class defines the acceptable attributes for the JoltSession constructor. The set methods add the attribute if one does not exist. Otherwise, the set method overwrites the old value.
The get and set methods throw the The following constructor creates an instance of the JoltSessionAttributes class.
get...Def
or get...ItemDef
. The get...Def
methods retrieve information about the first item (item 0). The get...ItemDef
methods retrieve information about an item that you specify by its position or index number. If the item has no information, these methods allow you to set a default. For example:
getIntItemDef
("CreditRating", 4, -1)defValue
parameter.
Appending Items
addString
("CompanyName", "BoltBikeWorks") JoltSessionAttributes Class
java.lang.Object
|
+----bea.jolt.JoltSessionAttributesjava.lang.NoSuchFieldError
or java.lang.IllegalAccessError
. By default, these errors are caught by the Java virtual machine.
public class
JoltSessionAttributes
{
/* The supported authentication levels. */
public final static int NOAUTH; // No authentication
public final static int APPASSWORD; // Application password
public final static int USRPASSWORD; // App and User passwords /* The attribute names for set and get. */
public final static String APPADDRESS // String "//host:port"
// Used with setString()
public final static String IDLETIMEOUT; // Used with SetInt()"
public final static String SENDTIMEOUT; // Used with SetInt()"
public final static String RECVTIMEOUT; // Used with SetInt()" /* The attribute name for get only. */
public final static String SESSIONTIMEOUT; // getIntDef() public
JoltSessionAttributes
(); //JoltSessionAttributes methods.
public int checkAuthenticationLevel
()
throws SessionException;
public void clear
();
public byte getByteDef
( String name, byte defValue );
public byte[] getBytesDef
( String name, byte[] defValue );
public double getDoubleDef
( String name, double defValue );
public float getFloatDef
( String name, float defValue );
public int getIntDef
( String name, int defValue );
public short getShortDef
( String name, short defValue );
public String getStringDef
( String name, String defValue );
public void setByte
( String name, byte value );
public void setBytes
( String name, byte[] value, int len);
public void setDouble
( String name, double value );
public void setFloat
( String name, float value );
public void setInt
( String name, int value );
public void setShort
( String name, short value );
public void setString
( String name, String value );
} JoltSessionAttributes Constructor
JoltSessionAttributes
Allocates a new instance of the JoltSessionAttributes class.
Synopsis
public JoltSessionAttributes();Usage
Specific components are extracted to assist in defining the attributes of the Session constructor.
Throws
java.lang.IllegalAccessError
.Occurs when the user tries to set a value to a get-only attribute, or to get a value from a set-only attribute.
java.lang.NoSuchFieldError
.Occurs when the user tries to set an attribute which is not one of the predefined attributes.
JoltSessionAttributes Methods
The following methods are used in conjunction with the JoltSessionAttributes class.
- checkAuthenticationLevel and clear methods. These methods provide a means to retrieve the values set for system access and to remove data.
These JoltSessionAttributes methods are described in the following sections.
Gets the authentication level set up by the TUXEDO administrator.
Synopsis
int checkAuthenticationLevel() throws SessionException;Usage
The authentication level determines which values are set to the JoltSession constructor parameters. This method returns the authentication level specified in Table 7-1.
You must set APPADDRESS before calling this method (refer to Table 7-2).
Returns
Table 7-1 describes the possible return values for the
checkAuthenticationLevel
method.
Throws
java.lang.IllegalAccessError
.Occurs when the user tries to set a value to a get-only attribute, or to get a value from a set-only attribute.
java.lang.NoSuchFieldError
.Occurs when the user tries to set an attribute which is not one of the predefined attributes.
Removes all attributes.
Synopsis
voidclear
();Usage
The JoltSessionAttributes class contains data that must be removed for object reuse. Use the clear method to remove data.
Gets the byte value of a specified item.
Synopsis
byte getByteDef ( String name, byte defValue );Usage
Gets the byte value (8-bit) of the item specified in the
name
parameter or the specifieddefValue
, if the name does not exist.Returns
This method returns a single byte value.
Throws
java.lang.IllegalAccessError
.Occurs when the user tries to set a value to a get-only attribute, or to get a value from a set-only attribute.
java.lang.NoSuchFieldError
.Occurs when the user tries to set an attribute which is not one of the predefined attributes.
Gets an array of byte values.
Synopsis
byte[ ] getBytesDef ( String name, byte[] defValue );Usage
Gets an array of byte values of the item specified in the
name
parameter or the specifieddefValue
, if the name does not exist.Returns
This method returns an array of values.
Throws
java.lang.IllegalAccessError
.Occurs when the user tries to set a value to a get-only attribute, or to get a value from a set-only attribute.
java.lang.NoSuchFieldError
.Occurs when the user tries to set an attribute which is not one of the predefined attributes.
Gets the double precision value of an item.
Synopsis
double getDoubleDef( String name, double defValue );Usage
Gets the double precision value of the item specified in the
name
parameter or the specifieddefValue
, if the name does not exist.Returns
This method returns an double precision floating point value (64-bit).
Throws
java.lang.IllegalAccessError
.Occurs when the user tries to set a value to a get-only attribute, or to get a value from a set-only attribute.
java.lang.NoSuchFieldError
.Occurs when the user tries to set an attribute which is not one of the predefined attributes.
Gets the floating point value of an item.
Synopsis
float getFloatDef( String name, float defValue );Usage
Gets the floating point value of the item specified in the
name
parameter or the specifieddefValue
, if the name does not exist.Returns
This method returns a floating point value (32-bit).
Throws
java.lang.IllegalAccessError
.Occurs when the user tries to set a value to a get-only attribute, or to get a value from a set-only attribute.
java.lang.NoSuchFieldError
.Occurs when the user tries to set an attribute which is not one of the predefined attributes.
Gets the integer value of an item.
Synopsis
int getIntDef( String name, int defValue );Parameters
name
Specifies the attribute name.
defValue
Specifies a default value for an item if it does not have an existing name.
Usage
Gets the integer value of the item specified in the
name
parameter or the specifieddefValue
, if the name does not exist. Use these values to specify thedefValue
parameter for this method.Returns
This method returns an integer value (32-bit).
Example
attr.getIntDef(attr.SESSIONTIMEOUT, 1);Throws
java.lang.IllegalAccessError
.Occurs when the user tries to set a value to a get-only attribute, or to get a value from a set-only attribute.
java.lang.NoSuchFieldError
.Occurs when the user tries to set an attribute which is not one of the predefined attributes.
Gets the short integer value of an item.
Synopsis
short getShortDef( String name, short defValue );Usage
Gets the short integer value of the item specified in the
name
parameter or the specifieddefValue
, if the name does not exist.Returns
This method returns a short integer value (16-bit).
Throws
java.lang.IllegalAccessError
.Occurs when the user tries to set a value to a get-only attribute, or to get a value from a set-only attribute.
java.lang.NoSuchFieldError
.Occurs when the user tries to set an attribute which is not one of the predefined attributes.
Gets the string value of an item.
Synopsis
String getStringDef( String name, String defValue );Usage
Gets the string value of the item specified in the
name
parameter or the specifieddefValue
, if the name does not exist. The default value can be a null string or any other text string.Returns
This method returns a text string.
Throws
java.lang.IllegalAccessError
.Occurs when the user tries to set a value to a get-only attribute, or to get a value from a set-only attribute.
java.lang.NoSuchFieldError
.Occurs when the user tries to set an attribute which is not one of the predefined attributes.
Sets the byte value of a specified item.
Synopsis
void setByte( String name, byte value );Usage
Sets the value of the item specified in the
name
parameter to the byte value specified in the value parameter. The value is an 8-bit byte.Throws
java.lang.IllegalAccessError
.Occurs when the user tries to set a value to a get-only attribute, or to get a value from a set-only attribute.
java.lang.NoSuchFieldError
.Occurs when the user tries to set an attribute which is not one of the predefined attributes.
Sets the byte array value of a specified item.
Synopsis
void setBytes( String name, byte[ ] value, int len );Usage
Sets the value of the item specified in the
name
parameter to the byte array value specified in the value parameter, with the length set by the len parameter. The value is in 8-bit bytes.Throws
java.lang.IllegalAccessError
.Occurs when the user tries to set a value to a get-only attribute, or to get a value from a set-only attribute.
java.lang.NoSuchFieldError
.Occurs when the user tries to set an attribute which is not one of the predefined attributes.
Sets the double precision value of a specified item.
Synopsis
void setDouble( String name, double value );Usage
Sets the value of the item specified in the
name
parameter to the double precision value specified in the value parameter. The value is in 64-bits.Throws
java.lang.IllegalAccessError
.Occurs when the user tries to set a value to a get-only attribute, or to get a value from a set-only attribute.
java.lang.NoSuchFieldError
.Occurs when the user tries to set an attribute which is not one of the predefined attributes.
Sets the floating point value of a specified item.
Synopsis
void setFloat( String name, float value );Usage
Sets the value of the item specified in the
name
parameter to the floating point (32-bit) value specified in the value parameter.Throws
java.lang.IllegalAccessError
.Occurs when the user tries to set a value to a get-only attribute, or to get a value from a set-only attribute.
java.lang.NoSuchFieldError
.Occurs when the user tries to set an attribute which is not one of the predefined attributes.
Sets the integer value of a specified item.
Synopsis
void setInt( String name, int value );Usage
Sets the value of the item specified in the
name
parameter to the integer (32-bit) value specified in the value parameter.Throws
java.lang.IllegalAccessError
.Occurs when the user tries to set a value to a get-only attribute, or to get a value from a set-only attribute.
java.lang.NoSuchFieldError
.Occurs when the user tries to set an attribute which is not one of the predefined attributes.
Sets the short integer value of a specified item.
Synopsis
void setShort( String name, short value );Usage
Sets the value of the item specified in the
name
parameter to the short (16-bit) integer value specified in the value parameter.Throws
java.lang.IllegalAccessError
.Occurs when the user tries to set a value to a get-only attribute, or to get a value from a set-only attribute.
java.lang.NoSuchFieldError
.Occurs when the user tries to set an attribute which is not one of the predefined attributes.
Sets the string value of a specified item.
Synopsis
void setString( String name, String value );Usage
Sets the value of the item specified in the
name
parameter to the string value specified in the value parameter.Throws
java.lang.IllegalAccessError
.Occurs when the user tries to set a value to a get-only attribute, or to get a value from a set-only attribute.
java.lang.NoSuchFieldError
.Occurs when the user tries to set an attribute which is not one of the predefined attributes.
Attributes Names for Get and Set Methods
The attribute names for the JoltSessionAttributes class include static final variables (essentially predefined constants) for setting the application address, and for setting and getting timeouts. The predefined attribute names listed in Table 7-2 are used for specifying the String
name
parameter of the JoltSessionAttributes get and set methods.Note: The get methods are unrestricted. That is, the programmer can define names in addition to using the predefined ones. The set methods are currently restricted to the use of the predefined names listed in Table 7-2.
Note: For more information about the JSL -T timeout refer to "*SERVERS Section."
java.lang.Object
|
+----bea.jolt.Session
|
+----bea.jolt.JoltSession
The JoltSession class represents the logon session object and is used to access available TUXEDO services. The GUI-based Jolt Repository handles the propagation of TUXEDO services to Jolt client applications. (For more information about the Jolt Repository, see Chapter 5, "Using the Jolt Repository Editor.") The programmer must instantiate an object for each logon session. The JoltSession object communicates data from, and connects to the TUXEDO System. The session ends with a call using the endSession()
method.
The JoltSession object is passed, by reference, to the JoltRemoteService and JoltTransaction objects. All Jolt transactions must pass a JoltSession to access the TUXEDO application.
public classJoltSession
{
// JoltSession Constructor
public JoltSession( JoltSessionAttributes attr, String
userName, String userRole, String userPassword, String
appPassword ) throws SessionException;
// JoltSession Method
public void endSession( )throws SessionException;
public finalisAlive
( );
public voidonReply
( JoltReplyreply
);
protected voidfinalize
( );
}
For more information see the following classes: JoltSessionAttributes, JoltRemoteService, JoltTransaction, JoltReply.
The JoltSession constructor creates a JoltSession object with attributes from the JoltSessionAttributes class. The JoltSession object is the logon to the target system which is identified in the APPADDRESS name of the JoltSessionAttributes. In addition, programmers can specify the IDLETIMEOUT value (in seconds) in JoltSessionAttributes to hint to the system when to drop the network connection while retaining the session. Value 0 means the network connection should be retained throughout the session. The administrator can override the behavior.
The programmer can set all other parameters for this constructor to null, depending upon the authentication level.
Creates an instance of the JoltSession class with the specified attributes.
Synopsis
JoltSession( JoltSessionAttributes attr, String userName,
String userRole, String userPassword, String appPassword )
throws SessionException;Usage
The JoltSession class creates an instance of the JoltSession class with the specified attributes. Specific components are extracted to assist in joining an application and terminating a session.
JoltSession allows the user identified by the userName parameter to log on to the Jolt/TUXEDO system. All parameters must be set according to the authentication level. If the logon is not successful, a SessionException is thrown. The object is returned upon completion.
Throws
The JoltSession constructor throws the following exceptions:
SessionException
TPEJOLT: Missing host name or missing port number.
TPEJOLT: Protocol Error
TPEJOLT: Network Error
TPEJOLT: Can't connect to (host name)
The JoltSession constructor throws the following TUXEDO errors:
tpinit
(3)TPEINVAL, TPENOENT, TPEPERM, TPEPROTO, TPESYSTEM, TPEOS
Refer to "TUXEDO Errors" in Appendix A ortperrno
(5) in the TUXEDO System Reference Manual for explanations of these error messages.
JoltSession Method
The JoltSession class contains one method, the endSession method, for handling session logoff activities, two additional methods,
isAlive()
andonReply()
for handling event subscription, and the overriddenfinalize()
method.
Performs a session termination procedure.
Synopsis
voidendSession
( ) throws SessionException;Usage
The
endSession
method is used to terminate the session and obsolete the session object. TheendSession
method allows the user to log off the Jolt/TUXEDO system. When logged off, the session is invalid.Throws
The
endSession()
method throws the following exceptions:SessionException
TPEJOLT: Invalid Session
TPEJOLT: Connection send error
The
endSession()
method generates a Jolt exception upon receipt of one of the following TUXEDO errors:tpterm
():TPEPROTO, TPESYSTEM, TPEOS
See Also
"TUXEDO Errors" in Appendix A or
tperrno
(5) in the TUXEDO System Reference Manual.
Checks if the session is still alive.
Synopsis
booleanisAlive
() throws SessionExceptionUsage
The
isAlive
method will return a Boolean (true/false) value indicating whether the client session is valid or not. The validity of the client session is checked at the Jolt Session Handler (JSH). If a client which is operating in connection-less mode callsisAlive()
while its network connection is closed, this method will cause the network connection to be re-opened and closed.Returns
True if this session is still alive; false otherwise.
Throws
The
isAlive()
method throws aSessionException
.
Is the default event handler for all events.
Synopsis
voidonReply
( JoltReplyreply
)Parameter
reply
Specifies an object containing the data message.
Usage
This method is the default event handler for all events. This method is invoked by Jolt applications and it should be overridden by the user. Client application developers need to provide an implementation of the
onReply()
method to invoke when any notification is received. TheJoltReply
object that is passed to theonReply()
method contains any data that is included with the notification. The application can use the methods inJoltReply
andJoltMessage
to retrieve this data.Since Jolt is a multithreaded environment, the
onReply()
method executes on a separate thread simultaneously with other application threads. You must, therefore, write a thread-safe handler. Separate threads could be executing theonReply()
method concurrently, so the method must be written to accommodate this possibility. Alternately, you can declare theonReply()
method as synchronized-this will cause all its invocations to be serialized.Overrides
The
onReply
method overrides anotheronReply()
method.
Calls the
endSession()
method if anendSession()
has never been called.Synopsis
protected voidfinalize
( )Usage
This method is automatically called by the Java garbage collector.
Overrides
The
finalize
method overridesjava.lang.Object.finalize()
.
java.lang.Object
|
+----bea.jolt.JoltRequestMessage
|
+----bea.jolt.JoltRemoteService
The JoltRemoteService class is a subclass (child class) of the JoltRequestMessage class. It is derived from and inherits the characteristics of its parent class, JoltRequestMessage. The JoltRemoteService object is reusable; therefore, the programmer should invoke the JoltRequestMessage clear
method to reset any previous data (such as flags, priority, and parameters) before invoking the object again.
JoltRemoteService
is used to perform the Request/Reply call. To make a call, the programmer:
add
methods from
JoltRequestMessage to add the parameters.
The JoltRemoteService methods are described as part of the JoltRequestMessage class. Refer to the JoltRequest Message, JoltSession, and JoltTransaction classes for additional information.
public classJoltRemoteService
extends JoltRequestMessage
{
publicJoltRemoteService
( String name, JoltSession s ) throws
ServiceException;
// JoltRemoteService methods
public voidcall
( Transaction t )
throws ServiceException,
TransactionException, ApplicationException
}
The following JoltRemoteService constructor is used to create instances of the JoltRemoteService class.
Defines a constructor for a remote service object.
Synopsis
JoltRemoteService( String name, JoltSession s ) throws
ServiceException;Usage
JoltRemoteService
defines the constructor for a remote service object. Thename
parameter specifies the service name. The s parameter specifies the session object from the JoltSession class. This constructor receives the most current version from a repository that holds the service definitions. If the service does not exist, an exception is thrown.Throws
ServiceException
TPENOENT - Service (service name) is not available.
TPEJOLT - Invalid session
TPEJOLT - bea.jolt.DefinitionException: Invalid (message)
JoltRemoteService Methods
Provides the means to call a transaction service for the
JoltRemoteService
object.
The
call
method calls the specified service.Synopsis
void call( Transaction t ) throws ApplicationException,
TransactionException, ServiceException;Usage
The
call
method calls the service. The t parameter specifies the transaction object. The transaction must belong to the same session as the current service. If a TUXEDO error (not service failure) occurs, the call method throws aServiceException
.You can pass a null to this
call
method to call services without defining a JoltTransaction object or to exclude the services from a transaction.You can use a
getErrno
to retrieve the TUXEDO error code and error message from theServiceException
. If there is a service failure (i.e.,TPESVCFAIL
), the call method throws a runtime exception,ApplicationException
.When programming in multithreaded mode, if the transaction is aborted, all outstanding calls associated with such a transaction receive a
TransactionException
with a TPEABORT error code. The associated message contains the service name.To call services without defining a JoltTransaction object or to exclude the services from a transaction, you can pass a null to the call method.
Throws
ApplicationException
(application code) - "this" object is included.
ServiceException
TPEJOLT: Invalid session
TPEJOLT: Connection send error
TPEJOLT: Connection recv error
TPEJOLT: Protocol error
TPEJOLT: bea.jolt.BufException:....
TPEJOLT: bea.jolt.MessageException:...
TransactionException
TPEJOLT - Invalid Transaction
TPEABORT - (service name)
The
call()
method generates an exception upon receipt of the following TUXEDO errors:tpcall
TPEINVAL, TPENOENT, TPEITYPE, TPETRAN,
TPETIME, TPESVCFAIL, TPESVCERR, TPEBLOCK,
TPGOTSIG, TPEPROTO, TPESYSTEM, TPEOS
See Also
"TUXEDO Errors" in Appendix A or
tperrno
in the TUXEDO System Reference Manual.
JoltRequestMessage is an abstract class whose main purpose is to serve as a base or parent class for JoltRemoteService. The JoltRemoteService class extends from (or is a subclass of) the JoltRequestMessage. All of the methods provided for the JoltRequestMessage class only work with the JoltRemoteService class.
Note: All JoltRequestMessage method exceptions are caught by the Java virtual machine by default.
public abstract class JoltRequestMessage
{
public StringgetName
();
public voidsetRequestPriority
( int priority );
public intgetApplicationCode
();
public voidclear
();
public voidaddByte
( String name, byte val );
public voidaddShort
( String name, short val );
public voidaddInt
( String name, int val );
public voidaddFloat
( String name, float val );
public voidaddDouble
( String name, double val );
public voidaddString
( String name, String val );
public voidaddBytes
( String name, byte[] val, int len );
public voiddelete
( String name );
public voiddeleteItem
( String name, int itemNo );
public voidsetByte
( String name, byte value );
public voidsetShort
( String name, short value );
public voidsetInt
( String name, int value );
public voidsetFloat
( String name, float value );
public voidsetDouble
( String name, double value );
public voidsetString
( String name, String value );
public voidsetBytes
( String name, byte[] value, int len );
public voidsetByteItem
( String name, int itemNo, byte val );
public voidsetShortItem
( String name, int itemNo, short val );
public voidsetIntItem
( String name, int itemNo, int val );
public voidsetFloatItem
( String name, int itemNo, float val );
public voidsetDoubleItem
( String name, int itemNo, double val );
public voidsetStringItem
( String name, int itemNo, String val );
public voidsetBytesItem
( String name, int itemNo, byte[] val,
int len);
public intgetOccurrenceCount
( String name );
public bytegetByteDef
( String name, byte defValue );
public shortgetShortDef
( String name, short defValue );
public intgetIntDef
( String name, int defValue );
public floatgetFloatDef
( String name, float defValue );
public doublegetDoubleDef
( String name, double defValue );
public StringgetStringDef
( String name, String defValue );
public byte[]getBytesDef
( String name, byte[] defValue );
public bytegetByteItemDef
( String name, int itemNo, byte def
The JoltRequestMessage methods are used in conjunction with the abstract JoltRequestMessage class. These methods are divided into five categories: the clear method, get methods, set methods, add methods, and delete methods.
Note:
The clear()
method removes JoltRequestMessage settings.
The get JoltRequestMessage methods are used to get values from the remote service object. These methods encompass two types of get methods: service and request methods, and output parameter methods.
Service and Request Methods. The service methods handle queries about service attributes such as the name of the current service, or the application code (i.e., tpusrcode
in ATMI). These methods include:
The corresponding set methods for these get methods are located in the "setByte" section.
The set methods are used to set values for the remote service object. These methods manipulate the input parameters. The set JoltRequestMessage methods are divided into two categories:
Service and Request Method. The service method sets the request priority service attribute, this includes:
Set Methods
In the following example, the All indexes specified by itemNo start at 0 and increment. Therefore, the second item in a list is actually itemNo 1 and the first item in the list is actually itemNo 0.
The add and delete methods are used to add or delete values for the remote service object. These methods manipulate the input parameters. These methods include:
setStringItem
method is used to change the name John to Jim. The itemNo parameter specifies a list of names. Currently, the name John exists for itemNo 2. To change the name you might write:
setStringItem ("names", 2, "jim");
Add and Delete Methods
Resets all input/output parameters or any information.
Synopsis
void clear();Usage
The
clear()
method handles removal of parameter settings or information set by the JoltRequestMessage class.
Gets the application code returned by the service.
Synopsis
int getApplicationCode();Usage
The
getApplicationCode()
method is equivalent totpurcode
or thercode
in the TUXEDOtpreturn
(3).Returns
This method returns an integer value (32-bit).
Gets the name of the current service.
Synopsis
String getName();Returns
This method returns a string value.
Gets the number of occurrences of a specified item.
Synopsis
int getOccurrenceCount( String name );Usage
This method retrieves the number of occurrences of an item specified by the
name
parameter. The item must be one of the result or output parameters.Returns
This method returns an integer value (32-bit).
Throws
java.lang.NoSuchFieldError
.(field name) Attempt to get a field that is not defined for this service.
Gets the byte value of a specified parameter.
Synopsis
byte getByteDef( String name, byte defValue );Usage
This method gets the byte value of the
name
parameter or the specifieddefValue
, if the name does not exist. The item must be one of the result or output parameters.Returns
This method returns a byte value (8-bit).
Throws
java.lang.NoSuchFieldError
.(field name) Attempt to get a field that is not defined for this service.
Gets the byte array value of a specified parameter.
Synopsis
byte[ ] getBytesDef( String name, byte[] defValue );Usage
This method gets the byte array value of the first item specified in the
name
parameter or the specifieddefValue
, if the name does not exist.Returns
This method returns an array of byte values.
Throws
java.lang.NoSuchFieldError
.(field name) Attempt to get a field that is not defined for this service.
Gets the double precision value of a specified parameter.
Synopsis
double getDoubleDef( String name, double defValue );Usage
This method gets the double precision value of the item specified in the
name
parameter or the specifieddefValue
, if the name does not exist.Returns
This method returns a double precision value (64-bit).
Throws
java.lang.NoSuchFieldError
.(field name) Attempt to get a field that is not defined for this service.
Gets the floating point value of a specified parameter.
Synopsis
float getFloatDef( String name, float defValue );Usage
This method gets the floating point value of the item specified in the
name
parameter or the specifieddefValue
, if the name does not exist.Returns
This method returns a floating point value (32-bit).
Throws
java.lang.NoSuchFieldError
.(field name) Attempt to get a field that is not defined for this service.
Gets the integer value of a specified parameter.
Synopsis
int getIntDef( String name, int defValue );Usage
This method gets the integer value of the item specified in the
name
parameter or the specifieddefValue
, if the name does not exist.Returns
This method returns an integer value (32-bit).
Throws
java.lang.NoSuchFieldError
.(field name) Attempt to get a field that is not defined for this service.
Gets the short integer value of a specified parameter.
Synopsis
short getShortDef( String name, short defValue );Usage
This method gets the short integer value (16-bit) of the item specified in the
name
parameter or the specifieddefValue
, if the name does not exist.Returns
This method returns a short integer value (16-bit).
Throws
java.lang.NoSuchFieldError
.(field name) Attempt to get a field that is not defined for this service.
The
getStringDef()
method gets the string value of a specified parameter.Synopsis
String getStringDef( String name, String defValue );Usage
This method gets the string value of the item specified in the
name
parameter or the specifieddefValue
, if the name does not exist. The default value can be a null string or any string that you specify.Returns
This method returns a string value.
Throws
java.lang.NoSuchFieldError
.(field name) Attempt to get a field that is not defined for this service.
Gets the byte item.
Synopsis
byte getByteItemDef( String name, int itemNo, byte def );Usage
This method gets the byte value of the itemNo of the
name
parameter. If the item does not exist, the get method returns the default value.Returns
This method returns a byte value (8-bit).
Throws
java.lang.NoSuchFieldError
.(field name) Attempt to get a field that is not defined for this service.
Gets the byte array item.
Synopsis
byte[] getBytesItemDef( String name, int itemNo, byte[] def );Usage
This method gets the byte value of the itemNo of the
name
parameter. If the item does not exist, the get method uses the default value.Returns
This method returns a byte value (8-bit).
Throws
java.lang.NoSuchFieldError
.(field name) Attempt to get a field that is not defined for this service.
Gets the double precision item.
Synopsis
double getDoubleItemDef( String name, int itemNo, double def );Usage
This method gets the double precision value of the itemNo of the
name
parameter. If the item does not exist, the get method returns the default value.Returns
This method returns a double precision value (64-bit).
Throws
java.lang.NoSuchFieldError
.(field name) Attempt to get a field that is not defined for this service.
Gets the floating point item.
Synopsis
float getFloatItemDef( String name, int itemNo, float def );Usage
This method gets the floating point value of the itemNo of the
name
parameter. If the item does not exist, the get method returns the default value.Returns
This method returns a floating point value (32-bit).
Throws
java.lang.NoSuchFieldError
.(field name) Attempt to get a field that is not defined for this service.
Gets the integer item.
Synopsis
int getIntItemDef( String name, int itemNo, int def );Usage
This method gets the integer value of the itemNo of the
name
parameter. If the item does not exist, the get method returns the default value.Returns
This method returns an integer value (32-bit).
Throws
java.lang.NoSuchFieldError
.(field name) Attempt to get a field that is not defined for this service.
Gets the short item.
Synopsis
short getShortItemDef( String name, int itemNo, short def );Usage
This method gets the short value of the itemNo of the
name
parameter. If the item does not exist, the get method returns the default value.Returns
This method returns a short integer value (16-bit).
Throws
java.lang.NoSuchFieldError
.(field name) Attempt to get a field that is not defined for this service.
Gets the string value of a specified item.
Synopsis
String getStringItemDef( String name, int itemNo, String def );Usage
This method gets the string value of the itemNo of the
name
parameter. If the item does not exist, the get method returns the default value.Returns
This method returns a string value.
Throws
java.lang.NoSuchFieldError
. (field name) Attempt to get a field that is not defined for this service.
Sets the request priority service attribute.
Synopsis
void setRequestPriority( int priority );Parameter
priority
Specify a priority value between 1 and 100 inclusive.
Usage
Sets the absolute request priority for the current service. It is set until
clear()
is called.
Sets the value of the specified item.
Synopsis
void setByte( String name, byte value );Usage
Sets the value of the item specified in the
name
parameter to the byte value specified in the value parameter. The value is an 8-bit byte.Throws
java.lang.IllegalAccessError
.(field name) - Attempt to set a value to an output parameter field.
java.lang.NoSuchFieldException
.(field name) - Attempt to set a field which is not defined for this service.
Sets the value of the specified item.
Synopsis
void setBytes( String name, byte[ ] value, int len );Usage
Sets the value of the item specified in the
name
parameter to the byte array value specified in the value parameter, with the length set by the len parameter. The value is in 8-bit bytes.Throws
java.lang.IllegalAccessError
.(field name) Attempt to set a value to an output parameter field.
java.lang.NoSuchFieldException
.(field name) Attempt to set a field which is not defined for this service.
Sets the double precision value of the specified item.
Synopsis
void setDouble( String name, double value );Usage
Sets the value of the item specified in the
name
parameter to the double precision (64-bit) value specified in the value parameter.Throws
java.lang.IllegalAccessError
.(field name) Attempt to set a value to an output parameter field.
java.lang.NoSuchFieldException
.(field name) - Attempt to set a field which is not defined for this service.
Sets the floating point value of the specified item.
Synopsis
void setFloat( String name, float value );Usage
Sets the value of the item specified in the
name
parameter to the floating point (32-bit) value specified in the value parameter.Throws
java.lang.IllegalAccessError
.(field name) - Attempt to set a value to an output parameter field.
java.lang.NoSuchFieldException
.(field name) - Attempt to set a field which is not defined for this service.
Sets the integer value of the specified item.
Synopsis
void setInt( String name, int value );Usage
Sets the value of the item specified in the
name
parameter to the integer (32-bit) value specified in the value parameter.Throws
java.lang.IllegalAccessError
.(field name) Attempt to set a value to an output parameter field.
java.lang.NoSuchFieldException
.(field name) Attempt to set a field which is not defined for this service.
Sets the short integer value of the specified item.
Synopsis
void setShort( String name, short value );Usage
Sets the value of the item specified in the
name
parameter to the short (16-bit) integer value specified in the value parameter.Throws
java.lang.IllegalAccessError
.(field name) Attempt to set a value to an output parameter field.
java.lang.NoSuchFieldException
.(field name) Attempt to set a field which is not defined for this service.
Sets the string value of the specified item.
Synopsis
void setString( String name, String value );Usage
Sets the value of the item specified in the
name
parameter to the string value specified in the value parameter.Throws
java.lang.IllegalAccessError
.(field name) Attempt to set a value to an output parameter field.
java.lang.NoSuchFieldException
.(field name) Attempt to set a field which is not defined for this service.
Sets a named item at a specified index with a byte value.
Synopsis
void setByteItem( String name, int itemNo, byte value );Usage
Sets the item specified in the
name
parameter at the index specified by itemNo with the byte value specified by the value parameter. If the item already exists, the value is overwritten.Throws
java.lang.IllegalAccessError
.(field name) Attempt to set a value to an output parameter field.
java.lang.NoSuchFieldException
.(field name) Attempt to set a field which is not defined for this service.
Sets a named item at a specified index with a byte value.
Synopsis
void setBytesItem( String name, int itemNo, byte[] value, int len );Usage
Sets the item specified in the
name
parameter at the index specified by itemNo with the byte array value specified by the value parameter. If the item already exists, the value is overwritten.Throws
java.lang.IllegalAccessError
.(field name) Attempt to set a value to an output parameter field.
java.lang.NoSuchFieldException
.(field name) Attempt to set a field which is not defined for this service.
Sets a named item at a specified index with a double precision value.
Synopsis
void setDoubleItem( String name, int itemNo, double value );Usage
Sets the item specified in the
name
parameter at the index specified by itemNo with the double precision value specified by the value parameter. If the item already exists, the value is overwritten.Throws
java.lang.IllegalAccessError
.(field name) Attempt to set a value to an output parameter field.
java.lang.NoSuchFieldException
.(field name) Attempt to set a field which is not defined for this service.
Sets a named item at a specified index with a floating point value.
Synopsis
void setFloatItem( String name, int itemNo, float value);Usage
Sets the item specified in the
name
parameter at the index specified by itemNo with the floating point value specified by the value parameter. If the item already exists, the value is overwritten.Throws
java.lang.IllegalAccessError
.(field name) Attempt to set a value to an output parameter field.
java.lang.NoSuchFieldException
.(field name) Attempt to set a field which is not defined for this service.
Sets a named item at a specified index with a integer value.
Synopsis
void setIntItem( String name, int itemNo, int value);Usage
Sets the item specified in the
name
parameter at the index specified by itemNo with the integer value specified by the value parameter. If the item already exists, the value is overwritten.Throws
java.lang.IllegalAccessError
.(field name) Attempt to set a value to an output parameter field.
java.lang.NoSuchFieldException
.(field name) Attempt to set a field which is not defined for this service.
Sets a named item at a specified index with a short integer value.
Synopsis
void setShortItem( String name, int itemNo, short value );Usage
Sets the item specified in the
name
parameter at the index specified by itemNo with the short value specified by the value parameter. If the item already exists, the value is overwritten.Throws
java.lang.IllegalAccessError
.(field name) Attempt to set a value to an output parameter field.
java.lang.NoSuchFieldException
.(field name) Attempt to set a field which is not defined for this service.
Sets a named item at a specified index with a string value.
Synopsis
void setStringItem( String name, int itemNo, string value );Usage
Sets the item specified in the
name
parameter at the index specified by itemNo with the string value specified by the value parameter. If the item already exists, the value is overwritten.Throws
java.lang.IllegalAccessError
.(field name) Attempt to set a value to an output parameter field.
java.lang.NoSuchFieldException
.(field name) Attempt to set a field which is not defined for this service.
Adds the byte input parameters.
Synopsis
void addByte( String name, byte val );Usage
The
addByte()
method adds specified byte items to the input parameters.Throws
java.lang.IllegalAccessError
.(field name) Attempt to add a value to an input parameter field, or delete a value from an input parameter field.
java.lang.NoSuchFieldError
.(field name) Attempt to add or delete a field that is not defined for this service.
Adds the byte array input parameter.
Synopsis
void addBytes( String name, byte[] val, int len );Usage
The
addBytes()
method adds the byte value (8-bit) of the item specified in thename
parameter.Throws
java.lang.IllegalAccessError
.(field name) Attempt to add a value to an input parameter field, or delete a value from an input parameter field.
java.lang.NoSuchFieldError
.(field name) Attempt to add or delete a field that is not defined for this service.
Adds the double precision input parameter.
Synopsis
void addDouble( String name, double val );Usage
The
addDouble()
method adds the double precision value (64-bit) of the item specified in thename
parameter.Throws
java.lang.IllegalAccessError
.(field name) Attempt to add a value to an input parameter field, or delete a value from an input parameter field.
java.lang.NoSuchFieldError
.(field name) Attempt to add or delete a field that is not defined for this service.
Adds the floating point input parameter.
Synopsis
void addFloat( String name, float val );Usage
The
addFloat()
method adds the floating point value (32-bit) of the item specified in thename
parameter.Throws
java.lang.IllegalAccessError
.(field name) Attempt to add a value to an input parameter field, or delete a value from an input parameter field.
java.lang.NoSuchFieldError
.(field name) Attempt to add or delete a field that is not defined for this service.
Adds the integer input parameter.
Synopsis
void addInt( String name, int val );Usage
The
addInt()
method adds the integer value (32-bit) of the item specified in thename
parameter.Throws
java.lang.IllegalAccessError
.(field name) Attempt to add a value to an input parameter field, or delete a value from an input parameter field.
java.lang.NoSuchFieldError
.(field name) Attempt to add or delete a field that is not defined for this service.
Adds the short integer value (16-bit) input parameter.
Synopsis
void addShort( String name, short val );Usage
This method adds the short integer value (16-bit) of the item specified in the
name
parameter.Throws
java.lang.IllegalAccessError
.(field name) Attempt to add a value to an input parameter field, or delete a value from an input parameter field.
java.lang.NoSuchFieldError
.(field name) Attempt to add or delete a field that is not defined for this service.
Adds the string value input parameter.
Synopsis
void addString( String name, String val );Usage
This method adds the string value of the item specified in the
name
parameter.Throws
java.lang.IllegalAccessError
.(field name) Attempt to add a value to an input parameter field, or delete a value from an input parameter field.
java.lang.NoSuchFieldError
.(field name) Attempt to add or delete a field that is not defined for this service.
Deletes a first occurrence of the named item or any existing item.
Synopsis
void delete( String name );Usage
This method deletes the first named item. The named item must be one of the input parameters.
Throws
java.lang.IllegalAccessError
.(field name) Attempt to add a value to an input parameter field, or delete a value from an input parameter field.
java.lang.NoSuchFieldError
.(field name) Attempt to add or delete a field that is not defined for this service.
Deletes an occurrence of an existing named item.
Synopsis
void deleteItem( String name, int itemNo );Usage
This method deletes an existing named item (input parameter). If the item does not exist, an exception will be thrown. The deleteItem method without the itemNo parameter is equivalent to delete methods with itemNo 0 (i.e., first occurrence).
Throws
java.lang.IllegalAccessError
.(field name) Attempt to add a value to an input parameter field, or delete a value from an input parameter field.
java.lang.NoSuchFieldError
.(field name) Attempt to add or delete a field that is not defined for this service.
java.lang.Object
|
+----bea.jolt.Transaction
|
+----bea.jolt.JoltTransaction
The JoltTransaction class is the explicit transaction model for Jolt. The JoltTransaction class implements the transaction object. This object can be used by JoltRemoteService to include several services into a single transaction. When a transaction is timed out, the user must rollback the transaction immediately. Due to the current implementation of TUXEDO, only one transaction object can be instantiated at one time.
Refer also to the JoltRemoteService and JoltSession classes.
public classJoltTransaction
{
publicJoltTransaction
( int timeout, JoltSession s) throws
TransactionException;
public voidcommit
() throws TransactionException;
public voidrollback
() throws TransactionException;
}
The JoltTransaction class provides a constructor to create the JoltTransaction object.
Creates an instance of the JoltTransaction object with the specified parameters.
Note: You can pass a null to the JoltRemoteService
call()
method to call services without defining a JoltTransaction object or to exclude the services from a transaction.Synopsis
publicJoltTransaction
( int timeout, JoltSession s) throws TransactionException;Usage
The constructor (or the method that is invoked automatically when a new instance of a class is created) implies the beginning of the transaction. The s (session) parameter in the constructor ensures that the transaction does not span over multiple sessions. The current Jolt release allows only one transaction per session.
JoltTransaction
requires that you set the timeout for a transaction. Specifying a timeout parameter of zero, sets the timeout to the maximum value for the system. If the transaction is not completed within this period of time (the time between thetpbegin()
and thetpcommit()
), then Jolt generates aTransactionException
.The RECVTIMEOUT for each transactional
JoltRemoteService.call()
is automatically adjusted to the proper timeout value.Throws
TransactionException
TPEJOLT: Invalid session
TPEJOLT: Connection send error
TPEJOLT: Connection recv error
TPEJOLT: Protocol error
The JoltTransaction constructor generates an exception upon receipt of the following TUXEDO errors:
tpbegin
TPEINVAL, TPETRAN, TPEPROTO, TPESYSTEM, TPEOS
See Also
"TUXEDO Errors" in Appendix A or
tperrno
(5) in the TUXEDO System Reference Manual.JoltTransaction Methods
The JoltTransaction methods provide the means to start or end a transaction process. The following methods handle commit and rollback transaction processing for the JoltTransaction class.
Performs the transaction commit.
Synopsis
voidcommit
()Usage
After
commit()
is called, the object is obsolete.Throws
TransactionException
TPEJOLT: Invalid transaction
TPEJOLT: Connection send error
TPEJOLT: Connection recv error
TPEJOLT: Protocol error
TPEABORT: Requests pending
The
commit()
method generates an exception upon receipt of the following TUXEDO errors:tpcommit
(3)TPEINVAL, TPETIME, TPEABORT, TPEHEURISTIC, TPEHAZARD, TPEPROTO, TPESYSTEM, TPEOS
Aborts the transaction.
Synopsis
voidrollback
()Usage
After
rollback()
is called, the object is obsolete.Throws
TransactionException
TPEJOLT: Invalid transaction
TPEJOLT: Connection send error
TPEJOLT: Connection recv error
TPEJOLT: Protocol error
The
rollback()
method generates an exception upon receipt of the following TUXEDO errors:tpabort
(3)TPEINVAL, TPEHEURISTIC, TPEHAZARD, TPEOS, TPEPROTO, TPESYSTEM
See Also
"TUXEDO Errors" in Appendix A or tperrno(5) in the TUXEDO System Reference Manual.
java.lang.Object
|
+----bea.jolt.JoltEvent
The JoltEvent class extends the java.lang.Object
class and is a base class for various event subscriptions. This class is not designed to be instantiated directly. The JoltEvent class provides some common implementations for all subscriptions. An event can be a notification event or service event. A notifiable event generates an event subscription while a service event invokes a service.
For additional information, refer also to the JoltSession class.
public class
JoltEvent
unsubscribe
()
unsubscribeAll
(Session)
The following methods are used with the JoltEvent class.
Deletes the subscription to an event.
Synopsis
public int unsubscribe()Usage
This method is used to stop subscribing to the event specified in the constructor. Once it is unsubscribed, this object becomes obsoleted. All notifications received as a result of a subscription will cause the
onReply()
method in the session to be invoked.Returns
Number of subscriptions deleted.
Throws
EventException
.No such event or invalid event.
SessionException
.An error occurs in this session.
Unsubscribes all event subscriptions in the specified session.
Synopsis
public static intunsubscribeAll
(Session
session)Usage
Unsubscribe all event subscriptions in the specified session. The session parameter requires a Jolt session object.
Returns
Number of subscriptions deleted.
Throws
EventException
.Unsubscription error from TUXEDO.
SessionException
.Invalid session or a session error.
java.lang.Object
|
+----bea.jolt.JoltEvent
|
+----bea.jolt.JoltUserEvent
The JoltUserEvent class extends JoltEvent. JoltUserEvent implements a subscription to an asynchronous (async) notification event. An async notification is either an unsolicited event notification or event notification from the TUXEDO Event Broker. Unsolicited notifications are produced in response to a TUXEDO tpnotify()
call or a TUXEDO tpbroadcast()
call. Event notifications are produced as a result of a TUXEDO tppost()
call.
The JoltUserEvent class is used in Jolt 1.1 to support notification. This class provides support for both unsolicited notification (produced as a result of tpnotify()
or tpbroadcast()
) and event notifications (produced as a result of tppost()
).
The String JoltUserEvent.UNSOLMSG
in the class is a constant which the application programmer uses to request unsolicited messages.
Note: In TUXEDO, an unsolicited notification is indistinguishable from event notification. This is also reflected in Jolt.
The handler for unsolicited notification and event notification is done in the Session object. A thread is used in this class to monitor any incoming messages.
For additional information, refer also to the JoltSession, JoltMessage, and JoltReply classes.
public class JoltUserEventUNSOLMSG
(String, String, Session)
JoltUserEvent
The regular expression constant for unsolicited notification subscription.
Synopsis
final staticString
UNSOLMSGJoltUserEvent Methods
The following methods are used with the JoltUserEvent class.
Subscribes to the specific asynchronous notification.
Synopsis
JoltUserEvent
(String expr, String filter, Session session)
throws EventException, SessionExceptionParameters
expr
JoltUserEvent.UNSOLMSG
for unsolicited notification or a regular expression for event notification. The parameter expr is a string containing a regular expression of the same format as the event expression used intpsubscribe()
. The maximum length of this parameter is 255 characters. Setting this parameter to the constantJoltUserEvent.UNSOLMSG
will allow the client to receive unsolicited messages (generated as a result oftpnotify()
ortpbroadcast()
).
filter
Null or Boolean expression. The parameter filter is a string of the same format as the filter parameter passed to
tpsubscribe()
. The maximum length of this parameter is 255 characters. Filter rules are specific to the buffers to which they are applied. Refer to TUXEDO documentation for complete explanation of the filtering function. Filtering is done on the TUXEDO server, not the Jolt client.
session
A JoltSession object. The parameter session is the JoltSession to which the subscription is bound. An event is bound to a single session.
Usage
This constructor subscribes the specific asynchronous notification. An asynchronous notification may be an unsolicited notification or event notification. If the expr is
JoltUserEvent.UNSOLMSG
, the filter must be null. Otherwise, the filter can be either null or a Boolean expression (seeFboolco
(3) in the TUXEDO System Reference Manual).This constructor will return a
JoltUserEvent
object, which will provide notification when the event identified by the parameter event occurs.Throws
SessionException
.Invalid session or a session error.
EventException
.Filter for unsolicited subscription is not null, or event subscription failed.
java.lang.Object
|
+----bea.jolt.JoltReply
The JoltReply class extends the java.lang.Object
. JoltReply is a place holder of the message for unsolicited messages or event notifications. This class provides the application with access to any message received with a TUXEDO event or notification.
public class JoltReply
MessagegetMessage
()
The following method is used with the JoltReply class.
Gets the response message.
Synopsis
Message getMessage()Usage
The
getMessage()
method returns a JoltMessage object. The returned object provides the application with access to any data that is associated with the event or notification.Returns
The
getMessage()
method returns a message object.
java.lang.Object
|
+----bea.jolt.Message
|
+----bea.jolt.JoltMessage
The JoltMessage class extends java.lang.Object
. This class implements the Message class, which encapsulates the attribute-value pair data for the application protocol. This class allows the user to get an output attribute to the message. For more information, refer also to the JoltReply classes.
public class JoltMessage
//These methods are duplicates of the JoltRequestMessage class
//They are inherited from that class.
public intgetOccurrenceCount
(Stringname
);
public bytegetByteDef
(Stringname
, bytedef
);
public shortgetShortDef
(Stringname
, shortdef
);
public intgetIntDef
(String name, int def);
public floatgetFloatDef
(Stringname
, floatdef)
;
public doublegetDoubleDef
(String name, double def);
public StringgetStringDef
(Stringname
,Stringdef
);
public byte[]getBytesDef
(Stringname
, bytedef
[]);
public bytegetByteItemDef
(Stringname
, intitemNo
, bytedef
);
public shortgetShortItemDef
(Stringname
, intitemNo
, shortdef
);
public intgetIntItemDef
(Stringname
, intitemNo
, intdef
);
public floatgetFloatItemDef
(Stringname
, intitemNo
, floatdef
);
public doublegetDoubleItemDef
(Stringname
, intitemNo
, doubledef)
;
public byte[]getBytesItemDef
(String name, int itemNo, byte
def[]);
public StringgetStringItemDef
(Stringname
, intitemNo
, Stringdef)
;
The following methods are used with the JoltMessage class.
Gets the number of occurrence of a named item.
Synopsis
synchronized intgetOccurrenceCount
(String name)Parameters
name
Specifies the name of the item.
Throws
NoSuchFieldError
.It is an invalid name.
Gets the first item based on its name.
Synopsis
public bytegetByteDef
(Stringname
, bytedef
)Parameters
name
Specifies the name of the item.
def
Specifies the default byte value.
Usage
Get the first item based on its name. If it does not exist, the default value will be returned.
Throws
NoSuchFieldError
.It is an invalid name.
Gets the first item based on its name.
Synopsis
shortgetShortDef
(Stringname
, shortdef
)Parameters
name
Specifies the name of the item.
def
Specifies the default short value.
Usage
Get the first item based on its name. If it does not exist, the default value will be returned.
Throws
NoSuchFieldError
. It is an invalid name.
IllegalAccessError
.Cannot delete an input item.
Gets the first item based on its name.
Synopsis
int getIntDef(String name, int def)Parameters
name
Specifies the name of the item.
def
Specifies the default int value.
Usage
Get the first item based on its name. If it does not exist, the default value will be returned.
Throws
NoSuchFieldError
. It is an invalid name.
IllegalAccessError
.Cannot delete an input item.
Gets the first item based on its name.
Synopsis
floatgetFloatDef
(Stringname
, floatdef
)Parameters
name
Specifies the name of the item.
def
Specifies the default float value.
Usage
Get the first item based on its name. If it does not exist, the default value will be returned.
Throws
NoSuchFieldError
. It is an invalid name.
Gets the first item based on its specified name.
Synopsis
doublegetDoubleDef
(String name, double def)Parameters
name
Specifies the name of the item.
def
Specifies the default double value.
Usage
Get the first item based on its specified name. If it does not exist, the default value is returned.
Throws
NoSuchFieldError
. It is an invalid name.
Gets the first item based on its name.
Synopsis
StringgetStringDef
(Stringname
,Stringdef
)Parameters
name
Specifies the name of the item.
def
Specifies the default string value.
Usage
Gets the first item based on its name. If it does not exist, the default value will be returned.
Throws
NoSuchFieldError
. It is an invalid name.
Gets the first item based on its name.
Synopsis
byte[]getBytesDef
(Stringname
, bytedef
[])Parameters
name
Specifies the name of the item.
def
Specifies the default byte-array value.
Usage
Get the first item based on its name. If it does not exist, the default value will be returned.
Throws
NoSuchFieldError
. It is an invalid name.
Gets an occurrence of a named item of byte data type.
Synopsis
bytegetByteItemDef
(Stringname
, intitemNo
, bytedef
)Parameters
name
Specifies the name of the item.
itemNo
Specifies the occurrence number of the item.
def
Specifies the default value.
Usage
The occurrence starts from 0. If it does not exist, the default value will be returned.
Returns
A byte value.
Throws
NoSuchFieldError
. It is an invalid name.
Gets an occurrence of a named item of short data type.
Synopsis
shortgetShortItemDef
(Stringname
, intitemNo
, shortdef
)Parameters
name
Specifies the name of the item.
itemNo
Specifies the occurrence number of the item.
def
Specifies the default value.
Usage
The occurrence starts from 0. If it does not exist, the default value will be returned.
Returns
A short value.
Throws
NoSuchFieldError
. It is an invalid name.
Gets an occurrence of a named item of int data type.
Synopsis
intgetIntItemDef
(Stringname
, intitemNo
, intdef
)Parameters
name
Specifies the name of the item.
itemNo
Specifies the occurrence number of the item.
def
Specifies the default value.
Usage
The occurrence starts from 0. If it does not exist, the default value will be returned.
Returns
An integer value.
Throws
NoSuchFieldError
. It is an invalid name.
Gets an occurrence of a named item of float data type.
Synopsis
floatgetFloatItemDef
(Stringname
, intitemNo
, floatdef
)Parameters
name
Specifies the name of the item.
itemNo
Specifies the occurrence number of the item.
def
Specifies the default value.
Usage
The occurrence starts from 0. If it does not exist, the default value will be returned.
Returns
A floating point value.
Throws
NoSuchFieldError
. It is an invalid name.
Gets an occurrence of a named item of double data type.
Synopsis
doublegetDoubleItemDef
(Stringname
, intitemNo
, doubledef
)Parameters
name
Specifies the name of the item.
itemNo
Specifies the occurrence number of the item.
def
Specifies the default value.
Usage
The occurrence starts from 0. If it does not exist, the default value will be returned.
Returns
A double precision value.
Throws
NoSuchFieldError
. It is an invalid name.
Gets an occurrence of a named item of byte-array data type.
Synopsis
byte[] getBytesItemDef(String name, int itemNo, byte def[])Parameters
name
Specifies the name of the item.
itemNo
Specifies the occurrence number of the item.
def
Specifies the default value.
Usage
The occurrence starts from 0. If it does not exist, the default value will be returned.
Returns
A byte-array object.
Throws
NoSuchFieldError
. It is an invalid name.
Gets an occurrence of a named item of string data type.
Synopsis
StringgetStringItemDef
(Stringname
, intitemNo
, Stringdef
)Parameters
name
Specifies the name of the item.
itemNo
Specifies the occurrence number of the item.
def
Specifies the default value.
Usage
The occurrence starts from 0. If it does not exist, the default value will be returned.
Returns
A string value.
Throws
NoSuchFieldError
. It is an invalid name.