com.ca.jcs.cfg
Class MetaPluginConfig

java.lang.Object
  extended by com.ca.jcs.cfg.MetaPluginConfig

public class MetaPluginConfig
extends Object

Configuration bean that allows mapping of metadata properties (and optionally their values) to the plug-in classes required to handle them.


Constructor Summary
MetaPluginConfig()
           
 
Method Summary
 Object createClassPlugin(MetaObjectClassMapping classMap)
          Create a plugin looking first for a constructor taking classMap as an argument.
 Object createPlugin(Object consArg)
          Calls createPlugin(Object, Class) assuming constructor argument is concrete class of consArg.
 Object createPlugin(Object consArg1, Class consArgClass1)
          Create a plug-in first looking for a constructor taking consArg1 (with class as defined in constructor argument passed in).
 Object createPluginFlexibleCons(Object consArg1, Class consArgClass1, Object consArg2, Class consArgClass2)
          Create a plug-in first looking for a constructor taking both consArg1 and consArg2 (with classes as defined in constructor arguments passed in), and secondly looking for constructor taking only consArg2 by itself).
 Object createPropertyPlugin(MetaObjectClassMapping classMap, DataModelProperty prop)
          Create a plugin looking first for a constructor taking both classMap and prop as arguments, otherwise falling back one taking just prop as an argument.
 List<String> getMetadataPropNames()
           
 Class getPluginClass()
           
 Object getPluginConfig()
          An optional object can be passed to the plugin in its constructor, allowing it's behaviour to be modulated for a specific plugin entry (eg whether it should be considered active by default etc).
 String getType()
          Config can either be triggered using a type (eg "BOOL", "COMPOUND_VALUE_CLASS_REF" or "COMPOUND_VALUE_CLASS_REF:MyClass") or by using metadataPropNames as triggers.
 boolean isApplicableToAllProps()
          Plugin application isn't driven by metadata property list, but rather its constructor is called for every datamodel property and needs to veto those it doesn't apply to by throwing a plug-in not required exception.
 boolean isApplicableToType(DataModelValue val)
           
 boolean isOverrideValuePlugin()
          Deprecated.  
 void setMetadataPropNames(List<String> metadataPropNames)
           
 void setOverrideValuePlugin(boolean overridesValuePlugin)
          Deprecated. 
 void setPluginClass(Class pluginClass)
           
 void setPluginConfig(Object pluginConfig)
           
 void setType(String type)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MetaPluginConfig

public MetaPluginConfig()
Method Detail

isOverrideValuePlugin

@Deprecated
public boolean isOverrideValuePlugin()
Deprecated. 

If true then specifies a plugin overrides a specific plugin already triggered by a properties datamodel value type, for instance an enum will be given an enum value validator by default but this maybe later overriden based on some controlling metadata settings such as MetaDataDefs.MD_IS_STORE_SYMBOLIC which affect the plug-in's behaviour.

Returns:
True if existing datamodel value plug-in should be clear if this config results in a more specific plug-in being created.

setOverrideValuePlugin

@Deprecated
public void setOverrideValuePlugin(boolean overridesValuePlugin)
Deprecated. 


isApplicableToAllProps

public boolean isApplicableToAllProps()
Plugin application isn't driven by metadata property list, but rather its constructor is called for every datamodel property and needs to veto those it doesn't apply to by throwing a plug-in not required exception.

Returns:
True if plugin can potentially apply to all datamodel properties, regardless of their metadata settings.

getType

public String getType()
Config can either be triggered using a type (eg "BOOL", "COMPOUND_VALUE_CLASS_REF" or "COMPOUND_VALUE_CLASS_REF:MyClass") or by using metadataPropNames as triggers. Using a type trigger has the following advantages of using a typeToPluginMap entry in a suite:
  1. The whole property is passed in to the plug-in's constructor, rather then just the property's value, allowing access to all metadata settings on it.
  2. The plug-in can optionally have a configuration object passed in to its constructor.


setType

public void setType(String type)

getMetadataPropNames

public List<String> getMetadataPropNames()

setMetadataPropNames

public void setMetadataPropNames(List<String> metadataPropNames)

getPluginClass

public Class getPluginClass()

setPluginClass

public void setPluginClass(Class pluginClass)

getPluginConfig

public Object getPluginConfig()
An optional object can be passed to the plugin in its constructor, allowing it's behaviour to be modulated for a specific plugin entry (eg whether it should be considered active by default etc).

Returns:
The configuration object specified in the server_jcs.xml file, or null if none was.

setPluginConfig

public void setPluginConfig(Object pluginConfig)

createPluginFlexibleCons

public Object createPluginFlexibleCons(Object consArg1,
                                       Class consArgClass1,
                                       Object consArg2,
                                       Class consArgClass2)
Create a plug-in first looking for a constructor taking both consArg1 and consArg2 (with classes as defined in constructor arguments passed in), and secondly looking for constructor taking only consArg2 by itself). If this class has a specialized configuration object to be passed in to the plugin then it is passed in as the first argument.

Parameters:
consArg1 - Optional argument to constructor.
consArgClass1 - Defined class for constructor argument matching consArg1 (may be defined as a base class instead of just consArg1.getClass())
consArg2 - Mandatory argument to constructor.
consArgClass2 - Defined class for constructor argument matching consArg2 (may be defined as a base class instead of just consArg2.getClass())
Returns:
Plugin object, or null if problem invoking constructor or if constructor throws PluginNotRequiredException after performing analysis of metadata.

createPlugin

public Object createPlugin(Object consArg1,
                           Class consArgClass1)
Create a plug-in first looking for a constructor taking consArg1 (with class as defined in constructor argument passed in). If this class has a specialized configuration object to be passed in to the plugin then it is passed in as the first argument.

Parameters:
consArg1 - Optional argument to constructor.
consArgClass1 - Defined class for constructor argument matching obj1 (may be defined as a base class instead of just obj1.getClass())
Returns:
Plugin object, or null if problem invoking constructor or if constructor throws PluginNotRequiredException after performing analysis of metadata.

createPlugin

public Object createPlugin(Object consArg)
Calls createPlugin(Object, Class) assuming constructor argument is concrete class of consArg.


createPropertyPlugin

public Object createPropertyPlugin(MetaObjectClassMapping classMap,
                                   DataModelProperty prop)
Create a plugin looking first for a constructor taking both classMap and prop as arguments, otherwise falling back one taking just prop as an argument.

Parameters:
classMap - Contains metadata for whole object class which defined prop.
prop - Property which plugin may be required (plugins constructor may veto).
Returns:
Created plugin object.

createClassPlugin

public Object createClassPlugin(MetaObjectClassMapping classMap)
Create a plugin looking first for a constructor taking classMap as an argument.

Parameters:
classMap - Contains metadata for whole object class which defined prop.
Returns:
Created plugin object.

isApplicableToType

public boolean isApplicableToType(DataModelValue val)

toString

public String toString()
Overrides:
toString in class Object


Created 2011-07-14 13:27 EST