NAME
Wombat::Server - server class
SYNOPSIS
my $wombat = Wombat::Server();
$wombat->setHome('/usr/local/wombat');
$wombat->setConfigFile('conf/server.xml');
$wombat->start();
$wombat->await();
$wombat->stop();
DESCRIPTION
This class implements a Wombat server. It uses server.xml to configure a container hierarchy and provides methods for starting and stopping the server. It is meant to be used in both standalone and embedded mode, so it does not take care of standard daemon things, like processing command line arguments or setting up signal handlers. Those are the responsibilities of the surrounding environment (eg a control script or mod_perl <Perl> section).
CONSTRUCTOR
ACCESSOR METHODS
- getConfigFile()
-
Return the location of the configuration file for this Server. Defaults to server.xml in the conf subdirectory of
getHome()
. - setConfigFile($configFile)
-
Set the location of the configuration file for this Server. If the specified location is relative, then it will be absolutized using
getHome()
. - getHome()
-
Return the home directory for this Server.
- setHome($home)
-
Set the home directory for this Server.
Parameters:
Throws:
PUBLIC METHODS
- await()
-
Direct all defined Services to begin listening for requests. Depending on Connector implementations, this method may return immediately (for Connectors that execute asynchrously, eg Apache) or may block (eg Http Connector).
- addService($service)
-
Add a new Service to the set of defined Services.
Parameters:
- getServices()
-
Return an array containing all defined Services.
- removeService($service)
-
Remove a Service from the set of defined Services.
Parameters:
LIFECYCLE METHODS
- start()
-
Prepare for active use of this component. This method should be called before any of the public methods of the component are utilized.
Throws:
- stop()
-
Gracefully terminate active use of this component. Once this method has been called, no public methods of the component should be utilized.
Throws:
SEE ALSO
AUTHOR
Brian Moseley, bcm@maz.org