
Static Public Member Functions | |
| static void | main (String[] args) |
Static Public Attributes | |
| static final String | CONTAINER_STARTTIME_DELAY_MILLIS_PROPERTYNAME = "acs.container.starttimeDelayMillis" |
Protected Member Functions | |
| AcsContainerRunner () | |
| void | initAcsLogging (final AcsManagerProxy managerProxy) |
| void | checkReadyToRun () throws AcsJContainerEx |
Protected Attributes | |
| String | m_containerName |
| String | m_managerLoc |
| boolean | m_useRecoveryMode |
| AcsEmbeddedContainerRunner | embeddedRunner |
| Logger | m_logger |
| AcsCorba | m_acsCorba |
| int | m_containerPort = -1 |
| int | initialSleeptimeMillis = 0 |
Package Functions | |
| void | setOptions (String[] args) throws AcsJContainerEx |
Private Member Functions | |
| void | run (String[] args) throws AcsJContainerEx |
Private Attributes | |
| ShutdownHook | m_shutdownHook |
Static Private Attributes | |
| static final String | CONTAINER_NAME_PROPERTYNAME = "ACS.containerName" |
| static final String | MANAGER_PROPERTYNAME = "ACS.manager" |
The main method of this class starts an AcsContainer.
Tasks performed are:
The implementation delegates many tasks to alma.acs.container.AcsEmbeddedContainerRunner, so that other applications which have to run a container inside can be written similarly to this class.
The functionality is comparable to that of maciActivate.cpp and maciContainerImpl.cpp/ContainerImpl/init(argc, argv) on the C++ side.
| alma::acs::container::AcsContainerRunner::AcsContainerRunner | ( | ) | [inline, protected] |
Empty constructor, only to be called from AcsContainerRunner::main method.
Referenced by main().
| void alma::acs::container::AcsContainerRunner::checkReadyToRun | ( | ) | throws AcsJContainerEx [inline, protected] |
References alma::acs::container::AcsEmbeddedContainerRunner::checkReadyToRun(), embeddedRunner, and m_containerPort.
Referenced by run().
| void alma::acs::container::AcsContainerRunner::initAcsLogging | ( | final AcsManagerProxy | managerProxy | ) | [inline, protected] |
Asynchronously connects to the log service so that after some time the locally collected log records will be sent over the wire.
References alma::acs::container::AcsManagerProxy::getManager(), alma::acs::container::AcsManagerProxy::getManagerHandle(), alma::acs::container::corba::AcsCorba::getORB(), m_acsCorba, m_logger, and run().
Referenced by run().
| static void alma::acs::container::AcsContainerRunner::main | ( | String[] | args | ) | [inline, static] |
The one and only main method to run a Java container. Options:
-manager myManagerloccorbaloc::myhost:xxxx/Manager (same as property ACS.manager, but with higher precedence); if missing, it will be taken from CDB, or will default to localhost. -containerName myContainerNameACS.containerName). References AcsContainerRunner(), alma::acs::container::corba::AcsCorba::doneCorba(), m_acsCorba, m_logger, and run().
| void alma::acs::container::AcsContainerRunner::run | ( | String[] | args | ) | throws AcsJContainerEx [inline, private] |
Startup choreography: performs the various tasks in the correct order.
Note on the implementation: the steps involved are grouped as private methods that access the instance variables. The intent was to make the sequence clearer.
| args | command line args as given to main. |
| AcsJContainerServicesEx | at the slightest provocation... |
References alma::acs::container::corba::AcsCorba::blockOnORB(), checkReadyToRun(), embeddedRunner, alma::acs::container::AcsEmbeddedContainerRunner::getContainer(), alma::acs::container::AcsEmbeddedContainerRunner::getContainerLogger(), alma::acs::container::AcsEmbeddedContainerRunner::getManagerProxy(), initAcsLogging(), alma::acs::container::corba::AcsCorba::initCorba(), initialSleeptimeMillis, alma::acs::util::StopWatch::logLapTime(), m_acsCorba, m_containerName, m_containerPort, m_logger, m_managerLoc, m_shutdownHook, m_useRecoveryMode, alma::acs::container::AcsEmbeddedContainerRunner::run(), alma::acs::container::corba::AcsCorba::runCorba(), alma::acs::container::ShutdownHook::setAcsContainer(), alma::acs::container::AcsEmbeddedContainerRunner::setContainerName(), alma::acs::util::StopWatch::setLogger(), alma::acs::container::AcsEmbeddedContainerRunner::setManagerLoc(), setOptions(), and alma::acs::shutdown::ShutdownHookBase::setRegularShutdownExpected().
Referenced by initAcsLogging(), and main().
| void alma::acs::container::AcsContainerRunner::setOptions | ( | String[] | args | ) | throws AcsJContainerEx [inline, package] |
Parses commandline and property options.
| args | as received by main() |
References CONTAINER_NAME_PROPERTYNAME, CONTAINER_STARTTIME_DELAY_MILLIS_PROPERTYNAME, alma::acs::util::CmdLineArgs::getValues(), initialSleeptimeMillis, alma::acs::util::CmdLineArgs::isSpecified(), m_containerName, m_containerPort, m_logger, m_managerLoc, m_useRecoveryMode, MANAGER_PROPERTYNAME, alma::acs::util::CmdLineArgs::parseArgs(), alma::acs::util::CmdLineArgs::registerOption(), and alma::JavaContainerError::wrappers::AcsJContainerEx::setContextInfo().
Referenced by run().
final String alma::acs::container::AcsContainerRunner::CONTAINER_NAME_PROPERTYNAME = "ACS.containerName" [static, private] |
Referenced by setOptions().
final String alma::acs::container::AcsContainerRunner::CONTAINER_STARTTIME_DELAY_MILLIS_PROPERTYNAME = "acs.container.starttimeDelayMillis" [static] |
Referenced by setOptions().
Referenced by checkReadyToRun(), and run().
int alma::acs::container::AcsContainerRunner::initialSleeptimeMillis = 0 [protected] |
Referenced by run(), and setOptions().
Referenced by initAcsLogging(), main(), and run().
String alma::acs::container::AcsContainerRunner::m_containerName [protected] |
Referenced by run(), and setOptions().
int alma::acs::container::AcsContainerRunner::m_containerPort = -1 [protected] |
Referenced by checkReadyToRun(), run(), and setOptions().
Logger alma::acs::container::AcsContainerRunner::m_logger [protected] |
Referenced by initAcsLogging(), main(), run(), and setOptions().
String alma::acs::container::AcsContainerRunner::m_managerLoc [protected] |
Referenced by run(), and setOptions().
Referenced by run().
boolean alma::acs::container::AcsContainerRunner::m_useRecoveryMode [protected] |
Referenced by run(), and setOptions().
final String alma::acs::container::AcsContainerRunner::MANAGER_PROPERTYNAME = "ACS.manager" [static, private] |
Referenced by setOptions().
1.6.2