Package DE_EPAGES::WebInterface::API::ApplicationServer
The application server is a server process that implements the business
loging of the epages application. The process waits for incoming requests
from the message center and distributes them to the appropriate modules,
aka. servlets for further processing.
This module encapsulates the communication protocol between the web
adapter and the applictaion server. It uses the MessageCenter module
to communicate the status of the process and to exchange cache hints
with other application servers.
Example |
my $AppServer = DE_EPAGES::WebInterface::API::ApplicationServer->new( Address => '213.232.211.243', Port => 10048, MCAddress => '213.232.211.243', MCPort => 10042, MaxRequest => 5000, BindAddress => inet_ntoa( INADDR_ANY ) ); $AppServer->run; |
@EXPORT_OK |
Functions
- GetAppServer
- TestSocket
- address
- currentRequest
- currentResponse
- currentServlet
- enterMonitorMode
- flushOutput
- messageCenter
- monitor
- monitorThread
- new
- port
- requestNo
- run
- serverSocket
- serverVariables
- sockets
- webadapter
GetAppServer
Returns the application server object that handles the current request. Returns undef if the application no application server is running.
Syntax |
$AppServer = GetAppServer(); |
Return |
|
TestSocket
Checks connection to socket.
Syntax |
TestSocket($Host, $Port, $Timeout, $Tries); |
Input |
|
address
Returns the application server IP address.
Syntax |
$Address = $AppServer->address; |
Return |
|
currentRequest
Returns the currently processed request.
Syntax |
$Request = $AppServer->currentRequest; |
Return |
|
currentResponse
Returns the response object for the currently processed request.
Syntax |
$Request = $AppServer->currentResponse; |
Return |
|
currentServlet
Returns the currently processed servlet.
Syntax |
$Request = $AppServer->currentServlet; |
Return |
|
enterMonitorMode
Sets the application server into monitor mode which means that the application server will send no further output and the progress can be monitored.
Syntax |
$AppServer->enterMonitorMode; |
flushOutput
Sends the buffered response data immediately to the client.
Syntax |
$AppServer->flushOutput; |
messageCenter
Returns the message center.
Syntax |
$MessageCenter = $AppServer->messageCenter; |
Return |
|
monitor
Returns the current monitor object.
Syntax |
$Monitor = $AppServer->monitor; |
Return |
|
monitorThread
Returns the current monitor thread object (not the thread it self).
Syntax |
$MonitorThread = $AppServer->monitorThread; |
Return |
|
new
Creates a new application server object.
Syntax |
$AppServer = DE_EPAGES::WebInterface::API::ApplicationServer->new( %Options ); |
Example |
my $AppServer = DE_EPAGES::WebInterface::API::ApplicationServer->new( Address => '213.232.211.243', Port => 10048, MCAddress => '213.232.211.243', MCPort => 10042, MaxRequest => 5000, MaxUptime => 3600, MaxMemory => 150, BindAddress => inet_ntoa( INADDR_ANY ) ); |
Input |
|
Return |
|
port
Returns the application server port number.
Syntax |
$Port = $AppServer->port; |
Return |
|
requestNo
Returns the current request counter.
Syntax |
$Counter = $AppServer->requestNo; |
Return |
|
run
Waits for incoming requests from the web adapter, distributes them to request handlers and sends the response back to the web apapter. This loop continues until the number of MaxRequest is reached or a 'shutdown' request is received.
Syntax |
$AppServer->run; |
serverSocket
Returns the server socket that are used to wait for incoming requests from the web adapter.
Syntax |
$Socket = $AppServer->serverSocket; |
Return |
|
serverVariables
Returns a hash of server variables that correspond to the CGI interface. The values are only valid for the current request.
Syntax |
$hVars = $AppServer->serverVariables; |
Return |
|
sockets
Returns the selector of sockets that are used by the application server. These sockets include the server socket that is used to wait for incoming requests and client sockets that are used for the actual data transfer between application server and web adapter.
Syntax |
$hSockets = $AppServer->sockets; |
Return |
|
webadapter
Returns the the webadapter interface object.
Syntax |
$WebAdapter = $AppServer->webadapter; |
Return |
|