Contents

Fiorano 10 provides EDBC templates which aid in component development. These templates provide lightweight services which do not have framework.

Three types of templates are supported for EDBC components:

  1. Simple JMS
  2. Multi Threaded
  3. POJO (Plain Old Java Object)

Scripts

The scripts required for generation of these services are present in the following location:

Windows: edbctemplates.bat file present in %FIORANO_HOME%\esb\tools\templates
Linux: edbctemplates.sh file present in %FIORANO_HOME%/esb/tools/templates

Simple JMS

Generating Template

  1. Execute %FIORANO_HOME%\esb\tools\templates\templates-console.bat [sh]

  2. From the command prompt, launch the wizard using %FIORANO_HOME%/esb/tools/templates/edbctemplates.bat [sh]
    Syntax: edbctemplates.bat [sh] –dest <dir> 

    Icon

    <dir> represents the target directory where the component code is generated.

    Example
  3. Provide service details in Service Information panel and click Next.


    Figure 1: Details of service
     
  4. In Runtime Arguments panel, add the required runtime arguments.


    Figure 2: Adding runtime arguments
     
  5. In the Template Information panel, select 'SimpleJMS' from the Select the template to be used drop-down.


    Figure 3: Specifying template to use

  6. Specify the required number of input and output ports and click Finish.

Component Development

Adding Business Logic

Business logic should be added in onMessage(Message msg) method of ${ServiceGUID}MessageListener (in the above example SimpleJMSMessageListener) class

${ServiceGUID}MessageListener showing method where business logic should be added

Accessing Runtime Arguments

Runtime arguments passed to the service can be accessed using runtimeArguments.getParameter("<runtime argument>")

Accessing runtime arguments

Sending Messages on Output Port

Messages can be sent to the required output port using producer.send((Destination) outputDestinations.get("<output port name>"), <message>);

Sending message on output port "OUT_PORT_1"

Multi Threaded

Generating Template

  1. Execute %FIORANO_HOME%\esb\tools\templates\templates-console.bat [sh].

  2. From the command prompt, launch the wizard using %FIORANO_HOME%\esb\tools\templates\edbctemplates.bat [sh].
    Syntax: edbctemplates.bat [sh] –dest <dir>

    Icon

    <dir> represents the target directory where the component code is generated.

    Example
  3. Provide service details in theService Information panel and click Next.


    Figure 4: Details of service
     
  4. In Runtime Arguments panel, add required runtime arguments.


    Figure 5: Adding runtime arguments
     
  5. In the Template Information panel, select MultiThreaded, specify the required number of input and output ports, and then click Finish.


    Figure 6: Specifying template to use

Component Development

Adding Business Logic

Business logic should be added in the execute() method of the ${ServiceGUID}Job (in the above example MultiThreadedJob) class

${ServiceGUID}job showing method where business logic should be added

Accessing Runtime Arguments

Runtime arguments passed to the service can be accessed using runtimeArguments.getParameter("<runtime argument>")

Accessing runtime arguments

Sending Messages on Output Port

Messages can be sent oto the required output port using sender.send((<message>,"<output port name>");

Sending message on output port "OUT_PORT_1"

 POJO

Generating Template

  1. Execute %FIORANO_HOME%\esb\tools\templates\templates-console.bat [sh].

  2. From the command prompt launch the wizard using FIORANO_HOME%\esb\tools\templates\edbctemplates.bat [sh]
    Syntax: edbctemplates.bat [sh] –dest <dir>

    Icon

    <dir> represents the target directory where the component code is generated.

    Example
  3. Provide the service details in the Service Information panel and click Next.


    Figure 7: Details of service
     
  4. In the Runtime Arguments panel, add the required runtime arguments.


    Figure 8: Adding runtime arguments
     
  5. In the Template Information panel, select POJO.
     
  6. Select jar file containing the required POJO class.
     
  7. Select the required method from the list of methods displayed.
    Methods with the following signatures alone appear:
    • public static void <method_name>(String)
    • public static void <method_name>(Message)
    • public static Message <method_name>(Message)
    • public static Message <method_name>(String)
    • public static String <method_name>(Message)
    • public static String <method_name>(String)


    Figure 9: Specifying template to use and selecting required method

Component generated for a POJO contains one input-output pair for each method selected. However, if the return type is void, output port will not be generated for that method.

When a message arrives at an input port, the associated method is invoked, and the response is sent to the respective output port if present.

Component Development

Business logic is generated into component and can be used as it is.

Adaptavist ThemeBuilder EngineAtlassian Confluence