Library Link To Toggle Frames Print Feedback

POJO Mode

In POJO mode the router sees messages as Java objects that represent the parameters of the operation invoked by the endpoint that sent the message.

Message handling

When the router operates in POJO mode it takes messages off of the transport and processes them using the same logic as a full Celtix Enterprise endpoint. As shown in Figure 4.1, “POJO Mode Message Processing”, the message is received by the transport layer, passed into the binding layer where it is turned into an XML representation of the data, and then it is marshalled into Java objects based on the method definition in the service endpoint interface (SEI). After the message is marshalled into Java objects, it is passed on to the router as a List of Java objects that contains one object for each parameter in the invoked methods parameter list.

[Important] Important

When using the router in POJO mode it must have access to the SEI.

Figure 4.1. POJO Mode Message Processing

message processing for POJO mode

Example

Given the SEI shown in Example 4.1, “Interface for Routing with POJO Mode”, the router's internal components would receive a java.util.List containing the following:

  • a java.lang.String object

  • a boolean value

Example 4.1. Interface for Routing with POJO Mode

package com.iona.demo;

...

@WebService(name="quoteReporter")
@SOAPBinding(use=Use.LITERAL, style=Style.RPC)
public interface quoteReporter
{
  public Quote getQuote(String ticker, boolean cached);
}

The response message would be passed through the router as a java.util.List containing a single com.iona.demo.Quote object.

Supported features

POJO mode is supported by the following features of the router:

  • operation-based routing

  • transport bridging

  • message format switching

  • chained processing

  • routing slip routes

  • recipient list routes

Strengths and weaknesses

POJO mode incurs the most processing overhead of the three data modes because every message must be marshalled and reserialized as it passes through the router. However, using POJO mode makes developing message processing elements easier by allowing developers to work with Java objects and not XML data. Because the processing elements work with Java objects they are also uneffected by changes to the underlying messaging and transport details.