1 23 24 package com.sun.enterprise.admin.server.core; 25 26 import java.util.*; 27 28 import com.sun.appserv.server.ServerLifecycleException; 29 import com.sun.appserv.server.ServerLifecycle; 30 import com.sun.appserv.server.ServerLifecycleImpl; 31 import com.sun.enterprise.admin.server.core.channel.AdminChannel; 32 33 import com.sun.enterprise.server.ServerContext; 34 35 import java.util.logging.*; 36 import com.sun.logging.LogDomains; 37 38 39 42 public class AdminChannelLifecycle extends ServerLifecycleImpl { 43 44 private static final int NOTINITIALIZED = 0; 45 private static final int INITIALIZED = 1; 46 private static final int READY = 2; 47 private static final int SHUTDOWN = 3; 48 49 private static int status = NOTINITIALIZED; 50 51 57 public void onInitialization(ServerContext context) 58 throws ServerLifecycleException { 59 if (status < INITIALIZED) { 60 status = INITIALIZED; 61 AdminChannel.createRMIChannel(); 62 AdminChannel.createSharedSecret(); 63 } 64 } 65 66 72 public void onReady(ServerContext context) 73 throws ServerLifecycleException { 74 if (status < READY) { 75 status = READY; 76 AdminChannel.setRMIChannelReady(); 77 } 78 } 79 80 86 public void onShutdown() 87 throws ServerLifecycleException { 88 if (status < SHUTDOWN) { 89 status = SHUTDOWN; 90 AdminChannel.setRMIChannelStopping(); 91 AdminChannel.destroyRMIChannel(); 92 } 93 } 94 95 101 public void onAbort(int port) 102 throws ServerLifecycleException { 103 AdminChannel.setRMIChannelAborting(port); 104 } 105 106 } 107 108 | Popular Tags |