ESB
13.2 13.1 13.0 12.2 12.1 12.0 11.0
13.2 13.1 13.0 12.2 12.1 12.0 11.0

Custom CPS

Contents

Functionality

This component is aimed at demonstrating the addition of custom CPS.

This sample shows how to write a new custom property sheet and how to handle the configuration serialization and deserialization.

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.customcps.model.CustomCPSPM
    
  2. A property sheet class containing UI which should be shown when CPS is launched should be created

    com.fiorano.edbc.customcps.ps.CustomCPSPropertySheet
    


    This property sheet class should extend TifosiCustomPropertySheet.
     

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

    <cps>
    	<launcher>com.fiorano.edbc.service.PropertySheet</launcher>
    </cps>
    

     

    1. Add following service references under "servicerefs" element

      <serviceref guid="TifosiUIFramework" version="4.0" /> 
      <serviceref guid="BCCommon" version="4.0" />
      
    2. Remove

      <serviceref guid="FioranoJavaRTL" version="4.0" />
      
  4. Add 'cpsClass' and 'cpsMandatory' (if the configuration is mandatory) attributes in service-export ant task (present in the target "deploy") in common.xml as 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.customcps.CustomCPS" cpsClass="com.fiorano.edbc.customcps.ps.CustomCPSPropertySheet" cpsMandatory="true" inMemoryClass="com.fiorano.edbc.customcps.CustomCPS" defaultLogModule="com.fiorano.edbc.customcps.customCPS">
       <fileset dir="${deploy.dir}">
          <include name="${jar.path}" />
       </fileset>
    </service-export>
    

Now 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

CustomCPS.java

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

Provide getter for configuration.

CustomCPSMessageListener.java

Change constructor to take CustomCPSPM instead of RuntimeArguments

JMSObjects.java

Change CustomCPSMessageListener 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.