/**
 * 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.
 */




JBI External Provider/Internal Consumer Demo
============================================

This demo illustrate how an internal $SUBSTITUTE_NAME_UPPER$ client that is deployed into 
a $SUBSTITUTE_NAME_UPPER$ service engine can communicate with an external 
$SUBSTITUTE_NAME_UPPER$ server through a generic JBI JMS binding component. 



Prerequisites
-------------

The  demo requires Apache ServiceMix 3.1, which you can download from:

   http://incubator.apache.org/servicemix/servicemix-31.html

It assumes some familiarity with the Java Business Integration (JBI)
specification. See the following URL for details: 

   http://java.sun.com/integration/



Overview
--------

The demo consists of a $SUBSTITUTE_NAME_UPPER$ Service Engine and a ServiceMix JMS
binding component. a $SUBSTITUTE_NAME_UPPER$ service unit (the service consumer) is 
deployed into a $SUBSTITUTE_NAME_UPPER$ Service Engine. A ServiceMix JMS binding 
service unit (the transport router) is deployed into ServiceMix JMS binding 
component. The $SUBSTITUTE_NAME_UPPER$ service unit and ServiceMix JMS binding 
service unit are wrapped in a $SUBSTITUTE_NAME_UPPER$ demo service assembly.



Building the demo
-----------------

Export SERVICEMIX_HOME for your shell environment.

From the samples/integration/JBI/external_provider_internal_consumer directory, 
build the demo by running:

   ant build



Installing and deploying
------------------------

Ensure that $SERVICEMIX_HOME/bin is in your path.

Start ServiceMix by running
  
   servicemix

Start the $SUBSTITUTE_NAME_UPPER$ server by running the following on a single line:

   ant server 
       -Dthirdparty.classpath=$SERVICEMIX_HOME/lib/activemq-core-4.1-incubator-20070103.jar:$SERVICEMIX_HOME/lib/backport-util-concurrent-2.2.jar:$SERVICEMIX_HOME/lib/activeio-core-3.0.0-incubator.jar:$SERVICEMIX_HOME/lib/geronimo-j2ee-management_1.0_spec-1.1.jar

Install the $SUBSTITUTE_NAME_UPPER$ Service Engine by running the following on a 
single line:

   ant -f $SERVICEMIX_HOME/ant/servicemix-ant-task.xml install-component 
       -Dsm.install.file=./service-engine/build/lib/cxf-service-engine.jar 
       -Dsm.username=smx -Dsm.password=smx
       
Start the $SUBSTITUTE_NAME_UPPER$ Service Engine with the following command:
       
   ant -f $SERVICEMIX_HOME/ant/servicemix-ant-task.xml start-component 
       -Dsm.component.name=CXFServiceEngine -Dsm.username=smx -Dsm.password=smx

Install and start the ServiceMix SOAP/JMS binding component by copying the 
following files from the $SERVICEMIX_HOME/components directory to the ServiceMix 
deploy directory:

- servicemix-jms-3.1-incubating-installer.zip
- servicemix-shared-3.1-incubating-installer.zip

Deploy the $SUBSTITUTE_NAME_UPPER$ demo service assembly:

   ant -f $SERVICEMIX_HOME/ant/servicemix-ant-task.xml deploy-service-assembly 
       -Dsm.deploy.file=./service-assembly/build/lib/cxf-service-assembly.zip 
       -Dsm.username=smx -Dsm.password=smx

Start the $SUBSTITUTE_NAME_UPPER$ demo service assembly:

   ant -f $SERVICEMIX_HOME/ant/servicemix-ant-task.xml start-service-assembly 
       -Dsm.service.assembly.name=cxf-demo-service-assembly -Dsm.username=smx 
       -Dsm.password=smx



What happens when the demo runs
-------------------------------

The $SUBSTITUTE_NAME_UPPER$ client service unit (the service consumer) invokes the 
ServiceMix JMS binding service unit using XML and the JBI Normalized Message 
Router (NMR). The ServiceMix JMS binding service routes this request to the 
$SUBSTITUTE_NAME_UPPER$ standalone server using SOAP/JMS. The ServiceMix JMS 
binding service unit acts as a router, connecting the $SUBSTITUTE_NAME_UPPER$ service 
consumer and the service provider.
