Package DE_EPAGES::WebInterface::API::MessageCenter
This module encapsulates all communication between the message center and the application server.
@EXPORT_OK |
Functions
- GetMessageCenterForScripts
- SynchronizeCache
- broadcastUpdateCacheRequest
- close
- connect
- new
- request
- sendFinishRequest
- sendIdleRequest
- sendInitialFreeRequest
- sendMonitorRequest
- sendPoolChanges
- sendPoolReset
- sendUpdateCacheRequest
- sendWorkingRequest
- verifyPool
GetMessageCenterForScripts
Creates a message center object to communicate with the MC/RR.
Syntax |
$MessageCenter = GetMessageCenterForScripts($AppServerPoolName, $Tries); |
Input |
|
Return |
|
SynchronizeCache
Sends information about database changes to the message center.
Syntax |
SynchronizeCache($AppServerPoolName); |
Input |
|
broadcastUpdateCacheRequest
Reports that a script has changed data. Unlike sendUpdateCacheRequest, this function distributes the data to all pools. This is useful if application servers use cache data from different pools, e.g. shared template byte code.
Syntax |
$MessageCenter->broadcastUpdateCacheRequest( $Database, $hTouched ); $MessageCenter->broadcastUpdateCacheRequest( 'Store', { TemplateByteCode => 1 } ); |
Input |
|
close
Close connection to message center.
Syntax |
$MessageCenter->close; |
connect
Establishes a connects to the message center at the ip address and port specified in the constructor new.
Syntax |
$MessageCenter->connect(); $MessageCenter->connect( $MaxTries ); |
Example |
$MessageCenter->connect( 100 ); |
Input |
|
new
Creates a new MessageCenter object. Before using any other method you must establish a connection by using the connect method.
Syntax |
$MessageCenter = DE_EPAGES::WebInterface::API::MessageCenter->new( AppServerAddress => $AppServerAddress, AppServerPort => $AppServerPort, ); |
Example |
my $MessageCenter = DE_EPAGES::WebInterface::API::MessageCenter->new( AppServerAddress => '127.0.0.1', AppServerPort => '10048', ); $MessageCenter->connect; $MessageCenter->sendInitialFreeRequest; $MessageCenter->sendFinishRequest; # or $MessageCenter->close; |
Input |
|
Return |
|
request
sends a request to the message center using the message center protocol.
Syntax |
$OutData = $self->request( $RequestCode, $RequestParams ); $OutData = $self->request( $RequestCode, $RequestParams, $InData ); |
Example |
$CacheUpdate = $self->request( MCREQUEST_WORKING, '10.10.10.10:10046', $CacheData ); |
Input |
|
Return |
|
sendFinishRequest
Reports that the application server process terminates itself. The message center communicates to the request router that this application server cannot receive any new requests. The connection to the message center will be closed.
Syntax |
$MessageCenter->sendFinishRequest; |
sendIdleRequest
Reports that the application server has finished processing the current request and is now idle. The message center communicates to the request router that this application server can now receive a new request.
Syntax |
$MessageCenter->sendIdleRequest; |
sendInitialFreeRequest
Registers an application server at the message center or change pool assigment.
Syntax |
$MessageCenter->sendInitialFreeRequest($PoolName); |
Input |
|
sendMonitorRequest
Reports that the application server process will perform a lengthy operation. This information can be used by request router for load balancing.
Syntax |
$MessageCenter->sendMonitorRequest; |
sendPoolChanges
Reports PoolDB changes to RR.
Syntax |
$MessageCenter->sendPoolChanges($TransactionIndex); |
Input |
|
sendPoolReset
Forces the Request Router to dismiss the local cache and re-load everything from the shared version of ASPoolDB.
Syntax |
$MessageCenter->sendPoolReset; |
sendUpdateCacheRequest
Reports that a script has changed data.
Syntax |
$MessageCenter->sendUpdateCacheRequest; |
sendWorkingRequest
Reports that the application server is now working. The message center communicates to the request router that this application server can not receive new requests.
Syntax |
$MessageCenter->sendWorkingRequest; |
verifyPool
Looks at pool database if application server is assigned to new pool. Then an initial free request for the new pool will be send.
Syntax |
$MessageCenter->verifyPool; |
Input |
|