Interface Policy

  • All Known Implementing Classes:
    KeepLatestContainerOnlyPolicy

    public interface Policy
    Policy that can be applied on KIE Server components on regular basis. It can be to perform cleanup operation (like disposing old containers) it can be time based restriction in using containers and more.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void apply​(KieServerRegistry kieServerRegistry, KieServer kieServer)
      Applies given policy on kie server.
      long getInterval()
      Returns interval (in milliseconds) how often the policy should be applied.
      String getName()
      Returns unique name of the policy so it can be referenced by name
      void start()
      Performs operation to start the policy - is executed only once when the policy is created
      void stop()
      Performs operation to stop the policy - is executed only once when the policy is destroyed
    • Method Detail

      • getName

        String getName()
        Returns unique name of the policy so it can be referenced by name
        Returns:
        name of the policy
      • getInterval

        long getInterval()
        Returns interval (in milliseconds) how often the policy should be applied.
        Returns:
        interval in milliseconds
      • start

        void start()
        Performs operation to start the policy - is executed only once when the policy is created
      • stop

        void stop()
        Performs operation to stop the policy - is executed only once when the policy is destroyed
      • apply

        void apply​(KieServerRegistry kieServerRegistry,
                   KieServer kieServer)
        Applies given policy on kie server. Actual operations depends on implementation though they can do any operation based on given parameters. kieServer should be used to alter state of the kie server while kieServerRegistry should be used to locate information to evaluate if policy can be applied
        Parameters:
        kieServerRegistry - registry of the kie server
        kieServer - actual instance representing kie server to perform operations on containers