blob: 98b7e67aaf7b23b27b9ee35da97c1f6558cf7664 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" >
<chapter>
<title>servicemix-bean</title>
<section>
<title>Overview</title>
<para>
The ServiceMix Bean component provides integration with beans (POJOs) with the JBI bus to make it easy to use POJOs to process JBI message exchanges. Like in an Message Driven Bean in J2EE a POJO will receive a message from the NMR and process it in any way it likes. Unlike in a JMS component where the coding is already done the Bean component gives the developer the freedom to create any type of message handling but it must be hand coded all the way.
</para>
<section>
<title>Namespace and xbean.xml</title>
<para>
The namespace URI for the servicemix-bean JBI component is <code>http://servicemix.apache.org/bean/1.0</code>. This is an example of <filename>xbean.xml</filename> file with a namespace definition with prefix <code>bean</code>.
<programlisting><![CDATA[
<beans xmlns:bean="http://servicemix.apache.org/bean/1.0">
<!-- add bean:endpoint definitions here -->
</beans>
]]></programlisting>
</para>
</section>
<section>
<title>Endpoint types</title>
<para>
The servicemix-bean component only defines one endpoint, called <code>bean:endpoint</code>. It can be used to receive and send message exchanges from/to the NMR.
</para>
</section>
</section>
<section>
<title><code>Endpoint bean:endpoint</code></title>
<section>
<title>Using a Java class</title>
<para>
When definining a <code>bean:endpoint</code> specifying a Java class name, a new instance of this class will be created for handling a single message exchange.
</para>
<programlisting><![CDATA[
<beans xmlns:bean="http://servicemix.apache.org/bean/1.0"
xmlns:my="urn:org:servicmix:docs:examples">
<bean:endpoint service="my:service" endpoint="endpoint"
class="org.apache.servicemix.docs.bean.MyHandlerBean"/>
</beans>
]]></programlisting>
</section>
</section>
<section>
<title>Sample configurations</title>
<para>
This section will list a whole set of sample configurations.
</para>
</section>
</chapter>