The logic for creating and displaying CPS is inbuilt in the Fiorano framework. User can specify the properties that have to be displayed in the CPS (Figure 2) by specifying JMX descriptors (Figure 3) in the java files containing the configuration details. Such java files are java bean type classes which have getter and setter for all the fields and an empty constructor.

To add a new property that should be shown in the CPS

  1. Add a getter and setter defined for the property.
  2. Add jmx.managed-attribute descriptors above the method.
  3. Add other jmx descriptors describing how the property has to be rendered or handled in the CPS.


Figure 1: CPS containing My Property attribute required for component configuration


Figure 2: Java file showing the JMX descriptors for the property

All the JMX descriptors that can be added on the components getters are shown in the following table.

JMX DescriptorDescriptionDefaultExample

propertyEditor

JMX descriptor to specify the editor class which should be launched when … is clicked in the CPS. By default basic editors are shown for basic return type
example:
if the getter returns a File then a file chooser is shown

 

@ jmx.descriptor name="propertyEditor" value="com.fiorano.adapter.jca.db.editors.SQLConfigurationEditor"

Expert

JMX descriptorTo make a specific Property Advanced so that its not visible unless 'expert' view is switched on in the BCDK

false

@jmx.descriptor name="expert" value="true"

displayName

By default, in the GUI the display name for a property is introspected from the class.
in case you want to specify a more meaningful display name to a property, then that can be done using the jmx.descriptor

 

@jmx.descriptor name="displayName" value="My Display Name"

Optional

To notify the editor that this property is optional. Optional property names are rendered in new Color(0, 128, 0) in CPS.

false

@jmx.descriptor name="optional" value="true"

Password

To inform that this property is password and render as "*****"

false

@jmx.descriptor name="password" value="true"

Index

Define the order in which properties appear in Studio.
Index should be a valid value is integer;
Indexes start from 0(zero)
If you don't specify this descriptor index is assumed to be 0 (zero)
The order of attributes is indeterminate, if they have same index.

@jmx.descriptor name="index" value="1"

legalValues

If the property can take only a value from a list of some permissible values, then same should be provided as a JMX descriptor. The values must be provided as comma separated list.

 

@jmx.descriptor name="legalValues" value="Value1,Value2"

canEditAsText

if this property is not specified default value is false if legalValues are present else true
if prop has legal values and canEditAsText is true, then you will see an editable combo box

false

@jmx.descriptor name="canEditAsText" value="true"

Refresh

If it is set to true for an attribute then all the attributes of the MBean are refreshed when the value changes

false

@jmx.descriptor name="refresh" value="true"

hidesProperties

JMX descriptor to indicate that change in the value of this attribute hides some other properties.
This descriptor also requires implementing method java.util.List fetchHiddenProperties()
Example:
class SampleBCConnection{
getProxyUsed (boolean use);
getProxyUser (String user);
getProxyPassword (String pwd);
}
To show properties ProxyUser and ProxyPassword only when ProxyUsed is true; change that above code as follows:
 class SampleBCConnection{
 /**
*@jmx.managed-attribute access="read-write" description="Determines whether proxy should be used to connect"
*@jmx.descriptor name="displayName" value="Use proxy?"

  • @jmx.descriptor name="hidesProperties" value="true"
    **/ 
    getProxyUsed(boolean use);
     getProxyUser(String user);
    getProxyPassword(String pwd);
    /**
  • @return
  • @jmx.managed-operation descriptor="get Hidden Properties"
    */
    public java.util.List fetchHiddenProperties()
    {
    return isProxyUsed() ? Collections.EMPTY_LIST: Arrays.asList(new String[] { "ProxyUser", "ProxyPassword" });
    }
    }

 

@jmx.descriptor name="hidesProperties" value="true"

propertySets
and
propertySetIndex

These descriptors are used to categorize or group properties under different propertySets. Below figure shows the use propertySets and propertySetIndex descriptors to define the propertySets and group properties under propertySets respectively.

Figure 3: code snippet showing the use of propertySets and propertySetIndex

Figure 4: CPS containing properties grouped under property Sets
The order of attributes within property set is still derived from "index"
If "propertySets" is defined for mbeans; all attributes with "propertySetIndex" not set lies in propertySet 0 (zero)
any property whose propertySetIndex is out-of-range lies in propertySet 0 (zero)
the overlapping of propertySets among multiple mbeans is undefined;

 

 

warningMessage

A warning Dialog pops up whenever the value of the property changes. The Message to be shown in the warning dialog should be set using value

 

@jmx.descriptor name="warningMessage" value="The Message comes here"

defaultValue

The default value which should be set for the property when "Reset" is clicked (Comes up on right-clicking the property)

 

@jmx.descriptor name="defaultValue" value="10"

minValue

Minimum value acceptable for the property

 

@jmx.descriptor name="minValue" value="0"

maxValue

Maximum value acceptable for the property

 

@jmx.descriptor name="maxValue" value="1000"

primitive

Used for Boolean properties, By Default a property specified Boolean shows "yes", "no", "none" in the combo box. If this property is set to true, "none" will not be shown

false

@jmx.descriptor name="primitive" value="true"

Adaptavist ThemeBuilder EngineAtlassian Confluence