ESB

Default CPS

Functionality

This sample shows how to write a JMXBased property sheet where all the configuration parameters are defined using JMX attributes.

Default Behavior

By default, there is no business logic or send logic implemented in the component's code. So it does not send out any message to the output port.

Changes required to use a different CPS

  1. A class which holds the configuration should be created

    com.fiorano.edbc.defaultcps.model.DefaultCPSPM
    
  2. This class contains the CPS properties described as JMX attributes.

  3.  Add the following lines In etc\ServiceDescriptor.xml under "execution" element after "separate-process" element

    <cps>
    	<launcher>com.fiorano.edbc.defaultcps.model.DefaultCPSPM</launcher>
    </cps>
    
  4. Under "servicerefs" element, make the following service reference changes:

    Add

    <serviceref guid="TifosiJavaRTL" version="4.0" />
    <serviceref guid="BCCommon" version="4.0" />
    

    Remove

    <serviceref guid="FioranoJavaRTL" version="4.0" />
    
  5. Add 'cpsClass' and 'cpsMandatory' (if the configuration is mandatory) attributes in service-export ant task (present in the target "deploy") in common.xmlas shown below:

    <?xml version="1.0" encoding="UTF-8"?>
    <service-export destfile="export.zip" servicefile="etc/ServiceDescriptor.xml" resourcesfile="etc/resources.properties" executionClass="com.fiorano.edbc.defaultcps.DefaultCPS" cpsClass="com.fiorano.edbc.defaultcps.model.DefaultCPSPM" cpsMandatory="false" inMemoryClass="com.fiorano.edbc.defaultcps.DefaultCPS" defaultLogModule="com.fiorano.edbc.defaultcps.defaultCPS">
       <fileset dir="${deploy.dir}">
          <include name="${jar.path}" />
       </fileset>
    </service-export>
    
  6. Make the following changes to the elements below.

Elements

Changes Required

ILookupConfiguration.java

Add method String getConfigurationLookupName();

RuntimeArguments.java

Add and implement method String getConfigurationLookupName();

LookupHelper.java

Add field String configurationLookupName and initialize in constructor

Add and implement method Object lookupSerializedConfiguration() throws NamingException

DefaultCPS.java

Add field DefaultCPSPM configuration
Initialize field configuration in void start(String[] args) and change the throws list accordingly

Provide getter for configuration.

DefaultCPSMessageListener.java

Change constructor to take CustomCPSPM instead of RuntimeArguments

JMSObjects.java

Change DefaultCPSMessageListener constructor in create() method to pass configuration object instead of runtime arguments object.

  • To check the functionality of this component, it should be registered with the server.

  • The steps to register the samples is specified in the Sample Templates section.