Creating Java Services to Use with Objects
This section provides two examples that demonstrate how to write simple Java services to get or create the necessary objects, manipulate the properties, and then place the objects on the pipeline within a flow.
![*](chapterTOC_bullet.png)
The first example illustrates how to write a service that creates an instance of a user-defined class and then inserts it into the pipeline where it can be passed to an adapter service instance in a flow.
![*](chapterTOC_bullet.png)
The second example shows how to extract a user-defined object from the pipeline and transform it into a document.
The EJB and associated classes used in these examples are as follows:
![*](chapterTOC_bullet.png)
The target bean is a stateless session EJB-
ComplexTrader. Its home interface exposes a
create method that takes no arguments and returns an instance of a
Trader.
![*](chapterTOC_bullet.png)
The
Trader object itself exposes two public methods:
buy and
sell. Each of these has the same signature:
public TradeResult buy (StockOrder order) throws RemoteException;
public TradeResult sell (StockOrder order) throws RemoteException;