Package org.zkoss.zats.mimic.impl
Class OperationAgentManager
java.lang.Object
org.zkoss.zats.mimic.impl.OperationAgentManager
This class maintains a mapping registry between ZK components (in specific version range) and OperationAgentBuilder.
It registers all entries in the constructor and retrieve them when ValueResolver requests.
OperationAgentBuilder, it will keeping search ZK component's class and its parent class until it finds a match or fails to match.- Author:
- pao, dennis
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<O extends OperationAgent>
OperationAgentBuilder<Agent,O> getBuilder(Object delegatee, Class<O> operation) Return a corresponding OperationAgentBuilder for delegatee supported operation class.static OperationAgentManager<O extends OperationAgent,C>
voidregisterBuilder(String startVersion, String endVersion, Class<C> delegateeClass, OperationAgentBuilder<? extends Agent, O> builder) register a operation builder mapping to component and operation.<O extends OperationAgent>
voidregisterBuilder(String startVersion, String endVersion, String delegateeClass, String builderClazz) Register a operation builder mapping to component and operation.
-
Constructor Details
-
OperationAgentManager
public OperationAgentManager()
-
-
Method Details
-
getInstance
-
registerBuilder
public <O extends OperationAgent> void registerBuilder(String startVersion, String endVersion, String delegateeClass, String builderClazz) Register a operation builder mapping to component and operation. We can specify zk version worked on. The version text could be normal version format (e.g. 6.0.0 or 5.0.7.1) or "*" sign means no specify. If specify version range doesn't include current zk version at runtime, this register will be ignored. Use this API if the component is only in a particular zk version only to avoid initial exception.- Parameters:
startVersion- start version (include)endVersion- end version (include)delegateeClass- the component class that builder maps to ( *notice: it should not specify interface)builderClazz- operation builder
-
registerBuilder
public <O extends OperationAgent,C> void registerBuilder(String startVersion, String endVersion, Class<C> delegateeClass, OperationAgentBuilder<? extends Agent, O> builder) register a operation builder mapping to component and operation. We can specify zk version worked on. The version text could be normal version format (e.g 6.0.0 or 5.0.7.1) or "*" sign means no specify. If specify version range doesn't include current zk version at runtime, this register will be ignored.- Parameters:
startVersion- start version (include)endVersion- end version (include)delegateeClass- the component class that builder maps to ( *notice: it should not specify interface)builder- operation builder
-
getBuilder
public <O extends OperationAgent> OperationAgentBuilder<Agent,O> getBuilder(Object delegatee, Class<O> operation) Return a corresponding OperationAgentBuilder for delegatee supported operation class. It will search in registry with delegatee's class first. If not found, it keeps searching with delegatee's parent class until found or failed.- Parameters:
delegatee-operation-- Returns:
- the operation agent builder
-