1 22 package org.jboss.system.microcontainer; 23 24 import java.util.HashMap ; 25 import java.util.Map ; 26 27 import org.jboss.dependency.plugins.AbstractControllerContextActions; 28 import org.jboss.dependency.plugins.spi.action.ControllerContextAction; 29 import org.jboss.dependency.spi.ControllerState; 30 31 37 public class ServiceControllerContextActions extends AbstractControllerContextActions 38 { 39 40 private static ServiceControllerContextActions instance; 41 42 private static ServiceControllerContextActions lifecycleOnly; 43 44 49 public static ServiceControllerContextActions getInstance() 50 { 51 if (instance == null) 52 { 53 Map <ControllerState, ControllerContextAction> actions = new HashMap <ControllerState, ControllerContextAction>(); 54 actions.put(ControllerState.DESCRIBED, new DescribeAction()); 55 actions.put(ControllerState.INSTANTIATED, new InstantiateAction()); 56 actions.put(ControllerState.CONFIGURED, new ConfigureAction()); 57 actions.put(ControllerState.CREATE, new CreateDestroyLifecycleAction()); 58 actions.put(ControllerState.START, new StartStopLifecycleAction()); 59 actions.put(ControllerState.INSTALLED, new InstallAction()); 60 instance = new ServiceControllerContextActions(actions); 61 } 62 return instance; 63 } 64 65 70 public static ServiceControllerContextActions getLifecycleOnly() 71 { 72 if (lifecycleOnly == null) 73 { 74 Map <ControllerState, ControllerContextAction> actions = new HashMap <ControllerState, ControllerContextAction>(); 75 actions.put(ControllerState.INSTANTIATED, new OnlyUnregisterAction()); 76 actions.put(ControllerState.CREATE, new CreateDestroyLifecycleAction()); 77 actions.put(ControllerState.START, new StartStopLifecycleAction()); 78 lifecycleOnly = new ServiceControllerContextActions(actions); 79 } 80 return lifecycleOnly; 81 } 82 83 84 89 protected ServiceControllerContextActions(Map <ControllerState, ControllerContextAction> actions) 90 { 91 super(actions); 92 } 93 } 94 | Popular Tags |