/** * Get the instance * * @return the actions */ public static ServiceControllerContextActions getLifecycleOnly() { if (lifecycleOnly == null) { Map<ControllerState, ControllerContextAction> actions = new HashMap<ControllerState, ControllerContextAction>(); actions.put(ControllerState.INSTANTIATED, new OnlyUnregisterAction()); actions.put(ControllerState.CREATE, new CreateDestroyLifecycleAction()); actions.put(ControllerState.START, new StartStopLifecycleAction()); lifecycleOnly = new ServiceControllerContextActions(actions); } return lifecycleOnly; }
/** * Create a new ServiceControllerContext. * * @param serviceController the service controller * @param name the name * @param target the target */ public ServiceControllerContext(ServiceController serviceController, ObjectName name, Object target) { super(name.getCanonicalName(), ServiceControllerContextActions.getInstance()); this.objectName = name; serviceContext.objectName = objectName; this.serviceController = serviceController; setTarget(target); setMode(ControllerMode.MANUAL); }
/** * Create a new ServiceControllerContext. * * @param serviceController the service controller * @param name the name of the context * @param includeLifecycle whether to include the lifecycle callouts * @param target the target */ public ServiceControllerContext(ServiceController serviceController, ObjectName name, boolean includeLifecycle, Object target) { super(name.getCanonicalName(), ServiceControllerContextActions.getLifecycleOnly()); this.objectName = name; serviceContext.objectName = objectName; this.serviceController = serviceController; setMode(ControllerMode.MANUAL); this.includeLifecycle = includeLifecycle; if (target != null) setTarget(target); }
/** * Get the instance * * @return the actions */ public static ServiceControllerContextActions getLifecycleOnly() { if (lifecycleOnly == null) { Map<ControllerState, ControllerContextAction> actions = new HashMap<ControllerState, ControllerContextAction>(); actions.put(ControllerState.INSTANTIATED, new OnlyUnregisterAction()); actions.put(ControllerState.CREATE, new CreateDestroyLifecycleAction()); actions.put(ControllerState.START, new StartStopLifecycleAction()); lifecycleOnly = new ServiceControllerContextActions(actions); } return lifecycleOnly; }
/** * Create a new ServiceControllerContext. * * @param serviceController the service controller * @param name the name * @param target the target */ public ServiceControllerContext(ServiceController serviceController, ObjectName name, Object target) { super(name.getCanonicalName(), ServiceControllerContextActions.getInstance()); this.objectName = name; serviceContext.objectName = objectName; this.serviceController = serviceController; setTarget(target); setMode(ControllerMode.MANUAL); }
/** * Create a new ServiceControllerContext. * * @param serviceController the service controller * @param name the name of the context * @param includeLifecycle whether to include the lifecycle callouts * @param target the target */ public ServiceControllerContext(ServiceController serviceController, ObjectName name, boolean includeLifecycle, Object target) { super(name.getCanonicalName(), ServiceControllerContextActions.getLifecycleOnly()); this.objectName = name; serviceContext.objectName = objectName; this.serviceController = serviceController; setMode(ControllerMode.MANUAL); this.includeLifecycle = includeLifecycle; if (target != null) setTarget(target); }
/** * Get the instance * * @return the actions */ public static ServiceControllerContextActions getInstance() { if (instance == null) { Map<ControllerState, ControllerContextAction> actions = new HashMap<ControllerState, ControllerContextAction>(); actions.put(ControllerState.DESCRIBED, new DescribeAction()); actions.put(ControllerState.INSTANTIATED, new InstantiateAction()); actions.put(ControllerState.CONFIGURED, new ConfigureAction()); actions.put(ControllerState.CREATE, new CreateDestroyLifecycleAction()); actions.put(ControllerState.START, new StartStopLifecycleAction()); actions.put(ControllerState.INSTALLED, new InstallAction()); instance = new ServiceControllerContextActions(actions); } return instance; }
/** * Create a new ServiceControllerContext. * * @param serviceController the service controller * @param metaData the meta data */ public ServiceControllerContext(ServiceController serviceController, ServiceMetaData metaData) { super(metaData.getObjectName().getCanonicalName(), ServiceControllerContextActions.getInstance()); this.objectName = metaData.getObjectName(); serviceContext.objectName = objectName; this.serviceController = serviceController; ControllerMode mode = metaData.getMode(); this.serviceMetaData = metaData; if (mode == null) setMode(ControllerMode.MANUAL); else setMode(mode); }
/** * Get the instance * * @return the actions */ public static ServiceControllerContextActions getInstance() { if (instance == null) { Map<ControllerState, ControllerContextAction> actions = new HashMap<ControllerState, ControllerContextAction>(); actions.put(ControllerState.DESCRIBED, new DescribeAction()); actions.put(ControllerState.INSTANTIATED, new InstantiateAction()); actions.put(ControllerState.CONFIGURED, new ConfigureAction()); actions.put(ControllerState.CREATE, new CreateDestroyLifecycleAction()); actions.put(ControllerState.START, new StartStopLifecycleAction()); actions.put(ControllerState.INSTALLED, new InstallAction()); instance = new ServiceControllerContextActions(actions); } return instance; }
/** * Create a new ServiceControllerContext. * * @param serviceController the service controller * @param metaData the meta data */ public ServiceControllerContext(ServiceController serviceController, ServiceMetaData metaData) { super(metaData.getObjectName().getCanonicalName(), ServiceControllerContextActions.getInstance()); this.objectName = metaData.getObjectName(); serviceContext.objectName = objectName; this.serviceController = serviceController; ControllerMode mode = metaData.getMode(); this.serviceMetaData = metaData; if (mode == null) setMode(ControllerMode.MANUAL); else setMode(mode); }