diff options
| author | ogattaz <olivier@gattaz.com> | 2014-07-07 10:59:14 +0200 |
|---|---|---|
| committer | ogattaz <olivier@gattaz.com> | 2014-07-07 10:59:14 +0200 |
| commit | 6772bfb46b72d859c316a9f6573d0c6be477ad5c (patch) | |
| tree | dafa343584216685e68b6edae37570eb97cf9d0c /src/main/java/com/c2kernel/process/StandardServer.java | |
| parent | 2fd193d7936084de91eae46e8c2763914d87ab71 (diff) | |
| parent | 0b689a787288f5a4ba568157905c3a0577f83821 (diff) | |
Merge branch 'master' of ssh://dev.cccs.uwe.ac.uk:22/var/git/cristal-kernel
Diffstat (limited to 'src/main/java/com/c2kernel/process/StandardServer.java')
| -rw-r--r-- | src/main/java/com/c2kernel/process/StandardServer.java | 91 |
1 files changed, 10 insertions, 81 deletions
diff --git a/src/main/java/com/c2kernel/process/StandardServer.java b/src/main/java/com/c2kernel/process/StandardServer.java index e283cb6..5855d7e 100644 --- a/src/main/java/com/c2kernel/process/StandardServer.java +++ b/src/main/java/com/c2kernel/process/StandardServer.java @@ -10,9 +10,7 @@ package com.c2kernel.process;
-import org.tanukisoftware.wrapper.WrapperListener;
-import org.tanukisoftware.wrapper.WrapperManager;
-
+import com.c2kernel.process.auth.Authenticator;
import com.c2kernel.utils.Logger;
/**************************************************************************
@@ -21,108 +19,39 @@ import com.c2kernel.utils.Logger; * @author $Author: abranson $ $Date: 2005/04/28 13:49:43 $
* @version $Revision: 1.47 $
**************************************************************************/
-public class StandardServer extends AbstractMain implements WrapperListener
+public class StandardServer extends AbstractMain
{
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 )
+ protected static void standardInitialisation( String[] args )
throws Exception
{
+ isServer = true;
+
// read args and init Gateway
Gateway.init(readC2KArgs(args));
// connect to LDAP as root
- Gateway.connect();
+ Authenticator auth = Gateway.connect();
//start console
Logger.initConsole("ItemServer");
//initialize the server objects
- Gateway.startServer();
+ Gateway.startServer(auth);
Logger.msg(5, "StandardServer::standardInitialisation - complete.");
}
-
- /**************************************************************************
- * Sets up and runs and item server
- **************************************************************************/
- @Override
- public Integer start(String[] args)
+ public static void main(String[] args) throws Exception
{
- try
- {
- //initialise everything
- standardInitialisation( args );
- }
- catch( Exception ex )
- {
- ex.printStackTrace();
- Logger.die("Startup failed");
- }
- return null;
- }
-
- public static void main(String[] args) {
- AbstractMain.runningAsWrapper = true;
- server = new StandardServer();
- 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);
- }
- }
-
+ //initialise everything
+ standardInitialisation( args );
}
-
- /**************************************************************************
- * 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) {
- WrapperManager.signalStopping(10000);
- try
- {
- Gateway.close();
- }
- catch( Exception ex )
- {
- Logger.error(ex);
- return 1;
- }
-
- Logger.msg("StandardServer::shutdown - complete. ");
- return 0;
- }
-
}
|
