Jolt 1.2 Developer's Guide

System.out.println("Successful deposit");
System.out.println("New balance is: " + dbal);
}
session.endSession();
System.exit(0);
} // end main
} // end SimXfer
The basic steps of the transaction process are as follows:
Set the connection attributes like hostname and portnumber in the JoltSessionAttribute object; see this line in the example:
sattr = new JoltSessionAttributes();
1.
The sattr.checkAuthenticationLevel() allows the application to determine the level of security required to log on to the server. Refer to the
following line in Example 6-1:
switch (sattr.checkAuthenticationLevel())
2.
The logon is done by instantiating a JoltSession object. Refer to the following lines in Example 6-1:
session = new JoltSession (sattr, userName, userRole,
userPassword, appPassword);
This example does not explicitly catch SessionException errors.
3.
All JoltRemoteService calls require a service to be specified and the session key returned from JoltSession(). Refer to the following lines in
Example 6-1:
withdrawal = new JoltRemoteService("WITHDRAWAL", session);
deposit = new JoltRemoteService("DEPOSIT", session);
These calls bind the service definition of both the WITHDRAWAL and DEPOSIT services, which are stored in the Jolt Repository, to the
withdrawal and deposit objects, respectively. The services WITHDRAWAL and DEPOSIT must be defined in the Jolt Repository otherwise a
ServiceException will be thrown. This example does not explicitly catch ServiceException errors.
4.
Once the service definitions are returned, the application-specific fields such as account number ACCOUNT_ID and withdrawal amount
SAMOUNT are automatically populated. Refer to the following lines in Example 6-1:
withdrawal.addInt("ACCOUNT_ID", 100000);
withdrawal.addString("SAMOUNT", "100.00");
5.