JBI Specification
JBI Specification
JBI Specification
Final Release
August 17, 2005
Editors:
Ron Ten-Hove
Peter Walker
August 17, 2005 Java Business Integration 1.0 Final Release iii
IF YOU OBTAINED ACCESS TO THIS SPECIFICATION BY MEANS OF A LICENSE FROM SUN THAT AUTHORIZED
YOU TO CREATE AND/OR DISTRIBUTE INDEPENDENT IMPLEMENTATIONS OF THE SPECIFICATION, OR IF YOU
OBTAINED ACCESS TO THIS SPECIFICATION BY OTHER MEANS BUT WISH TO USE THE SPECIFICATION TO
CREATE AND/OR DISTRIBUTE INDEPENDENT IMPLEMENTATIONS OF THE SPECIFICATION, THEN the
FOLLOWING PROVISIONS APPLY:
LIMITED LICENSE GRANTS
1. License for Evaluation Purposes. Sun hereby grants you a fully-paid, non-exclusive, non-transferable, worldwide, limited
license (without the right to sublicense), under Sun's applicable intellectual property rights to view, download, use and reproduce
the Specification only for the purpose of internal evaluation. This includes (i) developing applications intended to run on an
implementation of the Specification, provided that such applications do not themselves implement any portion(s) of the
Specification, and (ii) excerpting brief portions of the Specification in oral or written communications which discuss the
Specification provided that such excerpts do not in the aggregate constitute a significant portion of the Technology.
2. License for the Distribution of Compliant Implementations. Sun also grants you a perpetual, non-exclusive, non-transferable,
worldwide, fully paid-up, royalty free, limited license (without the right to sublicense) under any applicable copyrights or, subject
to the provisions of subsection 4 below, patent rights it may have covering the Specification to create and/or distribute an
Independent Implementation of the Specification that: (a) fully implements the Specification including all its required interfaces
and functionality; (b) does not modify, subset, superset or otherwise extend the Licensor Name Space, or include any public or
protected packages, classes, Java interfaces, fields or methods within the Licensor Name Space other than those required/
authorized by the Specification or Specifications being implemented; and (c) passes the Technology Compatibility Kit (including
satisfying the requirements of the applicable TCK Users Guide) for such Specification ("Compliant Implementation"). In
addition, the foregoing license is expressly conditioned on your not acting outside its scope. No license is granted hereunder for
any other purpose (including, for example, modifying the Specification, other than to the extent of your fair use rights, or
distributing the Specification to third parties). Also, no right, title, or interest in or to any trademarks, service marks, or trade names
of Sun or Sun's licensors, Sun or the Sun's licensors is granted hereunder. Java, and Java-related logos, marks and names are
trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries.
3. Pass-through Conditions. You need not include limitations (a)-(c) from the previous paragraph or any other particular "pass
through" requirements in any license You grant concerning the use of your Independent Implementation or products derived from
it. However, except with respect to Independent Implementations (and products derived from them) that satisfy limitations (a)-(c)
from the previous paragraph, You may neither: (a) grant or otherwise pass through to your licensees any licenses under Sun's
applicable intellectual property rights; nor (b) authorize your licensees to make any claims concerning their implementation's
compliance with the Spec in question.
4. Reciprocity Concerning Patent Licenses.
a. With respect to any patent claims covered by the license granted under subparagraph 2 above that would be infringed by all
technically feasible implementations of the Specification, such license is conditioned upon your offering on fair, reasonable and
non-discriminatory terms, to any party seeking it from You, a perpetual, non-exclusive, non-transferable, worldwide license under
Your patent rights which are or would be infringed by all technically feasible implementations of the Specification to develop,
distribute and use a Compliant Implementation.
b With respect to any patent claims owned by Sun and covered by the license granted under subparagraph 2, whether or not their
infringement can be avoided in a technically feasible manner when implementing the Specification, such license shall terminate
with respect to such claims if You initiate a claim against Sun that it has, in the course of performing its responsibilities as the Sun,
induced any other entity to infringe Your patent rights.
c Also with respect to any patent claims owned by Sun and covered by the license granted under subparagraph, where the
infringement of such claims can be avoided in a technically feasible manner when implementing the Specification such license,
with respect to such claims, shall terminate if You initiate a claim against Sun that its making, having made, using, offering to sell,
selling or importing a Compliant Implementation infringes Your patent rights.
5. Definitions. For the purposes of this Agreement: "Independent Implementation" shall mean an implementation of the
Specification that neither derives from any of Sun's source code or binary code materials nor, except with an appropriate and
separate license from Sun, includes any of Sun's source code or binary code materials; "Licensor Name Space" shall mean the
public class or interface declarations whose names begin with "java", "javax", "com.sun" or their equivalents in any subsequent
naming convention adopted by Sun through the Java Community Process, or any recognized successors or replacements thereof;
and "Technology Compatibility Kit" or "TCK" shall mean the test suite and accompanying TCK User's Guide provided by Sun
which corresponds to the Specification and that was available either (i) from Sun's 120 days before the first release of Your
2 Introduction ................................................................................................... 1
Summary ..................................................................................................................................................... 1
Scope ........................................................................................................................................................... 1
Target Audience .......................................................................................................................................... 2
Organization ................................................................................................................................................ 2
Conventions ................................................................................................................................................ 2
Expert Group ............................................................................................................................................... 3
Status of this Document .............................................................................................................................. 4
3 Overview ......................................................................................................... 5
Definitions ................................................................................................................................................... 7
Rationale & Assumptions ........................................................................................................................... 7
Goals ........................................................................................................................................................... 8
Relationship to other Specifications and Technologies .............................................................................. 8
Roles ............................................................................................................................................................ 8
6 Management ................................................................................................. 59
Overview ................................................................................................................................................... 59
Key Concepts ............................................................................................................................................ 60
Packaging .................................................................................................................................................. 64
Installation Service .................................................................................................................................... 71
Component Life Cycle .............................................................................................................................. 74
Deployment Service .................................................................................................................................. 78
Service Unit Life Cycle ............................................................................................................................. 81
Service Assembly Life Cycle .................................................................................................................... 82
MBean Status and Result Strings .............................................................................................................. 83
Ant Script Support .................................................................................................................................... 86
August 17, 2005 Java Business Integration 1.0 Final Release vii
Contents
August 17, 2005 Java Business Integration 1.0 Final Release viii
Contents
This is the Public Final version of the Java Business Integration (JBI) 1.0 specification.
Please address comments about this specification to [email protected].
August 17, 2005 Java Business Integration 1.0 Final Release xii
CHAPTER 2
Introduction
2.1 Summary
Enterprise application integration (EAI) and business-to-business integration (B2B) solutions have traditionally
required the use of non-standard technologies to create functional systems. This has required end users to either
“lock in” to a single vendor of such technologies, or create their own. Each approach has disadvantages. No
single vendor can cover the vast functional space of EAI and B2B (consider the thousands of applications and
protocols to be supported). This leaves users of integration technologies in the uncomfortable position
of selecting less than ideal solutions to their integration problems, and paying dearly for them.
Java™ Business Integration (JBI) seeks to address this problem by creating a standards-based architecture for
integration solutions. This infrastructure allows third-party components to be “plugged in” to a standard
infrastructure, and allows those components to interoperate in a predictable, reliable fashion despite being
produced by separate vendors. It is anticipated that this ability to interoperate will create a multivendor
“ecosystem” which will give rise to large pool of integration-related technologies that can be sourced by end
users. In addition, this ecosystem will foster new innovations in integration technologies, since it will permit
innovators to concentrate on a particular technology or problem area, without having to worry about providing
all the other pieces needed to build a complete integration solution.
Every integration problem is unique; an appropriate combination of JBI-compliant components will provide a
solution that is sized appropriately to the problem at hand. By avoiding lock-in to a particular vendor of
integration technologies, the user is free to choose components that provide the particular functions that he or
she needs, and be assured that a functional integration solution can be assembled from those pieces.
In the past, attempts to compose third-party components into systems that have the attributes required of
enterprise systems have not been very successful. JBI addresses this by adopting a service-oriented architecture
(SOA), which maximizes the decoupling between components, and creates well-defined interoperation
semantics founded on standards-based messaging. The SOA approach creates many other benefits that are
applicable to enterprise integration solutions.
2.2 Scope
The membership of the JSR 208 Expert group is largely composed of business-oriented engineers and designers
and this specification reflects their biases, priorities, requirements and experiences. In general, this specification
is scoped to the needs and requirements of business solution providers.
This specification is considered to be complimentary to the J2EE™ Platform specification. JBI does not require
the J2EE™ platform though there is a clear dependency on the J2SE™ platform. It is worth noting that the
J2EE™ platform may choose to reference this specification in the future.
2.4 Organization
This document is organized such that the initial sections provide some context and rationale for the JSR 208
initiative within the framework of the Java Community Process. Subsequent sections provide use-cases and
relevant examples as a clarification of the Application Programming Interfaces (APIs) and Service Provider
Interfaces (SPIs) specified in subsequent sections of the document.
2.5 Conventions
The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD
NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in this document are to be interpreted as described in
[RFC 2119]
Java code and XML fragments are formatted as shown in Listing 1
package com.foo.example;
class Runner {
public static void main(String[] args) {
System.out.println("Hello, Universe!");
}
}
Listing 1 Example code fragment
This specification uses a number of XML namespace prefixes throughout; they are listed in Table 1
JBI defines an architecture that allows the construction of integration systems from plug-in components, that
interoperate through the method of mediated message exchange. The message exchange model is based on the
web services description language 2.0 [WSDL 2.0] or 1.1 [WSDL 1.1].
Figure 1 illustrates, at a high level, the JBI concept of plug-in components. JBI provides specific interfaces for
use by a plug-in, while the plug-in provides specific interfaces for use by JBI. Components do not interact with
each other directly. Instead, as shown in Figure 2, JBI functions as an intermediary to route messages from
component to component. This separation of the participants in an exchange is key to decoupling service
providers from consumers, which is highly desirable in service-oriented architectures generally, and in
integration solutions in particular. This preserves flexibility, since consumer and provider are minimally
intertwined, and provides a key point for message processing and monitoring in JBI implementations. Note also
that this processing is inherently asynchronous; provider and consumer never share a thread. This also helps
keep components decoupled.
In this WSDL-based, service-oriented model, JBI plug-in components are responsible for providing and
consuming services. By providing a service, a component is making available a function or functions that can
be consumed by other components (or even itself). Such functions are modelled as WSDL 2.0 operations,
which involve the exchange of one or more messages. A set of four WSDL-defined, basic message exchange
patterns (MEPs) crisply defines the sequence of messages allowed during execution of an operation. This
shared understanding, between consumer and provider components, of the message exchange pattern is the
foundation of interoperability of such components in JBI.
The services provided by components (if any) are described to JBI by the component, using WSDL 1.1 or 2.0.
This provides an abstract, technology-neutral model of services using XML-based message exchanges. WSDL
also provides a mechanism for declaring additional service metadata of interest to service consumers and JBI
itself. Components can query JBI for the for the WSDL describing available services.
As shown in Figure 1, JBI components plug into what is termed the JBI framework. It is expected that such
components will be made available to end users from third parties, particularly where common or standardized
functions are needed in typical integration problems.
The components are divided into two distinct types:
• Service Engine (SE). SEs provide business logic and transformation services to other components, as well
as consume such services. SEs can integrate Java-based applications (and other resources), or applications
with available Java APIs.
• Binding Component (BC). BCs provide connectivity to services external to a JBI environment. This can
involve communications protocols, or services provided by Enterprise Information Systems (EIS
resources). BCs can integrate applications (and other resources) that use remote access technology that is
not available directly in Java.
Service engines and binding components can function as service providers, consumers, or both. (The distinction
between SEs and BCs is purely pragmatic, but is based on sound architectural principles. The separation of
business (and processing) logical from communications logic reduces implementation complexity, and
increases flexibility.)
In addition to a messaging system designed to promote component interoperability, JBI defines a management
structure, based on Java Management eXtensions (JMX). JBI provides standard mechanisms for:
• Installing components.
• Managing a component’s life cycle (stop/start etc.)
• Deploying service artifacts to components.
The last item requires some explanation. JBI components often function as a type of container, to which
artifacts can be deployed to add new service consumer or provider logic. For example, a service engine that
provides XSLT-based transformation services would have XSLT style sheets deployed to it, in order to add new
transformation operations. This process of adding such component-specific artifacts to an installed component
is called deployment, to distinguish it from component installation. JBI terms a collection of deployment
artifacts and associated metadata a service assembly. This type of collection of service-related artifacts and
metadata is referred as a composite service description (CSD) in some literature.
3.1 Definitions
JBI does not define a traditional application programming model. Instead, it embraces a service-oriented
approach to structuring enterprise functions, where JBI plug-in components function as service providers and
consumers. The APIs and SPIs defined in this specification are for the use of developers of service engines and
binding components that “plug in” to the JBI infrastructure, as described above.
As previously discussed, the term Service Engine (or SE) is used to refer to plug-in components that provide
business logic, transformational services, etc. Service engines can take a wide variety of forms, depending on
the type of functions they supply. In particular, some SEs can function as “containers,” presenting a unique
programming model to users. For example:
• An XSLT XML transformation engine can support multiple transformation types. In this case, the
programming interface is essentially the XSLT language itself.
• A WS-BPEL 2.0 business process execution engine. In this case, the programming interface is WS-BPEL
itself.
• An EJB container. In this case, the API is Java that conforms to the appropriate EJB specification.
Binding components provide the ability to use communications protocols to both access remotely provided
services, and allow remote service consumers to access services provided within the JBI environment. Protocols
can be as varied as the integration problems being solved require, but typical examples include
• SOAP over HTTP [http://www.ws-i.org/Profiles/BasicProfile-1.1.html],
• JMS/MOM [http://jcp.org/aboutJava/communityprocess/final/jsr914/index.html] and
• AS1/AS2 EDI [http://www.ietf.org/html.charters/ediint-charter.html] communications stacks.
A Binding Component may choose to implement one or more communications protocols, offering connectivity
services to SEs and thereby enabling SEs to expose their services to remote consumers as well as enabling the
consumption of remote services.
There are several distinct roles played by the various users of JBI:
• Integration Architect. This user designs the overall approach to solving integration problems. This
includes selecting JBI components to be used to provide connectivity and business logic.
• Integration Technologist. This user devises the particular services needed to solve an integration problem,
and configures a JBI system to integrate those services.
• System Administrator. This user installs, configures, monitors, and tunes the JBI system so that it
provides the designed integration services.
• JBI Component Developer. JBI components can be created by users, or by third parties. In either case, the
developer of JBI plug-ins must provide Java components that conform to particular contracts that are
defined in this specification.
These roles are elaborated upon in “Roles” on page 8
• The evolution of the Web Services standards is driving Service Integration to occur at a pace and at a level
requiring the inclusion of entirely new classes of “developers” trained not so much in procedural languages
but in emerging declarative vocabularies
• The need for supporting Service Composition vocabularies that depend heavily on WSDL [WSDL 2.0]
presents an opportunity to reach convergence on what is meant by an abstract business message, and more
specifically on what is meant by WSDL-defined messaging.
• By establishing a common abstract view of a normalized (business) message it becomes possible to
decouple a component-specific application programming model (used to design and develop business
logic) from the underlying communications infrastructure needed to support such logic.
3.3 Goals
The following are the primary goals of this specification:
• The establishment of a standard SPI for developers of service engines and binding components, known
collectively as JBI components.
• The development of an abstract protocol-neutral Message Exchange and Normalized Message (NM)
• Provision of a standard mechanism for Message Exchanges to flow between JBI components
• Establishment of a standard for the packaging of JBI components, as well as for deployment of service
artifacts to such components
• Definition of administrative and management hooks such that a diverse set of standard tools targeted at
specific problem domains can emerge over time
• Given the complexity and diversity of SE and BC implementations, it must be possible for different
vendors to deliver SEs, BCs or both. Such components must be able to interoperate reliably, and a system
constructed of such components (atop a JBI infrastructure) must be centrally manageable.
3.5 Roles
A functionally rich integration product is required to deliver a wide range of critical components over and above
what a standard JBI environment requires. By design, JBI is silent about many necessary elements of a
compelling overall solution. For example, a SE should be viewed as a container hosting business logic that is
“programmed” using vocabularies ranging from annotated Java™ to XML (such as XSLT), none of which is
defined by JBI. JBI therefore assumes a number of different actors playing complimentary roles with the
common underlying objective of delivering an overall business solution.
JBI provides an environment in which plug-in components reside. The environment provides a set of services to
facilitate execution of provided services, interaction between components, as well as management of the overall
system created by a JBI installation and all installed components.
JBI provides for interoperation between plug-in components by means of message-based service invocation,
described using a standard service description language. This provides a consistent model of services that the
components can provide and consume.
JBI provides a set of services to facilitate management of the JBI environment, including the installed
components. This includes component installation and life cycle management services.
• Simple (non-qualified) names. These are names that do not have an associated XML namespace. These
are used in situations where uniqueness is either not needed, or has a non-global scope.
The WSDL component model is shown schematically in the figure below.The details of this model are
• Interface Name. A qualified name identifying the service type globally. The interface name is used
extensively in JBI as a service type identifier.
• Extended Interfaces. Service types can be defined as extensions of other service types, in a fashion that
is analagous to Java interfaces. Thus a service type may be composed of other service types.
single JVM. External to the JBI environment are service consumers and providers, representing the external
entities that are to be integrated by JBI. These external entities can use a wide variety of technologies to
communicate with Binding Components in the JBI environment. Service Engines are essentially standard
containers for hosting WSDL-defined service providers and service consumers that are internal to the JBI
environment.1
Figure 4 above shows the major architectural components of JBI. This collection of components is called the
JBI Environment. Within each JBI environment, there is a collection of services which will provide operational
support. Key to this set of services is the Normalized Message router (NMR) which provides the mediated
message exchange infrastructure, allowing components to interoperate. In addition, JBI defines a framework
which provides the pluggable infrastructure for adding Service Engines (SEs), and protocol Binding
Components (BCs). These are depicted within the yellow, C-shaped framework polygon.
The right-hand side of the JBI environment depicts the management features of JBI. JBI defines a standard set
of JMX-based controls to allow external administrative tools (shown on the far right) to perform a variety of
system administrative tasks, as well as administer the components themselves.
The core message exchange concept implements WSDL messaging, as discussed above. Service requests are
generated by consumer components, routed by the NMR, and delivered to a provider component. For example,
the BPEL SE may generate a request, which happens to be provided by the external service provider connected
to the WS-I BC. The NMR will route the request to the WS-I binding. The SE in this case is a service consumer,
and the BC a provider.
All provided services are exposed as WSDL-described services (end points, specifically). Services provided by
SEs are described as end points in the same fashion as services provided by BCs (actually by external service
providers). This provides a consistent model of service provision, without regard to location.
1.The term “container” is used in two ways in this specification. A service engine can function as a container
for engine-specific entities, while the JBI environment itself is a container for service engines and binding
components. Because of this, JBI is sometimes called a “container of containers.” The context will make clear
which type of container is being discussed within this specification.
Service consumers may identify needed services by WSDL service name, not by end point address. This
decouples the consumer from the provider, and allows the NMR to select the appropriate provider. Service
consumers may also identify services by resolving Endpoint References. For example, this allows a JBI
component to resolve a service callback Endpoint Reference which was sent in a message.
Aside from the component framework and the NMR, the remainder of the JBI environment provides the
infrastructure for life cycle management, environmental inspection, administration, and reconfiguration. These
provide a predictable environment for reliable operations.
Reversing the direction, as shown in Figure 6, changes very little to this processing picture, except for what the
binding does. This is depicted below.
A consumer SE/BC creates a normalized message, putting it into a new MessageExchange. The
MessageExchange is addressed by a ServiceEndpoint; the SE does not select which component is used to
perform the service. The ME is sent and accepted in exactly the same fashion as the previous example. After
accepting the ME, the binding denormalizes the message into protocol and transport format, and sends the
message across the wire to the external service provider.
4.5 Management
The JBI environment, including bindings and engines, is administered through JMX. Several management bean
(MBean) types are defined by this specification to create a consistent management environment across the JBI-
provided components and the plug-ins.
Major functions supported by the management interfaces are:
• Installation of engines and bindings (components)
• Life cycle management of components (start/stop controls)
• Deployment of component artifacts to engines and bindings that support dynamic additions to their internal
execution environments. For instance, the SE is an XSLT engine, and the artifacts are new XSLT style
sheets to be installed in the container.
• Monitoring and control.
4.8 Components
JBI supports two kinds of components, Service Engines and Binding Components. JBI only distinguishes
between the two kinds through a flag; the model and API are otherwise identical. However, by convention,
Service Engines and Binding Components implement different functionality in JBI. (This distinction is
followed in the JBI-defined management interfaces.)
4.9 Examples
The following examples will help illustrate the use of the pieces of the JBI environment and components to
perform typical integration tasks.
Note that the double-headed arrows in the sequence chart indicate messages routed by the NMR. This is an
important feature: the components involved are loosely coupled. Each component indicates to the NMR the
desired message destination only by service name; the NMR determines which component this corresponds to.
Client1 is a service consumer that wishes to make a one-way request of a service offered by Service1.
Unfortunately, Client1 and Service1 don't have a common message format or messaging protocol, thus
necessitating the use of integration middleware to adapt both the message format and the messaging protocol
suitably. The middleware in this case is a JBI environment, shown in the large, rounded rectangle in the middle
of the message sequence chart. The individual objects shown are:
• BC1. A binding component that “speaks” Client1's protocol, which happens to be WS-I BP 1.1 compliant
SOAP.
• SE1. A service engine used to provide light-weight sequencing of services. This can be configured to
perform the desired message adaptation and forwarding.
• SE2. A service engine used to transform messages using XSLT 1.0.
• BC2. A binding component that “speaks” Service1's protocol, which is (in this example) AS2 over HTTP.
The message exchanges in the message sequence chart, above, are described in detail below.
• Client1 to BC1. The client is configured to send its request of Service1, the payload of which we term
REQ1, to BC1. As far as Client1 is concerned, BC1 is the end point for accessing Service1, using the
client's own messaging protocol.
• BC1 normalizes and forwards the inbound request for Service1, using the NMR to route the message. The
JBI instance is configured to send requests for Service1 to SE1. (SE1 is a light-weight engine that can
sequence the conversion and forwarding of messages.)
• SE1 selects the type of conversion to be performed, and sends a request to the conversion service to have
REQ1 converted to what we will label REQ1A. The NMR will route this message to the SE2, which
provides the desired service.SE2 will perform the transformation and synchronously return the result SE1.
• SE1 completes the sequencing the conversion-and-forward process by sending the result of the
transformation, REQ1A to Service1. (The NMR will route this to BC2).
• BC2 denormalizes the message, and sends it (one-way) to Service1.
The normalized message router, or NMR, receives message exchanges from JBI components (engines or
bindings), and routes them to the appropriate component for processing. This mediated message-exchange
processing model decouples service consumers from providers, and allows the NMR to perform additional
processing during the lifetime of the message exchange.
Note that this chapter makes use of WSDL 2.0 terms, rather than the older WSDL 1.1 ones.
Consumers and providers are decoupled, in that they normally share only the (abstract) service definition, and
not endpoint information. This isolates the consumer from the particulars of the service provider's
implementation (protocol etc.).
A WSDL interface can be implemented by more than one service. A consumer looking for providers of an
interface may find more than one provider (service and associated endpoint).
The first message (a request) is sent from the consumer to the provider (thus it has the “in” direction, from the
point of view of the provider). The second message (a response) is sent from the provider to the consumer (thus
is has the “out” direction). These exchanges are performed in the sequence given, with single messages. From
the provider’s perspective the exchange is a “in” message, following by an “out” message, thus leading to the
name of the pattern.
The activity diagram in Figure 9 depicts a one-way service invocation between two local Service Engines,
including a message exchange instance: 1
SE1, acting as a service consumer, invokes the desired service and operation by creating and initializing an in-
only message exchange, containing the request message. SE1 then sends the message exchange instance to the
NMR. This is indicated by the object flow between the SE1 and NMR swim lanes.
The NMR determines which service provider should provide the requested service and operation, and routes the
message exchange instance for delivery to the provider. This is shown by the object flow between the NMR and
SE2 swim lanes.
Note that this diagram is not meant to imply that the invoker must block a thread of execution to await the
completion of the exchange. The invoker can be event-driven, where sending and receiving message exchanges,
as shown in the activity diagram, advances the engine’s internal state without necessarily tying up thread
resources.
1.Note that this depicts a successful service invocation, so it applies to both the reliable and normal one-
way invocation types.
The following depicts a reliable one-way invocation between service engines hosted in separate JBI
environments. Note that there is no provision for “federating” separate JBI instances; the two JBI instances
Figure 10 SE Invokes Service Provided by Remote JBI Instance: Robust In with Fault
shown in this example see each other as remote consumers and providers, accessed by the communications
protocol provided by BC1 and BC2. There is no special relationship between the two JBI instances that affects
how service invocation is performed between them.
SE1 constructs and initializes a robust-in message exchange instance, and sends it to the NMR. (In the process
of creating the ME instance, the NMR has assigned it the unique identifier 'X'.) The NMR determines which
service provider should be used, and sends the message exchange to BC1 as a robust-in patterned instance. BC1
packages the request according to the requirements of the protocol that it implements, and sends the request to
the service provider, which, in this example, happens to be another JBI instance, JBI2, and is accessed via an
endpoint exposed by BC2.
When BC2 of JBI2 receives the request, it constructs a robust-in-patterned message exchange instance (“Y”),
and sends it to the NMR. The NMR of JBI2 determines which service provider should be used, and sends the
message exchange instance (“Y”) to SE2.
SE 2 then receives instance “Y”. After processing the request, SE2 may elect to return a fault message,
indicating an application-level error. In this case, SE2 can use instance “Y” to return a fault message, which will
follow the reverse of the path the request followed, eventually arriving at SE1 of JBI1, in message exchange
instance “X”. (A positive “done” response in such a MEP would follow the same path, but is not shown here for
sake of clarity.)
The following depicts a request-response invocation between a JBI-hosted Service Engine and a remote service
provider.
The service engine SE creates and initializes an in-out-patterned message exchange instance. SE sends this to
the NMR, which determines which service provider should process this invocation. In this case binding BC is
selected. When BC receives the message exchange (an in-out pattern), it denormalizes the request, and sends it
using its communications protocol to the external provider. The provider processes the request, returning either
the normal response or an application-level fault, as appropriate. The BC normalizes the response, and adds it to
the message exchange. The message exchange is then sent to the NMR, which routes it back to the consumer,
SE.
5.1.7 Endpoints
Endpoints, in WSDL 2.0, refer to a particular address, accessible by a particular protocol, used to access a
particular service. JBI uses this concept, referring to two distinct types of endpoints:
• External. Endpoints outside of the JBI environment:
• Endpoints exposed by external service providers.
• External endpoints exposed by binding components, for the use of external service consumers.
• Internal. Endpoints exposed by service providers within the JBI environment. These are accessed using the
NMR APIs.
Binding components serve to map between internal endpoints and external. For example, an internal endpoint
provided by a binding component is mapped by the BC to an external service provider endpoint.
In JBI endpoints are referred to (or addressed) in three distinct ways:
• Implicitly. JBI selects the endpoint of a service provider based on service type.
• Explicitly. A consumer chooses the endpoint of a service provider based on its own logic or configuration.
• Dynamically. An endpoint reference (EPR) is used within a message exchange to provide a “call back”
address that the service provider should use to send further message exchanges related to the on-going
5.4.1 Activation
As stated previously, activation is the process by which service providers declare to the NMR the particular
services they provide. Each declaration must be accompanied by a corresponding metadata definition, which
describes the declaration. (These metadata are supplied by a Component-supplied SPI.) JBI requires that
WSDL 1.1 or WSDL 2.0 be used for all such declarations. The NMR presumes (but does not enforce) that all
such declarations are compliant with the WSDL specifications. However, if the metadata are malformed, it is a
likely consequence that service consumers will be unable to properly invoke the service.
5.4.1.1 Service Provider Activation
A domain model for service provider activation is pictured below. Each endpoint activated by a provider MUST
be accompanied by metadata describing the service, endpoint, and binding details for the endpoint. (A service
engine uses a special JBI-defined binding type for service engine-provided services being so activated.)
A logical sequence diagram depicting a activation scenario follows. This picture is limited purely to activation-
related activity, and does not address the relation between endpoint activation and message exchanges.
1. As a precondition, the BC provides an implementation of the Component SPI, part of which is used to
provide metadata describing activated endpoints. (All components MUST provide this.)
2. BC activates an endpoint name.
3. NMR initializes the Service Endpoint.
4. SE queries the NMR for endpoint by name (or some other criteria).
5. SE uses the endpoint to query NMR for metadata describing the Service Endpoint.
6. NMR invokes the BCs Component SPI to fetch the appropriate metadata.
7. SE parses the DOM document returned by the NMR.
Exchange patterns begin with the initiator, which in the standard JBI patterns, is always the consumer, which
creates and initializes a new exchange instance. The consumer “owns” the message exchange instance until it
sends it for delivery (using DeliveryChannel.send()). Subsequently the participants alternate between
accepting the message exchange instance and sending it, until one participant sets the exchange status to a
terminal state, and sends it back to the other participant. A component “owns” a message exchange when it
accepts it (using DeliveryChannel.accept()).
The following diagrams depict the possible interactions between the consumer and provider for each type of
standard JBI message exchange pattern. Each pattern is a contract between the two participants, in their role as
service provider or consumer. Note that a participant can be easily determine its role when accepting a message
exchange instance by using MessageExchange.getRole(). This is helpful for participants in more
complex patterns, as well as a convenience for participants in simpler patterns.
5.4.2.1 Diagram Key
The MEP diagrams shown here use the symbols displayed in the following figure. The diagrams themselves
present a chronological view of the exchanges, with time progressing from the top of each diagram to the
bottom. Alternatives (fault versus normal response) are shown using the choice symbol.
Notes:
• Consumer initiates with message.
• Provider responds with status to complete exchange.
Notes:
• Consumer initiates with message.
• Provider may respond with status or fault.
• If provider response is status, the exchange is complete.
• If provider response is fault, consumer responds with status to complete exchange.
5.4.2.4 In-Out Message Exchange
This pattern is used for two-way exchanges.
Notes:
Notes:
• Consumer initiates with message.
• Provider may respond with message, fault, or status.
• If provider responds with status, the exchange is complete.
• If provider responds with fault, consumer must respond with status.
• If provider responds with message, consumer may respond with fault or status.
• If consumer responds with fault, provider must respond with status to complete exchange.
• Interface name. If this is specified on a message exchange, the implementation MUST use implicit
endpoint selection.
• Service name. The implementation MUST choose a provider endpoint that belongs to the given service
name, using implicit endpoint selection.
• Endpoint. The implementation MUST use the given endpoint as the service provider, either directly or
indirectly (see section 5.4.3.3 for details on direct and indirect routing).
If the implementation determines that more than one endpoint can be used to provide the service specified by
the message exchange (which is possible when using interface or service names to address the exchange), the
implementation MUST choose one provider endpoint. How this selection is accomplished is not specified here.
When a message exchange is routed from the service provider, it MUST always be sent to the component that
originated the exchange. Subsequent sending of the exchange from the consumer to provider MUST always
send the exchange to the provider endpoint selected during the initial send of the exchange.
When a message exchange is sent to a particular provider endpoint, the implementation MUST deliver the
message exchange to the DeliveryChannel of the component that activated the given endpoint.
When a message exchange is returned to a consumer component, the implementation MUST deliver the
message exchange to the DeliveryChannel of the consumer component.
5.4.3.1 Implementation Changes to Message Exchange Address Properties
A consumer may choose to set several message exchange provider address properties in the course of
initializing the exchange instance, and before sending it. When one provider address property is set, the
implementation MUST NOT alter any of the others (interface name, service name, or service endpoint).
When the component sends the new exchange instance, the implementation MUST set the endpoint property of
the exchange instance to the endpoint selected by the NMR as service provider (if not specified by the
component). Note that if the component specifies the endpoint directly, the implementation MUST NOT alter
this value, even if the endpoint refers to a service connection, as detailed in section 5.4.3.3.
5.4.3.2 Implicit Endpoint Selection Process
When the consumer specifies the desired service provider with any form of address other than a service
endpoint, the JBI implementation MUST select the provider endpoint implicitly. The process that
implementations MUST follow while performing implicit endpoint selection is given in this section. The
implicit endpoint selection process MUST be performed when the new message exchange instance is sent for
delivery by the consumer, when it calls DeliveryChannel.send or DeliveryChannel.sendSync.
If there are no candidate service provider endpoints that match the given service address, or if no suitable
matches are found of candidate providers during the execution of this selection process, the send or
sendSync method MUST throw a MessagingException with a suitable error message detailing the
routing failure.
For each candidate provider endpoint being considered by the JBI implementation, it MUST do the following:
• call the consumer’s Component.isExchangeWithProviderOkay() method, providing the
candidate endpoint and the message exchange that is the subject of this selection process as parameters.
• call the provider’s Component.isExchangeWithConsumerOkay() method, providing the candidate
endpoint and the message exchange that is the subject of this selection process as parameters.
A candidate provider endpoint that causes both of the above calls to return true is considered a match, and
suitable for use as an implicitly selected provider endpoint. Implementations MUST select one provider
endpoint to serve as the result of this selection process from all matching provider endpoints found, using
implementation-specific means. An implementation MAY “short circuit” this process by selecting the first
matching provider endpoint found.
The implementation MUST apply service connection processing to endpoints selected when implicit endpoint
selection is used (i.e., a service type or name is specified, rather than an endpoint).
as follows:
• getServiceName() and getEndpointName() MUST return an appropriate, fully-qualified
service name that is unique for the external endpoint to which the EPR referred. In this context,
appropriate means one of the following:
• The service name provided as part of the resolved EPR, or, if that is not applicable
• a service name that is unique to the binding component.
• getAsReference() MUST return null. If an EPR is needed for the endpoint, the original EPR must
be used.
JBI implementations MUST ensure that message exchanges that are addressed to an internal endpoint created
by EPR resolution are delivered to the component that created that internal endpoint. Component
implementations MUST distinguish between JBI-supplied ServiceEndpoints and ones created by itself.
An example endpoint implementation is shown in the listing below.
This wrapper MUST be used for messages within portType (abstract) operations (wsdl:input, wsdl:output, or
wsdl:fault). The document element <jbi:message> is the wrapper for all parts for such messages. It has the
following attributes and elements:
• version attribute, which must be 1.0.
• type attribute, which is the qualified-name of the WSDL 1.1 message definition contained in the wrapper.
This corresponds to the wsdl:input, wsdl:output, or wsdl:fault message attribute value.
• name attribute, which corresponds to the optional name attribute of the wsdl:input, wsdl:output, or
wsdl:fault corresponding to the normalized message. If this attribute is not provided, the WSDL 1.1 default
naming rules apply.
• zero or more <jbi:part> elements, representing the logical parts of the WSDL 1.1-described message.
All logical parts of the message must appear here, in the same order as defined in the WSDL 1.1 message
description referred to by the type attribute.
Each <jbi:part> element MUST contain the value of the logical part of the WSDL 1.1-defined message.
The <jbi:part> element may contain XML elements or non-XML text.
After conversion to wrapped doc-literal form, the normalized message content for a WSDL 1.1-defined
message MUST also conform to the requirements stated for WSDL 2.0-based normalized message content (i.e.,
it is represented as a javax.xml.Source).
5.5.1.1.5 Message Properties
Message properties are metadata associated with the message content. The following properties are defined by
this specification, and MAY be used components:
• Security subject. This property indicates the identity of the JAAS subject which either signed a message,
or is to be used to sign a subject, as determined by processing context. getSecuritySubject() and
setSecuritySubject() are used to read and write this normalized message property.
• Name/value pair properties. This is an extensible set of properties, where components MAY set
properties for the use of other components, or for themselves. getProperty() and setProperty()
are used to read from and write to the property set; getPropertyNames() MAY be used to discover the
names of all of the properties defined.
5.5.1.1.6 Message Attachments
Attachments to a message are represented as a named set of entities, which are handled by Java Activation
Framework handlers. The following operations MAY be performed by components:
• Add an attachment to the normalized message, by unique name.
• Remove an attachment from the normalized message, by unique name.
• List the names of all attachments for the normalized message.
• Get an attachment, by unique name, from the normalized message.
Attachment content MUST be represented as javax.activation.DataHandler objects.
5.5.2.1 DeliveryChannel
The DeliveryChannel interface serves as the primary means for a JBI component to interact with the
NMR. It allows the component to
• receive and send messages
• create message exchange factories.
5.5.2.1.1 Message Exchange Factory API
All message exchange instances MUST be created using instances of the message exchange factory. Such
factories MUST be created in one of three ways, using the component’s DeliveryChannel:
• createMessageExchangeFactory(ServiceEndpoint). This creates a factory that sets the
endpoint property of all exchange instances created to the given endpoint. This is useful when dealing with
explicitly selected endpoints, or dynamically resolved endpoints.
• createMessageExchangeFactory(QName interfaceName). This creates a factory that sets
the interfaceName property of all exchange instances created to the given interface name.
• createMessageExchangeFactory(). This creates a factory that leaves all properties message
exchanges set to their default (null or empty) values.
• createExchangeFactoryForService(QName serviceName). This creates a factory that sets
the service property of all exchange instances created by the factory to the given service name.
5.5.2.1.2 Creating Message Exchanges
The MessageExchangeFactory provides three distinct ways to create new message exchange instances.
These support three different needs:
• createExchange(serviceName, operationName). Creation from service name and operation
name. This permits the component to quickly put together an ME instance, without the need of inspecting
MEPs in service metadata.
• createExchange(URI). Creation from MEP URI. This permits extensions to the supported MEPs.
• createInOnlyExchange(), etc. Creation using MEP-specific convenience methods. This is
convenient for creating standard MEs in situations where the MEP required is known at coding-time.
5.5.2.1.3 Sending Message Exchanges
The DeliveryChannel offers two basic means of sending message exchanges:
• send(exchange). Asynchronous message transmission: this method doesn't block. The exchange MAY
be delivered concurrent to the thread of execution that called send().
• sendSync(exchange). Synchronous message transmission: this method MUST block the current
thread of execution until the exchange is returned.
The latter method has a variant that adds a time-out parameter. This allows JBI components to use simple
synchronous message exchanges without needing to manage “stuck” threads if an exchange is not returned as
expected. To support this time-out feature, the sendSync() method returns a boolean value to indicate
successful return of the exchange instance. The first overload, sendSync(exchange), always returns
true. If the second overload, sendSync(exchange, long), returns false, the exchange is placed in
the ExchangeStatus.ERROR state. If a provider component attempts to send such an message exchange
(i.e, one that has failed because of a sendSync() time-out), the implementation MUST fail the send() call
with an appropriate MessagingException.
When a MessageExchange instance is sent using one of the sendSync methods, the JBI implementation
MUST set the following property on the message exchange instance:
javax.jbi.messaging.sendSync
This property MAY be used by servicers of such requests, as a hint that such exchanges should receive different
treatment.
Note that in the case of asynchronous exchanges, there is no guarantee that the message exchange received (by
the receiver's call to accept(), discussed in the next section) will be the same object that was initially sent.
Rather, the only guarantee is that the message exchange ID MUST be the same.
5.5.2.1.4 Receiving Message Exchanges
The DeliveryChannel offers two ways of receiving message exchanges:
• accept(). This method MUST block until a MessageExchange instance is received from the NMR.
• accept(timeoutMS). This method works similarly to accept(), except that it is blocked for the
given time-out interval, the method MUST return null, indicating that nothing was received.
Message reception always follows the “pull” model: the JBI component MUST pull the message exchange
instance from the DeliveryChannel, using its own thread of execution. Components MAY use more than
one such thread, allowing concurrent message reception by the component. The JBI implementation MAY
satisfy multiple accept() requests from a single component in arbitrary order.
5.5.2.1.5 Closing Down a DeliveryChannel
The component MAY deactivate all endpoints for the services it provides in a single DeliveryChannel call:
• close(). This method MUST cause all activate endpoints activated with the component (that is, all
services provided by the component) to be shut down, in the same fashion as if
deactivateEndpoint() was called for each active endpoint.
Once a DeliveryChannel is so closed, it cannot be re-opened. Instead, a new instance of
DeliveryChannel is needed to allow a component to resume interacting with the NMR.
When a DeliveryChannel is closed, all MessageExchangeFactory instances created by that channel
MUST no longer function normally; all attempts to create a message exchange instance with such a factory
MUST result in a MessagingException being thrown by the factory method invoked, indicating that the
associated delivery channel is closed.
5.5.2.2 Service Description SPI
With the Component interface, the component MUST supply service metadata concerning services it provides
in its implementation of the getServiceDescription(ServiceEndpoint) method. This method
MUST return a DOM Document, which provides a WSDL description of the service provided by the given
endpoint.1 This method MUST return null if the endpoint is not active, or if the endpoint is not provided by
the component.
The document provided MUST be either a WSDL 2.0-compliant document, or a WSDL 1.1-compliant
document, with the following additional properties:
• The document must not use the <wsdl:import> or <wsdl:include> elements (the document MUST
be stand-alone).
• Service Engine-provided endpoints MUST use the binding type defined in the section titled “JBI Service
Engine WSDL Binding” on page 57.
The document MUST provide the complete definition for the named service, and the named endpoint, including
the service's interface and operations (including, of course, the message exchange patterns used).
1.Note that this document must provide XML namespace information. Some XML parsers do not default to
"namespace aware" parsing, and must be explicitly configured to enable this feature.
All message exchange instances MUST be created by calls to suitable factory methods provided by instances of
MessageExchangeFactory.
MessageExchange instances are owned by either the initiator, servicer, or NMR. Creating or accepting a
message exchange instance confers ownership on the creating (or accepting) component. Upon calling send()
for a particular ME instance, the component surrenders ownership of the ME instance immediately.
sendSync() causes ownership to be surrendered during the course of the call; when the call ends (returning
true) the component resumes ownership of the ME instance.
Ownership of an ME instance gives the owner the right to read from and write to the instance. When a
component (or the NMR) doesn't have ownership of an ME instance, it MUST NOT read from or write to the
instance, except for reading the message exchange status, which can be queried regardless of ownership. If a
component that is not the current owner of the instance does attempt to call any method (other than
getStatus()) on the instance an appropriate java.lang.IllegalStateException MUST be
thrown.
5.5.2.3.1 MessageExchange
The super-interface, MessageExchange, provides common methods for all APIs that implement a specific
message exchange pattern. MessageExchange instances provide the context for a sequence of normalized
message interchanges as well as status interchange. The instance can be thought of as a stateful container for
normalized messages.
Each exchange instance has the following features which are accessed by using the MessageExchange API:
• Status. ExchangeStatus provides a type-safe enumeration of the possible values of an ME's status
during its life cycle. A new ME instance is ACTIVE, and remains so until the end of its life cycle, when it
transitions to either a DONE or ERROR state. The status can be queried and set using getStatus() and
setStatus(), respectively.
• Source of an ERROR status. This feature allows the instance to retain the root cause (Java exception) of a
processing failure. See getError() and setError().
• Exchange ID. Each instance of a MessageExchange MUST have a unique identifier string, assigned by
the JBI implementation. This identifier can be used by JBI components to associate asynchronous
responses with originating requests.
• Exchange Pattern. Each instance of a MessageExchange has a pattern identifier. The standard
Message Exchange Patterns are identified by their WSDL 2.0-assigned URIs.
• Exchange Role. When a component creates or accepts a message exchange instance, it must discover its
role in the on-going exchange. In simple exchange patterns this can easily determined, using the status,
message, and fault features of the exchange. However, it is easier, and in the case of complex exchange
patterns it is necessary, for the component use the getRole() method to determine its role in the
continuing exchange.
• Service name. The qualified-name of the service being invoked by this exchange.
• Operation name. The qualified-name of the operation being invoked by this exchange.
• Service endpoint name. The optional, fully-qualified name of the endpoint of the service provider (service
name plus endpoint name).
• Normalized messages. The instance serves as a factory for NormalizedMessages associated with the
exchange instance. Methods are provided to create, set, and query such messages. See
createMessage(), setMessage(), and getMessage().
• Fault messages. The instance serves as a factory for Fault messages associated with the exchange
instance. Methods are provided to create, set, and query such messages. See createFault(),
setFault(), and getFault().
• Transaction Context. If the transaction context is non-null, the message exchange is transacted. See
getProperty() and setProperty(); transactions are named by the constant
MessageExchange.JTA_TRANSACTION_PROPERTY_NAME.
• Properties. Non-JBI message exchange features can be stored as properties: name-value pairs, where the
value is (to JBI) an opaque java.lang.Object.
The MessageExchange API provides sufficient functions to support all standard MEPs. However, “in” and
“out” messages are not distinguished at the API level, making understanding of ongoing exchanges at a Java
code level difficult. To address this issue, a set of MEP-specific APIs are provided, and are detailed in the four
sections below.
5.5.2.3.2 InOnly Message Exchange
This sub-interface provides an API for the “http://www.w3.org/2004/08/wsdl/in-only” MEP.
This provides the following MEP-specific methods:
• setInMessage(msg). This can be called only once; subsequent calls MUST cause the implementation
to throw an appropriate MessagingException.
• getInMessage(). This can be called multiple times; if the setInMessage() method (or
setMessage(msg, "in")) has not been called, it MUST return null.
5.5.2.3.3 InOptionalOut Message Exchange
This sub-interface provides an API for the “http://www.w3.org/2004/08/wsdl/in-opt-out”
MEP. This provides the following MEP-specific methods:
• setInMessage(msg). This can be called only once, by the service consumer; subsequent calls to this
method MUST cause the implementation to throw an appropriate MessagingException.
• getInMessage(). This can be called multiple times; if the setInMessage() method (or
setMessage(msg, "in")) has not been called, it MUST return null.
• setOutMessage(msg). This can be called only once, by the service provider; subsequent calls to this
method MUST cause the implementation to throw an appropriate MessagingException. Setting the
“out” message is optional in this pattern.
• getOutMessage(). This can be called multiple times; if the setOutMessage() method (or
setMessage(msg, "out")) has not been called, it MUST return null.
5.5.2.3.4 InOut Message Exchange
This sub-interface provides an API for the “http://www.w3.org/2004/08/wsdl/in-out” MEP. This
provides the following MEP-specific methods:
• setInMessage(msg). This can be called only once, by the service consumer; subsequent calls to this
method MUST cause the implementation to throw an appropriate MessagingException.
• getInMessage(). This can be called multiple times; if the setInMessage() method (or
setMessage(msg, "in")) has not been called, it MUST return null.
• setOutMessage(msg). This can be called only once, by the service provider; subsequent calls to this
method MUST cause the implementation to throw an appropriate MessagingException.
• getOutMessage(). This can be called multiple times; if the setOutMessage() method (or
setMessage(msg, "out")) has not been called, it MUST return null.
5.5.2.3.5 RobustInOnly Message Exchange
This sub-interface provides an API for the “http://www.w3.org/2004/08/wsdl/robust-in-
only” MEP. This provides the following MEP-specific methods:
• setInMessage(msg). This can be called only once, by the service consumer; subsequent calls to this
method MUST cause the implementation to throw an appropriate MessagingException.
• getInMessage(). This can be called multiple times; if the setInMessage() method (or
setMessage(msg, "in")) has not been called, it MUST return null.
A consumer SHOULD provide all available information, in the form of the above properties, to resolve the
ambiguity. If the consumer is unable to resolve the ambiguity by itself (and supply one or more of the above
properties), the consumer must send the message exchange, and allow the service provider the chance to resolve
the ambiguity.
For example, a SOAP binding component, serving as a consumer, may receive a request from an external
consumer for a service operation named “foo”. The WSDL 1.1 definition for foo includes the following:
<definitions xmlns ="http://schemas.xmlsoap.org/wsdl/"
xmlns:tns ="http://www.example.com/xmlsvr"
targetNamespace ="http://www.example.com/xslsvr">
<types>...</types>
<message name="DoFooInput">...</message>
<message name="DoFooOutput1">...</message>
<message name="DoFooOutput2">...</message>
<portType name="FooPortType">
<operation name="Foo">
<input name="foo-in" message="tns:DoFooInput"/>
<output name="foo-out1" message="tns:DoFooOutput1"/>
</operation>
<operation name="Foo">
<input name="foo-in" message="tns:DoFooInput"/>
<output name="foo-out2" message="tns:DoFooOutput2"/>
</operation>
</portType>
</definitions>
There is an ambiguity for operation “Foo”. If the SOAP binding wishes to consume an internal service with the
above definition, it must use one of the following strategies to resolve it.
• Set the "javax.jbi.messaging.wsdl-11.output-type" property of the InOut message exchange to
either tns:DoFooOutput1 or tns:DoFooOutput2, to select the first or second version of Foo, respectively.
• Set the "javax.jbi.messaging.wsdl-11.output-name" property of the InOut message
exchange to either “foo-out1” or “foo-out2”, to select the first or second version of Foo, respectively.
• Set no additional properties of the InOut message exchange. Instead, the consumer relies on the provider
to choose which version of operation “Foo” to use.
The binding chooses its strategy based on implementation-specific information (such as SOAP action headers,
or additional configuration information).
5.5.5.1.1 SE Initialization
Prior to the first "start" of a component, its "init" method is called to perform pre-start initialization. In this
example service engine, the delivery channel and message exchange factory are made ready.
5.5.5.1.2 BC Initialization
Prior to the first "start" of a component, its "init" method is called to perform pre-start initialization. In the same
fashion as the service engine above, this component prepares by creating a delivery channel and a message
exchange factory.
5.5.5.1.3 Message Exchange
Engine View
void someEngineMethod()
{
InOnly inOnly;
Message message;
// As initator, we get to create the message exchange
inOnly = factory.createInOnlyExchange();
// Create new message for this exhange.
message = inOnly.createMessage();
// Populate message with data (omitted)
// Set message as in reference in exchange
inOnly.setInMessage(message);
// Set operation and service details
// (We could avoid this by using channel.createExchange(SERVICE1,
// OP_UPDATE_STATUS); above)
inOnly.setOperation(OP_UPDATE_STATUS);
inOnly.setService(SERVICE1);
// We will allow the NMR to select the endpoint automatically.
// Alternatively, we could query the available endpoints implementing SERVICE1,
// choose from that list, and use inOnly.setEndpoint() to route the ME ourselves.
// Initiate the message exchange
channel.send(inOnly);
}
Listing 8 Message Exchange: Service Engine View
Binding View
void someBindingMethod()
{
MessageExchange exchange = channel.accept();
if (exchange instanceof InOnly)
process((InOnly) exchange);
else // ...
}
void process(InOnly inOnly)
{
NormalizedMessage inMsg;
// fetch "in" message from exchange
inMsg = inOnly.getInMessage();
// process data
try
{
// commit message to wire (omitted)
// set status appropriately
inOnly.setStatus(ExchangeStatus.DONE);
}
catch (Exception ex)
{
// Implicitly sets inOnly status to ExchangeStatus.ERROR
inOnly.setError(ex);
}
channel.send(inOnly);
}
Listing 9 Message Exchange: Binding View
Notes:
• Service name: {http://xyz.com/services}: service2
• Endpoint name: engine2
• Direction: Inbound
• Operation(s): getStockQuote (request -response)
• For simplicity, BC and SE are single-threaded and only participate in one exchange during the course of
this example.
• Assume the following constants are declared:
• QName SERVICE2 = new QName("http://xyz.com/services", "service2");
• String ENDPOINT2 = "engine2";
5.5.5.2.1 BC Initialization
5.5.5.2.2 SE Initialization
Binding View
void someBindingMethod() {
InOut inOut;
NormalizedMessage inMsg;
// Receive message over native protocol (omitted)
// Create InOut exchange
inOut = factory.createInOutExchange();
// Create new message
inMsg = inOut.createMessage();
// Normalize native protocol data (omitted)
// Set message as in reference in exchange
inOut.setInMessage(inMsg);
// Set operation and service details
inOut.setOperation(new QName(SERVICE2.getNamespaceURI(), "getStockQuote"));
inOut.setService(SERVICE2);
// Initiate the message exchange and wait for response
channel.sendSync(inOut);
process((InOut) inOut);
}
void process(InOut inOut) {
NormalizedMessage outMsg = inOut.getOutMessage();
if (inOut.getStatus() != ExchangeStatus.ACTIVE) {
// error occurred. Return error response in native wire protocol (omitted)
} else {
// commit response message to native wire protocol (omitted)
// Tell provider that the exchange is now complete.
inOut.setStatus(ExchangeStatus.DONE);
channel.send(inOut);
}
}
Listing 12 Example Binding Using Synchronous Message Exchange for Service Invocation
Engine View
void someEngineMethod() {
MessageExchange exchange = channel.accept();
if (exchange instanaceof InOut)
process((InOut) exchange);
else // ...
}
void process(InOut inOut) {
NormalizedMessage inMsg;
NormalizedMessage outMsg;
// fetch in message
inMsg = inOut.getInMessage();
// process data
try {
// perform appropriate processing to inMsg (omitted)
// create response message
outMsg = inOut.createMessage();
// populate message content (omitted);
// attach message to exchange
inOut.setOutMessage(outMsg);
}
catch (Exception ex) {
// Implicitly sets inOut status to ExchangeStatus.ERROR
inOut.setError(ex);
}
channel.send(inOut);
}
Listing 13 Example Engine Service Provider
As mentioned in the architecture overview section, the JBI environment is administered using JMX. This
includes the JBI components (the plug-in bindings and engines), which must provide specified management
interfaces. In addition, the JBI implementation must provide specified JMX Management Beans (MBeans) to
facilitate management of the JBI environment-provided infrastructure as well as the JBI components.In
addition, JBI implementations must provide a set of Apache Ant tasks specified in this chapter.
6.1 Overview
The major administrative tasks that are supported by this specification are:
• Installation of JBI components and shared libraries.
• Deployment of artifacts (opaque to JBI) to installed components.
• Starting and stopping components (binding and engines), as well as JBI implementation components (if
applicable).
• Starting and stopping groups of related services (composite assemblies).
All of these use cases assume the presence of an administrative tool, which serves to initiate activities using
JMX. JBI implementations provide particular MBeans that expose management functions to the administrative
tool. The MBeans are:
• InstallationServiceMBean. The administrative tool uses this management bean to install and uninstall
components and shared libraries.
• InstallerMBean. JBI implementations provide one of these per component installation started with the
InstallationServiceMBean. This is used to manage the installation process, including component-
supplied installation configuration via the component’s own MBean.
• DeploymentServiceMBean. The administrative tool uses this bean to deploy and undeploy artifacts to
components, as well as control the running state of individual deployments.
• LifeCycleMBean. The administrative tool uses this bean type to stop and start pieces of the JBI
implementation (use of this MBean is implementation dependent).
• ComponentLifeCycleMBean. The administrative tool uses this bean type to stop and start components.
The component may supply additional life cycle controls, using a component-supplied extension MBean.
In addition, components MAY expose their own MBeans, to provide component-specific management
functions beyond the life cycle and installation extensions mentioned above. For example, a component can
expose an MBean to manage internal logging levels.
Installation and deployment involve having the administrative tool deliver standardized packages to the
appropriate MBeans, listed above. JBI specifies how such packages are structured, including standard XML
descriptors of the packages.
6.2.3 Deployment
Many components function as containers, providing (or consuming) services based on artifacts contained by the
component. For example, an XSLT engine contains multiple style sheets, each providing a specific
transformation service.
The act of introducing new artifacts to a container component is called deployment, to distinguish it from
component or shared-library installation.
6.2.3.1 Unit Deployment
A single deployment package, destined for a single component, is termed a Service Unit, or SU. The contents
of a SU are opaque to JBI (other than a single descriptor file), but are transparent to the component to which it is
being deployed, as well as the design-time tooling that produced the artifacts contained by the SU. The service
unit must contain a single JBI-defined descriptor file that defines the static services produced and consumed by
the service unit. This is useful for tooling that is used to create composite deployments, as defined below.
6.2.3.2 Composite Deployment
Often multiple deployments are required to create a new service or consumer application within a JBI
environment. To support this directly, JBI provides a composite deployment capability, where deployments
meant for different components can be grouped into a Service Assembly, or SA. Such an assembly includes a
composite service deployment descriptor, detailing to which component each Service Unit contained in the SA
is to be deployed. Note that this service assembly concept is sometimes termed “composite service description”,
or CSD.
A service assembly represents a composite service. Because of this interrelationship, JBI provides management
functions to control the life cycles of the individual units of a service assembly collectively, rather than
individually.
1.This is a simplified explanation. See section 6.6.3 and the “Normalized Message Router” chapter, section
5.4.3.3, for a full explanation of how connections must be handled by the implementation.
These composite service metadata can be viewed schematically, as shown below. This example is based on the
Figure 22 Composite Service for Example One-way Message Adapter (from Architecture chapter)
one-way message adapter example application, given in the “Architecture of the JBI Environment” chapter.
BC1 serves as a proxy service consumer for the external client, BC2 serves as a proxy service provider. SE2 is
the transformation service provider, while SE1 orchestrates the overall service, serving both as provider and
consumer in the course of the orchestration. The service assembly connections serve to connect SE1 to the
services provided by SE2 and BC2, and BC1 to the one-way adapter service provided by SE1.
Use of composite service metadata, as described here, is only one of several methods JBI provides for
connecting service consumers to providers. See the “Normalized Message Router” chapter for details on
implicit endpoint selection by service type, dynamic endpoint selection by the consumer, and message exchange
address types.
The extended life cycle of a component is the base life cycle, as depicted above, plus states introduced by the
installation and uninstallation of the component. In addition, the base component life cycle MAY be extended
by a component by use of an extension MBean. For example, a component may add a “paused” sub-state to the
“Started” state, which is entered by use of the controls offered by an extension MBean.
6.3 Packaging
JBI defines standard packaging for both installation of components and deployment of artifacts to those
components that function as “containers”, as discussed above in section 6.2.3. For the installation case, a single
descriptor is used. In the deployment case two descriptors are used:
• Service assembly descriptor. This is used to describe the contents of a service assembly. Primarily it
described where the various service units that are included in the assembly are to deployed.
• Service unit descriptor. This is used to describe the services provided and consumed by a service unit.
Because of the similarity between all of these descriptor types, a single schema is employed for both.
services =
element services {
attribute binding-component { xsd:boolean },
provides*,
consumes*,
element* -this:* { text }*
}
connections =
element connections {
element connection {
element consumer {
( attribute interface-name { xsd:QName } |
(attribute service-name { xsd:QName }, attribute endpoint-name { text })
)
},
element provider {
attribute service-name { xsd:QName }, attribute endpoint-name { text }
}
}*,
element* -this:* { text }*
}
provides =
element provides {
attribute interface-name { xsd:QName },
attribute service-name {xsd:QName }, attribute endpoint-name { text },
element* -this:* { text }*
}
consumes =
element consumes {
attribute interface-name { xsd:QName },
( attribute service-name {xsd:QName }, attribute endpoint-name { text },
attribute link-type { "standard" | "hard" | "soft" }? )?,
element* -this:* { text }*
}
Listing 17 jbi.xml Schema (Relax NG) Continued
The following subsections detail the use of the productions contained in the “jbi” schema for jbi.xml files.
6.3.1.1 Use of jbi
The top-level production is “jbi”. This serves as the starting point for all deployment and installation descriptors
generated by this schema.
• Attribute version is a decimal value indicating the version of descriptor in use. For this version of JBI, this
value MUST be 1.0.
• The type element indicates what type of descriptor this is. It must be one of the following elements:
• component. This indicates that an installation package is described by the descriptor.
• service-assembly. This indicates that a deployment package is described by the descriptor.
• shared-library. This indicates that a shared-library installation package is described by the descriptor.
• services. This indicates that the descriptor is a service unit self-description.
The use of these different descriptor types is detailed below.
6.3.1.2 Use of identification
The identification production is used to provide identifying information for components, shared libraries,
service units, and service assemblies (which are collectively referred to as items here). The identification
production contains the following data:
• name. The name of the item. This is a human-friendly identifier for the item. Note that each item type
imposes other restrictions on name (e.g., uniqueness).
• description. A longer (one sentence) description of the item.
• extension elements (optional). Additional, vendor-specific identification information. These are not used
by JBI, but it is anticipated that tools used to create and manipulate the package identified will require
additional identifying information.
6.3.1.3 Use of class path
The class path production is used to declare a Java class path for components and shared libraries. Each path
element given is a path that is rooted as follows:
• Component bootstrap-class path and component-class path: rooted in the component’s installation
package installation root. See chapter “Component Framework” for details.
• Shared library shared-library-class path: rooted in the shared-library’s installation package installation
root. See chapter “Component Framework” for details.
Each path element must use the forward slash (’/’) as the file separator character.
6.3.1.4 Use of shared-library
The shared-library production is used to describe a shared-library installation package. It has the following
elements:
• version. This is used to indicate the version of the shared library. See the component shared-library-list /
shared-library version attribute.
• identification. This is used to provide identifying information for the shared-library. The name provided
must be unique among all installed shared-libraries in the JBI environment.
• shared-library-class path. This declares the class path elements (rooted in the shared-library installation
package) that are given to the components that use the shared library.
In addition, shared-library has the following attribute:
• class-loader-delegation. If this optional attribute has a value of "self-first", the class loader for the
shared-library will invert its default delegation model ("parent-first"), instead loading classes from
the loader first. See the “Class Loading” section of the “Framework” chapter for details.
6.3.1.5 Use of service-assembly
The service-assembly production is used to describe a service assembly deployment package. This deployment
descriptor describes the contained service units, and to which components they are to be deployed.
• identification. The name given is a unique identifier (among all service assemblies deployed to the JBI
environment) for the composite deployment.
• service-units. These elements describe the individual deployments to be made to components. See below
for details.
• connections. This optional element contains declarations of service interconnection metadata, used to map
static service consumers to service providers.
6.3.1.6 Use of service-unit
The service-unit production is used to describe a service component within a service-assembly deployment
package.
• identification. This provides a unique name (unique among service-units deployed to the target
component) for the service-unit.
• target.
• artifacts-zip. The name of the artifact archive file within the deployment package that will be deployed
• component-name. The name of the component that will have artifacts-zip deployed to it.
The provider subelement is used to declare the service provider endpoint to which the consumer is to be
connected. This element provides two attributes to declare the provider service endpoint: service-name and
endpoint-name.
6.3.1.10 Use of services
The services element is used to declare the static services provided and consumed by a service unit. The term
“static” in this context means those services that are provided or consumed due to the deployment of the service
unit, and that are known at design- and/or deployment-time.
• The binding-component attribute is supplied for the use of off-line tools, that may wish to distinguish
between service engines and binding components. It has no effect on the deployment process. An
implementation may provide a warning (as part of the deployment result/status) if the component’s type (as
declared in its installation descriptor) is not consistent with this attribute’s value.
6.3.1.11 Use of provides
The provides element is used to declare a service provided by a service unit. A provided service is declared with
the following attributes:
• interface-name. This qualified name indicates the type of service to be provided.
• service-name and endpoint-name. This pair of attributes declares the name of the endpoint that the
service unit will, after deployment, activate with JBI.
6.3.1.12 Use of consumes
The consumes element is used to declare a service consumed by a service unit. A consumed service must be
defined with the following required attribute:
• interface-name. This qualified name indicates the type of service to be consumed.
Optionally a fully qualified name of the endpoint the SU will use to consume the service can be specified. See
section 6.6.3 for a description of how this optional service endpoint name is used. If the service endpoint is
declared, an optional attribute can be supplied:
• link-type. This attribute is used to indicate the expected use of this consumer with connection links. The
possible values of this attribute are:
• standard. This is the default value. This indicates that the provided service endpoint must be routed
according to standard normalized message routing rules.
• hard. This indicates that the provided service endpoint name must match a service provider’s service
endpoint name; indirect connections are not allowed.
• soft. This indicates that the provided service endpoint must not match a service provider’s service
endpoint name; rather, it must match an indirect connection name.
See section 6.6.3 for details on how these values affect normalized message routing.
The contents of the installation descriptor file MUST conform to either the component installation descriptor
schema or the shared-library installation descriptor schema, as described above.
An example of an installation descriptor is shown below.
The example includes two “extension” elements, providing component-specific information, using an XML
name space that is outside of the document element’s. JBI implementations and component implementations
MAY use these extension elements to provide extra, component-specific data for the use of the component,
component tooling, or both.
Components vendors SHOULD use the identification extension element to provide identity information about
the component beyond the required JBI name and description. Such information could allow component-
specific tools to recognize the installation package type, and perform additional operations on the package or
the descriptor. This information is available to the component at both bootstrap and execution time (the jbi.xml
file is available at META-INF/jbi.xml relative to the installation root directory).
Components SHOULD use the component extension element to provide configuration information that is
known before installation is performed. The relationship between such configuration data and configuration
MBean-determined configuration data is determined by the component implementation. This information is
made available to the component through the InstallationContext interface.
• /{artifacts-file-name-N.zip}. As many service unit archives as are needed provide all such archives
mentioned in the deployment descriptor jbi.xml.
An example deployment descriptor and deployment package directory are given below. The descriptor makes
/META-INF/jbi.xml
/su1-artifacts.zip
/su2-artifacts.zip
Listing 20 Example Deployment Package Directory
reference to two separate files in the deployment package. Those two files, plus the descriptor itself, are
combined into a single ZIP archive, as shown in Listing 20.
Installation of components allows the component to supply an optional extension MBean to provide extended
configuration capabilities. Installation of shared-libraries does not allow for extended configuration, and thus
follows a simpler installation process. These two types of installation are detailed below.
Both types of installation begin with the JBI InstallationServiceMBean, a JMX management bean that
JBI implementations MUST provide. Once installed, individual shared libraries and components are referred to
by name. The term “name” in this context always refers to the unique library or component name, supplied in
the installation descriptor’s <identification><name> element value.
• Loading of the installer using the InstallerServiceMBean. This results in the creation of an
InstallerMBean for the component.
• Running the installer, using the InstallerMBean created above.
Optionally, the tool may interact with an installation extension MBean, installed during the above process.
These steps are elaborated upon in the following subsections.
6.4.2.1.1 Loading the Installer
When the InstallerServiceMBean.loadNewInstaller() method is called, the JBI
implementation MUST perform the following steps. A failure of any one of the steps will cause the entire
installation to be aborted, leaving the JBI environment in the same state it was in before the installation was
attempted.
1. Prepare installation context. When an installer MBean is created, the installation package ZIP file MUST
be expanded into an install root. This root is used throughout the lifetime of the component, and MUST be
located in a file system. Class path elements (from the jbi.xml installation descriptor) refer to items in the
install root. The JBI implementation MUST create an InstallationContext object, initialized to
provide the following data:
• Installation root, as a String containing the root’s full directory path name.
• Bootstrap class name, as given in the installation descriptor.
• Bootstrap class path, as given in the installation descriptor.
• Component name, as given in the installation descriptor.
• Installation Extension Data. A DOM fragment containing the installation extension data present in the
installation descriptor. If there are no such data in the descriptor, the fragment MUST be null.
2. Prepare Bootstrap class loader. The JBI implementation MUST create a class loader that provides access
to the bootstrap class path declared in the installation package descriptor. This class loader is described in
detail in chapter 7, “Component Framework.”
3. Initialize Installer. Using the above class loader, the JBI implementation MUST create an instance of the
bootstrap class, as declared in the installation descriptor. It MUST initialize the bootstrapper, by invoking
its init() method, passing it the installation context prepared in step 1. At this point the bootstrap code
provided by the component may optionally register an installation extension MBean, using the JMX server
provided by the component context.
4. Create Installer MBean. After the bootstrap init() call, the JBI implementation MUST create and
register an InstallerMBean for the component. Note that the InstallerMBean will need references
to the bootstrap loader object and the installation context to complete the installation.
6.4.2.1.2 Customized Installation
The administrative tool, after loading the installer as detailed in section 6.4.2.1.1, receives a JMX object name
for the InstallerMBean created for the component. The administrative tool must use the
InstallerMBean’s getInstallerConfigurationMBean() method to query for the existence of the
optional InstallerConfigurationMBean. If this does exist, the customization of the installation must
be done, using the InstallerConfigurationMBean BEFORE the installer is run by the administration
tool.
6.4.2.1.3 Run Installer
The administrative tool, after loading the installer as detailed in section 6.4.2.1.1, receives a JMX object name
for the InstallerMBean created for the component. The installation is completed by the administration tool
invoking the component’s InstallerMBean install() method. The JBI implementation MUST
perform the following processing steps to complete the installation.
Each installed component has a minimal life cycle, as defined here. This is illustrated below. The minimal life
cycle is modelled by two JBI MBeans: the InstallerMBean, which controls whether or not the component
is installed in the JBI system (i.e., in the installed state, as illustrated above), and the
ComponentLifeCycleMBean, which controls the component’s more conventional start/stop life cycle. The
component can extend the conventional life cycle by providing a life cycle extension MBean, which provides
additional life cycle states. Figure 26 illustrates this by adding a single “paused” substate to the standard
“Started” state. This extra substate is accessed through use of a “pause” control supplied by the extension
MBean.
The ComponentLifeCycleMBean and the life cycle extension MBean, if any, are the means by which a
management tool asks that the component change its running state. The component’s implementation of the
ComponentLifeCycle interface provides the actual logic to perform the state transitions that can be
commanded by administrative tools by means of these MBeans. The JBI implementation is responsible for the
following:
• It MUST persist the basic execution state the component is in.
• It MUST sequence the invocations of ComponentLifeCycle methods to assure legal transitions
through the basic execution states allowed. For example, if the start() MBean control is invoked by a
management tool on a component that is in the shutdown state, the implementation MUST, in sequence,
invoke the ComponentLifeCycle’s init() and start() methods. See the “Framework” chapter
for details on these component life cycle methods.
Note that on restart of the JBI environment, the JBI implementation MUST attempt to restore all components to
their previous standard running state. If a component wishes to instead restart in a different, extended substate
of the “Started” state, it must supply its own mechanisms to persist the extending running state, and restore it
during restart of the component by JBI. All life cycle extensions are considered substates of the Started state;
see the “Framework” chapter for details.
Instances of the component Bootstrap implementation MUST have their init() method called before it
can be used. Different instances of Bootstrap can be used during the extended life cycle of a component.
When the JBI implementation is finished with a Bootstrap instance, it MUST call the instance’s
cleanUp() method.
The sequence of interactions between the participants collaborating in the installation process is illustrated in
the figure below. This includes use of a configuration extension MBean. This diagram depicts the logical order
of operations. JBI and component implementations may vary the sequence, as long as the logical ordering
shown is preserved.
The process is driven by the administrative tool. Using the InstallationServiceMBean, the tool creates
a new InstallerMBean instance. The installer uses this new installer MBean to access the extension
MBean, in order to configure the Bootstrap object before installation continues. Finally, the tool starts the
install process proper: the InstallerMBean exploding the contents of installation package, and invoking the
Bootstrap object’s onInstall() and cleanUp() methods, in that order.
Note that registration and deregistration of the extension MBean is meant to depict use of the MBean server;
this is omitted from the diagram for simplicity. Components may create and register the MBean in the
Bootstrap’s init() method, or in the getExtensionMBean method. In either case, the extension MBean
must be deregistered in the cleanUp() method.
Note also that the admin tool is not obliged to call the getInstallerConfigurationMBean() method
of the InstallerMBean, as shown above. This step may be skipped by the admin tool if need be. (The tool
could, for example, have prior knowledge that the installer doesn’t have such an MBean, or that the tool had no
way of dealing with such an extension MBean if it did exist.)
The “explode” step that the InstallerMBean performs on itself depicts the process of unpacking the
contents of the component’s installation archive into its assigned root directory.
The uninstallation process is similar, and is depicted below. Note that the Bootstrap object creates, registers,
and deregisters the extension MBean. Also note that the Bootstrap object’s onUninstall() method is
called before the “clean up” step during uninstallation is done (the clean up step reverses the “explode” step
performed during installation). This is in contrast to the installation process, where the Bootstrap object’s
onInstall() method is invoked after the “explode” step. After this, the Bootstrap object’s cleanUp()
method is called, allowing the Bootstrap implementation to free any resources still allocated, such as the
registration of the extension MBean. Finally, the unloadInstaller() method is called on the installation
service MBean, at which time the implementation MUST register and clean up the installer MBean created at
the beginning of the sequence.
The JBI implementation MUST detect such duplicates. While it is an error for the administrator to deploy a
non-duplicate service unit that uses the same name as previously deployed service unit, it is not an error to
redeploy a duplicate service unit.
When a valid deployment package is received by the “deploy” method, the JBI implementation MUST provide
the following processing steps:
1. Validate the deployment package, ensuring that the deployment descriptor conforms to section 6.3.3. Also,
ensure that all service-unit artifacts are present in the package, and that all named target components are
installed in the JBI system.
2. For each <service-unit> in the <service-assembly> deployment descriptor:
• Unzip the service-unit artifacts archive, and place the result in file storage. (If the service-unit is deployed
to more than one component in the same deployment descriptor, the service unit MUST be copied such
that any changes to the deployment contents made by one component to the deployment artifacts do not
affect the other).
• Deploy the named service-unit to the named component. This is detailed in section “Service Unit
Deployment Processing” on page 79.
If any iteration (or iterations) of step 2 fails to successfully deploy the named service-unit to the named
component, the implementation MUST continue to deploy any remaining service units in the assembly. If all
service units of the assembly fail to deploy, a failure exception MUST be thrown. If at least one service unit
deployment succeeds, then any failures MUST be reported using the status return String of the
DeploymentServiceMBeans’s deploy() method. The format of this string is specified in section 6.9.
If the service-unit deployment is a duplicate, deployment MUST be skipped, without being considered a
deployment failure. Thus, redeployment of an assembly should succeed, but not disturb the existing
deployments.
The DeploymentServiceMBean is also used to control the life cycle of service assemblies; see section 6.8.
general components should interpret the Started state of a deployment as starting the provision and consumption
of services related to the deployment itself, while the Stopped state means that consumption of services have
ceased, and the Shutdown state means that both provision and consumption of services have ceased. The life
cycle state of a deployment is referred to as its running state.
Groups of service unit deployments are started in two phases, to assure orderly start-up of the JBI system. On
start or restart of any group of deployments, a JBI implementation MUST call init() for all service unit
deployments in the group before calling start() on any that are to be started.
JBI implementations MUST retain the running state of all service unit deployments, such that the system can be
restarted from a shutdown or crash, and all deployments will be restored to their previous running state. During
component restart, the implementation MUST perform the following to restore a service unit to its previous
state:
• Started. The implementation MUST call init(), followed by start().
• Stopped. The implementation MUST call init() to restore a service unit to the stopped state.
• Shutdown. The implementation MUST call init() followed by shutDown() to restore a service unit
to the shutdown state.
In all cases of state restoration, the implementation MUST call init() for all service units in the group being
restored before any other life cycle methods for service units in the group are called.
cycle controlled by the administrative tool through the use of the DeploymentServiceMBean:
• start(serviceAssemblyName). This method MUST attempt to start each of the service units of the assembly
that is not currently in the Started state. If any of the units are in the Shutdown state, then the
implementation MUST first invoke init() for each of those service units, as required above in section
6.7.
• stop(serviceAssemblyName). This method MUST attempt to stop each of the service units of the assembly
that is currently in the Started state.
• shutDown(serviceAssemblyName). This method MUST attempt to shut down each of the service units of
the assembly that is not currently shutdown. For all service units are in the Started state, the implementation
MUST first stop each of those service units, before attempting to shut down any of the service units of the
assembly.
When a failure to change the running state of any service unit occurs while processing the above management
commands, the failure MUST be reported in the returned status/result string (see section 6.9 for formatting
details).
Note that the running state of individual service units is controlled by using the ServiceUnitManager’s
life cycle controls for named service units. Access to each component’s ServiceUnitManager is described
in section 6.6.1.
management tools to make good use of the information to act on the results, display error messages, log results,
etc.
• frmwk-task-result is used to report the results of the implementation’s execution of the task. This includes
an optional element, is-cause-framework, which the implementation MUST set to “YES” in cases where
the JBI implementation is the cause of the task failing to execute.
• frmwk-task-result-details is used to contain a detailed task report, as well as locale information about the
report (supporting I18N/L10N).
• component-task-result is used to report results of interaction(s) with a component. This includes the
component’s unique name and details about the component task results. For example, this is used by the
component’s ServiceUnitManager implementation to return the results of deploy() and
undeploy().
• component-task-result-details is used to report task result details as performed by the component.
• task-result-details is used to report the task ID, result (SUCCESS or FAILED), and, optionally, a typed
(ERROR, WARNING, or INFO) message. Zero or more task status messages can be included (for dealing
with multiple interactions with components). Finally, optional exception information can be provided.
• msg-loc-info is used to report a message in the form of a format string and zero or more text parameters.
This structure supports I18N/L10N.
• loc-token is the message key for looking up localized text for the message
• loc-message is the default message. All messages must use the java.text.MessageFormat
patterns to define the message, and where parameters are placed within the message.
• loc-param. Zero or more parameters for the message.
• exception-info is used to report exceptions. It contains the following items:
• nesting-level. This indicates by integer value what the exception’s level was within a nested set of
exceptions.
• msg-loc-info is used to report the exception message value, as described above.
• stack-trace is used to report a stack trace at the point where the exception was thrown.
The following listing shows an example of a deployment error.
In this example, the error is caused by a malformed deployment descriptor discovered by the JBI
implementation (framework).
Components supply status/result strings as XML strings that conform to the component-task-result-details type
from the above schema. For example, the ServiceUnitManager.deploy() method returns such a status/
result string. The JBI implementation MUST combine the status/result strings supplied by components into the
the overall status/result document defined above.
used to remotely access the JBI environment targeted. This does not provide a full URL for accessing the JBI
environment; the implementation MUST provide a means for specifying a template that is used to construct the
URL, which is implementation specific. The reference implementation, which uses JMX connectors, provides
for this need in two ways:
• Using a system property:
com.sun.jbi.tools.remote.jmx.url = service:jmx:rmi:///jndi/rmi://{0}:{1}/management/rmi-jmx-connector
• Using an Ant property:
jbi.default.url=service:jmx:jmxmp://{0}:{1}
where {0} is replaced with the “host” attribute value and {1} is replaced with the “port” attribute value.
installation process provided by this task MUST both load and install the component.
6.10.6.1.1 Nested Element <param>
This nested element is an optional child element containing an installation configuration parameter which will
be passed to the install task. Multiple parameters require multiple <param> elements, one per parameter. This
element takes a name/value pair for setting the property of the InstallerConfigurationMBean
implemented by the Installer of the component.
Note that the attribute name value is case sensitive. For example, if the configuration MBean has a attribute Foo
as a “setFoo” not as a “setfoo”, then the name attribute value for the param element must be “Foo”. Passing the
name attribute value as “foo” will result in a property not found error.
MyConfigMBean {
setFoo1(String value);
setFoo2(String value);
}
Listing 23 Example Configuration MBean
configures it using the example MBean is shown below. This example uses script-supplied parameters to
provide the configuration data. Alternatively, an external file can be used to supply the configuration data. This
is shown below.
If the xmlOutput attribute is specified, the task must produce an XML document conforming to the following
XML schema. If xmlOutput is not specified, an implementation-defined text format MUST be output. An
example of such an output is below. An Ant script to produce equivalent XML output, and the output itself is
-----------------------------------------
------------ Service Engines ------------
-----------------------------------------
Name: Test_engine1
State: Started
Description: Test engine with shared library.
Name: ant_test_engine2
State: Shutdown
Description: Yet another test engine.
Listing 27 Example Service Listing
jbi-list-service-engines xmlOutput="jbi.output"/>
<!-- The value of the property ${jbi.output} contains the XML output of the task. -->
<!-- The user can acccess the XML text using the property value. For instance: -->
<echo message="${jbi.output}"/>
Listing 28 Example Ant Script fragment to List Service Engines as XML Output
xmlOutput attribute is specified, the format of the output must conform to the schema described in Listing
26, above. If the xmlOutput attribute is not specified, JBI implementations are free to format non-XML
output as they wish.
xmlOutput attribute of the task is specified, the format of the must conform to the schema described in
Listing 30, below. If xmlOutput is not required, the implementation is free to use any format for the output.
JBI components (service engines and binding components) provide interfaces for the use of JBI, and use
interfaces provided by JBI. The major messaging and management contracts between JBI and a component
have already been discussed in previous chapters. The remaining contracts, known collectively as the
component framework, are detailed in this chapter.
JBI implementations provide an environment for components, in addition to that provided by the standard Java
(J2EE or J2SE) environment the implementation runs under. The JBI framework provides the following for the
use of components:
• Component installation context. This MUST be supplied to the component during component bootstrap
(installation customization). This provides access to JBI-provided resources and component installation
information during installation and uninstallation of a component.
• Component context. This MUST be supplied to the component during component initialization. This
provides access to JBI-provided resources during normal execution of the component.
• Class loading. JBI ensures that the class loader used to create instances of the component-supplied
Bootstrap and Component classes is set appropriately at both bootstrap- and execution-time. This
gives components access to a standardized class loader hierarchy, giving access to component, shared, and
JBI libraries.
• Error indication. Exception classes provide indication of JBI-specific errors to the component, and allow
the component to distinguish various error types.
In addition, components implement particular interfaces, to provide the following functions to JBI:
• Bootstrap. This provides extended installation (and uninstallation) configuration functions for the
component, beyond those JBI’s management functions already provide.
• Component. This interface provides JBI with methods to get the component’s life cycle interface, provide
service metadata, and get the component’s service unit manager.
• Component life cycle. This provides life cycle control of the component. This is utilized by the
ComponentLifeCycleMBean, as described in the “Management” chapter.
• Service unit manager. This provides deployment and life cycle control for service units deployed to the
component. This is an optional interface; components that do not support deployment need not supply a
service unit manager.
These component-supplied services are related to management activities; to fully understand how these services
are used please see the “Management” chapter.
7.1.1 Bootstrapper
Installation of components is handled largely by the JBI management system (see the “Management” chapter
for details), which will copy the installation image to the file system of the JBI instance. The process of
installing (and the reverse, uninstalling) a component MAY be customized by the component. This allows
further installation processing beyond the simple copying of binary images that the management system
provides. For example, creation of database tables may be performed by a component’s bootstrap.
The component MUST provide, as part of its installation package, the fully-qualified name of a class that
implements the Bootstrap interface. (The installation package is specified in the “Management” chapter.)
The implementation MUST create and initialize (by calling Bootstrap.init()) an instance of the
Bootstrap class specified in the installation package before installing or uninstalling the component. This
process is detailed in the “Management” chapter.
states, and transitions between states, are depicted below. Note that the “Paused” and “Running”states illustrate
extended life cycle states that are an extension of the basic JBI life cycle states. All extended states are substates
of the standard “Started” state.
When first installed (as described in the “Management” chapter), the component is placed in the “Shutdown”
state. Before using the component-supplied services beyond the bootstrap, the implementation must obtain and
initialize the component’s life cycle implementation. This MUST be accomplished by using the component’s
implementation of javax.jbi.component.Component, as discussed above in “Component Interface”.
Using the component’s Component implementation, the JBI implementation MUST obtain the component’s
ComponentLifeCycle object.
When the LifeCycleMBean.start() method of the component is invoked (see the management chapter),
and the component is in the “Shutdown” state, the JBI implementation MUST call the component’s life cycle
init() method, passing to it a valid component context, followed by a call to the life cycle start() method, as
illustrated below. Subsequent calls to start(), from the “Stopped” state, MUST NOT cause the JBI
framework to call the init() method. Subsequent starts without an intervening stop and shut down behave as
shown below.
The JBI implementation MUST retain the Component implementation object created during the initial start
(or whenever it is first needed). The retained object is used to access the component’s life cycle implementation,
as well as other component information.
7.1.3.1 System Restart
The term system restart refers to the situation when the JBI system is restarted after a system shutdown or crash.
The JBI implementation MUST persist the running state of each component, such that, upon system restart, the
implementation will attempt to restore each component to its previous running state.
All component extended states are considered substates of the Started state. If a component must restore itself to
an extended state on system restart, it is responsible for persisting its state information, and, upon being
successfully restarted in the Started state, restore itself to the extended substate needed.
August 17, 2005 Java Business Integration 1.0 Final Release 100
Component Framework
August 17, 2005 Java Business Integration 1.0 Final Release 101
Component Framework
a given endpoint.
• getExternalEndpoints(). The implementation MUST return all of the external endpoints registered
that provide a particular interface type.
• getExternalEndpointsForService(). The implemenation MUST return all of the external
endpoints registered for a particular service.
Once a Descriptor for an endpoint is found, the service metadata (that is, the WSDL description of the
endpoint) can be retrieved using its getDescription() method, which returns a DOM representation of the
endpoint’s description.
7.2.1.2 Endpoint Activation and Deactivation
A JBI component that acts as a service provider MUST indicate to the NMR which endpoints it is currently
providing (a component can supply multiple endpoints). Such a component can dynamically (and arbitrarily)
activate and deactivate endpoints, using the following ComponentContext methods:
• activateEndpoint(serviceName, endpointName). This method is used by a component to
let the NMR know that the named endpoint is ready to process message exchanges. This MUST NOT be
called until the component is fully ready to process message exchanges destined for the named endpoint,
and the component's Component implementation is ready to supply service data about the endpoint.
• deactivateEndpoint(endpoint). This method is used by a component to let the NMR know that
the named endpoint is being withdrawn from service. The NMR MUST NOT allow initiators to invoke the
endpoint’s services after the endpoint is deactivated. Ongoing message exchanges will be permitted to
continue to completion.
August 17, 2005 Java Business Integration 1.0 Final Release 102
Component Framework
7.2.3 Loggers
The ComponentContext supplied to a component implementation may be used by the component to create
standard java.util.logging.Logger instances. The getLogger() method takes two arguments: a
(possibly empty) suffix string, and a (possibly null) resource bundle name. The getLogger()
implementation MUST guarantee the following:
• The name of the logger is unique for the component. There will be no collisions between the name of the
created logger and loggers similarly created for other components, or with loggers used internally within
the JBI implementation itself.
• Calling getLogger with the same suffix argument, within the same component, will always return the same
logger instance.
The resource bundle name, if non-null, MUST be used by the implementation to construct the Logger
instance, thus enabling localized logging messages. The resource bundle MUST be loadable when using the
component’s class loader as the initiating loader (i.e., it must be available in the component’s own class path, or
in a shared library). See section 7.3, below, for details on class and resource loading in the JBI environment.
August 17, 2005 Java Business Integration 1.0 Final Release 103
Component Framework
August 17, 2005 Java Business Integration 1.0 Final Release 104
Component Framework
To facilitate sharing of class loaders between components in a controllable, predictable fashion that will not
adversely affect other system components, a specific class loading scheme for JBI environments is required.
This behaviour is defined in the following section, as part of the execution class loader.
August 17, 2005 Java Business Integration 1.0 Final Release 105
Component Framework
August 17, 2005 Java Business Integration 1.0 Final Release 106
Component Framework
August 17, 2005 Java Business Integration 1.0 Final Release 107
Component Framework
August 17, 2005 Java Business Integration 1.0 Final Release 108
CHAPTER 8
Package
javax.jbi
Class Summary
Exceptions
JBIException110 JBIException is the top-level exception thrown by both JBI-supplied APIs and
component-provided SPIs.
August 17, 2005 Java Business Integration 1.0 Final Release 109
JBIException javax.jbi
javax.jbi
JBIException
Declaration
public class JBIException extends java.lang.Exception
java.lang.Object
|
+--java.lang.Throwable
|
+--java.lang.Exception
|
+--javax.jbi.JBIException
Description
JBIException is the top-level exception thrown by both JBI-supplied APIs and component-provided SPIs.
Member Summary
Constructors
JBIException(java.lang.String message)111
JBIException(java.lang.String message, java.lang.Throwable
cause)111
JBIException(java.lang.Throwable cause)111
August 17, 2005 Java Business Integration 1.0 Final Release 110
javax.jbi JBIException
JBIException(String)
Constructors
JBIException(String)
public JBIException(java.lang.String message)
Creates a new instance of JBIException with the specified exception detail message.
Parameters:
message - the detail message for this exception
JBIException(String, Throwable)
public JBIException(java.lang.String message, java.lang.Throwable cause)
Creates a new instance of JBIException with the specified exception detail message and cause.
Parameters:
message - the detail message for this exception
cause - Error or Exception which represents the cause of the problem (null if none, or if the
cause is not known)
JBIException(Throwable)
public JBIException(java.lang.Throwable cause)
August 17, 2005 Java Business Integration 1.0 Final Release 111
JBIException javax.jbi
JBIException(Throwable)
August 17, 2005 Java Business Integration 1.0 Final Release 112
CHAPTER 9
Package
javax.jbi.component
Class Summary
Interfaces
Bootstrap114 This interface is implemented by a JBI Component to provide any special processing
required at install/uninstall time.
Component116 This interface, implemented by component implementations, allows the JBI
implementation to query the component for various types of information.
ComponentContext119 This interface provides access to data needed by a JBI component about the JBI
environment in which it is installed, as well providing the means to allow the
component to inform the JBI environment about services provided by this component.
ComponentLifeCycle126 This interface must be implemented by a JBI component to provide initialization, start,
stop, and shutdown life cycle processing.
InstallationContext128 This context contains information necessary for a JBI component to perform its
installation/uninstallation processing.
ServiceUnitManager131 This interface defines component-supplied methods for managing service unit
deployments, and is implemented by the component.
August 17, 2005 Java Business Integration 1.0 Final Release 113
Bootstrap javax.jbi.component
cleanUp()
javax.jbi.component
Bootstrap
Declaration
public interface Bootstrap
Description
This interface is implemented by a JBI Component to provide any special processing required at install/
uninstall time. The methods defined here are called by the JBI implementation during the installation (or
uninstallation) of the component that, among other things, supplies an implementation of this interface.
Initialization/cleanup tasks such as creation/deletion of directories, files, and database tables can be done by the
onInstall()115 and onUninstall()115 methods, respectively. This also allows the component to
terminate the installation or uninstallation in the event of an error.
After calling onInstall()115 or onUninstall()115 , regardless of outcome, the JBI implementation
must call the cleanUp()114 method afterwards. Similarly, if init(InstallationContext)115 fails
with an exception, the JBI implementation must call the cleanUp()114 method.
Component implementors should note that there is no guarantee that the same instance of its Bootstrap
implementation will be used during both install and uninstall operations on the component. Data that need to be
retained between installation-time and uninstallation-time must be persisted in such as fashion that a separate
instance of the bootstrap class can find them, despite component or system shutdown.
Member Summary
Methods
void cleanUp()114
getExtensionMBeanName()115
javax.management.Objec
tName
void init(InstallationContext installContext)115
void onInstall()115
void onUninstall()115
Methods
cleanUp()
public void cleanUp()
throws JBIException
Cleans up any resources allocated by the bootstrap implementation, including performing deregistration of
the extension MBean, if applicable.
This method must be called after the onInstall() or onUninstall() method is called, whether it succeeds or
fails. It must be called after init() is called, if init() fails by throwing an exception.
Throws:
javax.jbi.JBIException110 - if the bootstrap cannot clean up allocated resources.
August 17, 2005 Java Business Integration 1.0 Final Release 114
javax.jbi.component Bootstrap
getExtensionMBeanName()
getExtensionMBeanName()
public javax.management.ObjectName getExtensionMBeanName()
Obtains the ObjectName of the optional installer configuration MBean. If none is provided by this
component, this method must return null.
This method must be called before onInstall() (or onUninstall()) is called by the JBI implementation.
Returns: ObjectName of the optional installer configuration MBean; returns null if there is no such
MBean.
init(InstallationContext)
public void init(javax.jbi.component.InstallationContext128 installContext)
throws JBIException
Initializes the installation environment for a component. This method is expected to save any information
from the installation context that may be needed by other methods.
If the component needs to register an optional installer configuration MBean, it MUST do so during
execution of this method, or the getExtensionMBean() method.
This method must be called after the installation root (available through the installContext parameter) is
prepared.
Parameters:
installContext - the context containing information from the install command and from the
component installation ZIP file; this must be non-null.
Throws:
javax.jbi.JBIException110 - when there is an error requiring that the installation be
terminated.
onInstall()
public void onInstall()
throws JBIException
Called at the beginning of installation of a component to perform any special installation tasks required by
the component.
This method must not be called if the init() method failed with an exception.
Throws:
javax.jbi.JBIException110 - when there is an error requiring that the installation be
terminated.
onUninstall()
public void onUninstall()
throws JBIException
Called at the beginning of uninstallation of a component to perform any special uninstallation tasks
required by the component.
This method must not be called if the init() method failed with an exception.
Throws:
javax.jbi.JBIException110 - when there is an error requiring that the uninstallation be
terminated.
August 17, 2005 Java Business Integration 1.0 Final Release 115
Component javax.jbi.component
getLifeCycle()
javax.jbi.component
Component
Declaration
public interface Component
Description
This interface, implemented by component implementations, allows the JBI implementation to query the
component for various types of information. This includes:
• The component’s life cycle control interface.
• The component’s service unit manager, for handling deployments.
• A method for querying service metadata describing services provided by this component.
• “Policy” methods that are called by the JBI implementation to query if proposed matches of this component
to a provider (or consumer) are acceptable, according to this component’s policies.
• Endpoint reference (EPR) resolution. Some components will provide the ability to resolve EPRs (typically
binding components). This ability to resolve EPRs is used by JBI to facilitate resolution of EPRs received
by service consumers.
The name of the class that implements this interface for a component is specified in the installation descriptor
for that component.
Member Summary
Methods
ComponentLifeCycle getLifeCycle()116
org.w3c.dom.Document getServiceDescription(javax.jbi.servicedesc.ServiceEndpoint
ref)117
ServiceUnitManager getServiceUnitManager()117
boolean isExchangeWithConsumerOkay(javax.jbi.servicedesc.ServiceEndpo
int endpoint, javax.jbi.messaging.MessageExchange exchange)117
boolean isExchangeWithProviderOkay(javax.jbi.servicedesc.ServiceEndpo
int endpoint, javax.jbi.messaging.MessageExchange exchange)117
resolveEndpointReference(org.w3c.dom.DocumentFragment epr)118
javax.jbi.servicedesc.
ServiceEndpoint
Methods
getLifeCycle()
public javax.jbi.component.ComponentLifeCycle126 getLifeCycle()
Get the life cycle control interface for this component. This interface allows the JBI implementation to
control the running state of this component.
August 17, 2005 Java Business Integration 1.0 Final Release 116
javax.jbi.component Component
getServiceDescription(ServiceEndpoint)
This method must be called before any other methods of this interface are called. In addition, the JBI
implementation must call the init() method of the component life cycle returned by this method before
calling any other methods on this interface, or the component life cycle interface.
Returns: the life cycle control interface for this component; must be non-null.
getServiceDescription(ServiceEndpoint)
public org.w3c.dom.Document
getServiceDescription(javax.jbi.servicedesc.ServiceEndpoint192 ref)
Retrieves a DOM representation containing metadata which describes the service provided by this
component, through the given endpoint. The result can use WSDL 1.1 or WSDL 2.0.
Parameters:
endpoint - the service endpoint.
Returns: the description for the specified service endpoint.
getServiceUnitManager()
public javax.jbi.component.ServiceUnitManager131 getServiceUnitManager()
Get the ServiceUnitManager for this component. If this component does not support deployments, it must
return null.
Returns: the ServiceUnitManager for this component, null if none there is none.
isExchangeWithConsumerOkay(ServiceEndpoint, MessageExchange)
public boolean isExchangeWithConsumerOkay(javax.jbi.servicedesc.ServiceEndpoint192
endpoint, javax.jbi.messaging.MessageExchange171 exchange)
This method is called by JBI to check if this component, in the role of provider of the service indicated by
the given exchange, can actually perform the operation desired.
Parameters:
endpoint - the endpoint to be used by the consumer; must be non-null.
exchange - the proposed message exchange to be performed; must be non-null.
Returns: true if this provider component can perform the the given exchange with the described
consumer.
isExchangeWithProviderOkay(ServiceEndpoint, MessageExchange)
public boolean isExchangeWithProviderOkay(javax.jbi.servicedesc.ServiceEndpoint192
endpoint, javax.jbi.messaging.MessageExchange171 exchange)
This method is called by JBI to check if this component, in the role of consumer of the service indicated by
the given exchange, can actually interact with the the provider properly. The provider is described by the
given endpoint and the service description supplied by the given endpoint.
Parameters:
endpoint - the endpoint to be used by the provider; must be non-null.
exchange - the message exchange that is to be performed.
Returns: true if this consumer component can interact with the described provider to perform the given
exchange.
August 17, 2005 Java Business Integration 1.0 Final Release 117
Component javax.jbi.component
resolveEndpointReference(DocumentFragment)
resolveEndpointReference(DocumentFragment)
public javax.jbi.servicedesc.ServiceEndpoint192
resolveEndpointReference(org.w3c.dom.DocumentFragment epr)
Resolve the given endpoint reference. This is called by JBI when it is attempting to resolve the given EPR
on behalf of a component.
If this component returns a non-null result, it must conform to the following:
• This component implements the javax.jbi.servicedesc.ServiceEndpoint192 returned.
• The result must not be registered or activated with the JBI implementation.
Dynamically resolved endpoints are distinct from static ones; they must not be activated (see
ComponentContext.activateEndpoint(QName, String)120 ), nor registered (see
ComponentContext119 ) by components. They can only be used to address message exchanges; the JBI
implementation must deliver such exchanges to the component that resolved the endpoint reference (see
ComponentContext.resolveEndpointReference(DocumentFragment)125 ).
Parameters:
epr - the endpoint reference, in some XML dialect understood by the appropriate component (usually
a binding); must be non-null.
Returns: the service endpoint for the EPR; null if the EPR cannot be resolved by this component.
August 17, 2005 Java Business Integration 1.0 Final Release 118
javax.jbi.component ComponentContext
resolveEndpointReference(DocumentFragment)
javax.jbi.component
ComponentContext
Declaration
public interface ComponentContext
Description
This interface provides access to data needed by a JBI component about the JBI environment in which it is
installed, as well providing the means to allow the component to inform the JBI environment about services
provided by this component. This interface provides methods for the following functions:
• Get the DeliveryChannel for this component. This is required to allow the component to send and receive
message exchanges.
• Activate (and deactivate) service endpoints provided by this component.
• Register (and deregister) external endpoints provided by this component.
• Query available endpoints (internal and external).
• Query various data about the component, as installed in the JBI environment (name, workspace root, install
root, initial JNDI context, MBean Server, Transaction Manager).
• Loggers. Obtain the component’s logger and subloggers.
• MBean name creator. Access a utility for creating custom MBean names.
• EPR Resolver. Ask JBI to resolve an endpoint reference (EPR), converting it into a service endpoint.
Note: The term “NMR” (meaning Normalized Message Router) is used here to refer to the messaging system of
the JBI implementation. This term is used as a synonym for the JBI implementation, and refers only to the
logical message routing functions of a JBI implementation. It is not meant to require that JBI implementations
literally have a subsystem named “NMR”.
Member Summary
Methods
activateEndpoint(javax.xml.namespace.QName serviceName,
javax.jbi.servicedesc. java.lang.String endpointName)120
ServiceEndpoint
void deactivateEndpoint(javax.jbi.servicedesc.ServiceEndpoint
endpoint)121
void deregisterExternalEndpoint(javax.jbi.servicedesc.ServiceEndpo
int externalEndpoint)121
java.lang.String getComponentName()121
getDeliveryChannel()121
javax.jbi.messaging.De
liveryChannel
getEndpoint(javax.xml.namespace.QName service,
javax.jbi.servicedesc. java.lang.String name)122
ServiceEndpoint
org.w3c.dom.Document getEndpointDescriptor(javax.jbi.servicedesc.ServiceEndpoint
endpoint)122
August 17, 2005 Java Business Integration 1.0 Final Release 119
ComponentContext javax.jbi.component
activateEndpoint(QName, String)
Member Summary
getEndpoints(javax.xml.namespace.QName interfaceName)122
javax.jbi.servicedesc.
ServiceEndpoint[]
getEndpointsForService(javax.xml.namespace.QName
javax.jbi.servicedesc. serviceName)122
ServiceEndpoint[]
getExternalEndpoints(javax.xml.namespace.QName
javax.jbi.servicedesc. interfaceName)123
ServiceEndpoint[]
getExternalEndpointsForService(javax.xml.namespace.QName
javax.jbi.servicedesc. serviceName)123
ServiceEndpoint[]
java.lang.String getInstallRoot()123
getLogger(java.lang.String suffix, java.lang.String
java.util.logging.Logg resourceBundleName)123
er
getMBeanNames()124
javax.jbi.management.M
BeanNames
getMBeanServer()124
javax.management.MBean
Server
getNamingContext()124
javax.naming.InitialCo
ntext
java.lang.Object getTransactionManager()124
java.lang.String getWorkspaceRoot()124
void registerExternalEndpoint(javax.jbi.servicedesc.ServiceEndpoin
t externalEndpoint)125
resolveEndpointReference(org.w3c.dom.DocumentFragment epr)125
javax.jbi.servicedesc.
ServiceEndpoint
Methods
activateEndpoint(QName, String)
public javax.jbi.servicedesc.ServiceEndpoint192
activateEndpoint(javax.xml.namespace.QName serviceName,
java.lang.String endpointName)
throws JBIException
Activates the named endpoint with the NMR. Activation indicates to the NMR that this component is ready
to process requests sent to the named endpoint.
Note that the JBI implementation may call this component’s
Component.getServiceDescription(ServiceEndpoint)117 method before returning from
this method call; the component’s implementation must be ready to supply service description metadata
before the result of this activation call (a ServiceEndpoint) is known.
Parameters:
serviceName - qualified name of the service the endpoint exposes; must be non-null.
endpointName - the name of the endpoint to be activated; must be non-null and non-empty.
August 17, 2005 Java Business Integration 1.0 Final Release 120
javax.jbi.component ComponentContext
deactivateEndpoint(ServiceEndpoint)
deactivateEndpoint(ServiceEndpoint)
public void deactivateEndpoint(javax.jbi.servicedesc.ServiceEndpoint192 endpoint)
throws JBIException
Deactivates the given endpoint with the NMR. Deactivation indicates to the NMR that this component will
no longer process requests sent to the named endpoint.
Parameters:
endpoint - reference to the endpoint to be deactivated; must be non-null.
Throws:
javax.jbi.JBIException110 - if the endpoint cannot be deactivated.
deregisterExternalEndpoint(ServiceEndpoint)
public void deregisterExternalEndpoint(javax.jbi.servicedesc.ServiceEndpoint192
externalEndpoint)
throws JBIException
Deregisters the given external endpoint with the NMR. This indicates to the NMR that the given external
endpoint can no longer be used as a proxy for external service consumers to access an internal service of the
same service name.
Parameters:
externalEndpoint - the external endpoint to be deregistered; must be non-null.
Throws:
javax.jbi.JBIException110 - if the given external endpoint was not previously registered.
getComponentName()
public java.lang.String getComponentName()
Get the unique component name of this component, as assigned by the identification section of this
component’s installation descriptor.
Returns: the component name; must be non-null and non-empty.
getDeliveryChannel()
public javax.jbi.messaging.DeliveryChannel158 getDeliveryChannel()
throws MessagingException
Get a channel for this component to use to communicate with the Normalized Message Router. This
channel must be used by the component to send and receive message exchanges.
Returns: the delivery channel for this component; must be non-null.
Throws:
javax.jbi.messaging.MessagingException183 - if a channel has already been opened,
but not yet closed.
August 17, 2005 Java Business Integration 1.0 Final Release 121
ComponentContext javax.jbi.component
getEndpoint(QName, String)
getEndpoint(QName, String)
public javax.jbi.servicedesc.ServiceEndpoint192 getEndpoint(javax.xml.namespace.QName
service, java.lang.String name)
Get the service endpoint for the named activated endpoint, if any.
Parameters:
service - qualified-name of the endpoint’s service; must be non-null.
name - name of the endpoint; must be non-null.
Returns: the named endpoint, or null if the named endpoint is not activated.
getEndpointDescriptor(ServiceEndpoint)
public org.w3c.dom.Document
getEndpointDescriptor(javax.jbi.servicedesc.ServiceEndpoint192 endpoint)
throws JBIException
getEndpoints(QName)
public javax.jbi.servicedesc.ServiceEndpoint[]192 getEndpoints(javax.xml.namespace.QName
interfaceName)
Queries the NMR for active endpoints that implement the given interface. This will return the endpoints for
all services and endpoints that implement the named interface (portType in WSDL 1.1). This method does
NOT include external endpoints (those registered using
registerExternalEndpoint(ServiceEndpoint)125 .
Parameters:
interfaceName - qualified name of interface/portType that is implemented by the endpoint; if
null then all activated endpoints in the JBI environment must be returned.
Returns: an array of available endpoints for the specified interface name; must be non-null; may be empty.
getEndpointsForService(QName)
public javax.jbi.servicedesc.ServiceEndpoint[]192
getEndpointsForService(javax.xml.namespace.QName serviceName)
Queries the NMR for active endpoints belonging to the given service. This method does NOT include
external endpoints (those registered using
registerExternalEndpoint(ServiceEndpoint)125 .
Parameters:
serviceName - qualified name of the service that the endpoints are part of; must be non-null.
Returns: an array of available endpoints for the specified service name; must be non-null; may be empty.
August 17, 2005 Java Business Integration 1.0 Final Release 122
javax.jbi.component ComponentContext
getExternalEndpoints(QName)
getExternalEndpoints(QName)
public javax.jbi.servicedesc.ServiceEndpoint[]192
getExternalEndpoints(javax.xml.namespace.QName interfaceName)
Queries the NMR for external endpoints that implement the given interface name. This methods returns
only registered external endpoints (see registerExternalEndpoint(ServiceEndpoint)125 .
Parameters:
interfaceName - qualified name of interface implemented by the endpoints; must be non-null.
Returns: an array of available external endpoints for the specified interface name; must be non-null; may
be empty.
getExternalEndpointsForService(QName)
public javax.jbi.servicedesc.ServiceEndpoint[]192
getExternalEndpointsForService(javax.xml.namespace.QName serviceName)
Queries the NMR for external endpoints that are part of the given service.
Parameters:
serviceName - qualified name of service that contains the endpoints; must be non-null.
Returns: an array of available external endpoints for the specified service name; must be non-null; may be
empty.
getInstallRoot()
public java.lang.String getInstallRoot()
getLogger(String, String)
public java.util.logging.Logger getLogger(java.lang.String suffix,
java.lang.String resourceBundleName)
throws MissingResourceException, JBIException
Get a logger instance from JBI. Loggers supplied by JBI are guaranteed to have unique names such that
they avoid name collisions with loggers from other components created using this method. The suffix
parameter allows for the creation of subloggers as needed. The JBI specification says nothing about the
exact names to be used, only that they must be unique across components and the JBI implementation itself.
Parameters:
suffix - for creating subloggers; use an empty string for the base component logger; must be non-
null.
resourceBundleName - name of ResourceBundle to be used for localizing messages for the
logger. May be null if none of the messages require localization. The resource, if non-null, must be
loadable using the component’s class loader as the initiating loader.
Returns: a standard logger, named uniquely for this component (plus the given suffix, if applicable); must
be non-null.
August 17, 2005 Java Business Integration 1.0 Final Release 123
ComponentContext javax.jbi.component
getMBeanNames()
Throws:
java.util.MissingResourceException - if the ResourceBundleName is non-null and no
corresponding resource can be found.
javax.jbi.JBIException110 - if the resourceBundleName has changed from a previous
invocation by this component of this method with the same suffix.
getMBeanNames()
public javax.jbi.management.MBeanNames155 getMBeanNames()
Get a reference to the MBeanNames creator for use in creating custom MBean names.
Returns: a reference to the MBeanNames creator; must be non-null.
getMBeanServer()
public javax.management.MBeanServer getMBeanServer()
Get the JMX MBean server used to register all MBeans in the JBI environment.
Returns: a reference to the MBean server; must be non-null.
getNamingContext()
public javax.naming.InitialContext getNamingContext()
Get the JNDI naming context for this component. This context is a standard JNDI InitialContext but
its content will vary based based on the environment in which the JBI implementation is running.
Returns: the JNDI naming context; must be non-null.
getTransactionManager()
public java.lang.Object getTransactionManager()
Get the TransactionManager for this implementation. The instance returned is an implementation of the
standard JTA interface. If none is available, this method returns null.
The object returned by this method is untyped, to allow this interface to be compiled in environments that
do not support JTA. If not null, the object returned must be of type
javax.transaction.TransactionManager.
This downcast is necessary because JBI is used in environments that do not support JTA (i.e., J2SE).
Explicit use of JTA types would cause compilation failures in such environments.
Returns: A TransactionManager instance, or null if none is available in the execution environment.
getWorkspaceRoot()
public java.lang.String getWorkspaceRoot()
Get the root directory path for this component’s private workspace.
This method MUST return the file path formatted for the underlying platform.
The returned value must indicate a valid file path that the component may use to write files to, and read files
from.
Returns: The private workspace root path, in platform-specific form; must be non-null and non-empty.
August 17, 2005 Java Business Integration 1.0 Final Release 124
javax.jbi.component ComponentContext
registerExternalEndpoint(ServiceEndpoint)
registerExternalEndpoint(ServiceEndpoint)
public void registerExternalEndpoint(javax.jbi.servicedesc.ServiceEndpoint192
externalEndpoint)
throws JBIException
Registers the given external endpoint with the NMR. This indicates to the NMR that the given endpoint is
used as a proxy for external service consumers to access an internal service of the same service name (but a
different endpoint name).
Parameters:
externalEndpoint - the external endpoint to be registered; must be non-null.
Throws:
javax.jbi.JBIException110 - if an external endpoint with the same name is already registered,
by this or another component.
resolveEndpointReference(DocumentFragment)
public javax.jbi.servicedesc.ServiceEndpoint192
resolveEndpointReference(org.w3c.dom.DocumentFragment epr)
Resolve the given endpoint reference into a service endpoint. This is called by the component when it has
an EPR that it wants to resolve into a service endpoint.
Note that the service endpoint returned refers to a dynamic endpoint; the endpoint will exist only as long as
this component retains a strong reference to the object returned by this method. The endpoint may not be
included in the list of “activated” endpoints.
Parameters:
epr - endpoint reference as an XML fragment; must be non-null.
Returns: the service endpoint corresponding to the given endpoint reference; null if the reference cannot
be resolved.
August 17, 2005 Java Business Integration 1.0 Final Release 125
ComponentLifeCycle javax.jbi.component
getExtensionMBeanName()
javax.jbi.component
ComponentLifeCycle
Declaration
public interface ComponentLifeCycle
Description
This interface must be implemented by a JBI component to provide initialization, start, stop, and shutdown life
cycle processing. These methods comprise the life cycle contract between the JBI implementation and the
component. The life cycle of a component begins with a call to the init() method on an instance of the
component’s implementation of this interface, and ends with the first call to the shutDown() method on that
instance. Between these two calls, there can be any number of stop() and start() calls.
The JBI implementation must track the running state of a component, and ensure that life cycle state changes
are always legal. For example, if the management interface for controlling a component’s life cycle
(javax.jbi.management.ComponentLifeCycleMBean139 ) is used to start a component that was
just installed (and thus in the Shutdown state), the implementation must invoke this component’s
init(ComponentContext)126 method before invoking its start()127 method.
Member Summary
Methods
getExtensionMBeanName()126
javax.management.Objec
tName
void init(ComponentContext context)126
void shutDown()127
void start()127
void stop()127
Methods
getExtensionMBeanName()
public javax.management.ObjectName getExtensionMBeanName()
Get the JMX object name for the extension MBean for this component; if there is none, return null.
Returns: the JMX object name of the additional MBean or null if there is no additional MBean.
init(ComponentContext)
public void init(javax.jbi.component.ComponentContext119 context)
throws JBIException
Initialize the component. This performs initialization required by the component but does not make it ready
to process messages. This method is called once for each life cycle of the component.
August 17, 2005 Java Business Integration 1.0 Final Release 126
javax.jbi.component ComponentLifeCycle
shutDown()
If the component needs to register an additional MBean to extend its life cycle, or provide other component
management tasks, it should be registered during this call.
Parameters:
context - the component’s context, providing access to component data provided by the JBI
environment; must be non-null.
Throws:
javax.jbi.JBIException110 - if the component is unable to initialize.
shutDown()
public void shutDown()
throws JBIException
Shut down the component. This performs clean-up, releasing all run-time resources used by the component.
Once this method has been called, init(ComponentContext)126 must be called before the
component can be started again with a call to start()127 .
Throws:
javax.jbi.JBIException110 - if the component is unable to shut down
start()
public void start()
throws JBIException
Start the component. This makes the component ready to process messages. This method is called after
init(ComponentContext)126 , both when the component is being started for the first time and when
the component is being restarted after a previous call to shutDown()127 . If stop()127 was called
previously but shutDown()127 was not, start() can be called again without another call to
init(ComponentContext)126 .
Throws:
javax.jbi.JBIException110 - if the component is unable to start.
stop()
public void stop()
throws JBIException
Stop the component. This makes the component stop accepting messages for processing. After a call to this
method, start()127 may be called again without first calling init(ComponentContext)126 .
Throws:
javax.jbi.JBIException110 - if the component is unable to stop
August 17, 2005 Java Business Integration 1.0 Final Release 127
InstallationContext javax.jbi.component
getClassPathElements()
javax.jbi.component
InstallationContext
Declaration
public interface InstallationContext
Description
This context contains information necessary for a JBI component to perform its installation/uninstallation
processing. This is provided to the init() method of the component Bootstrap114 interface.
Member Summary
Methods
java.util.List getClassPathElements()128
java.lang.String getComponentClassName()128
java.lang.String getComponentName()129
ComponentContext getContext()129
getInstallationDescriptorExtension()129
org.w3c.dom.DocumentFr
agment
java.lang.String getInstallRoot()129
boolean isInstall()129
void setClassPathElements(java.util.List classPathElements)130
Methods
getClassPathElements()
public java.util.List getClassPathElements()
Get a list of elements that comprise the class path for this component. Each element represents either a
directory (containing class files) or a library file. All elements are reachable from the install root. These
elements represent class path items that the component’s execution-time component class loader uses, in
search order. All path elements must use the file separator character appropriate to the system (i.e.,
File.separator).
Returns: a list of String objects, each of which contains a class path elements. The list must contain at
least one class path element.
getComponentClassName()
public java.lang.String getComponentClassName()
Get the name of the class that implements the Component116 interface for this component. This must be
the component class name given in the component’s installation descriptor.
Returns: the Component116 implementation class name, which must be non-null and non-empty.
August 17, 2005 Java Business Integration 1.0 Final Release 128
javax.jbi.component InstallationContext
getComponentName()
getComponentName()
public java.lang.String getComponentName()
Get the unique name assigned to this component. This name must be assigned from the component’s
installation descriptor identification section.
Returns: the unique component name, which must be non-null and non-empty.
getContext()
public javax.jbi.component.ComponentContext119 getContext()
Get the JBI context for this component. The following methods are valid to use on the context:
• ComponentContext.getMBeanNames()124
• ComponentContext.getMBeanServer()124
• ComponentContext.getNamingContext()124
• ComponentContext.getTransactionManager()124
All other methods on the returned context must throw a IllegalStateException exception if
invoked.
Returns: the JBI context for this component, which must be non-null.
getInstallationDescriptorExtension()
public org.w3c.dom.DocumentFragment getInstallationDescriptorExtension()
Return a DOM document fragment representing the installation descriptor (jbi.xml) extension data for the
component, if any.
The Installation Descriptor Extension data are located at the end of the <component> element of the
installation descriptor.
Returns: a DOM document fragment containing the installation descriptor (jbi.xml) extension data, or
null if none is present in the descriptor.
getInstallRoot()
public java.lang.String getInstallRoot()
Get the installation root directory full path name for this component. This path name must be formatted for
the platform the JBI environment is running on.
Returns: the installation root directory name, which must be non-null and non-empty.
isInstall()
public boolean isInstall()
Returns true if this context was created in order to install a component into the JBI environment. Returns
false if this context was created to uninstall a previously installed component.
This method is provided to allow Bootstrap114 implementations to tailor their behaviour according to
use case. For example, the Bootstrap.init(InstallationContext)115 method
implementation may create different types of extension MBeans, depending on the use case specified by
this method.
August 17, 2005 Java Business Integration 1.0 Final Release 129
InstallationContext javax.jbi.component
setClassPathElements(List)
Returns: true if this context was created in order to install a component into the JBI environment;
otherwise the context was created to uninstall an existing component.
setClassPathElements(List)
public void setClassPathElements(java.util.List classPathElements)
Set the list of elements that comprise the class path for this component. Each element represents either a
directory (containing class files) or a library file. Elements are reached from the install root. These elements
represent class path items that the component’s execution-time component class loader uses, in search
order. All file paths are relative to the install root of the component.
This method allows the component’s bootstrap to alter the execution-time class path specified by the
component’s installation descriptor. The component configuration determined during installation can affect
the class path needed by the component at execution-time. All path elements must use the file separator
character appropriate to the system (i.e., File.separator.
Parameters:
classPathElements - a list of String objects, each of which contains a class path elements; the list
must be non-null and contain at least one class path element.
Throws:
java.lang.IllegalArgumentException - if the class path elements is null, empty, or if an
individual element is ill-formed.
August 17, 2005 Java Business Integration 1.0 Final Release 130
javax.jbi.component ServiceUnitManager
deploy(String, String)
javax.jbi.component
ServiceUnitManager
Declaration
public interface ServiceUnitManager
Description
This interface defines component-supplied methods for managing service unit deployments, and is
implemented by the component. The JBI implementation queries the component for the implementation of this
object using the Component.getServiceUnitManager()117 method.
Member Summary
Methods
java.lang.String deploy(java.lang.String serviceUnitName, java.lang.String
serviceUnitRootPath)131
void init(java.lang.String serviceUnitName, java.lang.String
serviceUnitRootPath)132
void shutDown(java.lang.String serviceUnitName)132
void start(java.lang.String serviceUnitName)132
void stop(java.lang.String serviceUnitName)133
java.lang.String undeploy(java.lang.String serviceUnitName, java.lang.String
serviceUnitRootPath)133
Methods
deploy(String, String)
public java.lang.String deploy(java.lang.String serviceUnitName,
java.lang.String serviceUnitRootPath)
throws DeploymentException
Deploy a Service Unit to the component. This is called by the JBI implementation in order to deploy the
given artifact to the implementing component.
Upon successful deployment, a non-empty result string must be returned, that starts with the JBI-defined
component-task-result element. For example:
<component-task-result>
<component-name>BC1</component-name>
<component-task-result-details
xmlns=“http://java.sun.com/xml/ns/jbi/management-message”>
<task-result-details>
<task-id>deploy</task-id>
<task-result>SUCCESS</task-result>
</task-result-details>
</component-task-result-details>
</component-task-result>
A failed deployment of the service unit must be reported using the component-task-result element
as well; the task-result must be set to FAILED.
August 17, 2005 Java Business Integration 1.0 Final Release 131
ServiceUnitManager javax.jbi.component
init(String, String)
Parameters:
serviceUnitName - name of the service unit being deployed; must be non-null and non-empty and
unique among service units already deployed to the component.
serviceUnitRootPath - path of the service unit artifact root, in platform-specific format; must be
non-null and non-empty.
Returns: deployment status message, which is an XML string that conforms to the component-task-
result type from the schema given in the MBean Status and Result Strings section of the
Management chapter of the JBI specification; must be non-null and non-empty.
Throws:
javax.jbi.management.DeploymentException141 - if the deployment operation is
unsuccessful.
init(String, String)
public void init(java.lang.String serviceUnitName, java.lang.String serviceUnitRootPath)
throws DeploymentException
Initialize the given deployed service unit. This is the first phase of a two-phase start, where the component
must prepare to receive service requests related to the deployment (if any).
The serviceUnitRootPath parameter is provided to facilitate restart of the component. This allows simple
components to rely entirely on JBI’s ability to persist deployment information, avoiding the need for the
component to provide its own persistence mechanism.
Parameters:
serviceUnitName - name of the service unit being initialized; must be non-null, non-empty, and
match the name of a previously deployed (but not yet undeployed) service unit.
serviceUnitRootPath - path of the service unit artifact root, in platform-specific format; must be
non-null and non-empty.
Throws:
javax.jbi.management.DeploymentException141 - if the service unit is not deployed, or
if it is in an incorrect state.
shutDown(String)
public void shutDown(java.lang.String serviceUnitName)
throws DeploymentException
Shut down the deployed service unit. This causes the component to return to the state it was in after
deploy(String, String)131 , and before init(String, String)132 .
Parameters:
serviceUnitName - name of the service unit being shut down; must be non-null, non-empty, and
match the name of a previously deployed (but not yet undeployed) service unit.
Throws:
javax.jbi.management.DeploymentException141 - if the service unit is not deployed, or
if it is in an incorrect state.
start(String)
public void start(java.lang.String serviceUnitName)
throws DeploymentException
August 17, 2005 Java Business Integration 1.0 Final Release 132
javax.jbi.component ServiceUnitManager
stop(String)
Start the deployed service unit. This is the second phase of a two-phase start, where the component can now
initiate service requests related to the deployment.
Parameters:
serviceUnitName - name of the service unit being started; must be non-null, non-empty, and
match the name of a previously deployed (but not yet undeployed) service unit.
Throws:
javax.jbi.management.DeploymentException141 - if the service unit is not deployed, or
if it is in an incorrect state.
stop(String)
public void stop(java.lang.String serviceUnitName)
throws DeploymentException
Stop the deployed service unit. This causes the component to cease generating service requests related to
the given service unit. This returns the service unit to a state equivalent to after init(String,
String)132 was called.
Parameters:
serviceUnitName - name of the service unit being stopped; must be non-null, non-empty, and
match the name of a previously deployed (but not yet undeployed) service unit.
Throws:
javax.jbi.management.DeploymentException141 - if the service unit is not deployed, or
if it is in an incorrect state.
undeploy(String, String)
public java.lang.String undeploy(java.lang.String serviceUnitName,
java.lang.String serviceUnitRootPath)
throws DeploymentException
Undeploy a Service Unit from the component. The service unit must be shutdown to undeploy it.
Parameters:
serviceUnitName - name of the service unit being undeployed; must be non-null, non-empty, and
match the name of a previously deployed (but not yet undeployed) service unit.
serviceUnitRootPath - path of the service unit artifact root, in platform-specific format; must be
non-null and non-empty.
Returns: deployment status message, which is an XML string that conforms to the component-task-
result type from the schema given in the MBean Status and Result Strings section of the
Management chapter of the JBI specification; must be non-null and non-empty
Throws:
javax.jbi.management.DeploymentException141 - if the undeployment operation is
unsuccessful.
August 17, 2005 Java Business Integration 1.0 Final Release 133
ServiceUnitManager javax.jbi.component
undeploy(String, String)
August 17, 2005 Java Business Integration 1.0 Final Release 134
CHAPTER 10
Package
javax.jbi.management
Class Summary
Interfaces
AdminServiceMBean136 This interface defines a set of administrative methods allowing a JMX-based
administrative tool to perform a variety of administrative tasks.
ComponentLifeCycleMBea ComponentLifeCycleMBean defines the standard life cycle controls for JBI Installable
n139 Components.
DeploymentServiceMBean The deployment service MBean allows administrative tools to manage service
143 assembly deployments.
InstallationServiceMBe The deployment service MBean allows administrative tools to manage service
an149 assembly deployments.
InstallerMBean151 The InstallerMBean defines standard installation and uninstallation controls for
components.
LifeCycleMBean153 LifeCycleMBean is a base interface that defines standard life cycle controls for JBI
implementation services (which are implementation-specific), and JBI components
(bindings and engines).
MBeanNames155 This interface provides methods to create JMX object names for component- supplied
MBeans.
Exceptions
DeploymentException141 DeploymentException is an exception thrown by the Deployment Service and the
Service Unit Manager.
August 17, 2005 Java Business Integration 1.0 Final Release 135
AdminServiceMBean javax.jbi.management
javax.jbi.management
AdminServiceMBean
Declaration
public interface AdminServiceMBean
Description
This interface defines a set of administrative methods allowing a JMX-based administrative tool to perform a
variety of administrative tasks.
• Find component lifecycle MBean names for:
• Individual components, by name
• All binding components
• All service engines
• Find lifecyle MBeans names for implementation-defined services:
• Individual implementation services, by name
• All implementation services
• Query whether an individual component is a binding or engine
• Query implementation information (version etc.)
Member Summary
Methods
getBindingComponents()137
javax.management.Objec
tName[]
getComponentByName(java.lang.String name)137
javax.management.Objec
tName
getEngineComponents()137
javax.management.Objec
tName[]
java.lang.String getSystemInfo()137
getSystemService(java.lang.String serviceName)137
javax.management.Objec
tName
getSystemServices()138
javax.management.Objec
tName[]
boolean isBinding(java.lang.String componentName)138
boolean isEngine(java.lang.String componentName)138
August 17, 2005 Java Business Integration 1.0 Final Release 136
javax.jbi.management AdminServiceMBean
getBindingComponents()
Methods
getBindingComponents()
public javax.management.ObjectName[] getBindingComponents()
Get a list of ComponentLifeCycleMBean139 s for all binding components currently installed in the
JBI system.
Returns: array of JMX object names of component life cycle MBeans for all installed binding
components; must be non-null; may be empty
getComponentByName(String)
public javax.management.ObjectName getComponentByName(java.lang.String name)
getEngineComponents()
public javax.management.ObjectName[] getEngineComponents()
Get a list of ComponentLifeCycleMBean139 s for all service engines currently installed in the JBI
system.
Returns: array of JMX object names of component life cycle MBeans for all installed service engines;
must be non-null; may be empty
getSystemInfo()
public java.lang.String getSystemInfo()
Return current version and other info about this JBI implementation. The contents of the returned string are
implementation dependent.
Returns: information string about the JBI implementation, including version information; must be non-
null and non-empty
getSystemService(String)
public javax.management.ObjectName getSystemService(java.lang.String serviceName)
August 17, 2005 Java Business Integration 1.0 Final Release 137
AdminServiceMBean javax.jbi.management
getSystemServices()
getSystemServices()
public javax.management.ObjectName[] getSystemServices()
Looks up all JBI system services LifeCycleMBean153 ’s currently installed. System services are
implementation-defined services which can administered through JMX. System services are not related to
service engines.
Returns: array of LifecycleMBean JMX object names of system services currently installed in the JBI
implementation; must be non-null; may be empty
isBinding(String)
public boolean isBinding(java.lang.String componentName)
isEngine(String)
public boolean isEngine(java.lang.String componentName)
August 17, 2005 Java Business Integration 1.0 Final Release 138
javax.jbi.management ComponentLifeCycleMBean
getExtensionMBeanName()
javax.jbi.management
ComponentLifeCycleMBean
Declaration
public interface ComponentLifeCycleMBean extends LifeCycleMBean153
Description
ComponentLifeCycleMBean defines the standard life cycle controls for JBI Installable Components.
• Initialize the component, preparing it to receive service requests.
• Start the component, allowing it to initiate service requests.
• Stop the component from initiating any more service requests.
• Shut down the component, returning it to the uninitialized state where it cannot receive service requests.
• Query the JMX object name of the extension MBean for the component.
Member Summary
Methods
getExtensionMBeanName()139
javax.management.Objec
tName
Methods
getExtensionMBeanName()
public javax.management.ObjectName getExtensionMBeanName()
throws JBIException
August 17, 2005 Java Business Integration 1.0 Final Release 139
ComponentLifeCycleMBean javax.jbi.management
getExtensionMBeanName()
Get the JMX ObjectName for the life cycle extension MBean for this component. If there is none, return
null. Note that this MBean may serve as a container for multiple MBeans, as required by the component
implementation.
Returns: ObjectName the JMX object name of the additional MBean or null if there is no additional
MBean.
Throws:
javax.jbi.JBIException110 - if there is a failure getting component information for the
component to which this life cycle applies.
August 17, 2005 Java Business Integration 1.0 Final Release 140
javax.jbi.management DeploymentException
getExtensionMBeanName()
javax.jbi.management
DeploymentException
Declaration
public class DeploymentException extends javax.jbi.JBIException110
java.lang.Object
|
+--java.lang.Throwable
|
+--java.lang.Exception
|
+--javax.jbi.JBIException110
|
+--javax.jbi.management.DeploymentException
Description
DeploymentException is an exception thrown by the Deployment Service and the Service Unit Manager.
Member Summary
Constructors
DeploymentException(java.lang.String message)142
DeploymentException(java.lang.String message,
java.lang.Throwable cause)142
DeploymentException(java.lang.Throwable cause)142
August 17, 2005 Java Business Integration 1.0 Final Release 141
DeploymentException javax.jbi.management
DeploymentException(String)
Constructors
DeploymentException(String)
public DeploymentException(java.lang.String message)
DeploymentException(String, Throwable)
public DeploymentException(java.lang.String message, java.lang.Throwable cause)
Creates a new instance of DeploymentException with the specified detail message and cause.
Parameters:
message - the detail message for this exception
cause - Error or Exception which represents the cause of the problem (null if none, or if the
cause is not known)
DeploymentException(Throwable)
public DeploymentException(java.lang.Throwable cause)
August 17, 2005 Java Business Integration 1.0 Final Release 142
javax.jbi.management DeploymentServiceMBean
DeploymentException(Throwable)
javax.jbi.management
DeploymentServiceMBean
Declaration
public interface DeploymentServiceMBean
Description
The deployment service MBean allows administrative tools to manage service assembly deployments. The
tasks supported are:
• Deploying a service assembly.
• Undeploying a previously deployed service assembly.
• Querying deployed service assemblies:
• For all components in the system.
• For a particular component.
• Control the state of deployed service assemblies:
• Start the service units that contained in the SA.
• Stop the service units that contained in the SA.
• Shut down the service units that contained in the SA.
• Query the service units deployed to a particular component.
• Check if a service unit is deployed to a particular component.
• Query the deployment descriptor for a particular service assembly.
Member Summary
Fields
static SHUTDOWN144
java.lang.String
static STARTED144
java.lang.String
static STOPPED144
java.lang.String
Methods
boolean canDeployToComponent(java.lang.String componentName)144
java.lang.String deploy(java.lang.String serviceAssemblyZipUrl)144
java.lang.String[] getComponentsForDeployedServiceAssembly(java.lang.String
serviceAssemblyName)145
java.lang.String[] getDeployedServiceAssemblies()145
java.lang.String[] getDeployedServiceAssembliesForComponent(java.lang.String
componentName)145
java.lang.String[] getDeployedServiceUnitList(java.lang.String componentName)146
java.lang.String getServiceAssemblyDescriptor(java.lang.String
serviceAssemblyName)146
August 17, 2005 Java Business Integration 1.0 Final Release 143
DeploymentServiceMBean javax.jbi.management
SHUTDOWN
Member Summary
java.lang.String getState(java.lang.String serviceAssemblyName)146
boolean isDeployedServiceUnit(java.lang.String componentName,
java.lang.String serviceUnitName)146
java.lang.String shutDown(java.lang.String serviceAssemblyName)147
java.lang.String start(java.lang.String serviceAssemblyName)147
java.lang.String stop(java.lang.String serviceAssemblyName)147
java.lang.String undeploy(java.lang.String serviceAssemblyName)148
Fields
SHUTDOWN
public static final java.lang.String SHUTDOWN
STARTED
public static final java.lang.String STARTED
The service assembly is started. This means that the assembly’s offered services can accept message
exchanges, and it can send exchanges to consume services.
STOPPED
public static final java.lang.String STOPPED
The service assembly is stopped. This means that the assembly’s offered services can accept message
exchanges, but it will not send any.
Methods
canDeployToComponent(String)
public boolean canDeployToComponent(java.lang.String componentName)
Returns true if the the given component accepts the deployment of service units. This is used by admin
tools to determine which components can be named in service assembly deployment descriptors.
Parameters:
componentName - name of the component; must be non-null and non-empty
Returns: true if the named component accepts deployments; false if the named component does not
accept deployments or it does not exist
deploy(String)
public java.lang.String deploy(java.lang.String serviceAssemblyZipUrl)
throws Exception
August 17, 2005 Java Business Integration 1.0 Final Release 144
javax.jbi.management DeploymentServiceMBean
getComponentsForDeployedServiceAssembly(String)
Note that the implementation must not automatically start the service assembly after deployment; it must
wait for the start(String)147 method to be invoked by the administrative tool.
Parameters:
serviceAssemblyZipUrl - String containing the location URL of the Service Assembly ZIP file;
must be non-null, non-empty, and a legal URL
Returns: Result/Status of the current deployment; must conform to JBI management result/status XML
schema; must be non-null and non-empty
Throws:
java.lang.Exception - if complete deployment fails
getComponentsForDeployedServiceAssembly(String)
public java.lang.String[] getComponentsForDeployedServiceAssembly(java.lang.String
serviceAssemblyName)
throws Exception
Returns an array of component names, where for each the given assembly contains a service unit for the
component.
Parameters:
serviceAssemblyName - the service assembly to be queried; must be non-null and non-empty
Returns: array of component names, where for each name the given assembly contains a service unit from
the given service assembly; must be non-null; may be empty
Throws:
java.lang.Exception - if a processing error occurs
getDeployedServiceAssemblies()
public java.lang.String[] getDeployedServiceAssemblies()
throws Exception
getDeployedServiceAssembliesForComponent(String)
public java.lang.String[] getDeployedServiceAssembliesForComponent(java.lang.String
componentName)
throws Exception
Returns an array of Service Assembly names, where each assembly contains Service Units for the given
component.
Parameters:
componentName - name of the component to query; must be non-null and non-empty
Returns: array of of Service Assembly names, where each assembly contains a Service Unit for the named
component; must be non-null; may be empty
Throws:
java.lang.Exception - if a processing error occurs
August 17, 2005 Java Business Integration 1.0 Final Release 145
DeploymentServiceMBean javax.jbi.management
getDeployedServiceUnitList(String)
getDeployedServiceUnitList(String)
public java.lang.String[] getDeployedServiceUnitList(java.lang.String componentName)
throws Exception
Returns an array of service unit names that are currently deployed to the named component.
Parameters:
componentName - the name of the component to query; must be non-null and non-empty
Returns: array of service unit names deployed in the named component; must be non-null; may be empty
Throws:
java.lang.Exception - if a processing error occurs
getServiceAssemblyDescriptor(String)
public java.lang.String getServiceAssemblyDescriptor(java.lang.String
serviceAssemblyName)
throws Exception
Returns the deployment descriptor of the Service Assembly that was deployed to the JBI enviroment,
serialized to a String.
Parameters:
serviceAssemblyName - name of the service assembly to be queried; must be non-null and non-
empty
Returns: descriptor of the Assembly Unit; must be non-null
Throws:
java.lang.Exception - if a processing error occurs
getState(String)
public java.lang.String getState(java.lang.String serviceAssemblyName)
throws Exception
Get the running state of a service assembly. The possible result values of this query are enumerated by the
following set of constants: SHUTDOWN144 , STOPPED144 , STARTED144 .
Parameters:
serviceAssemblyName - name of the assembly to query; must be non-null and non-empty
Returns: the state of the service assembly, as a string value; must be one of the enumerated string values
provided by this interface: SHUTDOWN144 , STOPPED144 , or STARTED144
Throws:
java.lang.Exception - if there is no such assembly
isDeployedServiceUnit(String, String)
public boolean isDeployedServiceUnit(java.lang.String componentName,
java.lang.String serviceUnitName)
throws Exception
Queries if the named Service Unit is currently deployed to the named component.
Parameters:
componentName - name of the component to query; must be non-null and non-empty
serviceUnitName - name of the subject service unit; must be non-null and non-empty
August 17, 2005 Java Business Integration 1.0 Final Release 146
javax.jbi.management DeploymentServiceMBean
shutDown(String)
Returns: true if the named service unit is currently deployed to the named component
Throws:
java.lang.Exception
shutDown(String)
public java.lang.String shutDown(java.lang.String serviceAssemblyName)
throws Exception
Shut down the service assembly. This puts the assembly back into the SHUTDOWN144 state.
Parameters:
serviceAssemblyName - name of the assembly to be shut down; must be non-null and non-empty
Returns: result / status string giving the results of shutting down each service unit in the assembly; must
be non-null and non-empty
Throws:
java.lang.Exception - if there is no such assembly
java.lang.Exception - if the assembly fails to shut down
start(String)
public java.lang.String start(java.lang.String serviceAssemblyName)
throws Exception
Start the service assembly. This puts the assembly into the STARTED144 state.
Parameters:
serviceAssemblyName - name of the assembly to be started; must be non-null and non-empty
Returns: result / status string giving the results of starting (and possibly initializing) each service unit in
the assembly; must be non-null and non-empty
Throws:
java.lang.Exception - if there is no such assembly
java.lang.Exception - if the assembly fails to start
stop(String)
public java.lang.String stop(java.lang.String serviceAssemblyName)
throws Exception
Stop the service assembly. This puts the assembly into the STOPPED144 state.
Parameters:
serviceAssemblyName - name of the assembly to be stopped; must be non-null and non-empty
Returns: result / status string giving the results of stopping each service unit in the assembly; must be non-
null and non-empty
Throws:
java.lang.Exception - if there is no such assembly
java.lang.Exception - if the assembly fails to stop
August 17, 2005 Java Business Integration 1.0 Final Release 147
DeploymentServiceMBean javax.jbi.management
undeploy(String)
undeploy(String)
public java.lang.String undeploy(java.lang.String serviceAssemblyName)
throws Exception
August 17, 2005 Java Business Integration 1.0 Final Release 148
javax.jbi.management InstallationServiceMBean
installSharedLibrary(String)
javax.jbi.management
InstallationServiceMBean
Declaration
public interface InstallationServiceMBean
Description
The deployment service MBean allows administrative tools to manage service assembly deployments. The
tasks supported are:
• Installing (and uninstalling) a shared library
• Creating (loading) and destroying (unloading) a component installer MBean.
• Finding an existing component installer MBean.
Installing and uninstalling components is accomplished using InstallerMBean151 s, loaded by this
MBean. An individual installer MBean is needed for each component installation / uninstalltin. This is to
support the more complex installation process that some components require.
Member Summary
Methods
java.lang.String installSharedLibrary(java.lang.String slZipURL)149
loadInstaller(java.lang.String componentName)150
javax.management.Objec
tName
loadNewInstaller(java.lang.String installZipURL)150
javax.management.Objec
tName
boolean uninstallSharedLibrary(java.lang.String slName)150
boolean unloadInstaller(java.lang.String componentName, boolean
isToBeDeleted)150
Methods
installSharedLibrary(String)
public java.lang.String installSharedLibrary(java.lang.String slZipURL)
August 17, 2005 Java Business Integration 1.0 Final Release 149
InstallationServiceMBean javax.jbi.management
loadInstaller(String)
loadInstaller(String)
public javax.management.ObjectName loadInstaller(java.lang.String componentName)
loadNewInstaller(String)
public javax.management.ObjectName loadNewInstaller(java.lang.String installZipURL)
Load the installer for a new component for the given component installation package.
Parameters:
installZipURL - URL locating a ZIP file containing the JBI Installation package to be installed;
must be non-null, non-empty, and a legal URL
Returns: the JMX ObjectName of the InstallerMBean loaded from installZipURL; must be non-null
uninstallSharedLibrary(String)
public boolean uninstallSharedLibrary(java.lang.String slName)
unloadInstaller(String, boolean)
public boolean unloadInstaller(java.lang.String componentName, boolean isToBeDeleted)
August 17, 2005 Java Business Integration 1.0 Final Release 150
javax.jbi.management InstallerMBean
getInstallerConfigurationMBean()
javax.jbi.management
InstallerMBean
Declaration
public interface InstallerMBean
Description
The InstallerMBean defines standard installation and uninstallation controls for components. InstallerMBeans
are created by the InstallationServiceMBean149 . The InstallerMBean offers controls to allow an
administrative tool to:
• Install the component from the installation package.
• Uninstall the component.
• Check the installation status of the component.
• Get the file path to the component’s installation root directory.
Member Summary
Methods
getInstallerConfigurationMBean()151
javax.management.Objec
tName
java.lang.String getInstallRoot()151
install()152
javax.management.Objec
tName
boolean isInstalled()152
void uninstall()152
Methods
getInstallerConfigurationMBean()
public javax.management.ObjectName getInstallerConfigurationMBean()
throws JBIException
getInstallRoot()
public java.lang.String getInstallRoot()
August 17, 2005 Java Business Integration 1.0 Final Release 151
InstallerMBean javax.jbi.management
install()
install()
public javax.management.ObjectName install()
throws JBIException
Install a component.
Note that the implementation must leave the component in its installed, shutdown state. Automatic starting
of components during installation by implementations is not allowed.
Returns: JMX ObjectName representing the LifeCycleMBean for the installed component, or null if the
installation did not complete
Throws:
javax.jbi.JBIException110 - if the installation fails
isInstalled()
public boolean isInstalled()
uninstall()
public void uninstall()
throws JBIException
Uninstall the component. This completely removes the component from the JBI system.
Throws:
javax.jbi.JBIException110 - if the uninstallation fails
August 17, 2005 Java Business Integration 1.0 Final Release 152
javax.jbi.management LifeCycleMBean
SHUTDOWN
javax.jbi.management
LifeCycleMBean
Declaration
public interface LifeCycleMBean
Description
LifeCycleMBean is a base interface that defines standard life cycle controls for JBI implementation services
(which are implementation-specific), and JBI components (bindings and engines).
Member Summary
Fields
static SHUTDOWN153
java.lang.String
static STARTED153
java.lang.String
static STOPPED153
java.lang.String
static UNKNOWN154
java.lang.String
Methods
java.lang.String getCurrentState()154
void shutDown()154
void start()154
void stop()154
Fields
SHUTDOWN
public static final java.lang.String SHUTDOWN
STARTED
public static final java.lang.String STARTED
STOPPED
public static final java.lang.String STOPPED
August 17, 2005 Java Business Integration 1.0 Final Release 153
LifeCycleMBean javax.jbi.management
UNKNOWN
UNKNOWN
public static final java.lang.String UNKNOWN
Methods
getCurrentState()
public java.lang.String getCurrentState()
shutDown()
public void shutDown()
throws JBIException
Shut down the item. This releases resources, returning the item to an uninitialized state.
Throws:
javax.jbi.JBIException110 - if the item fails to shut down
start()
public void start()
throws JBIException
stop()
public void stop()
throws JBIException
August 17, 2005 Java Business Integration 1.0 Final Release 154
javax.jbi.management MBeanNames
BOOTSTRAP_EXTENSION
javax.jbi.management
MBeanNames
Declaration
public interface MBeanNames
Description
This interface provides methods to create JMX object names for component- supplied MBeans. This ensures
that component-supplied MBeans follow the JBI implementation-determined naming convention.
Components obtain instances of this name creator using
javax.jbi.component.ComponentContext.getMBeanNames()124 .
Member Summary
Fields
static BOOTSTRAP_EXTENSION155
java.lang.String
static COMPONENT_LIFE_CYCLE_EXTENSION155
java.lang.String
Methods
createCustomComponentMBeanName(java.lang.String customName)155
javax.management.Objec
tName
java.lang.String getJmxDomainName()156
Fields
BOOTSTRAP_EXTENSION
public static final java.lang.String BOOTSTRAP_EXTENSION
COMPONENT_LIFE_CYCLE_EXTENSION
public static final java.lang.String COMPONENT_LIFE_CYCLE_EXTENSION
The custom name that must be used for component life cycle extensions
Methods
createCustomComponentMBeanName(String)
public javax.management.ObjectName createCustomComponentMBeanName(java.lang.String
customName)
Formulate and return an MBean ObjectName for a custom control of this name creator’s JBI component.
August 17, 2005 Java Business Integration 1.0 Final Release 155
MBeanNames javax.jbi.management
getJmxDomainName()
This is used by components to create JMX names for their own JMX controls, allowing the JBI
implementation to prefix the created name to fit within the implementation’s own naming scheme.
Standard extensions must use the following custom name constants:
• Bootstrap (installer) extension: BOOTSTRAP_EXTENSION155 .
• Component life cycle extension: COMPONENT_LIFE_CYCLE_EXTENSION155 .
All other custom component MBeans must use custom names that do not collide with the standard
extension names.
Parameters:
customName - the name of the custom control; must be non-null and non-empty; must be legal for
use in a JMX object name
Returns: the JMX ObjectName of the MBean, or null if the customName is invalid
getJmxDomainName()
public java.lang.String getJmxDomainName()
Retrieve the default JMX Domain Name for MBeans registered in this instance of the JBI implementation.
Returns: the JMX domain name for this instance of the JBI implemention; must be non-null and non-
empty
August 17, 2005 Java Business Integration 1.0 Final Release 156
CHAPTER 11
Package
javax.jbi.messaging
Class Summary
Interfaces
DeliveryChannel158 Bi-directional communication channel used by engines and bindings (hereafter called
JBI components) to interact with the Normalized Message Router.
Fault164 Marker interface for WSDL fault messages.
InOnly165 Supports operations used to process an In Only MEP to completion.
InOptionalOut167 Supports operations used to process an In Optional Out MEP to completion.
InOut169 Supports operations used to process an In Out MEP to completion.
MessageExchange171 MessageExchange represents a container for normalized messages which is described
by an exchange pattern.
MessageExchangeFactory A message exchange factory is used used to create new instances of
180 MessageExchange171 .
NormalizedMessage185 Represents a JBI Normalized Message.
RobustInOnly188 Supports operations used to process an Robust In Only MEP to completion.
Classes
ExchangeStatus162 Typesafe enumeration containing status values for a message exchange.
MessageExchange.Role179 Typesafe enumeration containing the roles a component can play in an exchange.
Exceptions
MessagingException183 Generic exception used to report messaging related errors in the Normalized Message
Router.
August 17, 2005 Java Business Integration 1.0 Final Release 157
DeliveryChannel javax.jbi.messaging
accept()
javax.jbi.messaging
DeliveryChannel
Declaration
public interface DeliveryChannel
Description
Bi-directional communication channel used by engines and bindings (hereafter called JBI components) to
interact with the Normalized Message Router. Each JBI component has one DeliveryChannel associated
with it. Using the delivery channel, a component may:
• Receive message exchanges routed to the component (optionally, with a time-out).
• Send a message asynchronously (that is, without waiting for a response or status change acknowledging
that the exchange was received).
• Send a message synchronously, blocking the thread of execution until the result is received. Optionally, this
can be done with a time-out.
Member Summary
Methods
MessageExchange accept()158
MessageExchange accept(long timeoutMS)159
void close()159
createExchangeFactory()159
MessageExchangeFactory
createExchangeFactory(javax.xml.namespace.QName
MessageExchangeFactory interfaceName)159
createExchangeFactory(javax.jbi.servicedesc.ServiceEndpoint
MessageExchangeFactory endpoint)160
createExchangeFactoryForService(javax.xml.namespace.QName
MessageExchangeFactory serviceName)160
void send(MessageExchange exchange)160
boolean sendSync(MessageExchange exchange)160
boolean sendSync(MessageExchange exchange, long timeoutMS)161
Methods
accept()
public javax.jbi.messaging.MessageExchange171 accept()
throws MessagingException
Blocking call used to service a MessageExchange instance which has been initiated by another component.
This method supports concurrent invocation for multi-threaded environments. This must be interruptable
(Thread.interrupt()).
Returns: message exchange instance; must be non-null
August 17, 2005 Java Business Integration 1.0 Final Release 158
javax.jbi.messaging DeliveryChannel
accept(long)
Throws:
MessagingException183 - failed to accept
MessagingException183 - when the blocked thread is interrupted
accept(long)
public javax.jbi.messaging.MessageExchange171 accept(long timeoutMS)
throws MessagingException, IllegalArgumentException
Blocking call used to service a MessageExchange instance which has been initiated by another component,
within the given timeout period. This method supports concurrent invocation for multi-threaded
environments.
Parameters:
timeoutMS - timeout period, in milliseconds (0 means no timeout); must be greater than or equal to
zero
Returns: message exchange instance, or null if timed out
Throws:
java.lang.IllegalArgumentException - if timeoutMS < 0
MessagingException183 - failed to accept
MessagingException183 - when the blocked thread is interrupted
close()
public void close()
throws MessagingException
createExchangeFactory()
public javax.jbi.messaging.MessageExchangeFactory180 createExchangeFactory()
Create a message exchange factory. This factory will create exchange instances with all appropriate
properties set to null.
Returns: a message exchange factory; must be non-null
createExchangeFactory(QName)
public javax.jbi.messaging.MessageExchangeFactory180
createExchangeFactory(javax.xml.namespace.QName interfaceName)
August 17, 2005 Java Business Integration 1.0 Final Release 159
DeliveryChannel javax.jbi.messaging
createExchangeFactory(ServiceEndpoint)
createExchangeFactory(ServiceEndpoint)
public javax.jbi.messaging.MessageExchangeFactory180
createExchangeFactory(javax.jbi.servicedesc.ServiceEndpoint192 endpoint)
createExchangeFactoryForService(QName)
public javax.jbi.messaging.MessageExchangeFactory180
createExchangeFactoryForService(javax.xml.namespace.QName serviceName)
send(MessageExchange)
public void send(javax.jbi.messaging.MessageExchange171 exchange)
throws MessagingException
Routes a MessageExchange instance through the Normalized Message Router to the appropriate servicing
component. This method supports concurrent invocation for multi-threaded environments.
This is used not only to send the initial message in an exchange, but also for the servicer to “return” the
exchange with the appropriate response (response, fault, or ExchangeStatus). In more complex
message exchange patterns, a single MessageExchange can be sent back-and-forth via send() several
times, but always terminating with the MessageExchange instance being sent with a terminal
ExchangeStatus.
Parameters:
exchange - message exchange to send; must be non-null
Throws:
MessagingException183 - unable to send exchange
sendSync(MessageExchange)
public boolean sendSync(javax.jbi.messaging.MessageExchange171 exchange)
throws MessagingException
Routes a MessageExchange instance through the Normalized Message Router to the appropriate servicing
component, and blocks until the exchange is returned (that is, the other participant sends the message
exchange back). This method supports concurrent invocation for multi-threaded environments.
If the thread making this call is interrupted, the message exchange is treated in the same fashion as a timed-
out sendSync call; see sendSync(MessageExchange, long)161 .
Note that the “returned” message exchange (the instance returned by the other participant in the exchange)
is the same instance referred to by the parameter exchange.
August 17, 2005 Java Business Integration 1.0 Final Release 160
javax.jbi.messaging DeliveryChannel
sendSync(MessageExchange, long)
Parameters:
exchange - message exchange to send; must be non-null
Returns: true if the exchange has been returned (always)
Throws:
MessagingException183 - unable to send exchange, or no response is expected from the send()
operation (i.e., the MessageExchange is being used to convey an ExchangeStatus)
MessagingException183 - when the blocked thread is interrupted
sendSync(MessageExchange, long)
public boolean sendSync(javax.jbi.messaging.MessageExchange171 exchange, long timeoutMS)
throws MessagingException
Routes a MessageExchange instance through the Normalized Message Router to the appropriate servicing
component, and blocks until the exchange is returned (that is, the other participant sends the message
exchange back), or the specified timeout interval elapses. This method supports concurrent invocation for
multi-threaded environments.
If the thread making this call is interrupted while this method is blocked, the message exchange is treated as
if the time out occurred.
If this method returns false (indicating that timeout occurred), the message exchange must be marked by the
implementation as being in the ExchangeStatus.ERROR163 state. Attempts by the service provider to
send a MessageExchange in such an ERROR state must result in the send (or sendSync) method called
ending abruptly with an appropriate MessagingException.
Note that the “returned” message exchange (the instance returned by the other participant in the exchange)
is the same instance referred to by the parameter exchange.
Parameters:
exchange - message exchange to send; must be non-null
timeoutMS - timeout period, in milliseconds (0 means no timeout); must be greater than or equal to
zero
Returns: true if the exchange has been returned, or false if the method timed out while waiting
Throws:
java.lang.IllegalArgumentException - if timeoutMS < 0
MessagingException183 - unable to send exchange, or no response is expected from the send()
operation (i.e., the MessageExchange is being used to convey an ExchangeStatus)
MessagingException183 - when the blocked thread is interrupted
August 17, 2005 Java Business Integration 1.0 Final Release 161
ExchangeStatus javax.jbi.messaging
ACTIVE
javax.jbi.messaging
ExchangeStatus
Declaration
public final class ExchangeStatus
java.lang.Object
|
+--javax.jbi.messaging.ExchangeStatus
Description
Typesafe enumeration containing status values for a message exchange.
Member Summary
Fields
static ExchangeStatus ACTIVE162
static ExchangeStatus DONE162
static ExchangeStatus ERROR163
Methods
boolean equals(java.lang.Object obj)163
int hashCode()163
java.lang.String toString()163
static ExchangeStatus valueOf(java.lang.String status)163
Fields
ACTIVE
public static final javax.jbi.messaging.ExchangeStatus162 ACTIVE
DONE
public static final javax.jbi.messaging.ExchangeStatus162 DONE
August 17, 2005 Java Business Integration 1.0 Final Release 162
javax.jbi.messaging ExchangeStatus
ERROR
ERROR
public static final javax.jbi.messaging.ExchangeStatus162 ERROR
Methods
equals(Object)
public boolean equals(java.lang.Object obj)
Returns true if this ExchangeStatus has the same type and value as the given object.
Overrides: equals in class Object
Parameters:
obj - value to be compared for equality
Returns: true if this object is equal to the given object in type and value
hashCode()
public int hashCode()
toString()
public java.lang.String toString()
valueOf(String)
public static javax.jbi.messaging.ExchangeStatus162 valueOf(java.lang.String status)
August 17, 2005 Java Business Integration 1.0 Final Release 163
Fault javax.jbi.messaging
valueOf(String)
javax.jbi.messaging
Fault
Declaration
public interface Fault extends NormalizedMessage185
Description
Marker interface for WSDL fault messages.
August 17, 2005 Java Business Integration 1.0 Final Release 164
javax.jbi.messaging InOnly
getInMessage()
javax.jbi.messaging
InOnly
Declaration
public interface InOnly extends MessageExchange171
Description
Supports operations used to process an In Only MEP to completion.
Member Summary
Methods
NormalizedMessage getInMessage()165
void setInMessage(NormalizedMessage msg)166
Methods
getInMessage()
public javax.jbi.messaging.NormalizedMessage185 getInMessage()
August 17, 2005 Java Business Integration 1.0 Final Release 165
InOnly javax.jbi.messaging
setInMessage(NormalizedMessage)
setInMessage(NormalizedMessage)
public void setInMessage(javax.jbi.messaging.NormalizedMessage185 msg)
throws MessagingException
August 17, 2005 Java Business Integration 1.0 Final Release 166
javax.jbi.messaging InOptionalOut
getInMessage()
javax.jbi.messaging
InOptionalOut
Declaration
public interface InOptionalOut extends MessageExchange171
Description
Supports operations used to process an In Optional Out MEP to completion.
Member Summary
Methods
NormalizedMessage getInMessage()167
NormalizedMessage getOutMessage()168
void setInMessage(NormalizedMessage msg)168
void setOutMessage(NormalizedMessage msg)168
Methods
getInMessage()
public javax.jbi.messaging.NormalizedMessage185 getInMessage()
August 17, 2005 Java Business Integration 1.0 Final Release 167
InOptionalOut javax.jbi.messaging
getOutMessage()
Throws:
java.lang.IllegalStateException - if the component is not the owner of this message
exchange
getOutMessage()
public javax.jbi.messaging.NormalizedMessage185 getOutMessage()
setInMessage(NormalizedMessage)
public void setInMessage(javax.jbi.messaging.NormalizedMessage185 msg)
throws MessagingException
setOutMessage(NormalizedMessage)
public void setOutMessage(javax.jbi.messaging.NormalizedMessage185 msg)
throws MessagingException
August 17, 2005 Java Business Integration 1.0 Final Release 168
javax.jbi.messaging InOut
getInMessage()
javax.jbi.messaging
InOut
Declaration
public interface InOut extends MessageExchange171
Description
Supports operations used to process an In Out MEP to completion.
Member Summary
Methods
NormalizedMessage getInMessage()169
NormalizedMessage getOutMessage()170
void setInMessage(NormalizedMessage msg)170
void setOutMessage(NormalizedMessage msg)170
Methods
getInMessage()
public javax.jbi.messaging.NormalizedMessage185 getInMessage()
August 17, 2005 Java Business Integration 1.0 Final Release 169
InOut javax.jbi.messaging
getOutMessage()
Throws:
java.lang.IllegalStateException - if the component is not the owner of this message
exchange
getOutMessage()
public javax.jbi.messaging.NormalizedMessage185 getOutMessage()
setInMessage(NormalizedMessage)
public void setInMessage(javax.jbi.messaging.NormalizedMessage185 msg)
throws MessagingException
setOutMessage(NormalizedMessage)
public void setOutMessage(javax.jbi.messaging.NormalizedMessage185 msg)
throws MessagingException
August 17, 2005 Java Business Integration 1.0 Final Release 170
javax.jbi.messaging MessageExchange
setOutMessage(NormalizedMessage)
javax.jbi.messaging
MessageExchange
Declaration
public interface MessageExchange
Description
MessageExchange represents a container for normalized messages which is described by an exchange pattern.
The exchange pattern defines the names, sequence, and cardinality of messages in an exchange.
When a consumer initiates a message exchange (that is, it creates a new exchange instance and initializes it), it
has a choice of how to address the exchange, to indicate the service desired. In increasing order of specificity,
the initiating consumer may address the new exchange by:
• Service Type. The consumer supplies only the interface name, indicating the type of service desired. The
NMR chooses a suitable provider when the message is sent.
• Service Name. The consumer supplies only the service name, indicating the service provider desired, but
not the particular endpoint exposed by that provider to use. The NMR chooses a suitable endpoint when the
message is sent.
• Service Endpoint. The consumer specifies the exact service endpoint name it wishes to use. The consumer
can determine this dynamically (by querying available active endpoints), or the service endpoint can be
determined at design or deployment time. When the message exchange is sent, the NMR will attempt to
route the instance to the given endpoint only. (Note that connection metadata can alter this behaviour, by
introducing aliases for endpoints.)
The NMR will always use the most specific address type given, ignoring other, less specific ones, if any.
Note that whenever the NMR chooses the provider endpoint, it must set the endpoint property of the message
exchange instance to the endpoint it selected.
Note also that setting the different address properties of an exchange instance does not cause side effects. For
example, setting the service endpoint will not affect the previously set interface name or service name.
Member Summary
Nested Classes
static class MessageExchange.Role179
Fields
static JTA_TRANSACTION_PROPERTY_NAME172
java.lang.String
Methods
Fault createFault()172
NormalizedMessage createMessage()173
getEndpoint()173
javax.jbi.servicedesc.
ServiceEndpoint
java.lang.Exception getError()173
August 17, 2005 Java Business Integration 1.0 Final Release 171
MessageExchange javax.jbi.messaging
JTA_TRANSACTION_PROPERTY_NAME
Member Summary
java.lang.String getExchangeId()173
Fault getFault()173
getInterfaceName()174
javax.xml.namespace.QN
ame
NormalizedMessage getMessage(java.lang.String name)174
getOperation()174
javax.xml.namespace.QN
ame
java.net.URI getPattern()174
java.lang.Object getProperty(java.lang.String name)174
java.util.Set getPropertyNames()175
MessageExchange.Role getRole()175
getService()175
javax.xml.namespace.QN
ame
ExchangeStatus getStatus()175
boolean isTransacted()175
void setEndpoint(javax.jbi.servicedesc.ServiceEndpoint endpoint)176
void setError(java.lang.Exception error)176
void setFault(Fault fault)176
void setInterfaceName(javax.xml.namespace.QName interfaceName)176
void setMessage(NormalizedMessage msg, java.lang.String name)177
void setOperation(javax.xml.namespace.QName name)177
void setProperty(java.lang.String name, java.lang.Object obj)177
void setService(javax.xml.namespace.QName service)177
void setStatus(ExchangeStatus status)178
Fields
JTA_TRANSACTION_PROPERTY_NAME
public static final java.lang.String JTA_TRANSACTION_PROPERTY_NAME
Methods
createFault()
public javax.jbi.messaging.Fault164 createFault()
throws MessagingException
August 17, 2005 Java Business Integration 1.0 Final Release 172
javax.jbi.messaging MessageExchange
createMessage()
createMessage()
public javax.jbi.messaging.NormalizedMessage185 createMessage()
throws MessagingException
Creates a normalized message based on the specified message reference. The pattern governing this
exchange must contain a definition for the reference name supplied.
Returns: a new normalized message; must be non-null
Throws:
java.lang.IllegalStateException - if the component is not the owner of this message
exchange
MessagingException183 - if the exchange is in a terminal state (getStatus()175 !=
ExchangeStatus.ACTIVE162 )
getEndpoint()
public javax.jbi.servicedesc.ServiceEndpoint192 getEndpoint()
getError()
public java.lang.Exception getError()
getExchangeId()
public java.lang.String getExchangeId()
Returns the unique identifier assigned by the NMR for this exchange.
Returns: unique id for this exchange; null if not set
getFault()
public javax.jbi.messaging.Fault164 getFault()
Retrieves the fault message for this exchange, if one exists. A fault/message reference is unnecessary, since
an exchange can carry at most one fault, and it is always the final message in an exchange.
Returns: fault associated with the exchange, or null if not present
August 17, 2005 Java Business Integration 1.0 Final Release 173
MessageExchange javax.jbi.messaging
getInterfaceName()
Throws:
java.lang.IllegalStateException - if the component is not the owner of this message
exchange
getInterfaceName()
public javax.xml.namespace.QName getInterfaceName()
getMessage(String)
public javax.jbi.messaging.NormalizedMessage185 getMessage(java.lang.String name)
getOperation()
public javax.xml.namespace.QName getOperation()
getPattern()
public java.net.URI getPattern()
getProperty(String)
public java.lang.Object getProperty(java.lang.String name)
August 17, 2005 Java Business Integration 1.0 Final Release 174
javax.jbi.messaging MessageExchange
getPropertyNames()
Parameters:
name - property name; must be non-null and non-empty
Returns: property value; may be null
Throws:
java.lang.IllegalStateException - if the component is not the owner of this message
exchange
getPropertyNames()
public java.util.Set getPropertyNames()
getRole()
public javax.jbi.messaging.MessageExchange.Role179 getRole()
Queries the role that the caller (which must be the owner of the this exchange instance) plays in the
exchange.
Returns: Role the caller (the exchange owner) must play in the exchange; must be non-null
Throws:
java.lang.IllegalStateException - if the component is not the owner of this message
exchange
getService()
public javax.xml.namespace.QName getService()
getStatus()
public javax.jbi.messaging.ExchangeStatus162 getStatus()
isTransacted()
public boolean isTransacted()
August 17, 2005 Java Business Integration 1.0 Final Release 175
MessageExchange javax.jbi.messaging
setEndpoint(ServiceEndpoint)
Throws:
java.lang.IllegalStateException - if the component is not the owner of this message
exchange
setEndpoint(ServiceEndpoint)
public void setEndpoint(javax.jbi.servicedesc.ServiceEndpoint192 endpoint)
Specifies the endpoint used by this exchange. Note that this must not affect the value of the Service
property of this message exchange.
Parameters:
endpoint - endpoint address; may be null
Throws:
java.lang.IllegalStateException - if the component is not the owner of this message
exchange
setError(Exception)
public void setError(java.lang.Exception error)
Used to specify the source of a failure status. Invoking this method automatically adjusts the status of the
ME to ExchangeStatus.ERROR.
Parameters:
error - error cause; must be non-null
Throws:
java.lang.IllegalStateException - if the component is not the owner of this message
exchange
setFault(Fault)
public void setFault(javax.jbi.messaging.Fault164 fault)
throws MessagingException
Specifies the fault message for this exchange, if one exists. A fault/message reference is unnecessary, since
an exchange can carry at most one fault, and it is always the final message in an exchange.
Parameters:
fault - fault message; may be null
Throws:
MessagingException183 - operation not permitted in the current exchange state
java.lang.IllegalStateException - if the component is not the owner of this message
exchange
setInterfaceName(QName)
public void setInterfaceName(javax.xml.namespace.QName interfaceName)
August 17, 2005 Java Business Integration 1.0 Final Release 176
javax.jbi.messaging MessageExchange
setMessage(NormalizedMessage, String)
Throws:
java.lang.IllegalStateException - if the component is not the owner of this message
exchange
setMessage(NormalizedMessage, String)
public void setMessage(javax.jbi.messaging.NormalizedMessage185 msg,
java.lang.String name)
throws MessagingException
Sets a normalized message with the specified message reference. The pattern governing this exchange must
contain a definition for the reference name supplied.
Parameters:
msg - normalized message; must be non-null
name - message reference; must be non-null and non-empty
Throws:
MessagingException183 - operation not permitted in the current exchange state
java.lang.IllegalStateException - if the component is not the owner of this message
exchange
setOperation(QName)
public void setOperation(javax.xml.namespace.QName name)
setProperty(String, Object)
public void setProperty(java.lang.String name, java.lang.Object obj)
setService(QName)
public void setService(javax.xml.namespace.QName service)
August 17, 2005 Java Business Integration 1.0 Final Release 177
MessageExchange javax.jbi.messaging
setStatus(ExchangeStatus)
Throws:
java.lang.IllegalStateException - if the component is not the owner of this message
exchange
setStatus(ExchangeStatus)
public void setStatus(javax.jbi.messaging.ExchangeStatus162 status)
throws MessagingException
August 17, 2005 Java Business Integration 1.0 Final Release 178
javax.jbi.messaging MessageExchange.Role
CONSUMER
javax.jbi.messaging
MessageExchange.Role
Declaration
public static final class MessageExchange.Role
java.lang.Object
|
+--javax.jbi.messaging.MessageExchange.Role
Description
Typesafe enumeration containing the roles a component can play in an exchange.
Member Summary
Fields
static CONSUMER179
MessageExchange.Role
static PROVIDER179
MessageExchange.Role
Fields
CONSUMER
public static final javax.jbi.messaging.MessageExchange.Role179 CONSUMER
PROVIDER
public static final javax.jbi.messaging.MessageExchange.Role179 PROVIDER
August 17, 2005 Java Business Integration 1.0 Final Release 179
MessageExchangeFactory javax.jbi.messaging
createExchange(QName, QName)
javax.jbi.messaging
MessageExchangeFactory
Declaration
public interface MessageExchangeFactory
Description
A message exchange factory is used used to create new instances of MessageExchange171 . Service
consumers use these factories to create message exchanges when initiating a new service request.
Message exchange factories are created using the javax.jbi.component.ComponentContext119
given to the component during its initialization (see
javax.jbi.component.ComponentLifeCycle126 ). There are a variety of ways to creating such
factories, each of which creates a context that is used to provide some of the default properties of
MessageExchange171 instances created by the factory instances. For example, a factory can be created for
a particular endpoint, ensuring that all exchanges created by the factory have that endpoint set as the default
endpoint property of the exchange. This allows components to retain factories as a way of aligning internal
processing context with the context contained in the factory, ensuring that the exchanges created consistently
reflect that context.
Member Summary
Methods
MessageExchange createExchange(javax.xml.namespace.QName serviceName,
javax.xml.namespace.QName operationName)180
MessageExchange createExchange(java.net.URI pattern)181
InOnly createInOnlyExchange()181
InOptionalOut createInOptionalOutExchange()181
InOut createInOutExchange()181
RobustInOnly createRobustInOnlyExchange()182
Methods
createExchange(QName, QName)
public javax.jbi.messaging.MessageExchange171 createExchange(javax.xml.namespace.QName
serviceName, javax.xml.namespace.QName operationName)
throws MessagingException
August 17, 2005 Java Business Integration 1.0 Final Release 180
javax.jbi.messaging MessageExchangeFactory
createExchange(URI)
Returns: new message exchange, initialized for invoking the given service and operation; must be non-
null
Throws:
MessagingException183 - if the given service or operation are not registered with the NMR.
MessagingException183 - if the factory was created for a particular interface, and the given
serviceName does not implement that interface.
createExchange(URI)
public javax.jbi.messaging.MessageExchange171 createExchange(java.net.URI pattern)
throws MessagingException
Creates a new MessageExchange instance used to initiate a service invocation. JBI defines a set of four
fundamental message exchange types which are created using binding and engine delivery channels. This
base method is provided for extensibility, to satisfy the need for vendor-specific message exchange
patterns. The registration and administration of these patterns is not addressed by JBI.
Parameters:
pattern - message exchange pattern; must be non-null and non-empty
Returns: new message exchange; must be non-null
Throws:
MessagingException183 - specified pattern is not registered to a message exchange type
createInOnlyExchange()
public javax.jbi.messaging.InOnly165 createInOnlyExchange()
throws MessagingException
createInOptionalOutExchange()
public javax.jbi.messaging.InOptionalOut167 createInOptionalOutExchange()
throws MessagingException
createInOutExchange()
public javax.jbi.messaging.InOut169 createInOutExchange()
throws MessagingException
August 17, 2005 Java Business Integration 1.0 Final Release 181
MessageExchangeFactory javax.jbi.messaging
createRobustInOnlyExchange()
Throws:
MessagingException183 - failed to create exchange
createRobustInOnlyExchange()
public javax.jbi.messaging.RobustInOnly188 createRobustInOnlyExchange()
throws MessagingException
August 17, 2005 Java Business Integration 1.0 Final Release 182
javax.jbi.messaging MessagingException
createRobustInOnlyExchange()
javax.jbi.messaging
MessagingException
Declaration
public class MessagingException extends javax.jbi.JBIException110
java.lang.Object
|
+--java.lang.Throwable
|
+--java.lang.Exception
|
+--javax.jbi.JBIException110
|
+--javax.jbi.messaging.MessagingException
Description
Generic exception used to report messaging related errors in the Normalized Message Router.
Member Summary
Constructors
MessagingException(java.lang.String msg)184
MessagingException(java.lang.String msg, java.lang.Throwable
cause)184
MessagingException(java.lang.Throwable cause)184
August 17, 2005 Java Business Integration 1.0 Final Release 183
MessagingException javax.jbi.messaging
MessagingException(String)
Constructors
MessagingException(String)
public MessagingException(java.lang.String msg)
MessagingException(String, Throwable)
public MessagingException(java.lang.String msg, java.lang.Throwable cause)
Create a new MessagingException with the specified cause and error text.
Parameters:
msg - error detail; must be non-null
cause - underlying error; may be null
MessagingException(Throwable)
public MessagingException(java.lang.Throwable cause)
August 17, 2005 Java Business Integration 1.0 Final Release 184
javax.jbi.messaging NormalizedMessage
MessagingException(Throwable)
javax.jbi.messaging
NormalizedMessage
Declaration
public interface NormalizedMessage
Description
Represents a JBI Normalized Message. A normalized message consists of:
• Content. The XML “payload” message, which conforms to the abstract WSDL message given in the
service description. (WSDL 1.1-described messages are converted to a JBI-defined XML “wrapper”
format.)
• Attachments. Extra (generally binary) attachments to the main message.
• Security subject. The security subject associated with the content.
• Properties. Other message-related data other than the first-class items listed above. Properties are name/
value pairs. There are some JBI-defined names (and corresponding value types). This may be extended by
components to include component-specific properties.
Member Summary
Methods
void addAttachment(java.lang.String id,
javax.activation.DataHandler content)186
getAttachment(java.lang.String id)186
javax.activation.DataH
andler
java.util.Set getAttachmentNames()186
getContent()186
javax.xml.transform.So
urce
java.lang.Object getProperty(java.lang.String name)186
java.util.Set getPropertyNames()186
getSecuritySubject()187
javax.security.auth.Su
bject
void removeAttachment(java.lang.String id)187
void setContent(javax.xml.transform.Source content)187
void setProperty(java.lang.String name, java.lang.Object value)187
void setSecuritySubject(javax.security.auth.Subject subject)187
August 17, 2005 Java Business Integration 1.0 Final Release 185
NormalizedMessage javax.jbi.messaging
addAttachment(String, DataHandler)
Methods
addAttachment(String, DataHandler)
public void addAttachment(java.lang.String id, javax.activation.DataHandler content)
throws MessagingException
getAttachment(String)
public javax.activation.DataHandler getAttachment(java.lang.String id)
getAttachmentNames()
public java.util.Set getAttachmentNames()
getContent()
public javax.xml.transform.Source getContent()
getProperty(String)
public java.lang.Object getProperty(java.lang.String name)
getPropertyNames()
public java.util.Set getPropertyNames()
August 17, 2005 Java Business Integration 1.0 Final Release 186
javax.jbi.messaging NormalizedMessage
getSecuritySubject()
Returns: set of property names for this message; must be non-null; may be empty
getSecuritySubject()
public javax.security.auth.Subject getSecuritySubject()
removeAttachment(String)
public void removeAttachment(java.lang.String id)
throws MessagingException
Removes the attachment from this message with the specified unique identifier.
Parameters:
id - attachment identifier; must be non-null and non-empty
Throws:
MessagingException183 - failed to remove attachment or the attachment does not exist
setContent(Source)
public void setContent(javax.xml.transform.Source content)
throws MessagingException
setProperty(String, Object)
public void setProperty(java.lang.String name, java.lang.Object value)
setSecuritySubject(Subject)
public void setSecuritySubject(javax.security.auth.Subject subject)
August 17, 2005 Java Business Integration 1.0 Final Release 187
RobustInOnly javax.jbi.messaging
getInMessage()
javax.jbi.messaging
RobustInOnly
Declaration
public interface RobustInOnly extends MessageExchange171
Description
Supports operations used to process an Robust In Only MEP to completion.
Member Summary
Methods
NormalizedMessage getInMessage()188
void setInMessage(NormalizedMessage msg)189
Methods
getInMessage()
public javax.jbi.messaging.NormalizedMessage185 getInMessage()
August 17, 2005 Java Business Integration 1.0 Final Release 188
javax.jbi.messaging RobustInOnly
setInMessage(NormalizedMessage)
Throws:
java.lang.IllegalStateException - if the component is not the owner of this message
exchange
setInMessage(NormalizedMessage)
public void setInMessage(javax.jbi.messaging.NormalizedMessage185 msg)
throws MessagingException
August 17, 2005 Java Business Integration 1.0 Final Release 189
RobustInOnly javax.jbi.messaging
setInMessage(NormalizedMessage)
August 17, 2005 Java Business Integration 1.0 Final Release 190
CHAPTER 12
Package
javax.jbi.servicedesc
Class Summary
Interfaces
ServiceEndpoint192 Reference to an endpoint, used to refer an endpoint as well as query information about
the endpoint.
August 17, 2005 Java Business Integration 1.0 Final Release 191
ServiceEndpoint javax.jbi.servicedesc
getAsReference(QName)
javax.jbi.servicedesc
ServiceEndpoint
Declaration
public interface ServiceEndpoint
Description
Reference to an endpoint, used to refer an endpoint as well as query information about the endpoint.
An endpoint is an addressable entity in the JBI system, used for accessing the provider of a specific service.
This interface is implemented by both the JBI implementation and JBI components, in the following use cases:
• Activated endpoints: created by JBI implementation.
• Internal endpoints from endpoint resolution: created by the component implementation.
• Registered external endpoints: created by the component implementation.
See the JBI Specification for details on requirements imposed on components in the latter two use cases.
Member Summary
Methods
getAsReference(javax.xml.namespace.QName operationName)192
org.w3c.dom.DocumentFr
agment
java.lang.String getEndpointName()193
getInterfaces()193
javax.xml.namespace.QN
ame[]
getServiceName()193
javax.xml.namespace.QN
ame
Methods
getAsReference(QName)
public org.w3c.dom.DocumentFragment getAsReference(javax.xml.namespace.QName
operationName)
Get a reference to this endpoint, using an endpoint reference vocabulary that is known to the provider.
Parameters:
operationName - the name of the operation to be performed by a consumer of the generated EPR;
null if this is not applicable
Returns: endpoint reference as an XML fragment; null if the provider does not support such references
August 17, 2005 Java Business Integration 1.0 Final Release 192
javax.jbi.servicedesc ServiceEndpoint
getEndpointName()
getEndpointName()
public java.lang.String getEndpointName()
getInterfaces()
public javax.xml.namespace.QName[] getInterfaces()
Get the qualified names of all the interfaces implemented by this service endpoint.
Returns: array of all interfaces implemented by this service endpoint; must be non-null and non-empty
getServiceName()
public javax.xml.namespace.QName getServiceName()
August 17, 2005 Java Business Integration 1.0 Final Release 193
ServiceEndpoint javax.jbi.servicedesc
getServiceName()
August 17, 2005 Java Business Integration 1.0 Final Release 194
August 17, 2005 Java Business Integration 1.0 Final Release 195
ALMANAC LEGEND
The almanac presents classes and intefaces in alphabetic order, regardless of their package. Fields, methods and
constructors are in alphabetic order in a single list.
This almanac is modeled after the style introduced by Patrick Chan in his excellent book Java Developers
Almanac.
➊➘ ➋➘
RealtimeThread javax.realtime
➌➙ Object
➥ Thread ➍➙ Runnable
➥ RealtimeThread Schedulable
void addToFeasibility()
➎➘ ➏➘ RealtimeThread currentRealtimeThread()
1.3 ❏ Scheduler getScheduler()
❉ RealtimeThread()
1.3 ❉ RealtimeThread(SchedulingParameters scheduling)
❏ void sleep(Clock clock, HighResolutionTime time)
➚ ➚ throws InterruptedException
➐ ➑
1. Name of the class, interface, nested class or nested interface. Interfaces are italic.
2. Name of the package containing the class or interface.
3. Inheritance hierarchy. In this example, RealtimeThread extends Thread, which extends Object.
4. Implemented interfaces. The interface is to the right of, and on the same line as, the class that implements
it. In this example, Thread implements Runnable, and RealtimeThread implements
Schedulable.
5. The first column above is for the value of the @since comment, which indicates the version in which the
item was introduced.
6. The second column above is for the following icons. If the “protected” symbol does not appear, the
member is public. (Private and package-private modifiers also have no symbols.) One symbol from each
group can appear in this column.
Modifiers Access Modifiers Constructors and Fields
❍ abstract ♦protected ❉ constructor
● final ✍ field
❏ static
■ static final
August 17, 2005 Java Business Integration 1.0 Final Release 196
CHAPTER 13
Almanac
AdminServiceMBean javax.jbi.management
AdminServiceMBean
javax.management.ObjectName[] getBindingComponents()
javax.management.ObjectName getComponentByName(String name)
javax.management.ObjectName[] getEngineComponents()
String getSystemInfo()
javax.management.ObjectName getSystemService(String serviceName)
javax.management.ObjectName[] getSystemServices()
boolean isBinding(String componentName)
boolean isEngine(String componentName)
Bootstrap javax.jbi.component
Bootstrap
void cleanUp() throws javax.jbi.JBIException
javax.management.ObjectName getExtensionMBeanName()
void init(InstallationContext installContext) throws javax.jbi.JBIException
void onInstall() throws javax.jbi.JBIException
void onUninstall() throws javax.jbi.JBIException
Component javax.jbi.component
Component
ComponentLifeCycle getLifeCycle()
org.w3c.dom.Document getServiceDescription(javax.jbi.servicedesc.ServiceEndpoint ref)
ServiceUnitManager getServiceUnitManager()
boolean isExchangeWithConsumerOkay(javax.jbi.servicedesc.ServiceEndpoint en
dpoint, javax.jbi.messaging.MessageExchange exchange)
boolean isExchangeWithProviderOkay(javax.jbi.servicedesc.ServiceEndpoint end
point, javax.jbi.messaging.MessageExchange exchange)
javax.jbi.servicedesc.ServiceEndp resolveEndpointReference(org.w3c.dom.DocumentFragment epr)
oint
August 17, 2005 Java Business Integration 1.0 Final Release 197
Almanac
ComponentContext javax.jbi.component
ComponentContext
javax.jbi.servicedesc.ServiceEndp activateEndpoint(javax.xml.namespace.QName serviceName,
oint String endpointName) throws javax.jbi.JBIException
void deactivateEndpoint(javax.jbi.servicedesc.ServiceEndpoint endpoint)
throws javax.jbi.JBIException
void deregisterExternalEndpoint(javax.jbi.servicedesc.ServiceEndpoint extern
alEndpoint) throws javax.jbi.JBIException
String getComponentName()
javax.jbi.messaging.DeliveryChan getDeliveryChannel() throws javax.jbi.messaging.MessagingException
nel
javax.jbi.servicedesc.ServiceEndp getEndpoint(javax.xml.namespace.QName service, String name)
oint
org.w3c.dom.Document getEndpointDescriptor(javax.jbi.servicedesc.ServiceEndpoint endpoint)
throws javax.jbi.JBIException
javax.jbi.servicedesc.ServiceEndp getEndpoints(javax.xml.namespace.QName interfaceName)
oint[]
javax.jbi.servicedesc.ServiceEndp getEndpointsForService(javax.xml.namespace.QName serviceName)
oint[]
javax.jbi.servicedesc.ServiceEndp getExternalEndpoints(javax.xml.namespace.QName interfaceName)
oint[]
javax.jbi.servicedesc.ServiceEndp getExternalEndpointsForService(javax.xml.namespace.QName serviceNa
oint[] me)
String getInstallRoot()
java.util.logging.Logger getLogger(String suffix, String resourceBundleName)
throws java.util.MissingResourceException, javax.jbi.JBIException
javax.jbi.management.MBeanNam getMBeanNames()
es
javax.management.MBeanServer getMBeanServer()
javax.naming.InitialContext getNamingContext()
Object getTransactionManager()
String getWorkspaceRoot()
void registerExternalEndpoint(javax.jbi.servicedesc.ServiceEndpoint externalE
ndpoint) throws javax.jbi.JBIException
javax.jbi.servicedesc.ServiceEndp resolveEndpointReference(org.w3c.dom.DocumentFragment epr)
oint
ComponentLifeCycle javax.jbi.component
ComponentLifeCycle
javax.management.ObjectName getExtensionMBeanName()
void init(ComponentContext context) throws javax.jbi.JBIException
void shutDown() throws javax.jbi.JBIException
void start() throws javax.jbi.JBIException
void stop() throws javax.jbi.JBIException
ComponentLifeCycleMBean javax.jbi.management
ComponentLifeCycleMBean LifeCycleMBean
javax.management.ObjectName getExtensionMBeanName() throws javax.jbi.JBIException
August 17, 2005 Java Business Integration 1.0 Final Release 198
Almanac
DeliveryChannel javax.jbi.messaging
DeliveryChannel
MessageExchange accept() throws MessagingException
MessageExchange accept(long timeoutMS) throws MessagingException,
IllegalArgumentException
void close() throws MessagingException
MessageExchangeFactory createExchangeFactory()
MessageExchangeFactory createExchangeFactory(javax.xml.namespace.QName interfaceName)
MessageExchangeFactory createExchangeFactory(javax.jbi.servicedesc.ServiceEndpoint endpoint)
MessageExchangeFactory createExchangeFactoryForService(javax.xml.namespace.QName service
Name)
void send(MessageExchange exchange) throws MessagingException
boolean sendSync(MessageExchange exchange) throws MessagingException
boolean sendSync(MessageExchange exchange, long timeoutMS)
throws MessagingException
DeploymentException javax.jbi.management
Object
➥Throwable java.io.Serializable
➥Exception
➥javax.jbi.JBIException
➥DeploymentException
❉ DeploymentException(String message)
❉ DeploymentException(String message, Throwable cause)
❉ DeploymentException(Throwable cause)
DeploymentServiceMBean javax.jbi.management
DeploymentServiceMBean
boolean canDeployToComponent(String componentName)
String deploy(String serviceAssemblyZipUrl) throws Exception
String[] getComponentsForDeployedServiceAssembly(String serviceAssemblyNa
me) throws Exception
String[] getDeployedServiceAssemblies() throws Exception
String[] getDeployedServiceAssembliesForComponent(String componentName)
throws Exception
String[] getDeployedServiceUnitList(String componentName) throws Exception
String getServiceAssemblyDescriptor(String serviceAssemblyName)
throws Exception
String getState(String serviceAssemblyName) throws Exception
boolean isDeployedServiceUnit(String componentName, String serviceUnitName)
throws Exception
✍■ String SHUTDOWN
String shutDown(String serviceAssemblyName) throws Exception
String start(String serviceAssemblyName) throws Exception
✍■ String STARTED
August 17, 2005 Java Business Integration 1.0 Final Release 199
Almanac
ExchangeStatus javax.jbi.messaging
Object
➥ExchangeStatus
✍■ ExchangeStatus ACTIVE
✍■ ExchangeStatus DONE
boolean equals(Object obj)
✍■ ExchangeStatus ERROR
int hashCode()
String toString()
❏ ExchangeStatus valueOf(String status)
Fault javax.jbi.messaging
Fault NormalizedMessage
InOnly javax.jbi.messaging
InOnly MessageExchange
NormalizedMessage getInMessage()
void setInMessage(NormalizedMessage msg) throws MessagingException
InOptionalOut javax.jbi.messaging
InOptionalOut MessageExchange
NormalizedMessage getInMessage()
NormalizedMessage getOutMessage()
void setInMessage(NormalizedMessage msg) throws MessagingException
void setOutMessage(NormalizedMessage msg) throws MessagingException
InOut javax.jbi.messaging
InOut MessageExchange
NormalizedMessage getInMessage()
NormalizedMessage getOutMessage()
void setInMessage(NormalizedMessage msg) throws MessagingException
void setOutMessage(NormalizedMessage msg) throws MessagingException
InstallationContext javax.jbi.component
InstallationContext
java.util.List getClassPathElements()
String getComponentClassName()
String getComponentName()
ComponentContext getContext()
org.w3c.dom.DocumentFragment getInstallationDescriptorExtension()
August 17, 2005 Java Business Integration 1.0 Final Release 200
Almanac
String getInstallRoot()
boolean isInstall()
void setClassPathElements(java.util.List classPathElements)
InstallationServiceMBean javax.jbi.management
InstallationServiceMBean
String installSharedLibrary(String slZipURL)
javax.management.ObjectName loadInstaller(String componentName)
javax.management.ObjectName loadNewInstaller(String installZipURL)
boolean uninstallSharedLibrary(String slName)
boolean unloadInstaller(String componentName, boolean isToBeDeleted)
InstallerMBean javax.jbi.management
InstallerMBean
javax.management.ObjectName getInstallerConfigurationMBean() throws javax.jbi.JBIException
String getInstallRoot()
javax.management.ObjectName install() throws javax.jbi.JBIException
boolean isInstalled()
void uninstall() throws javax.jbi.JBIException
JBIException javax.jbi
Object
➥Throwable java.io.Serializable
➥Exception
➥JBIException
❉ JBIException(String message)
❉ JBIException(String message, Throwable cause)
❉ JBIException(Throwable cause)
LifeCycleMBean javax.jbi.management
LifeCycleMBean
String getCurrentState()
✍■ String SHUTDOWN
void shutDown() throws javax.jbi.JBIException
void start() throws javax.jbi.JBIException
✍■ String STARTED
void stop() throws javax.jbi.JBIException
✍■ String STOPPED
✍■ String UNKNOWN
August 17, 2005 Java Business Integration 1.0 Final Release 201
Almanac
MBeanNames javax.jbi.management
MBeanNames
✍■ String BOOTSTRAP_EXTENSION
✍■ String COMPONENT_LIFE_CYCLE_EXTENSION
javax.management.ObjectName createCustomComponentMBeanName(String customName)
String getJmxDomainName()
MessageExchange javax.jbi.messaging
MessageExchange
Fault createFault() throws MessagingException
NormalizedMessage createMessage() throws MessagingException
javax.jbi.servicedesc.ServiceEndp getEndpoint()
oint
Exception getError()
String getExchangeId()
Fault getFault()
javax.xml.namespace.QName getInterfaceName()
NormalizedMessage getMessage(String name)
javax.xml.namespace.QName getOperation()
java.net.URI getPattern()
Object getProperty(String name)
java.util.Set getPropertyNames()
MessageExchange.Role getRole()
javax.xml.namespace.QName getService()
ExchangeStatus getStatus()
boolean isTransacted()
✍■ String JTA_TRANSACTION_PROPERTY_NAME
void setEndpoint(javax.jbi.servicedesc.ServiceEndpoint endpoint)
void setError(Exception error)
void setFault(Fault fault) throws MessagingException
void setInterfaceName(javax.xml.namespace.QName interfaceName)
void setMessage(NormalizedMessage msg, String name)
throws MessagingException
void setOperation(javax.xml.namespace.QName name)
void setProperty(String name, Object obj)
void setService(javax.xml.namespace.QName service)
void setStatus(ExchangeStatus status) throws MessagingException
MessageExchange.Role javax.jbi.messaging
Object
➥MessageExchange.Role
✍■ MessageExchange.Role CONSUMER
✍■ MessageExchange.Role PROVIDER
August 17, 2005 Java Business Integration 1.0 Final Release 202
Almanac
MessageExchangeFactory javax.jbi.messaging
MessageExchangeFactory
MessageExchange createExchange(javax.xml.namespace.QName serviceName,
javax.xml.namespace.QName operationName)
throws MessagingException
MessageExchange createExchange(java.net.URI pattern) throws MessagingException
InOnly createInOnlyExchange() throws MessagingException
InOptionalOut createInOptionalOutExchange() throws MessagingException
InOut createInOutExchange() throws MessagingException
RobustInOnly createRobustInOnlyExchange() throws MessagingException
MessagingException javax.jbi.messaging
Object
➥Throwable java.io.Serializable
➥Exception
➥javax.jbi.JBIException
➥MessagingException
❉ MessagingException(String msg)
❉ MessagingException(String msg, Throwable cause)
❉ MessagingException(Throwable cause)
NormalizedMessage javax.jbi.messaging
NormalizedMessage
void addAttachment(String id, javax.activation.DataHandler content)
throws MessagingException
javax.activation.DataHandler getAttachment(String id)
java.util.Set getAttachmentNames()
javax.xml.transform.Source getContent()
Object getProperty(String name)
java.util.Set getPropertyNames()
javax.security.auth.Subject getSecuritySubject()
void removeAttachment(String id) throws MessagingException
void setContent(javax.xml.transform.Source content)
throws MessagingException
void setProperty(String name, Object value)
void setSecuritySubject(javax.security.auth.Subject subject)
RobustInOnly javax.jbi.messaging
RobustInOnly MessageExchange
NormalizedMessage getInMessage()
void setInMessage(NormalizedMessage msg) throws MessagingException
August 17, 2005 Java Business Integration 1.0 Final Release 203
Almanac
ServiceEndpoint javax.jbi.servicedesc
ServiceEndpoint
org.w3c.dom.DocumentFragment getAsReference(javax.xml.namespace.QName operationName)
String getEndpointName()
javax.xml.namespace.QName[] getInterfaces()
javax.xml.namespace.QName getServiceName()
ServiceUnitManager javax.jbi.component
ServiceUnitManager
String deploy(String serviceUnitName, String serviceUnitRootPath)
throws javax.jbi.management.DeploymentException
void init(String serviceUnitName, String serviceUnitRootPath)
throws javax.jbi.management.DeploymentException
void shutDown(String serviceUnitName)
throws javax.jbi.management.DeploymentException
void start(String serviceUnitName)
throws javax.jbi.management.DeploymentException
void stop(String serviceUnitName)
throws javax.jbi.management.DeploymentException
String undeploy(String serviceUnitName, String serviceUnitRootPath)
throws javax.jbi.management.DeploymentException
August 17, 2005 Java Business Integration 1.0 Final Release 204
CHAPTER 14
Future Directions
Like any 1.0 version of a specification, JBI 1.0 is the start of what in the future will be a more elaborate, and
complete specification. This section summarizes what directions are anticipated in future versions of JBI. This
chapter is provided for informational purposes; it is non-normative. This may include the following:
• Adoption of a work manager (from another JSR) to allow components to not have to manage their own
threads.
• Persistence of MessageExchanges. Currently message exchanges are not serializable; they cannot be
persisted for purposes of failure recovery.
• Distributed JBI. JBI, as currently defined, is not distributed. Distributed implementations may require
support in the JBI specification to address issues that arise only in distributed systems.
• Handlers. It has been proposed that JBI define a standard type of message exchange handler, that can be
installed (in chains) in delivery channels. This would allow composition of interesting functions that can
added to components unobtrusively.
• Policy - framework, language (JSR 265). JBI 1.0 specifies a simple mechanism for expressing capabilities
(required and provided), and has three “hooks” for allowing components and the JBI implementation to
apply policies during these capabilities as inputs. Efforts such as JSR 265 will define standard access to
policy engines, policy language abstracts, etc. that may allow improvements on the JBI 1.0 mechanisms, or
August 17, 2005 Java Business Integration 1.0 Final Release 205
Future Directions
• Security - SAML, other JSRs, interprocess protections, JMX security. JBI 1.0 provides a basic mechanism
for carrying security subject information with normalized messages, leaving other security aspects
(authentication of those subjects, and authorization) up to components (and JBI implementations) to
provide. It has been proposed that JBI implementations could provide some help with these remaining
aspects of security, perhaps leveraging services description metadata.
• Allow shared libraries to be used by Bootstrap implementations.
As the Java community gains experience with using JBI, other ideas for improving and extending JBI 1.0 will
arise. Since JBI touches three distinct developer communities (for JBI implementations, components, and
“applications”), the ideas may be unusually diverse. In addition, JBI is strongly aligned with web services
messaging models, which are still being actively developed and improved on by the standards community. This
alignment could be a further source of changes to improve and extend future versions of JBI.
August 17, 2005 Java Business Integration 1.0 Final Release 206
CHAPTER 15
Appendix: Use of Transactions
This appendix contains information on how transactions can be used by JBI components to accomplish two
common goals:
• Control the reliability of internal message exchanges
• Handle external transaction protocols
The contents of this appendix are largely not normative; they are meant to illustrate some intented uses of
transactions by JBI components to achieve certain qualities of service.
15.1.1 Reliability
JBI is a solution in the enterprise computing arena, thus it requires a high-level of reliability. From the NMR
point of view, this means that the message delivery design needs to address features that allow for at least a
minimum level message exchange reliability. The NMR API's don't need to enforce 100% reliability, they just
need to make that level of service available when needed. Allowing a range of reliability enables a range of
solutions for BC and SE implementers.
15.1.2 Transactional
Transactions have wide applicability in JBI-based applications. Using JBI to compose services will often
require the sharing of a transaction context between JBI engines/bindings. Such transactions can facilitate
reliable operation of composed services. The NMR facilitates the composition of business processing and
communication, including sharing of transaction contexts.
The NMR MAY include transactional pieces itself.
The unit of work in the NMR is a Message Exchange. This is also the unit of work when a transaction is being
used. The NMR is considered to be transaction aware. If the NMR is told that the Message Exchange is being
controlled by a transaction, the NMR will internally use the transaction, if required, and will pass the transaction
context along with the Message Exchange.
The primary reason for the inclusion of transactions is to assist in the primary responsibility of reliable
messaging. Without transactions the One-Way communications primitive could not be used in a reliable
fashion. The extension of transactions to other communications primitives is for completeness.
August 17, 2005 Java Business Integration 1.0 Final Release 207
Appendix: Use of Transactions
It should also be noted that the preceding assumes single JVM/JBI transactions. This is not meant to preclude
the use of distributed transactions, but the standards for such transactions are not yet mature enough to be
incorporated by JBI directly. Future versions of JBI may address distributed transactions directly.
15.1.3 Persistence
Persistence is the ability to persist the state of a Message Exchange at defined point during the Message
Exchange lifetime. Persistence is a step below the Transactional. Persistence doesn't allow the coordination of
multiple components. It does allow the Message Exchange state to be saved, typically to bound the work
required during restart recovery (i.e. a transformation engine may wish to save the results of the XSLT
transformation so that it this won't have to be redone given the relative expense of the transformation versus
persisting the result.)
The general support for persistence is tied in with support for recoverability, which is discussed in the next
section.
15.1.4 Recoverability
Recoverability is the ability of an active Message Exchange to be recovered during restart recovery to some
consistent point in it's lifetime. This would normally involve either persisting a Message Exchange or using
finer grain transactions to save the state of the Message Exchange.
15.1.5 Secrecy
Secrecy is the protection of information from being disclosed to outside parties. This is a basic requirement in
the financial industry, and often required in many other industries. In the NMR this comes about if the NMR
uses external storage in the implementation of transactions or persistence. The basic approach to solving this
problem is to encrypt any user data stored on external storage. This is an implementation problem, and not one
directly addressed by JBI.
August 17, 2005 Java Business Integration 1.0 Final Release 208
Appendix: Use of Transactions
message to the application. Failure to successfully deliver the message will result in retries. Such protocols are
often realized as persistent message queues, as depicted in the message sequence chart below.
Stateful service engines use a persistent store to retain state over system shutdowns. To assure reliable message
transfer from the reliable messaging queue to the SE's persistent state store, the message exchange should not be
ended (with status exchange) until the message (or the results of processing the message) are persisted by the
SE.
Notes:
1. Code in or attached to BC queues a message for delivery to the BC. It expects that this information is
persisted. Once on the queue it should never be removed until step 8 has been reached. This guarantees that
the message will at least be sent once.
2. The BC picks a message to attempt delivery.
3. BC normalizes the message, and sends it to NMR.
4. SE accepts message from NMR
5. SE saves message. The SE could also check to see if the message has been seen before if follow-on logic
can't tolerate duplicate messages.
6. SE sends status to the NMR. SE can reject the message (e.g., structural, content or age problem) or accept
it, in either case the outcome is returned to the initiator.
7. BC accepts status from the NMR.
8. BC removes message from the delivery queue. After this point in time no attempt to redeliver the message
will be made.
August 17, 2005 Java Business Integration 1.0 Final Release 209
Appendix: Use of Transactions
15.2.2 Request-Response
Notes:
1. Code in or attached to BC queues a message for delivery to the BC. It expects that this information is
persisted. Once on the queue it should never be removed until step 8 has been reached. The guarantees that
the message will at least be sent once.
2. The BC picks a message to attempt delivery.
3. BC sends the message to the NMR.
4. SE accepts the message from the NMR
5. SE saves the message and its response to the message. (The SE could also check to see if the message has
been seen before if follow-on logic can't tolerate duplicate messages.)
6. SE sends the response to NMR. SE can reject the message (e.g., structural, content or age problem) or
accept it, in either case the outcome is returned to the initiator.
7. BC accepts response from NMR.
8. BC saves response
9. BC sends status of response to NMR
10. SE get status from the NMR
11. SE can cleanup any leftovers since it has positive acknowledgment of acceptance.
12. BC performs any cleanup.
August 17, 2005 Java Business Integration 1.0 Final Release 210
Appendix: Use of Transactions
15.3.1 One-Way
An example sequence of operations for an exchange initiator is shown below.
Notes:
1. Initiator (an SE or a BC) starts a transaction. It may use its own transactional resources.
2. Initiator creates and initializes a Message Exchange instance, and sets the transaction on the Message
Exchange properties.
3. Initiator sends the ME to NMR.
4. NMR enlists its own internal resource.
5. NMR saves the ME.
6. NMR delists its own internal resource
7. Initiator commits the transaction. The initiator could do some more work with its own resources before the
commit and after the send().
August 17, 2005 Java Business Integration 1.0 Final Release 211
Appendix: Use of Transactions
An example message sequence diagram for the servicer side of this scenario is shown below:
Figure 37
August 17, 2005 Java Business Integration 1.0 Final Release 212
Appendix: Use of Transactions
Notes:
1. Initiator starts a transaction and enlists it local resource.
2. Initiator can work with the local resource and then send the ME.
3. Servicer calls except, the transaction has been switched to the servicer's thread.
4. Servicer does whatever it wants with the message. It can enlist and delist local resource it needed.
5. Servicer sends the status back.
6. Initiator accepts the status. The transaction context has been switched back to the initiator's accept() thread.
7. Initiator can do other work with its local transaction and the commits.
August 17, 2005 Java Business Integration 1.0 Final Release 213
Appendix: Use of Transactions
15.3.3 Request-Response
The Request Response communications primitive is the one case that can't be made reliable in a practical
fashion. The next section on transactional message exchange will provide a solution for this case.
1. Initiator creates a transaction.
2. Initiator enlists its local resources in the transaction and sends the message.
3. Servicer accepts the ME and the transaction context moves to the servicer's accept() thread.
4. Servicer processes the request, enlisting its local resources into the transaction if it needs.
5. Servicer delists any local resources and sends the response.
6. Initiator accepts the response and the transaction context is switched to the initiator thread.
7. Initiator can use local resources and send the status to the servicer.
8. Servicer accepts the status. Transaction context is not available, probably not much to do here.
9. Servicer can do anything it likes but can't effect the transaction.
10. Initiator can use local resources and then delists and commits the transaction.
August 17, 2005 Java Business Integration 1.0 Final Release 214
CHAPTER 16
References
[APACHE ANT]
Apache Software Foundation. Apache Ant. See http://ant.apache.org/.
[ESB]
David A. Chappell. Enterprise Service Bus. O’Reilly, 2004.
[JAX-P 1.3]
Jeff Suttor, Norm Walsh. JavaTM API for XML Processing (JAXP) 1.3. See http://jcp.org/en/jsr/
detail?id=206.
[JAX-P Tutorial]
Sun Microsystems, Inc. JAX-P Tutorial. See http://java.sun.com/webservices/docs/1.3/tutorial/doc/
IntroWS5.html.
[JAX-RPC 2.0]
Marc Hadley, Roberto Chinnici. The Java API for XML Based RPC (JAX-RPC) 2.0. Early Draft Review 2,
JCP, January 2005. See http://jcp.org/aboutJava/communityprocess/edr/jsr224/index2.html.
[JLS]
James Gosling, Bill Joy, Guy Steele, Gilad Bracha. The Java Language Specification 2.0. Book, Sun
Microsystems, Inc., 2000. See http://java.sun.com/docs/books/jls/.
[JMX 1.2]
Sun Microsystems. Java Management Extensions (JMX) 1.2. See http://java.sun.com/products/
JavaManagement/.
[JVM 2]
Tim Lindholm, Frank Yellin. The JavaTM Virtual Machine Specification, Second Edition. Book, Sun
Microsystems, Inc., 1999. See http://java.sun.com/docs/books/vmspec/2nd-edition/html/
VMSpecTOC.doc.html.
[RFC 2119]
Scott Bradner. Key words for use in RFCs to Indicate Requirement Levels. RFC, Internet Engineering Task
Force, March 1997. See http://www.ietf.org/rfc/rfc2119.txt.
[W3C XOP]
Martin Gudgin, Noah Mendelsohn, Mark Nottignham, Herve Ruellan. XML-binary Optimized Packaging.
Recommendation, W3C, January 2005. See http://www.w3.org/TR/2005/REC-xop10-20050125/.
August 17, 2005 Java Business Integration 1.0 Final Release 215
References
[WS-I AP]
Chris Ferris, Anish Karmarkar, Canyan Kevin Liu. Attachments Profile 1.0. Profile, Web Services
Interoperability Organization, August, 2004. See http://www.ws-i.org/Profiles/AttachmentsProfile-1.0-
2004-08-24.html.
[WSDL 1.1]
Erik Christensen, Francisco Cubera, Greg Meridith, Sanjiva Weerawarana. Web Services Description
Language 1.1. Member Submission, W3C, March 2001. See http://www.w3.org/TR/wsdl.
[WSDL 2.0]
Roberto Chinnici, Martin Gudgin, Jean-Jacques Moreau, Jeffrey Schlimmer, and Sanjiva Weerawarana.
Web Services Description Language (WSDL) Version 2.0 Part 1: Core Language. Working Draft, W3C,
August 2004. See http://www.w3.org/TR/2004/WD-wsdl20-20040803.
[WSDL 2.0 Bindings]
H. Haas, P. Le Hégaret, J-J. Moreau, D. Orchard, J. Schlimmer, Editors. Web Services Description
Language (WSDL) Version 2.0 Part 3: Bindings. Working Draft, W3C, August 2004. See http://
www.w3.org/TR/2004/WD-wsdl20-bindings-20040803
[WSDL 2.0 Extensions]
Martin Gudgin, Amy Lewis, Jeffrey Schlimmer. Web Services Description Language (WSDL) Version 2.0
Part 2: Predefined Extensions. Working Draft, W3C, August, 2004. See http://www.w3.org/TR/2004/WD-
wsdl20-extensions-20040803/.
[XML 1.0]
Tim Bray, Jean Paoli, C. M. Sperberg-McQueen, and Eve Maler. Extensible Markup Language (XML) 1.0
(Second Edition). Recommendation, W3C, October 2000. See http://www.w3.org/TR/2000/REC-xml-
20001006.
August 17, 2005 Java Business Integration 1.0 Final Release 216
Index Bootstrap class loading
ordering rules 107
BOOTSTRAP_EXTENSION
of javax.jbi.management.MBeanNames 155
A BuildException
accept() in Ant tasks 86
of javax.jbi.messaging.DeliveryChannel 158
accept(long)
of javax.jbi.messaging.DeliveryChannel 159
C
activateEndpoint(QName, String) canDeployToComponent(String)
of javax.jbi.component.ComponentContext of javax.jbi.management.DeploymentService-
120 MBean 144
Activation Class Loading
service provider 29 defined 63
Activation, endpoint 29 delegation order 104
ACTIVE implementation behaviour 103
of javax.jbi.messaging.ExchangeStatus 162 Class Loading Ordering Rules
addAttachment(String, DataHandler) bootstrap 107
of javax.jbi.messaging.NormalizedMessage execution 105
186 class-path
AdminServiceMBean in jbi.xml, use of 67
of javax.jbi.management 136 cleanUp()
Ant Script Support 86 of javax.jbi.component.Bootstrap 114
Ant Task close()
jbi-deploy-service-assembly 91 of javax.jbi.messaging.DeliveryChannel 159
jbi-install-component 87 Component
jbi-install-shared-library 89 of javax.jbi.component 116
jbi-list-binding-components 94 restart 100
jbi-list-service-assemblies 95 service description SPI 44
jbi-list-service-engines 92 start 99
jbi-list-shared-libraries 95 Component (interface)
jbi-shut-down-component 90 use of 98
jbi-shut-down-service-assembly 92 Component Context
jbi-start-component 90 use of 101
jbi-start-service-assembly 91 Component Installation Service 72
jbi-stop-component 90 Component Life Cycle
jbi-stop-service-assembly 92 defined 63
jbi-undeploy-service-assembly 91 extension 75
jbi-uninstall-component 89 management 74
jbi-uninstall-shared-library 89 Component Uninstallation
management 78
COMPONENT_LIFE_CYCLE_EXTENSION
B of javax.jbi.management.MBeanNames 155
Binding Type ComponentContext
for service engine (WSDL) 57 of javax.jbi.component 119
Bootstrap ComponentLifeCycle
of javax.jbi.component 114 of javax.jbi.component 126
use of 98 use of 98
Bootstrap Class Loader ComponentLifeCycleMBean
defined 63 of javax.jbi.management 139
August 17, 2005 Java Business Integration 1.0 Final Release 217
Index
component-name createRobustInOnlyExchange()
in jbi.xml, use of 68 of javax.jbi.messaging.MessageExchangeFac-
composite deployment tory 182
defined 60 CSD
composite service description 6 see composite service description 6
Composite Service Metadata
defined 61 D
connection
in jbi.xml, use of 68 DataHandler
Connection Metadata of javax.activation, as message attachments 41
service assembly, handling 80 deactivateEndpoint(ServiceEndpoint)
connections of javax.jbi.component.ComponentContext
in jbi.xml, use of 68 121
CONSUMER Delegation
of javax.jbi.messaging.MessageExchange.Role class loading 104
179 DeliveryChannel
Consumers, Service accept, use of 44
key concepts 21 closing, API 44
consumes key concepts 22
in jbi.xml, use of 69 of javax.jbi.messaging 158
createCustomComponentMBeanName(String) sending exchanges 43
of javax.jbi.management.MBeanNames 155 use of API 43
createExchange(QName, QName) Denormalization, defined 28
of javax.jbi.messaging.MessageExchangeFac- deploy(String)
tory 180 of javax.jbi.management.DeploymentService-
createExchange(URI) MBean 144
of javax.jbi.messaging.MessageExchangeFac- deploy(String, String)
tory 181 of javax.jbi.component.ServiceUnitManager
createExchangeFactory() 131
of javax.jbi.messaging.DeliveryChannel 159 Deployment
createExchangeFactory(QName) defined 60
of javax.jbi.messaging.DeliveryChannel 159 Deployment Descriptors
createExchangeFactory(ServiceEndpoint) described 65
of javax.jbi.messaging.DeliveryChannel 160 Deployment Life Cycle
createExchangeFactoryForService(QName) defined 63
of javax.jbi.messaging.DeliveryChannel 160 Deployment Service
createFault() management 78
of javax.jbi.messaging.MessageExchange 172 deployment, composite
createInOnlyExchange() defined 60
of javax.jbi.messaging.MessageExchangeFac- Deployment, unit
tory 181 defined 60
createInOptionalOutExchange() DeploymentException
of javax.jbi.messaging.MessageExchangeFac- of javax.jbi.management 141
tory 181 use of 107
createInOutExchange() DeploymentException(String)
of javax.jbi.messaging.MessageExchangeFac- of javax.jbi.management.DeploymentExcep-
tory 181 tion 142
createMessage() DeploymentException(String, Throwable)
of javax.jbi.messaging.MessageExchange 173 of javax.jbi.management.DeploymentExcep-
tion 142
August 17, 2005 Java Business Integration 1.0 Final Release 218
Index
August 17, 2005 Java Business Integration 1.0 Final Release 219
Index
getDeliveryChannel() getInMessage()
of javax.jbi.component.ComponentContext of javax.jbi.messaging.InOnly 165
121 of javax.jbi.messaging.InOptionalOut 167
getDeployedServiceAssemblies() of javax.jbi.messaging.InOut 169
of javax.jbi.management.DeploymentService- of javax.jbi.messaging.RobustInOnly 188
MBean 145 getInstallationDescriptorExtension()
getDeployedServiceAssembliesForCompo- of javax.jbi.component.InstallationContext
nent(String) 129
of javax.jbi.management.DeploymentService- getInstallerConfigurationMBean()
MBean 145 of javax.jbi.management.InstallerMBean 151
getDeployedServiceUnitList(String) getInstallRoot()
of javax.jbi.management.DeploymentService- of javax.jbi.component.ComponentContext
MBean 146 123
getEndpoint() of javax.jbi.component.InstallationContext
of javax.jbi.messaging.MessageExchange 173 129
getEndpoint(QName, String) of javax.jbi.management.InstallerMBean 151
of javax.jbi.component.ComponentContext getInterfaceName()
122 of javax.jbi.messaging.MessageExchange 174
getEndpointDescriptor(ServiceEndpoint) getInterfaces()
of javax.jbi.component.ComponentContext of javax.jbi.servicedesc.ServiceEndpoint 193
122 getJmxDomainName()
getEndpointName() of javax.jbi.management.MBeanNames 156
of javax.jbi.servicedesc.ServiceEndpoint 193 getLifeCycle()
getEndpoints(QName) of javax.jbi.component.Component 116
of javax.jbi.component.ComponentContext getLogger
122 of ComponentContext, use of 103
getEndpointsForService(QName) getLogger(String, String)
of javax.jbi.component.ComponentContext of javax.jbi.component.ComponentContext
122 123
getEngineComponents() getMBeanNames()
of javax.jbi.management.AdminServiceMBean of javax.jbi.component.ComponentContext
137 124
getError() getMBeanServer()
of javax.jbi.messaging.MessageExchange 173 of javax.jbi.component.ComponentContext
getExchangeId() 124
of javax.jbi.messaging.MessageExchange 173 getMessage(String)
getExtensionMBeanName() of javax.jbi.messaging.MessageExchange 174
of javax.jbi.component.Bootstrap 115 getNamingContext()
of javax.jbi.component.ComponentLifeCycle of javax.jbi.component.ComponentContext
126 124
of javax.jbi.management.ComponentLifeCy- getOperation()
cleMBean 139 of javax.jbi.messaging.MessageExchange 174
getExternalEndpoints(QName) getOutMessage()
of javax.jbi.component.ComponentContext of javax.jbi.messaging.InOptionalOut 168
123 of javax.jbi.messaging.InOut 170
getExternalEndpointsForService(QName) getPattern()
of javax.jbi.component.ComponentContext of javax.jbi.messaging.MessageExchange 174
123 getProperty(String)
getFault() of javax.jbi.messaging.MessageExchange 174
of javax.jbi.messaging.MessageExchange 173 of javax.jbi.messaging.NormalizedMessage
August 17, 2005 Java Business Integration 1.0 Final Release 220
Index
186
getPropertyNames()
I
of javax.jbi.messaging.MessageExchange 175 Identification
of javax.jbi.messaging.NormalizedMessage in jbi.xml, use of 66
186 Implicit Provider Endpoint Selection 34
getRole() In Optional-Out MEP
of javax.jbi.messaging.MessageExchange 175 defined 33
getSecuritySubject() init(ComponentContext)
of javax.jbi.messaging.NormalizedMessage of javax.jbi.component.ComponentLifeCycle
187 126
getService() init(InstallationContext)
of javax.jbi.messaging.MessageExchange 175 of javax.jbi.component.Bootstrap 115
getServiceAssemblyDescriptor(String) init(String, String)
of javax.jbi.management.DeploymentService- of javax.jbi.component.ServiceUnitManager
MBean 146 132
getServiceDescription(ServiceEndpoint) InOnly
of javax.jbi.component.Component 117 of javax.jbi.messaging 165
getServiceName() In-Only MEP
of javax.jbi.servicedesc.ServiceEndpoint 193 defined 31, 32
getServiceUnitManager() InOnly Message Exchange
of javax.jbi.component.Component 117 API 47
getState(String) InOptionalOut
of javax.jbi.management.DeploymentService- of javax.jbi.messaging 167
MBean 146 InOptionalOut Message Exchange
getStatus() API 47
of javax.jbi.messaging.MessageExchange 175 InOut
getSystemInfo() of javax.jbi.messaging 169
of javax.jbi.management.AdminServiceMBean In-Out MEP
137 defined 32
getSystemService(String) InOut Message Exchange
of javax.jbi.management.AdminServiceMBean API 47
137 install()
getSystemServices() of javax.jbi.management.InstallerMBean 152
of javax.jbi.management.AdminServiceMBean Installation
138 defined 60
getTransactionManager() Installation Descriptor
of javax.jbi.component.ComponentContext described 65
124 Installation Packaging 69
getWorkspaceRoot() Installation Service
of javax.jbi.component.ComponentContext component 72
124 shared library 72
specified 71
InstallationContext
H of javax.jbi.component 128
hard link use of 102
defined 35 InstallationServiceMBean
hashCode() of javax.jbi.management 149
of javax.jbi.messaging.ExchangeStatus 163 InstallerMBean
creation during component installation 72
of javax.jbi.management 151
August 17, 2005 Java Business Integration 1.0 Final Release 221
Index
August 17, 2005 Java Business Integration 1.0 Final Release 222
Index
August 17, 2005 Java Business Integration 1.0 Final Release 223
Index
August 17, 2005 Java Business Integration 1.0 Final Release 224
Index
ServiceUnitManager shutDown()
of javax.jbi.component 131 of javax.jbi.component.ComponentLifeCycle
use during service unit deployment 79 127
setClassPathElements(List) of javax.jbi.management.LifeCycleMBean
of javax.jbi.component.InstallationContext 154
130 shutDown(String)
setContent(Source) of javax.jbi.component.ServiceUnitManager
of javax.jbi.messaging.NormalizedMessage 132
187 of javax.jbi.management.DeploymentService-
setEndpoint(ServiceEndpoint) MBean 147
of javax.jbi.messaging.MessageExchange 176 soft link
setError(Exception) defined 35
of javax.jbi.messaging.MessageExchange 176 standard link
setFault(Fault) defined 35
of javax.jbi.messaging.MessageExchange 176 start()
setInMessage(NormalizedMessage) of javax.jbi.component.ComponentLifeCycle
of javax.jbi.messaging.InOnly 166 127
of javax.jbi.messaging.InOptionalOut 168 of javax.jbi.management.LifeCycleMBean
of javax.jbi.messaging.InOut 170 154
of javax.jbi.messaging.RobustInOnly 189 start(String)
setInterfaceName(QName) of javax.jbi.component.ServiceUnitManager
of javax.jbi.messaging.MessageExchange 176 132
setMessage(NormalizedMessage, String) of javax.jbi.management.DeploymentService-
of javax.jbi.messaging.MessageExchange 177 MBean 147
setOperation(QName) Start, Component 99
of javax.jbi.messaging.MessageExchange 177 STARTED
setOutMessage(NormalizedMessage) of javax.jbi.management.DeploymentService-
of javax.jbi.messaging.InOptionalOut 168 MBean 144
of javax.jbi.messaging.InOut 170 of javax.jbi.management.LifeCycleMBean
setProperty(String, Object) 153
of javax.jbi.messaging.MessageExchange 177 Status and Result Strings
of javax.jbi.messaging.NormalizedMessage defined 83
187 stop()
setSecuritySubject(Subject) of javax.jbi.component.ComponentLifeCycle
of javax.jbi.messaging.NormalizedMessage 127
187 of javax.jbi.management.LifeCycleMBean
setService(QName) 154
of javax.jbi.messaging.MessageExchange 177 stop(String)
setStatus(ExchangeStatus) of javax.jbi.component.ServiceUnitManager
of javax.jbi.messaging.MessageExchange 178 133
Shared Library of javax.jbi.management.DeploymentService-
installation service 72 MBean 147
shared-library STOPPED
in jbi.xml, use of 67 of javax.jbi.management.DeploymentService-
SHUTDOWN MBean 144
of javax.jbi.management.DeploymentService- of javax.jbi.management.LifeCycleMBean
MBean 144 153
of javax.jbi.management.LifeCycleMBean
153
August 17, 2005 Java Business Integration 1.0 Final Release 225
Index
T WS-I
attachments profile 1.0 39
toString()
of javax.jbi.messaging.ExchangeStatus 163
transaction context X
for MessageExchange 46 XML-binary Optimized Packaging 39
XOP 39
U
undeploy(String)
of javax.jbi.management.DeploymentService-
MBean 148
undeploy(String, String)
of javax.jbi.component.ServiceUnitManager
133
Undeployment
service assembly, management 80
uninstall()
of javax.jbi.management.InstallerMBean 152
Uninstallation
component, managment 78
uninstallSharedLibrary(String)
of javax.jbi.management.InstallationServiceM-
Bean 150
unit deployment
defined 60
UNKNOWN
of javax.jbi.management.LifeCycleMBean
154
unloadInstaller(String, boolean)
of javax.jbi.management.InstallationServiceM-
Bean 150
V
valueOf(String)
of javax.jbi.messaging.ExchangeStatus 163
W
W3C
XOP 39
WSDL
as used for service descriptions 44
WSDL 1.1
Message Exchange Properties 48
message wrapper schema 40
messages 40
WSDL Binding Type
for service engine 57
August 17, 2005 Java Business Integration 1.0 Final Release 226
Colophon
This specification document was generated from a set of Java, FrameMaker, StarOffice, and HTML source
files. They were compiled using javadoc and the MIF Doclet.
The MIF doclet generates its output in MIF format, which is processed through Adobe FrameMaker, http://
www.adobe.com/products/framemaker (http://www.adobe.com/products/framemaker).
August 17, 2005 Java Business Integration 1.0 Final Release 227
Colophon
August 17, 2005 Java Business Integration 1.0 Final Release 228