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

To add a new property to be displayed 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 is 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 table below.

JMX DescriptorDescriptionDefaultExample

propertyEditor

JMX descriptor to specify the editor class to be launched when the ellipsis button is clicked in the CPS. By default basic editors are shown for the 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

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

false

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

displayName

By default, the name for a property is introspected from the class.
To assign a different display name to a property, use the jmx.descriptor

 

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

Optional

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

false

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

Password

To inform that this property has password, it is rendered as "*****"

false

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

Index

Define the order in which properties appear in the Studio.

  • An Index should be a valid integer.
  • Indexes start from 0(zero) 
  • If not specified, the descriptor index is assumed to be 0 (zero)
  • The order of attributes is indeterminate, if they share the same index.

 

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

legalValues

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

 

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

canEditAsText

If this property is not specified, default value is false if legalValues are present and else true if the property has legal values

If this property is true, then an editable combo box is displayed.

false

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

Refresh

If 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 certain other properties.
This descriptor requires implementing the 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. The figure below 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 box is displayed when the value of the property changes. The Message to be shown in the warning dialog should be set using a value.

 

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

defaultValue

The default value to be set for the property when "Reset" is clicked (right-click the property to set the default value)

 

@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", and "none" in the box displayed. If this property is set to true, "none" will not be shown

false

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

Adaptavist ThemeBuilder EngineAtlassian Confluence