Server

Server is used as the base class for application specific server classes generated by the Rose Expert.
 

Hierarchy

BEATuxBldr · Server
 

Description

The member functions of this class provide default behavior for Module1Srv (Generated Server) sub-classes that the Rose Expert creates for your application. This allows you to easily extend the implementation of member functions for a specific generated application.
 

Member Functions

This section lists the member functions of Server.

Table 4-24 Server Member Functions

Data Member Access Documented in

close_xa_rm

public

Server

initialize

public

Server

open_xa_rm

public

Server

release

public

Server


 

close_xa_rm

close_xa_rm closes the Resource Manager linked to the calling application's server process.
 

Synopsis

int close_xa_rm()

 

Returns

Upon successful completion, close_xa_rm returns a non-negative value.

Under the following conditions, close_xa_rm fails and returns the error code from the associated tx_close function call. For more information about tx_close refer to the BEA TUXEDO Reference Manual (see Where to Find Related Information). The error codes that may be returned by close_xa_rm are listed below:

[TX_PROTOCOL_ERROR]
This is returned when the member function was called in an improper context; for example, the caller is in transaction mode. No Resource Managers are closed.

[TX_ERROR]
This is returned when the transaction manager or one (or more) of the Resource Managers encounter a transient error. All Resource Managers that could be closed are closed. The exact nature of the error is written to the BEA TUXEDO ULOG file.

[TX_FAIL]
This is returned when the transaction manager or one (or more) of the Resource Managers encounter a fatal error. The transaction manager and/or one (or more) of the Resource Managers can no longer perform work on behalf of the application. The exact nature of the error is written to the BEA TUXEDO ULOG file.

 

Description

close_xa_rm should be called once by the implementation of release for each server that is linked with an Resource Manager and should be used in place of any Resource Manager-specific close function call. The information needed to close a Resource Manager should be placed in the CLOSEINFO parameter in the GROUPS section of the BEA TUXEDO UBBCONFIG file. This information depends on the Resource Manager termination semantics and is provided by the Resource Manager vendor.

For more information about the CLOSEINFO parameter, refer to the ubbconfig section of the BEA TUXEDO Reference Manual, and the Configuring Distributed Transaction Processing section of the BEA TUXEDO Administration Guide (see Where to Find Related Information).
 

initialize

initialize allows the server application to perform application-specific initialization procedures, as implemented by the server application developer.
 

Synopsis

Boolean initialization argc, char** argv)

 

Parameters

argc
Specifies the total number of elements in argv. The value of argc will be one greater than the number of application-specific options.

argv[0]
Contains the name of the server.

argv[1..n]
Each element contains an application-specific option.

 

Returns

TRUE
When the server is able to process incoming client requests.

FALSE
When an error occurs in initialize, the application code should return FALSE, causing the server to exit gracefully. The application code should not attempt to use the exit system call.

 

Description

initialize is called by the C++ ATMI Framework as the last step in server initialization. It allows the server application to perform application-specific initialization procedures such as connecting to a database, registering with an Event broker, performing centralized logging, etc.

Application-specific options contained in argv are passed to the server from the server main function. These options are specified in the BEA TUXEDO UBBCONFIG file in the CLOPT parameter of the SERVER section. Options recognized by BEA TUXEDO should be listed first in the CLOPT parameter, followed by a double-hyphen (--), followed by any application-specific options.

For processes that are linked with a Resource Manager, the implementation of initialize must call open_xa_rm to connect to Resource Manager(s) that have been linked with this server.

For more information about the CLOPT parameter, refer to the ubbconfig section of the BEA TUXEDO Reference Manual, and the Configuring Distributed Transaction Processing section of the BEA TUXEDO Administration Guide (see Where to Find Related Information).
 

open_xa_rm

open_xa_rm opens the Resource Manager linked to this server.
 

Synopsis

int open_xa_rm()
 

Returns

Upon successful completion, open_xa_rm returns a non-negative value.

Under the following conditions, open_xa_rm fails and returns the error code from the associated tx_open function call. For more information about tx_open refer to the BEA TUXEDO Reference Manual (see Where to Find Related Information). The error codes that may be returned by open_xa_rm are listed below:

[TX_ERROR]
This is returned when the transaction manager or one (or more) of the Resource Managers encounter a transient error. None of the Resource Manager(s) are opened. The exact nature of the error is written to the BEA TUXEDO ULOG file.

[TX_FAIL]
This is returned when the transaction manager or one (or more) of the Resource Managers encounter a fatal error.The transaction manager and/or one (or more) of the Resource Managers can no longer perform work on behalf of the application. The exact nature of the error is written to the BEA TUXEDO ULOG file.

 

Description

open_xa_rm should be called once by the implementation of initialize for each server that is linked with a Resource Manager and should be used in place of any Resource Manager-specific open function call. The information needed to open a Resource Manager should be placed in the OPENINFO parameter in the GROUPS section of the BEA TUXEDO UBBCONFIG file. This information depends on the Resource Manager connection semantics and is provided by the Resource Manager vendor.

For more information about the OPENINFO parameter, refer to the ubbconfig section of the BEA TUXEDO Reference Manual, and the Configuring Distributed Transaction Processing section of the BEA TUXEDO Administration Guide (see Where to Find Related Information).
 

release

release causes the server application to perform any application-specific procedures during server shut-down.
 

Synopsis

void release()

 

Description

release is called by the C++ ATMI Framework during server shut-down and allows the application to perform any application-specific clean up such as logging off a database, raising events, perform central logging, etc. For servers that are linked with an Resource Manager, release must call the close_xa_rm to close the Resource Manager.

Note: Regardless of the status or actions of release, the server is shut down once release returns.