|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ow2.cmi.lb.util.PolicyFactory<T>
T - the type parameter of the constructed policies@ThreadSafe public final class PolicyFactory<T extends org.ow2.cmi.lb.LoadBalanceable>
Define a factory to construct policies.
| Constructor Summary | |
|---|---|
PolicyFactory(org.ow2.cmi.controller.common.ClusterViewManager clusterViewManager)
Constructs a new factory for policies with a given manager of cluster view. |
|
| Method Summary | |
|---|---|
static java.lang.Object |
convertString(java.lang.Class<? extends org.ow2.cmi.lb.policy.IPolicy> policyClass,
java.lang.String propertyName,
java.lang.String svalue)
Converts the given value from String to the given type. |
static java.lang.Object |
convertString(java.lang.reflect.Type propertyType,
java.lang.String svalue)
|
static java.util.List<?> |
convertStrings(java.lang.Class<? extends org.ow2.cmi.lb.policy.IPolicy> policyClass,
java.lang.String propertyName,
java.util.List<java.lang.String> slist)
|
org.ow2.cmi.lb.policy.IPolicy<T> |
createPolicy(java.lang.Class<? extends org.ow2.cmi.lb.policy.IPolicy> policyClass)
Returns a pure policy for a given class. |
org.ow2.cmi.lb.policy.IPolicy<T> |
getPolicy(java.lang.Class<? extends org.ow2.cmi.lb.policy.IPolicy> policyClass,
java.lang.Class<? extends org.ow2.cmi.lb.strategy.IStrategy> strategyClass,
java.util.Map<java.lang.String,?> properties)
Returns a policy for the given classes of policy, strategy and properties. |
org.ow2.cmi.lb.policy.IPolicy<T> |
getPolicy(java.lang.String objectName)
Returns a policy to access to the object with the given name. |
static java.util.Map<java.lang.String,java.lang.Object> |
getProperties(org.ow2.cmi.lb.policy.IPolicy<?> policy)
|
static java.lang.Object |
getProperty(org.ow2.cmi.lb.policy.IPolicy<?> policy,
java.lang.String propertyName)
|
static java.util.Map<java.lang.String,PropertyData> |
getPropertyData(java.lang.Class<? extends org.ow2.cmi.lb.policy.IPolicy> policyClass)
|
static java.lang.reflect.Type |
getPropertyRawType(java.lang.Class<? extends org.ow2.cmi.lb.policy.IPolicy> policyClass,
java.lang.String propertyName)
|
static java.lang.reflect.Type |
getPropertyType(java.lang.Class<? extends org.ow2.cmi.lb.policy.IPolicy> policyClass,
java.lang.String propertyName)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PolicyFactory(org.ow2.cmi.controller.common.ClusterViewManager clusterViewManager)
clusterViewManager - a manager to retrieve the cluster view| Method Detail |
|---|
public org.ow2.cmi.lb.policy.IPolicy<T> getPolicy(java.lang.String objectName)
throws PolicyFactoryException,
org.ow2.cmi.reference.ObjectNotFoundException
objectName - a name of object
PolicyFactoryException - if the policy cannot be constructed
org.ow2.cmi.reference.ObjectNotFoundException - if none object has the given name
public org.ow2.cmi.lb.policy.IPolicy<T> getPolicy(java.lang.Class<? extends org.ow2.cmi.lb.policy.IPolicy> policyClass,
java.lang.Class<? extends org.ow2.cmi.lb.strategy.IStrategy> strategyClass,
java.util.Map<java.lang.String,?> properties)
throws PolicyFactoryException
policyClass - strategyClass - properties -
PolicyFactoryException - if the policy cannot be constructed
public org.ow2.cmi.lb.policy.IPolicy<T> createPolicy(java.lang.Class<? extends org.ow2.cmi.lb.policy.IPolicy> policyClass)
throws PolicyFactoryException
policyClass - a class defining a policy
PolicyFactoryException - if the policy cannot be constructed
public static java.util.Map<java.lang.String,java.lang.Object> getProperties(org.ow2.cmi.lb.policy.IPolicy<?> policy)
throws org.ow2.cmi.lb.PropertyConfigurationException
org.ow2.cmi.lb.PropertyConfigurationException
public static java.lang.Object getProperty(org.ow2.cmi.lb.policy.IPolicy<?> policy,
java.lang.String propertyName)
throws org.ow2.cmi.lb.PropertyConfigurationException
org.ow2.cmi.lb.PropertyConfigurationException
public static java.lang.reflect.Type getPropertyRawType(java.lang.Class<? extends org.ow2.cmi.lb.policy.IPolicy> policyClass,
java.lang.String propertyName)
throws org.ow2.cmi.lb.PropertyConfigurationException
org.ow2.cmi.lb.PropertyConfigurationException
public static java.lang.reflect.Type getPropertyType(java.lang.Class<? extends org.ow2.cmi.lb.policy.IPolicy> policyClass,
java.lang.String propertyName)
throws org.ow2.cmi.lb.PropertyConfigurationException
org.ow2.cmi.lb.PropertyConfigurationException
public static java.util.Map<java.lang.String,PropertyData> getPropertyData(java.lang.Class<? extends org.ow2.cmi.lb.policy.IPolicy> policyClass)
throws org.ow2.cmi.lb.PropertyConfigurationException
org.ow2.cmi.lb.PropertyConfigurationException
public static java.lang.Object convertString(java.lang.Class<? extends org.ow2.cmi.lb.policy.IPolicy> policyClass,
java.lang.String propertyName,
java.lang.String svalue)
throws org.ow2.cmi.lb.PropertyConfigurationException
propertyName - the property namesvalue - a value
org.ow2.cmi.lb.PropertyConfigurationException - if the conversion is not possible
public static java.lang.Object convertString(java.lang.reflect.Type propertyType,
java.lang.String svalue)
throws org.ow2.cmi.lb.PropertyConfigurationException
org.ow2.cmi.lb.PropertyConfigurationException
public static java.util.List<?> convertStrings(java.lang.Class<? extends org.ow2.cmi.lb.policy.IPolicy> policyClass,
java.lang.String propertyName,
java.util.List<java.lang.String> slist)
throws org.ow2.cmi.lb.PropertyConfigurationException
org.ow2.cmi.lb.PropertyConfigurationException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||