Class SetServiceDesiredStateTask

  • All Implemented Interfaces:
    SubTask

    public class SetServiceDesiredStateTask
    extends ComponentBasedTask

    A Rhino management sub task for setting the desired state of a Service. <p> .Ant Parameters

    Attribute Description Required

    failonerror

    Flag to control failure behaviour. If 'true', the sub task will throw a BuildException when an error is encountered. If 'false', the sub task will throw a NonFatalBuildException instead of a BuildException under specific circumstances. See below for conditions (if any) which will cause a NonFatalBuildException.

    No. default value is taken from the Rhino management parent task.

    serviceid

    Canonical name of the service to activate.

    Only required/allowed if the component nested element is not present.

    <p> .Parameters available as nested elements

    Element Description Required

    component

    Identifies the service to activate. See SleeComponentElement

    Only required/allowed if the serviceid attribute is not present.

    desiredstate

    One or more elements which can identify either the default desired state, or per-node desired state. Valid values for the state attribute are 'active' and 'inactive'. See DesiredStateElement

    Yes (at least one)

    <p> .NonFatalBuildException throw conditions The task is run targeting an unrecognised service.

    • Constructor Detail

      • SetServiceDesiredStateTask

        public SetServiceDesiredStateTask()
    • Method Detail

      • addDesiredState

        public void addDesiredState​(DesiredStateElement state)

        Add a DesiredStateElement, called by ant.

        Parameters:
        state - the desired state element
      • execute

        protected void execute()
                        throws org.apache.tools.ant.BuildException
        Specified by:
        execute in class AbstractBaseTask
        Throws:
        org.apache.tools.ant.BuildException
      • validateParameters

        protected void validateParameters()
                                   throws org.apache.tools.ant.BuildException
        Specified by:
        validateParameters in class AbstractBaseTask
        Throws:
        org.apache.tools.ant.BuildException
      • setServiceID

        public void setServiceID​(String serviceID)