|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ow2.carol.cmi.lb.util.LBPolicyFactory<T>
T - the type parameter of the constructed policies@ThreadSafe public final class LBPolicyFactory<T extends org.ow2.carol.cmi.lb.LoadBalanceable>
Define a factory to construct policies.
| Constructor Summary | |
|---|---|
LBPolicyFactory(org.ow2.carol.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.carol.cmi.lb.policy.ILBPolicy> lbPolicyClass,
java.lang.String lbPropertyName,
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.carol.cmi.lb.policy.ILBPolicy> lbPolicyClass,
java.lang.String lbPropertyName,
java.util.List<java.lang.String> slist)
|
org.ow2.carol.cmi.lb.policy.ILBPolicy<T> |
createLBPolicy(java.lang.Class<? extends org.ow2.carol.cmi.lb.policy.ILBPolicy> lbPolicyClass)
Returns a pure policy for a given class. |
org.ow2.carol.cmi.lb.policy.ILBPolicy<T> |
getLBPolicy(java.lang.Class<? extends org.ow2.carol.cmi.lb.policy.ILBPolicy> lbPolicyClass,
java.lang.Class<? extends org.ow2.carol.cmi.lb.strategy.ILBStrategy> lbStrategyClass,
java.util.Map<java.lang.String,?> properties)
Returns a policy for the given classes of LB policy, strategy and properties. |
org.ow2.carol.cmi.lb.policy.ILBPolicy<T> |
getLBPolicy(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.carol.cmi.lb.policy.ILBPolicy<?> lbPolicy)
|
static java.lang.Object |
getProperty(org.ow2.carol.cmi.lb.policy.ILBPolicy<?> lbPolicy,
java.lang.String propertyName)
|
static java.util.Map<java.lang.String,LBPropertyData> |
getPropertyData(java.lang.Class<? extends org.ow2.carol.cmi.lb.policy.ILBPolicy> lbPolicyClass)
|
static java.lang.reflect.Type |
getPropertyRawType(java.lang.Class<? extends org.ow2.carol.cmi.lb.policy.ILBPolicy> lbPolicyClass,
java.lang.String propertyName)
|
static java.lang.reflect.Type |
getPropertyType(java.lang.Class<? extends org.ow2.carol.cmi.lb.policy.ILBPolicy> lbPolicyClass,
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 LBPolicyFactory(org.ow2.carol.cmi.controller.common.ClusterViewManager clusterViewManager)
clusterViewManager - a manager to retrieve the cluster view| Method Detail |
|---|
public org.ow2.carol.cmi.lb.policy.ILBPolicy<T> getLBPolicy(java.lang.String objectName)
throws LBPolicyFactoryException,
org.ow2.carol.cmi.reference.ObjectNotFoundException
objectName - a name of object
LBPolicyFactoryException - if the policy cannot be constructed
org.ow2.carol.cmi.reference.ObjectNotFoundException - if none object has the given name
public org.ow2.carol.cmi.lb.policy.ILBPolicy<T> getLBPolicy(java.lang.Class<? extends org.ow2.carol.cmi.lb.policy.ILBPolicy> lbPolicyClass,
java.lang.Class<? extends org.ow2.carol.cmi.lb.strategy.ILBStrategy> lbStrategyClass,
java.util.Map<java.lang.String,?> properties)
throws LBPolicyFactoryException
objectName - a name of object
LBPolicyFactoryException - if the policy cannot be constructed
org.ow2.carol.cmi.reference.ObjectNotFoundException - if none object has the given name
public org.ow2.carol.cmi.lb.policy.ILBPolicy<T> createLBPolicy(java.lang.Class<? extends org.ow2.carol.cmi.lb.policy.ILBPolicy> lbPolicyClass)
throws LBPolicyFactoryException
lbPolicyClass - a class defining a LB policy
LBPolicyFactoryException - if the policy cannot be constructed
public static java.util.Map<java.lang.String,java.lang.Object> getProperties(org.ow2.carol.cmi.lb.policy.ILBPolicy<?> lbPolicy)
throws org.ow2.carol.cmi.lb.PropertyConfigurationException
org.ow2.carol.cmi.lb.PropertyConfigurationException
public static java.lang.Object getProperty(org.ow2.carol.cmi.lb.policy.ILBPolicy<?> lbPolicy,
java.lang.String propertyName)
throws org.ow2.carol.cmi.lb.PropertyConfigurationException
org.ow2.carol.cmi.lb.PropertyConfigurationException
public static java.lang.reflect.Type getPropertyRawType(java.lang.Class<? extends org.ow2.carol.cmi.lb.policy.ILBPolicy> lbPolicyClass,
java.lang.String propertyName)
throws org.ow2.carol.cmi.lb.PropertyConfigurationException
org.ow2.carol.cmi.lb.PropertyConfigurationException
public static java.lang.reflect.Type getPropertyType(java.lang.Class<? extends org.ow2.carol.cmi.lb.policy.ILBPolicy> lbPolicyClass,
java.lang.String propertyName)
throws org.ow2.carol.cmi.lb.PropertyConfigurationException
org.ow2.carol.cmi.lb.PropertyConfigurationException
public static java.util.Map<java.lang.String,LBPropertyData> getPropertyData(java.lang.Class<? extends org.ow2.carol.cmi.lb.policy.ILBPolicy> lbPolicyClass)
throws org.ow2.carol.cmi.lb.PropertyConfigurationException
org.ow2.carol.cmi.lb.PropertyConfigurationException
public static java.lang.Object convertString(java.lang.Class<? extends org.ow2.carol.cmi.lb.policy.ILBPolicy> lbPolicyClass,
java.lang.String lbPropertyName,
java.lang.String svalue)
throws org.ow2.carol.cmi.lb.PropertyConfigurationException
lbPropertyName - svalue - a value
org.ow2.carol.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.carol.cmi.lb.PropertyConfigurationException
org.ow2.carol.cmi.lb.PropertyConfigurationException
public static java.util.List<?> convertStrings(java.lang.Class<? extends org.ow2.carol.cmi.lb.policy.ILBPolicy> lbPolicyClass,
java.lang.String lbPropertyName,
java.util.List<java.lang.String> slist)
throws org.ow2.carol.cmi.lb.PropertyConfigurationException
org.ow2.carol.cmi.lb.PropertyConfigurationException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||