The BEAWEB components contain the objects specific for Microsoft Active Server Pages (ASP). These objects are:
This object provides a session pool factory for the Microsoft specific SessionPool object.
The following component creates an instance of the SessionPoolManager object.
Create a SessionPoolManager object.
The following methods are used in conjunction with the SessionPoolManager object:
SessionPoolManager Object
BEAWEB.SessionPoolManager Component
Synopsis
Server.CreateObject ("BEAWEB.SessionPoolManager")
Usage
SessionPoolManager Methods
done
()
Done with this session manager. Stops all session pools and terminates all active connections immediately.
intcreateSessionPool
(Stringaddrs[]
, Stringsaddrs[]
, intminCons
, intmaxCons
, UserInfousr
, Stringid
)
addrs
saddrs
minCons
maxCons
usr
id
Create a session pool with multiple restartable connections. The caller provides a unique ID to identify the session pool. If a connection in the session pool is terminated unexpectedly, a new connection will be established to keep the session pool alive. A session pool provides load-balancing among connections and failover capability by letting the user specify a primary server address list and a secondary server address list. The id must be null for this release.
The number of successful connections.
suspendSessionPool
(Stringid
, booleanaction
)
id
action
true
to suspend the session pool; false
to resume it.
Suspend this session pool so it will not accept any new requests. It allows the administrator to shut down the session pool gracefully. The ID must be null for this release. This method is part of the administrative object library.
stopSessionPool
(Stringid
)
id
Shut down a session pool; all active connections in the session are also terminated immediately. The ID must be null for this release. This method is part of the administrative class library.
removeSessionPool(Stringid
)
id
Shut down and remove the session pool; all active connections in this session pool are terminated immediately. The ID must be null for this release. This method is part of the administrative class library.
SessionPool getSessionPool(Stringid
)
id
Get the session pool. If the session pool does not exist, this method will return nothing. The ID must be null for this release.
A session pool or nothing if it does not exist.
This object provides a SessionPool implementation for the Microsoft Active Server Pages environment. It is created by the createSessionPool method in the SessionPoolManager object.
The SessionPool methods are used in conjunction with the SessionPool object:
Resultcall
(Stringname
, Stringindata
[]
, Transactiontran
)
name
indata
tran
Call a service with a transaction (or null for no transaction). The indata
is either a String array with name=value pairs or a null for an implicit ASP Request object. The name in the name=value pair should match the parameter name in the Jolt service definition. The member name in the Request object may have a trailing "_" and an index number (e.g., SBALANCE_0) if it is a multiple occurrence field. Any non-matching names in the indata parameter or Request object are ignored. The tran parameter must be the object returned by the startTransaction() method.
A Result object.
Transaction startTransaction(inttimeout
)
timeout
Start a transaction. The transaction should be committed or aborted before continuing to another page, unless programmatic arrangements to commit or abort the transaction have been made. Otherwise, the connection is locked until the transaction is terminated.
A transaction object, or nothing if failure occurs.
ConnectiongetConnection
(intindex
)
index
Get a connection. This method is part of the administrative API.
int setMaxConnections(intmaxCons
)
maxCons
Change the session pool size. Currently shrinking the session pool is disallowed. This method is part of the administrative class library.
The new pool size.
int getMaxConnections()
Get the maximum number of connections configured in this session pool. This method is part of the administrative class library.
booleanisSuspended
()
Check if this session pool is suspended, so it does not accept any new requests. This method is part of the administrative class library.
This object provides the Template implementation for the Microsoft Application Server Pages. The output of the template content is sent to the web server response buffer.
The following component creates an instance of the Template object.
Server.CreateObject ("BEAWEB.Template")
The following methods are used in conjunction with the Template object:
inteval
(TemplateDatadata
[]
)
data
Process the cached template with a list of data set and send the processed template to the response buffer. The list must be a VBScript Array object.
0 if success; -1 for any error.
intevalFile
(Stringpath
, TemplateDatadata
[]
)
path
data
Replace the tags in a template file with the values from a list of template data set. The list is an array object.
0 if success; -1 if the template file cannot be opened or there is an I/O error.
int load(Stringpath
)
Load the template from a file into memory for faster access. The contents are cached until the unload() is called.
path
0 if success, -1 if file cannot be opened.
unload()
Unload the cached template.
This object represents the data set that can be used by template processing. It provides an extra method to import the ASP built-in Request object. The keys to the template data are the field names in the data set.
The following component creates instances of the TemplateData object.
Server.CreateObject ("BEAWEB.TemplateData")
The following methods are used in conjunction with the TemplateData object:
setValue
(Stringname
, Stringvalue
)
name
value
This method is same as setValueByIndex(name,0,value)
for non-octet value.
StringgetValue
(Stringname
, Stringdefval
)
name
defval
Get the string value of a data element associated with a name. Most output data, except carray (octets) data type, are automatically converted to String. If there is a type-cast error, the default value will be returned.
The string value of the data element or the default value.
setValueByIndex
(String
name
, int
index
, String
value
)
name
index
value
Set the string value of a data element associated with a name and an index.
StringgetValueByIndex
(Stringname
, intindex
, Stringdefval
)
name
index
defval
Get the string value of a data element associated with a name and an index. Most output data, except carray (octets) data type, are automatically converted to String. If there is a type-cast error, the default value will be returned.
The string value of the data element or the default value.
setBytesValue
(Stringname
, bytevalue
[])
name
value
This method is same as setBytesByIndexValue(name,0,value)
for the octet value.
byte[]getBytesValue
(Stringname
, bytedefval
[])
name
defval
Get the octet value of a data element associated with a name. If an output field has carray (octets) data type, the data remains as byte[]. The caller must use this method to retrieve the data. If there is a type-cast error, the default value will be returned.
The octet value of the data element or the default value.
byte[]getBytesValueByIndex
(Stringname
, intindex
, byte defval[])
name
index
defval
Get the octet value of a data element associated with a name and an index. If an output field has carray (octets) data type, the data remains as byte[]. The caller must use this method to retrieve the data. If there is a type-cast error, the default value will be returned.
The octet value of the data element or the default value.
setBytesValueByIndex
(String
name
, int
index
, byte
value
[])
name
index
value
Set the octet value of a data element associated with a name and an index. The data element should be defined as carray in the TUXEDO application.
intgetCount
(Stringname
)
name
Get occurrence count of a data element.
The count of occurrences.
voidimportRequest
()
Import the values from the Microsoft ASP Request object into this TemplateData object.
This object represents a connection (TUXEDO session) to a Jolt server and provides simple methods for connection status. It is returned from the getConnection method on the SessionPool object. This object is a part of the administrative class library.
The following methods are used in conjunction with the Connection object:
DategetAccessTime
()
Get the last access time of this object.
StringgetAddr
()
Get the server address.
intgetErrorCount
()
Get the cumulative system error count.
intgetUseCount
()
Get the outstanding request count.
booleaninTransaction
()
Check if the connection is in a transaction.
True
if the connection is in a transaction; false
otherwise.
booleanisAlive
()
Check if the connection is still alive.
True
if the connection is still alive; false
otherwise.
This object contains the TUXEDO user authentication information. This information may be needed to create a TUXEDO session.
The following component creates an instance of the UserInfo object.
This component creates an instance of the UserInfo object.
Server.CreateObject ("BEAWEB.UserInfo")
The following methods are used in conjunction with the UserInfo object:
setUserName
(Stringusername
)
username
You must set the TUXEDO user name before creating a session pool. This is only required if the user authorization level is specified in TUXEDO.
setUserPassword
(Stringpassword
)
password
You must set the TUXEDO user password before creating a session. This is only required if the user authorization level is specified in TUXEDO.
setUserRole
(Stringuserrole
)
userrole
You must set the TUXEDO user role before creating a session. This is only required if the user authorization level is specified in TUXEDO.
setAppPassword
(Stringpassword
)
password
You must set the TUXEDO application password before creating a session. This is only required if the application or user authorization level is specified in TUXEDO.
This object is a wrapper for the bea.jolt.JoltTransaction object. If an error occurs, the method in this object returns an error code instead of throwing an exception. This object is returned by the startTransaction method or the SessionPool object.
The following methods are used in conjunction with the Transaction object:
intcommit
()
Commit the transaction.
0 if successful; otherwise, a TUXEDO error number.
introllback
()
Roll back the transaction.
0 if successful; otherwise, a TUXEDO error number.
This object represents the result set from the service invocation. Most output data types are converted into String
, except carray
which remains as byte[]
. The caller must use the getBytesValue()
methods to get the carray
data. The keys the data in the Result object are the field names in the result set. Since this object is derived from the TemplateData object, it can be used by the Template object for template processing. This object is returned from the call() method or the SessionPool object.
The following methods are used in conjunction with the Result object:
booleanapplicationError
()
Test if an application error occurred in the corresponding service invocation. The application error is equivalent to TPESVCFAIL
in TUXEDO.
True
if an application error occurs.
booleansystemError
()
Test if a system error occurred in the corresponding service invocation.
True
if a system error occurs.
int getError
()
Get the system (non-TPESVCFAIL
) error number. The error number is same as the tperrno
in TUXEDO.
The system error number.
int getErrorDetail
()
Get the detail system error number. This information is available only to TUXEDO 6.4 and then only if the service call has timed out.
The detail system error number or 0.
int getApplicationCode
()
Get the application code returned by the service. The application code is same as the tpurcode
in TUXEDO.
The application code.
String getStringError
()
Get the system error message. If it is not a system error, null is returned.
The system error message.
String getStringErrorDetail
()
Get the detail system error message. This information is available only to
TUXEDO 6.4 and then only if the service call has timed out.
The detail system error message or null.
booleannoError
()
Test if no error was encountered in the corresponding service invocation.
True
if there is no error.
setValue
(Stringname
, Stringvalue
)
name
value
This method is same as setValueByIndex(name,0,value)
for non-octet value.
StringgetValue
(Stringname
, Stringdefval
)
name
defval
Get the string value of a data element associated with a name. Most output data, except carray (octets) data type, are automatically converted to String. If there is a type-cast error, the default value will be returned.
The string value of the data element or the default value.
setValueByIndex
(String
name
, int
index
, String
value
)
name
index
value
Set the string value of a data element associated with a name and an index.
StringgetValueByIndex
(Stringname
, intindex
, Stringdefval
)
name
index
defval
Get the string value of a data element associated with a name and an index. Most output data, except carray (octets) data type, are automatically converted to String. If there is a type-cast error, the default value will be returned.
The string value of the data element or the default value.
setBytesValue
(Stringname
, bytevalue
[])
name
value
This method is same as setBytesByIndexValue(name,0,value)
for the octet value.
byte[]getBytesValue
(Stringname
, bytedefval
[])
name
defval
Get the octet value of a data element associated with a name. If an output field has carray (octets) data type, the data remains as byte[]. The caller must use this method to retrieve the data. If there is a type-cast error, the default value will be returned.
The octet value of the data element or the default value.
byte[]getBytesValueByIndex
(Stringname
, intindex
, byte defval[])
name
index
defval
Get the octet value of a data element associated with a name and an index. If an output field has carray (octets) data type, the data remains as byte[]. The caller must use this method to retrieve the data. If there is a type-cast error, the default value will be returned.
The octet value of the data element or the default value.
setBytesValueByIndex
(String
name
, int
index
, byte
value
[])
name
index
value
Set the octet value of a data element associated with a name and an index. The data element should be defined as carray in the TUXEDO application.
intgetCount
(Stringname
)
name
Get occurrence count of a data element.
The count of occurrences.
voidimportRequest
()
Import the values from the Microsoft ASP Request object into this TemplateData object.