Package org.kie.server.services.api
Interface Policy
-
- All Known Implementing Classes:
KeepLatestContainerOnlyPolicy
public interface PolicyPolicy 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 voidapply(KieServerRegistry kieServerRegistry, KieServer kieServer)Applies given policy on kie server.longgetInterval()Returns interval (in milliseconds) how often the policy should be applied.StringgetName()Returns unique name of the policy so it can be referenced by namevoidstart()Performs operation to start the policy - is executed only once when the policy is createdvoidstop()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.kieServershould be used to alter state of the kie server whilekieServerRegistryshould be used to locate information to evaluate if policy can be applied- Parameters:
kieServerRegistry- registry of the kie serverkieServer- actual instance representing kie server to perform operations on containers
-
-