WebSphere brand IBM WebSphere Sensor Events, Version 6.2

Working with Reusable Components

Reusable Components are WebSphere® Sensor Events task agents that can react to handle a sensor event or to provide information back to the caller or onto an SIBus. They are provided as a suite of business-level services, and they also define the programming model for building custom agents on WebSphere Sensor Events that can handle events and expose services to applications.

Configuring Reusable Components

Each Reusable Component is a task agent and has configuration properties that can be modified in the WebSphere Sensor Events Administrative Console. For details on how to use the WebSphere Sensor Events Administrative Console to modify an agent, see Working with agents in the WebSphere Sensor Events information center.

The common configuration properties for all Reusable Components are:

ruc.targetBackend
A Reusable Component provides many interfaces to a set of services, and can also include the implementation logic. Alternatively, the separation of the implementation logic into an enterprise application known as the back-end implementation is also supported.

This property defines the target interface or enterprise application that contains the Reusable Component implementation logic, such as ruc.epcis, ruc.wse, ruc.its, ruc.db, or ruc.custom. For example:

  • Setting the value to ruc.epcis in the Observation Reusable Component means you want the output to go to a standard EPCIS interface.
  • Setting the value to ruc.wse in the EPC Reusable Component means you want to generate EPCs using WebSphere Sensor Events.
  • Setting the value to ruc.db means you want to use a local database.
  • Setting the value to ruc.its means the back-end implementation will use the most efficient methods for integration with InfoSphere™ Traceability Server, even if those methods are not part of the EPCIS specification. For example, this back-end implementation supports EPC generation for the EPC Reusable Component and master data queries in the Info Reusable Component.

Setting value to ruc.custom means that you will use a custom back-end implementation. When using ruc.custom as the value, you must also specify an additional ruc.targetBackendJNDI property to point to the new back-end EJB, using its JNDI name. See Creating a Reusable Component and a back-end implementation for details about creating a customer back-end implementation.

When updating the targetBackend property, make sure the Reusable Component is targeted toward a back-end implementation that uses all of the specific back-end interfaces that the Reusable Component needs to call. The following table shows the mapping of the Reusable Components to the back-end interfaces that they need.

Table 1. Mapping of back-end interfaces to Reusable Components
Reusable Component Possible Back-End Interfaces Name of the Back-End Interface to Use with ruc.custom
Aggregation ruc.db, ruc.epcis, ruc.custom Aggregation
Asset Management ruc.db, ruc.custom Asset Management, Asset Type Management
BAE not applicable not applicable
Commissioning ruc.db, ruc.epcis, ruc.its, ruc.custom Commissioning
Decommissioning ruc.db, ruc.epcis, ruc.its, ruc.custom Commissioning
Disaggregation ruc.db, ruc.epcis, ruc.custom Aggregation
EPC ruc.its, ruc.wse, ruc.custom EPC Management
EPCIS Connector not applicable not applicable
Inference ruc.db, ruc.its, ruc.custom Aggregation Inference
Info ruc.its, ruc.custom Aggregation Inference, EPC Detailed Query, Master Data
Locating ruc.db, ruc.epcis, ruc.custom Observation
Observation ruc.db, ruc.epcis, ruc.custom Observation
Print ruc.wse, ruc.custom EPC Print
Reporting ruc.db, ruc.epcis, ruc.custom Observation
Validation ruc.db, ruc.epcis, ruc.its, ruc.custom Commissioning
WBE not applicable not applicable
ruc.targetBackendJNDI
This property is used when you have a custom back-end implementation (ruc.custom). Use this property to point to the new back-end EJB.
action-name.output.success
The topic to use for a response from the message-driven bean (MDB) when an action is successful.
action-name.output.failure
The topic to use a response from the MDB when an action is unsuccessful.

Each Reusable Component can have multiple actions, so you may need multiple versions of the action-name.output.success and action-name.output.failure properties. Also, certain Reusable Components have additional properties that are further explained in the individual topics for each Reusable Component.

You also use the WebSphere Sensor Events Administrative Console to set the endpoints for the Reusable Components. The endpoints are necessary when you are using Web services to call InfoSphere Traceability Server. You can set the endpoints as properties in either the WebSphere Sensor Events SystemAgent or in each individual Reusable Component task agent. Setting the endpoints in the SystemAgent means that any Reusable Component can use them, while setting the endpoints in individual Reusable Component task agents means you that particular agent will use those endpoints. You can also leave the endpoint property value empty in a task agent if you are not using ruc.epcis or ruc.its as the back-end implementation in that specific Reusable Component.

Use the following properties to set the complete endpoint, or a specific part of the endpoint:

The following values are supported for the remote_system name epcis, which is used by the ruc.epcis back-end implementation for all queries and the ruc.its back-end implementation for many queries:

Important:
  • Priority is given to the endpoint property over the extension property, if they are both provided.
  • Priority is given to the value of the endpoints in the Reusable Component task agents over the value of the endpoints in the SystemAgent, if they are both provided.

Methods for invoking Reusable Components

There are three methods for invoking Reusable Components: stateless session beans, Web services, and MDBs.

Stateless session beans and Web services are synchronous calls, meaning that if those methods returns a value, then they will return that value directly. The MDBs are asynchronous, meaning that when a message is sent to the Reusable Component, the Reusable Component sends a response to the SIBus, instead of directly returning the response value. To retrieve the response value, you must subscribe to the response message topic. The topic names are configurable for each action in each Reusable Component.

Stateless session bean methods
To use this method:
  1. Obtain the Reusable Component ibmruc_rucimpl_ejbClient.jar file from the WebSphere Sensor Events lib directory. See Copying the required JAR files for more information on the files required to call a Reusable Component.
  2. Use the JNDI name of the Reusable Component to get the EJB's remote interface in your application or business process.

For more information, refer to the exact API for each Reusable Component that is explained in each Reusable Component detail topic. The API is also in the Javadoc information.

Web services interfaces
To use Web services interfaces:
  1. Obtain the Reusable Component's WSDL from the WebSphere Sensor Events lib directory.
  2. Use the WSDL to call the Reusable Component from your application or business process.

For more information, refer to the API that is a subset of the session bean methods, as indicated in each Reusable Component detail topic.

Message-driven beans
Invoking the Reusable Components as MDBs requires you to configure the activation specifications for Reusable Components and their message selectors.
  • Determine the activation specification values for the Reusable Component.
  • Publish an ISensorEvent with a specific action to the SIBus that matches the message selector.
  • Optional: Subscribe to the reply topics for the Reusable Component's success and failure results.

Library | Support | Terms of use

(c) Copyright IBM Corporation 2004, 2009. All rights reserved.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.