summaryrefslogtreecommitdiff
path: root/source/com/c2kernel/process/StandardServer.java
diff options
context:
space:
mode:
authorAndrew Branson <andrew.branson@cern.ch>2012-05-30 08:37:45 +0200
committerAndrew Branson <andrew.branson@cern.ch>2012-05-30 08:37:45 +0200
commitb086f57f56bf0eb9dab9cf321a0f69aaaae84347 (patch)
tree8e6e26e8b7eed6abad7a17b093bdbb55c5e6b1ba /source/com/c2kernel/process/StandardServer.java
parent22088ae8d2d5ff390518dbe1c4372325ffb3a647 (diff)
Initial Maven Conversion
Diffstat (limited to 'source/com/c2kernel/process/StandardServer.java')
-rw-r--r--source/com/c2kernel/process/StandardServer.java127
1 files changed, 0 insertions, 127 deletions
diff --git a/source/com/c2kernel/process/StandardServer.java b/source/com/c2kernel/process/StandardServer.java
deleted file mode 100644
index 6804da5..0000000
--- a/source/com/c2kernel/process/StandardServer.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/**************************************************************************
- * StandardServer
- *
- * $Revision: 1.47 $
- * $Date: 2005/04/28 13:49:43 $
- *
- * Copyright (C) 2001 CERN - European Organization for Nuclear Research
- * All rights reserved.
- **************************************************************************/
-
-package com.c2kernel.process;
-
-import org.tanukisoftware.wrapper.WrapperListener;
-import org.tanukisoftware.wrapper.WrapperManager;
-
-import com.c2kernel.utils.Logger;
-
-/**************************************************************************
- * Base class for all servers i.e. c2k processes that serve Entities
- *
- * @author $Author: abranson $ $Date: 2005/04/28 13:49:43 $
- * @version $Revision: 1.47 $
- **************************************************************************/
-public class StandardServer extends AbstractMain implements WrapperListener
-{
- protected static StandardServer server;
-
-
- /**************************************************************************
- * C2KRootPOA suitable for Factory objects
- **************************************************************************/
-
-
-
-
-
- /**************************************************************************
- * void StandardInitalisation( String[] )
- *
- * Set-up calls to ORB, POA and Factorys, both optional and required.
- **************************************************************************/
- protected void standardInitialisation( String[] args )
- throws Exception
- {
- // read args and init Gateway
- Gateway.init(readC2KArgs(args), true);
-
- // connect to LDAP as root
- Gateway.connect();
-
- //start console
- Logger.initConsole("ItemServer");
-
- //initialize the server objects
- Gateway.startServer();
-
- Logger.msg(5, "StandardServer::standardInitialisation - complete.");
-
- }
-
-
- /**************************************************************************
- * Sets up and runs and item server
- **************************************************************************/
- @Override
- public Integer start(String[] args)
- {
- try
- {
- //initialise everything
- standardInitialisation( args );
- }
- catch( Exception ex )
- {
- Logger.error(ex);
- Logger.die("Startup failed");
- }
- return null;
- }
-
- public static void main(String[] args) {
- server = new StandardServer();
- AbstractMain.runningAsWrapper = true;
- WrapperManager.start( server, args );
- }
-
- /**
- *
- */
- @Override
- public void controlEvent(int event) {
- if (WrapperManager.isControlledByNativeWrapper()) {
- // The Wrapper will take care of this event
- } else {
- // We are not being controlled by the Wrapper, so
- // handle the event ourselves.
- if ((event == WrapperManager.WRAPPER_CTRL_C_EVENT) ||
- (event == WrapperManager.WRAPPER_CTRL_CLOSE_EVENT) ||
- (event == WrapperManager.WRAPPER_CTRL_SHUTDOWN_EVENT)){
- WrapperManager.stop(0);
- }
- }
-
- }
-
- /**************************************************************************
- * Closes all listeners, quits the VM.
- * This method should be called to kill the server process
- * e.g. from the NT service wrapper
- **************************************************************************/
- @Override
- public int stop(int arg0) {
- try
- {
- Gateway.close();
- }
- catch( Exception ex )
- {
- Logger.error(ex);
- return 1;
- }
-
- Logger.msg("StandardServer::shutdown - complete. ");
- return 0;
- }
-
-}