public class DefaultPolicyHandler extends StrolchComponent implements PolicyHandler, PolicyDefVisitor
This is the default Strolch PolicyHandler which implements PolicyDefVisitor. This
PolicyHandler parses a policy configuration file to handle the look-up of KeyPolicyDef
StrolchComponent uses two configuration properties:
PROP_READ_POLICY_FILE - Default is false. If false then no configuration file is read. Useful if all
policy definitions are JavaPolicyDefPROP_POLICY_CONFIG - Default is DEF_STROLCH_POLICIES_XML. If PROP_READ_POLICY_FILE is
true, then this property is used to determine which configuration file to parse for the policy key mappings for
KeyPolicyDefCOMPONENT_VERSION_PROPERTIES, logger| Constructor and Description |
|---|
DefaultPolicyHandler(ComponentContainer container,
String componentName) |
| Modifier and Type | Method and Description |
|---|---|
<T extends StrolchPolicy> |
getPolicy(PolicyDef policyDef,
StrolchTransaction tx)
Instantiates the actual policy by resolving the
PolicyDef using a PolicyDefVisitor |
void |
initialize(ComponentConfiguration configuration)
Life cycle step initialize.
|
<T> Class<T> |
visit(JavaPolicyDef policyDef) |
<T> Class<T> |
visit(KeyPolicyDef policyDef) |
assertContainerStarted, assertStarted, destroy, getConfiguration, getContainer, getName, getState, getVersion, runAs, runAs, runAsAgent, runAsAgent, runAsAgentWithResult, runAsAgentWithResult, runWithResult, runWithResult, setup, start, stoppublic DefaultPolicyHandler(ComponentContainer container, String componentName)
public void initialize(ComponentConfiguration configuration) throws Exception
StrolchComponentinitialize in class StrolchComponentExceptionpublic <T extends StrolchPolicy> T getPolicy(PolicyDef policyDef, StrolchTransaction tx)
PolicyHandlerPolicyDef using a PolicyDefVisitorgetPolicy in interface PolicyHandlerpolicyDef - the PolicyDef referencing a concrete policytx - the current transaction for which the policy is instantiatedpublic <T> Class<T> visit(JavaPolicyDef policyDef) throws ClassNotFoundException
visit in interface PolicyDefVisitorClassNotFoundExceptionpublic <T> Class<T> visit(KeyPolicyDef policyDef) throws ClassNotFoundException
visit in interface PolicyDefVisitorClassNotFoundExceptionCopyright © 2011–2016 Strolch. All rights reserved.