1 22 package org.jboss.kernel.plugins.dependency; 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 42 public class KernelControllerContextActions extends AbstractControllerContextActions 43 { 44 45 private static KernelControllerContextActions instance; 46 47 48 private static KernelControllerContextActions noInstantiate; 49 50 55 public static KernelControllerContextActions getInstance() 56 { 57 if (instance == null) 58 { 59 Map <ControllerState, ControllerContextAction> actions = new HashMap <ControllerState, ControllerContextAction>(); 60 actions.put(ControllerState.DESCRIBED, new DescribeAction()); 61 actions.put(ControllerState.INSTANTIATED, new InstantiateAction()); 62 actions.put(ControllerState.CONFIGURED, new ConfigureAction()); 63 actions.put(ControllerState.CREATE, new CreateDestroyLifecycleAction()); 64 actions.put(ControllerState.START, new StartStopLifecycleAction()); 65 actions.put(ControllerState.INSTALLED, new InstallAction()); 66 instance = new KernelControllerContextActions(actions); 67 } 68 return instance; 69 } 70 71 76 public static KernelControllerContextActions getNoInstantiate() 77 { 78 if (noInstantiate == null) 79 { 80 Map <ControllerState, ControllerContextAction> actions = new HashMap <ControllerState, ControllerContextAction>(); 81 actions.put(ControllerState.DESCRIBED, new DescribeAction()); 82 actions.put(ControllerState.CONFIGURED, new ConfigureAction()); 83 actions.put(ControllerState.CREATE, new CreateDestroyLifecycleAction()); 84 actions.put(ControllerState.START, new StartStopLifecycleAction()); 85 actions.put(ControllerState.INSTALLED, new InstallAction()); 86 noInstantiate = new KernelControllerContextActions(actions); 87 } 88 return noInstantiate; 89 } 90 91 96 protected KernelControllerContextActions(Map <ControllerState, ControllerContextAction> actions) 97 { 98 super(actions); 99 } 100 } 101 | Popular Tags |