http://git-wip-us.apache.org/repos/asf/servicemix-features/blob/d358d2ea/examples/jbi/simple/quartz.xml ---------------------------------------------------------------------- diff --git a/examples/jbi/simple/quartz.xml b/examples/jbi/simple/quartz.xml deleted file mode 100644 index ef1f760..0000000 --- a/examples/jbi/simple/quartz.xml +++ /dev/null @@ -1,56 +0,0 @@ -<?xml version="1.0"?> -<!-- - 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. ---> -<beans xmlns="http://www.springframework.org/schema/beans" - xmlns:util="http://www.springframework.org/schema/util" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:quartz="http://servicemix.apache.org/quartz/1.0" - xmlns:camel="http://camel.apache.org/schema/spring" - xmlns:osgi="http://www.springframework.org/schema/osgi" - xmlns:b="http://servicemix.apache.org/examples/camel" - xsi:schemaLocation=" - http://www.springframework.org/schema/beans - http://www.springframework.org/schema/beans/spring-beans.xsd - http://www.springframework.org/schema/util - http://www.springframework.org/schema/util/spring-util.xsd - http://www.springframework.org/schema/osgi - http://www.springframework.org/schema/osgi/spring-osgi.xsd - http://www.springframework.org/schema/osgi-compendium - http://www.springframework.org/schema/osgi-compendium/spring-osgi-compendium.xsd - http://servicemix.apache.org/quartz/1.0 - http://servicemix.apache.org/quartz/1.0/servicemix-quartz.xsd - http://camel.apache.org/schema/spring - http://camel.apache.org/schema/spring/camel-spring.xsd - http://www.springframework.org/schema/osgi - http://www.springframework.org/schema/osgi/spring-osgi.xsd"> - - <camel:camelContext> - <camel:route> - <camel:from uri="jbi:endpoint:http://servicemix.apache.org/examples/camel/receiver/endpoint" /> - <camel:to uri="log:test?showStreams=true" /> - </camel:route> - </camel:camelContext> - - <quartz:endpoint service="b:service" endpoint="endpoint" targetService="b:receiver"> - <quartz:trigger> - <quartz:simple repeatCount="500" repeatInterval="1000" startDelay="5000" /> - </quartz:trigger> - </quartz:endpoint> - - <bean class="org.apache.servicemix.common.osgi.EndpointExporter" /> - -</beans>
http://git-wip-us.apache.org/repos/asf/servicemix-features/blob/d358d2ea/examples/jbi/simple/wsn.xml ---------------------------------------------------------------------- diff --git a/examples/jbi/simple/wsn.xml b/examples/jbi/simple/wsn.xml deleted file mode 100644 index cea8d88..0000000 --- a/examples/jbi/simple/wsn.xml +++ /dev/null @@ -1,76 +0,0 @@ -<?xml version="1.0"?> -<!-- - 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. ---> -<beans xmlns="http://www.springframework.org/schema/beans" - xmlns:util="http://www.springframework.org/schema/util" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:http="http://servicemix.apache.org/http/1.0" - xmlns:ctx="http://www.springframework.org/schema/context" - xmlns:osgi="http://www.springframework.org/schema/osgi" - xmlns:osgix="http://www.springframework.org/schema/osgi-compendium" - xmlns:wsn="http://servicemix.org/wsnotification" - xsi:schemaLocation=" - http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd - http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd - http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd - http://www.springframework.org/schema/osgi http://www.springframework.org/schema/osgi/spring-osgi.xsd - http://www.springframework.org/schema/osgi-compendium http://www.springframework.org/schema/osgi-compendium/spring-osgi-compendium.xsd - http://servicemix.apache.org/http/1.0 http://servicemix.apache.org/http/1.0/servicemix-http.xsd"> - - <http:endpoint service="wsn:NotificationBroker" - endpoint="http-binding" - targetService="wsn:NotificationBroker" - targetEndpoint="Broker" - role="consumer" - locationURI="${baseUrl}/Broker/" - defaultMep="http://www.w3.org/2004/08/wsdl/in-out" - soap="true"/> - - <http:endpoint service="wsn:CreatePullPoint" - endpoint="http-binding2" - targetService="wsn:CreatePullPoint" - targetEndpoint="Broker" - role="consumer" - locationURI="${baseUrl}/CreatePullPoint/" - defaultMep="http://www.w3.org/2004/08/wsdl/in-out" - soap="true"/> - - <!-- Export this service assembly to the OSGi registry --> - <bean class="org.apache.servicemix.common.osgi.EndpointExporter" /> - - <!-- The target endpoints for this Service Assembly are defined outside the scope of this SA. - To make sure the SA is not create before those endpoints are available, we add - two dependencies at spring-dm level on the required endpoints. - --> - <osgi:reference id="notificationBrokerEndpoint" - interface="org.apache.servicemix.nmr.api.Endpoint" - filter="(&(jbi.internal=true)(SERVICE_NAME={http://servicemix.org/wsnotification}NotificationBroker))" /> - <osgi:reference id="createPullpointEndpoint" - interface="org.apache.servicemix.nmr.api.Endpoint" - filter="(&(jbi.internal=true)(SERVICE_NAME={http://servicemix.org/wsnotification}CreatePullPoint))" /> - - <!-- Expose some properties using the OSGi Configuration Admin service. - The values specified here is the default value which can be overriden - by feeding the configuration admin service with the needed configuration. - This can be done by creating a file named etc/org.apache.servicemix.examples.wsn.cfg - containing the property below. --> - <osgix:cm-properties id="wsnProps" persistent-id="org.apache.servicemix.examples.wsn"> - <prop key="baseUrl">http://0.0.0.0:8192/wsn</prop> - </osgix:cm-properties> - <ctx:property-placeholder properties-ref="wsnProps" /> - -</beans> http://git-wip-us.apache.org/repos/asf/servicemix-features/blob/d358d2ea/examples/nmr/basic/README.txt ---------------------------------------------------------------------- diff --git a/examples/nmr/basic/README.txt b/examples/nmr/basic/README.txt deleted file mode 100644 index 0e6aafb..0000000 --- a/examples/nmr/basic/README.txt +++ /dev/null @@ -1,195 +0,0 @@ -/* - * 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. - */ - -NMR EXAMPLE -=========== - -Purpose -------- -Write and expose a simple NMR endpoint. - - -Explanation ------------ -This example consists of: - -1. An endpoint bundle that includes: - - - An EchoEndpoint Java class that adds an "Echo" prefix - to any messages it receives from the client and returns - the updated messages. The EchoEndpoint.java file is - located in the endpoint/src/main/java/org/apache/ - servicemix/nmr/examples/nmr/endpoint directory of this - example. - - - A Spring configuration file, beans.xml, which makes the - EchoEndpoint functionality available as a service. The - beans.xml file is located in the endpoint/src/main/ - resources/META-INF/spring directory of this example. - -2. A client bundle that includes: - - - A Client Java class that accesses the NMR and sends - messages to the EchoEndpoint service. The Client.java - file is located in the client/src/main/java/org/apache/ - servicemix/nmr/examples/nmr/client directory of this example. - - - A Spring configuration file, beans.xml, which configures - the client and the NMR. The beans.xml file is located - in the client/src/main/resources/META-INF/spring directory - of this example. - - -Prerequisites for Building and Running the Example --------------------------------------------------- -1. You must have the following installed on your machine: - - - JDK 1.5 or higher - - - Maven 2.0.9 or higher (for building) - - For more information, see the README in the top-level examples - directory. - - -2. Start ServiceMix by running the following command: - - <servicemix_home>/bin/servicemix (on UNIX) - <servicemix_home>\bin\servicemix (on Windows) - - -Running the Example -------------------- -You can run the example in two ways: - -- A. Using a Prebuilt Deployment Bundle: Quick and Easy - This option is useful if you want to see the example up and - running quickly. - -- B. Building the Example Bundle Yourself - This option is useful if you want to change the example in any - way. It tells you how to build and deploy the example. This - option might be slower than option A because, if you do not - already have the required bundles in your local Maven - repository, Maven will have to download the bundles it needs. - -A. Using a Prebuilt Deployment Bundle: Quick and Easy ----------------------------------------------------- -To install and run a prebuilt version of this example, enter -the following command in the ServiceMix console: - - features:install examples-nmr - -This command makes use of the ServiceMix features facility. For -more information about the features facility, see the README.txt -file in the examples parent directory. - -You can verify that example is running by looking at the log -file in the data/log directory of your ServiceMix installation, -or by typing the following command in the ServiceMix console: - - log:display - -You should see output similar to following appearing in the -log file every five seconds: - - 09:35:02,450 | INFO | ndpoint-thread-1 | EchoEndpoint - | amples.nmr.endpoint.EchoEndpoint 34 | Received in EchoEndpoint: Hello - 09:35:02,451 | INFO | Thread-8 | Client - | x.nmr.examples.nmr.client.Client 75 | Response from Endpoint EchoHello - - -B. Building the Example Bundle Yourself ---------------------------------------- -To install and run the example where you build the example -bundle yourself, complete the following steps: - -1. If you have already run the example using the prebuilt - version as described above, you must first uninstall the - examples-nmr feature by entering the following command - in the ServiceMix console: - - features:uninstall examples-nmr - -2. Build the example by opening a command prompt, changing - directory to examples/nmr (this example) and entering - the following Maven command: - - mvn install - - If all of the required OSGi bundles are available in your - local Maven repository, the example will build quickly. - Otherwise it may take some time for Maven to download - everything it needs. - - The mvn install command builds the example deployment bundles - and copies them to your local Maven repository and to the target - subdirectory of the example client and endpoint directories. - -3. Install the example by entering the following command in - the ServiceMix console: - - features:install examples-nmr - - This command makes use of the ServiceMix features facility. For - more information about the features facility, see the README.txt - file in the examples parent directory. - -You can verify that example is running by looking at the log -file in the data/log directory of your ServiceMix installation, -or by typing the following command in the ServiceMix console: - - log:display - -You should see output similar to following appearing in the -log file every five seconds: - - 09:35:02,450 | INFO | ndpoint-thread-1 | EchoEndpoint - | amples.nmr.endpoint.EchoEndpoint 34 | Received in EchoEndpoint: Hello - 09:35:02,451 | INFO | Thread-8 | Client - | x.nmr.examples.nmr.client.Client 75 | Response from Endpoint EchoHello - - -Stopping and Uninstalling the Example -------------------------------------- -To stop the example, you must first know the bundle ID that ServiceMix -has assigned to it. To get the bundle ID, enter the following command -at the ServiceMix console: - - osgi:list - -At the end of the listing, you should see an entry similar to the -following: - -[ 168] [Active ] [ ] [Started ] [ 60] Apache ServiceMix NMR Example:: NMR Endpoint (1.1.0.2) -[ 169] [Active ] [ ] [Started ] [ 60] Apache ServiceMix NMR Example:: NMR Client (1.1.0.2) - -In this case, the bundle IDs are 168 and 169. - -To stop the example, enter the following command at the ServiceMix -console: - - osgi:stop <bundle_id> - -To uninstall the example, enter one of the following commands in -the ServiceMix console: - - features:uninstall examples-nmr - -or - - osgi:uninstall <bundle_id> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/servicemix-features/blob/d358d2ea/examples/nmr/basic/client/pom.xml ---------------------------------------------------------------------- diff --git a/examples/nmr/basic/client/pom.xml b/examples/nmr/basic/client/pom.xml deleted file mode 100644 index f0d221e..0000000 --- a/examples/nmr/basic/client/pom.xml +++ /dev/null @@ -1,81 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - - <!-- - - 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. - --> - - <modelVersion>4.0.0</modelVersion> - - <parent> - <groupId>org.apache.servicemix.examples</groupId> - <artifactId>org.apache.servicemix.examples.nmr</artifactId> - <version>4.6.0-SNAPSHOT</version> - </parent> - - <groupId>org.apache.servicemix.examples</groupId> - <artifactId>org.apache.servicemix.examples.nmr.client</artifactId> - <packaging>bundle</packaging> - <name>Apache ServiceMix :: Examples :: NMR :: Endpoint and Client :: Client</name> - - <description>Example bundle for registering and interacting with the NMR as a client</description> - - <dependencies> - <dependency> - <groupId>org.apache.servicemix.nmr</groupId> - <artifactId>org.apache.servicemix.nmr.api</artifactId> - </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-api</artifactId> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>org.osgi</groupId> - <artifactId>org.osgi.core</artifactId> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-beans</artifactId> - <scope>provided</scope> - </dependency> - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>org.apache.felix</groupId> - <artifactId>maven-bundle-plugin</artifactId> - <configuration> - <instructions> - <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName> - <Bundle-Description>${project.description}</Bundle-Description> - <Import-Package> - org.slf4j, - org.apache.servicemix.nmr.api, - org.apache.servicemix.nmr.api.service, - org.osgi.framework, - org.springframework.beans.factory;version="${spring.import.range}" - </Import-Package> - <Private-Package>org.apache.servicemix.nmr.examples.nmr.client</Private-Package> - </instructions> - </configuration> - </plugin> - </plugins> - </build> -</project> http://git-wip-us.apache.org/repos/asf/servicemix-features/blob/d358d2ea/examples/nmr/basic/client/src/main/java/org/apache/servicemix/nmr/examples/nmr/client/Client.java ---------------------------------------------------------------------- diff --git a/examples/nmr/basic/client/src/main/java/org/apache/servicemix/nmr/examples/nmr/client/Client.java b/examples/nmr/basic/client/src/main/java/org/apache/servicemix/nmr/examples/nmr/client/Client.java deleted file mode 100644 index 2ae73d0..0000000 --- a/examples/nmr/basic/client/src/main/java/org/apache/servicemix/nmr/examples/nmr/client/Client.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * 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. - */ -package org.apache.servicemix.nmr.examples.nmr.client; - -import org.apache.servicemix.nmr.api.Channel; -import org.apache.servicemix.nmr.api.Endpoint; -import org.apache.servicemix.nmr.api.Exchange; -import org.apache.servicemix.nmr.api.NMR; -import org.apache.servicemix.nmr.api.Pattern; -import org.apache.servicemix.nmr.api.Status; -import org.apache.servicemix.nmr.api.Reference; -import org.apache.servicemix.nmr.api.service.ServiceHelper; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.DisposableBean; -import org.springframework.beans.factory.InitializingBean; - -public class Client implements InitializingBean, DisposableBean, Runnable { - - private final Logger logger = LoggerFactory.getLogger(Client.class); - - private NMR nmr; - - private Thread sendRequestThread; - private volatile boolean run = true; - - public void afterPropertiesSet() throws Exception { - sendRequestThread = new Thread(this); - sendRequestThread.start(); - - } - - public void destroy() throws Exception { - run = false; - if (sendRequestThread != null) { - sendRequestThread.interrupt(); - } - } - - public void setNmr(NMR nmr) { - this.nmr = nmr; - } - - public NMR getNmr() { - return nmr; - } - - public void run() { - Channel client = null; - try { - // Create the client channel - client = nmr.createChannel(); - // Create a reference that will be used as the target for our exchanges - Reference ref = nmr.getEndpointRegistry().lookup(ServiceHelper.createMap(Endpoint.NAME, "EchoEndpoint")); - while (run) { - try { - // Create an exchange and send it - Exchange e = client.createExchange(Pattern.InOut); - e.setTarget(ref); - e.getIn().setBody("Hello"); - client.sendSync(e); - logger.info("Response from Endpoint {}", e.getOut().getBody()); - // Send back the Done status - e.setStatus(Status.Done); - client.send(e); - } catch (Exception e) { - e.printStackTrace(); - logger.error(e.getMessage()); - } - // Sleep a bit - try { - Thread.sleep(5000); - } catch (InterruptedException e) { - } - } - } finally { - if (client != null) { - client.close(); - } - } - } - -} - http://git-wip-us.apache.org/repos/asf/servicemix-features/blob/d358d2ea/examples/nmr/basic/client/src/main/resources/META-INF/spring/beans.xml ---------------------------------------------------------------------- diff --git a/examples/nmr/basic/client/src/main/resources/META-INF/spring/beans.xml b/examples/nmr/basic/client/src/main/resources/META-INF/spring/beans.xml deleted file mode 100644 index fb548c2..0000000 --- a/examples/nmr/basic/client/src/main/resources/META-INF/spring/beans.xml +++ /dev/null @@ -1,39 +0,0 @@ -<?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. ---> -<beans xmlns="http://www.springframework.org/schema/beans" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:osgi="http://www.springframework.org/schema/osgi" - xmlns:util="http://www.springframework.org/schema/util" - xsi:schemaLocation=" - http://www.springframework.org/schema/beans - http://www.springframework.org/schema/beans/spring-beans.xsd - http://www.springframework.org/schema/util - http://www.springframework.org/schema/util/spring-util.xsd - http://www.springframework.org/schema/osgi - http://www.springframework.org/schema/osgi/spring-osgi.xsd"> - - <!-- NMR --> - <osgi:reference id="nmr" - interface="org.apache.servicemix.nmr.api.NMR" - cardinality="1..1" /> - - <!-- client --> - <bean id="client" class="org.apache.servicemix.nmr.examples.nmr.client.Client"> - <property name="nmr" ref="nmr" /> - </bean> -</beans> http://git-wip-us.apache.org/repos/asf/servicemix-features/blob/d358d2ea/examples/nmr/basic/endpoint/pom.xml ---------------------------------------------------------------------- diff --git a/examples/nmr/basic/endpoint/pom.xml b/examples/nmr/basic/endpoint/pom.xml deleted file mode 100644 index 2ff98dc..0000000 --- a/examples/nmr/basic/endpoint/pom.xml +++ /dev/null @@ -1,70 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - - <!-- - - 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. - --> - - <modelVersion>4.0.0</modelVersion> - - <parent> - <groupId>org.apache.servicemix.examples</groupId> - <artifactId>org.apache.servicemix.examples.nmr</artifactId> - <version>4.6.0-SNAPSHOT</version> - </parent> - - <groupId>org.apache.servicemix.examples</groupId> - <artifactId>org.apache.servicemix.examples.nmr.endpoint</artifactId> - <packaging>bundle</packaging> - <name>Apache ServiceMix :: Examples :: NMR :: Endpoint and Client :: Endpoint</name> - - <description>Example bundle for registering and implementing a new NMR endpoint</description> - - <dependencies> - <dependency> - <groupId>org.apache.servicemix.nmr</groupId> - <artifactId>org.apache.servicemix.nmr.api</artifactId> - </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-api</artifactId> - <scope>provided</scope> - </dependency> - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>org.apache.felix</groupId> - <artifactId>maven-bundle-plugin</artifactId> - <configuration> - <instructions> - <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName> - <Bundle-Description>${project.description}</Bundle-Description> - <Import-Package> - org.slf4j, - org.apache.servicemix.nmr.api - </Import-Package> - <Private-Package>org.apache.servicemix.nmr.examples.nmr.endpoint</Private-Package> - </instructions> - </configuration> - </plugin> - </plugins> - </build> - - -</project> http://git-wip-us.apache.org/repos/asf/servicemix-features/blob/d358d2ea/examples/nmr/basic/endpoint/src/main/java/org/apache/servicemix/nmr/examples/nmr/endpoint/EchoEndpoint.java ---------------------------------------------------------------------- diff --git a/examples/nmr/basic/endpoint/src/main/java/org/apache/servicemix/nmr/examples/nmr/endpoint/EchoEndpoint.java b/examples/nmr/basic/endpoint/src/main/java/org/apache/servicemix/nmr/examples/nmr/endpoint/EchoEndpoint.java deleted file mode 100644 index 0e8bbfb..0000000 --- a/examples/nmr/basic/endpoint/src/main/java/org/apache/servicemix/nmr/examples/nmr/endpoint/EchoEndpoint.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * 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. - */ -package org.apache.servicemix.nmr.examples.nmr.endpoint; - -import org.apache.servicemix.nmr.api.Channel; -import org.apache.servicemix.nmr.api.Endpoint; -import org.apache.servicemix.nmr.api.Exchange; -import org.apache.servicemix.nmr.api.Status; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class EchoEndpoint implements Endpoint { - - private final Logger logger = LoggerFactory.getLogger(EchoEndpoint.class); - - private Channel channel; - - public void process(Exchange exchange) { - if (exchange.getStatus().equals(Status.Active)) { - logger.info("Received in EchoEndpoint: {}", exchange.getIn().getBody()); - exchange.getOut().setBody("Echo" + exchange.getIn().getBody(), String.class); - channel.send(exchange); - } - } - - public void setChannel(Channel channel) { - this.channel = channel; - } - -} - http://git-wip-us.apache.org/repos/asf/servicemix-features/blob/d358d2ea/examples/nmr/basic/endpoint/src/main/resources/META-INF/spring/beans.xml ---------------------------------------------------------------------- diff --git a/examples/nmr/basic/endpoint/src/main/resources/META-INF/spring/beans.xml b/examples/nmr/basic/endpoint/src/main/resources/META-INF/spring/beans.xml deleted file mode 100644 index 7d2ca24..0000000 --- a/examples/nmr/basic/endpoint/src/main/resources/META-INF/spring/beans.xml +++ /dev/null @@ -1,44 +0,0 @@ -<?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. ---> -<beans xmlns="http://www.springframework.org/schema/beans" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:osgi="http://www.springframework.org/schema/osgi" - xmlns:util="http://www.springframework.org/schema/util" - xsi:schemaLocation=" - http://www.springframework.org/schema/beans - http://www.springframework.org/schema/beans/spring-beans.xsd - http://www.springframework.org/schema/util - http://www.springframework.org/schema/util/spring-util.xsd - http://www.springframework.org/schema/osgi - http://www.springframework.org/schema/osgi/spring-osgi.xsd"> - - <!-- Echo Endpoint --> - <bean id="echo" class="org.apache.servicemix.nmr.examples.nmr.endpoint.EchoEndpoint" /> - - <osgi:service ref="echo"> - <osgi:interfaces> - <value>org.apache.servicemix.nmr.api.Endpoint</value> - </osgi:interfaces> - <osgi:service-properties> - <entry key="NAME"> - <value>EchoEndpoint</value> - </entry> - </osgi:service-properties> - </osgi:service> - -</beans> http://git-wip-us.apache.org/repos/asf/servicemix-features/blob/d358d2ea/examples/nmr/basic/pom.xml ---------------------------------------------------------------------- diff --git a/examples/nmr/basic/pom.xml b/examples/nmr/basic/pom.xml deleted file mode 100644 index 2a7ea57..0000000 --- a/examples/nmr/basic/pom.xml +++ /dev/null @@ -1,40 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - - <!-- - - 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. - --> - - <modelVersion>4.0.0</modelVersion> - - <parent> - <groupId>org.apache.servicemix.examples</groupId> - <artifactId>nmr</artifactId> - <version>4.6.0-SNAPSHOT</version> - </parent> - - <groupId>org.apache.servicemix.examples</groupId> - <artifactId>org.apache.servicemix.examples.nmr</artifactId> - <packaging>pom</packaging> - <name>Apache ServiceMix :: Examples :: NMR :: Endpoint and Client</name> - - <modules> - <module>endpoint</module> - <module>client</module> - </modules> - -</project> http://git-wip-us.apache.org/repos/asf/servicemix-features/blob/d358d2ea/examples/nmr/camel-nmr-blueprint/README.txt ---------------------------------------------------------------------- diff --git a/examples/nmr/camel-nmr-blueprint/README.txt b/examples/nmr/camel-nmr-blueprint/README.txt deleted file mode 100644 index 7ab41a9..0000000 --- a/examples/nmr/camel-nmr-blueprint/README.txt +++ /dev/null @@ -1,239 +0,0 @@ -/* - * 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. - */ - -CAMEL BLUEPRINT NMR EXAMPLE -=========================== - -Purpose -------- -Using Blueprint, this example deploys two Camel EIP routes that communicate -with each other via the ServiceMix NMR. - - -Explanation ------------ -The NMR is a general-purpose message bus that applications can -use to communicate within the ServiceMix OSGi container. It is -modeled on the Normalized Message Router (NMR) defined in the -Java Business Integration (JBI) specification. - -The Camel routes are defined in the beans.xml file that is located -in the src/main/resources/OSGI-INF/blueprint directory of this example. -The contents of the blueprint.xml file can be explained as follows: - -1. Defines a route that generates a heartbeat message every - 2000ms and sends it to the NMR. - -2. Defines a second route that receives the message from the NMR, - transforms the heartbeat into a message containing the current - date and time, and logs the message. - -The routes are deployed in an OSGi bundle. - - -Prerequisites for Building and Running the Example --------------------------------------------------- -1. You must have the following installed on your machine: - - - JDK 1.6 or higher - - - Maven 2.2.1 or higher (for building) - - For more information, see the README in the top-level examples - directory. - - -2. Start ServiceMix by running the following command: - - <servicemix_home>/bin/servicemix (on UNIX) - <servicemix_home>\bin\servicemix (on Windows) - - -Running the Example -------------------- -You can run the example in two ways: - -- A. Using a Prebuilt Deployment Bundle: Quick and Easy - This option is useful if you want to see the example up and - running quickly. - -- B. Building the Example Bundle Yourself - This option is useful if you want to change the example in any - way. It tells you how to build and deploy the example. This - option might be slower than option A because if you do not - already have the required bundles in your local Maven - repository, Maven will have to download the bundles it needs. - - -Updating and Redeploying the Properties File from the Console -------------------------------------------------------------- -You can update and redeploy the properties file that is used by the -properties placeholder in the blueprint.xml from console as follows: - -1. Edit the org.apache.servicemix.examples.cfg file, located in the - same folder as this README, by changing the value of the "prefix" - key to whatever you want (for example, YourTransform). - -2. Copy the updated configuration file to your <servicemix_home>/etc - directory. You can do this from the ServiceMix console by typing: - - copy $YOUR_SERVICEMIX_HOME/examples/camel-osgi/org.apache.servicemix.examples.cfg - $YOUR_SERVICEMIX_HOME/etc - - On Windows you need to replace / in the path with \\. - - Note, the text you are typing might intermingle with the output - being logged. This is nothing to worry about. - -3. Restart the example bundle: - - (i) First you must know the bundle ID that ServiceMix has assigned - to it. To get the bundle ID, enter the following command in the - ServiceMix console: - - osgi:list - - At the end of the listing, you should see an entry similar to - the following: - - [ 185] [Active ] [Created ] [ ] [ 60] Apache ServiceMix :: Features :: Examples :: Camel NMR Blueprint (${project.version}) - - In this case, the bundle ID is 185. - - (ii) Enter the following command in the ServiceMix console to - restart the bundle: - - osgi:restart <bundle_id> - - The prefix of the output should change, and the output should look - similar to the following: - - >>>> YourTransform set body: Tue Aug 11 17:14:12 BST 2009 - >>>> YourTransform set body: Tue Aug 11 17:14:14 BST 2009 - >>>> YourTransform set body: Tue Aug 11 17:14:16 BST 2009 - -For information on how to stop and/or uninstall the example, see -"Stopping and Uninstalling the Example" below. - - -A. Using a Prebuilt Deployment Bundle:Quick and Easy ----------------------------------------------------- -To install and run a prebuilt version of this example, enter -the following command in the ServiceMix console: - - features:install examples-camel-nmr-blueprint - -This command makes use of the ServiceMix features facility. For -more information about the features facility, see the README.txt -file in the examples parent directory. - -Once the example is running you should see output similar to -the following being logged to the console screen: - ->>>> Blueprint-NMR-Example set body: Mon Jan 10 09:00:24 CET 2011 ->>>> Blueprint-NMR-Example set body: Mon Jan 10 09:00:26 CET 2011 ->>>> Blueprint-NMR-Example set body: Mon Jan 10 09:00:28 CET 2011 - -For information on how to stop and/or uninstall the example, -see "Stopping and Uninstalling the Example" below. - -B. Building the Example Bundle Yourself ---------------------------------------- -To install and run the example where you build the example -bundle yourself, complete the following steps: - -1. If you have already run the example using the prebuilt - version as described above, you must first uninstall the - examples-camel-nmr feature by entering the following command - in the ServiceMix console: - - features:uninstall examples-camel-nmr-blueprint - -2. Build the example by opening a command prompt, changing - directory to examples/camel-nmr (this example) and entering - the following Maven command: - - mvn install - - If all of the required OSGi bundles are available in your - local Maven repository, the example will build quickly. - Otherwise it may take some time for Maven to download - everything it needs. - - The mvn install command builds the example deployment bundle and - copies it to your local Maven repository and to the target - directory of this example. - -3. Install the example by entering the following command in - the ServiceMix console: - - features:install examples-camel-nmr-blueprint - - This command makes use of the ServiceMix features facility. For - more information about the features facility, see the README.txt - file in the examples parent directory. - -Once the example is running you should see output similar to the -following being logged to the console screen: - ->>>> Blueprint-NMR-Example set body: Mon Jan 10 09:00:24 CET 2011 ->>>> Blueprint-NMR-Example set body: Mon Jan 10 09:00:26 CET 2011 ->>>> Blueprint-NMR-Example set body: Mon Jan 10 09:00:28 CET 2011 - -Stopping and Uninstalling the Example -------------------------------------- -To stop the example, first you must know the bundle ID that ServiceMix -has assigned to it. To get the bundle ID, enter the following command -in the ServiceMix console (Note, the text you are typing will -intermingle with the output being logged. This is nothing to worry -about.): - - osgi:list - -At the end of the listing, you should see an entry similar to the -following: - - [ 185] [Active ] [Created ] [ ] [ 60] Apache ServiceMix :: Features :: Examples :: Camel NMR Blueprint (${project.version}) - -In this case, the bundle ID is 185. - -To stop the example, enter the following command in the ServiceMix -console: - - osgi:stop <bundle_id> - -For example: - - osgi:stop 185 - -To uninstall the example, enter one of the following commands -in the ServiceMix console: - - features:uninstall examples-camel-nmr-blueprint - -or - - osgi:uninstall <bundle_id> - - -Viewing the Log Entries ------------------------ -You can view the entries in the log file in the data/log -directory of your ServiceMix installation, or by typing the -following command in the ServiceMix console: - - log:display http://git-wip-us.apache.org/repos/asf/servicemix-features/blob/d358d2ea/examples/nmr/camel-nmr-blueprint/org.apache.servicemix.examples.cfg ---------------------------------------------------------------------- diff --git a/examples/nmr/camel-nmr-blueprint/org.apache.servicemix.examples.cfg b/examples/nmr/camel-nmr-blueprint/org.apache.servicemix.examples.cfg deleted file mode 100644 index 16efba6..0000000 --- a/examples/nmr/camel-nmr-blueprint/org.apache.servicemix.examples.cfg +++ /dev/null @@ -1,22 +0,0 @@ -# -# 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. -# -# - - -prefix=YourTransform http://git-wip-us.apache.org/repos/asf/servicemix-features/blob/d358d2ea/examples/nmr/camel-nmr-blueprint/pom.xml ---------------------------------------------------------------------- diff --git a/examples/nmr/camel-nmr-blueprint/pom.xml b/examples/nmr/camel-nmr-blueprint/pom.xml deleted file mode 100644 index a70d02e..0000000 --- a/examples/nmr/camel-nmr-blueprint/pom.xml +++ /dev/null @@ -1,52 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - - <!-- - - 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. - --> - - <modelVersion>4.0.0</modelVersion> - - <parent> - <groupId>org.apache.servicemix.examples</groupId> - <artifactId>nmr</artifactId> - <version>4.6.0-SNAPSHOT</version> - </parent> - - <artifactId>camel-nmr-blueprint</artifactId> - <packaging>bundle</packaging> - <name>Apache ServiceMix :: Features :: Examples :: Camel NMR Blueprint</name> - <description>Camel example using NMR component and blueprint configuration</description> - - <build> - <plugins> - <plugin> - <groupId>org.apache.felix</groupId> - <artifactId>maven-bundle-plugin</artifactId> - <configuration> - <instructions> - <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName> - <Bundle-Description>${project.description}</Bundle-Description> - <Import-Package>org.apache.servicemix.camel.nmr,org.apache.servicemix.nmr.api,*</Import-Package> - <Private-Package>org.apache.servicemix.examples.camel</Private-Package> - </instructions> - </configuration> - </plugin> - </plugins> - </build> - -</project> http://git-wip-us.apache.org/repos/asf/servicemix-features/blob/d358d2ea/examples/nmr/camel-nmr-blueprint/src/main/java/org/apache/servicemix/examples/camel/MyTransform.java ---------------------------------------------------------------------- diff --git a/examples/nmr/camel-nmr-blueprint/src/main/java/org/apache/servicemix/examples/camel/MyTransform.java b/examples/nmr/camel-nmr-blueprint/src/main/java/org/apache/servicemix/examples/camel/MyTransform.java deleted file mode 100644 index 61d9d0e..0000000 --- a/examples/nmr/camel-nmr-blueprint/src/main/java/org/apache/servicemix/examples/camel/MyTransform.java +++ /dev/null @@ -1,54 +0,0 @@ -/** - * 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. - */ -package org.apache.servicemix.examples.camel; - -import java.util.Date; -import java.util.logging.Logger; - -/** - * @version $Revision: 640450 $ - */ -public class MyTransform { - private static final transient Logger logger = Logger.getLogger(MyTransform.class.getName()); - private boolean verbose = true; - private String prefix = "MyTransform"; - - public Object transform(Object body) { - String answer = prefix + " set body: " + new Date(); - if (verbose) { - System.out.println(">>>> " + answer); - } - logger.info(">>>> " + answer); - return answer; - } - - public boolean isVerbose() { - return verbose; - } - - public void setVerbose(boolean verbose) { - this.verbose = verbose; - } - - public String getPrefix() { - return prefix; - } - - public void setPrefix(String prefix) { - this.prefix = prefix; - } -} http://git-wip-us.apache.org/repos/asf/servicemix-features/blob/d358d2ea/examples/nmr/camel-nmr-blueprint/src/main/resources/OSGI-INF/blueprint/blueprint.xml ---------------------------------------------------------------------- diff --git a/examples/nmr/camel-nmr-blueprint/src/main/resources/OSGI-INF/blueprint/blueprint.xml b/examples/nmr/camel-nmr-blueprint/src/main/resources/OSGI-INF/blueprint/blueprint.xml deleted file mode 100644 index d9372ef..0000000 --- a/examples/nmr/camel-nmr-blueprint/src/main/resources/OSGI-INF/blueprint/blueprint.xml +++ /dev/null @@ -1,50 +0,0 @@ -<?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. - ---> -<blueprint - xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" - xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd"> - - <cm:property-placeholder persistent-id="org.apache.servicemix.examples"> - <cm:default-properties> - <cm:property name="prefix" value="Blueprint-NMR-Example"/> - </cm:default-properties> - </cm:property-placeholder> - - <camelContext xmlns="http://camel.apache.org/schema/blueprint"> - <!-- Route periodically sent events into the NMR --> - <route> - <from uri="timer://myTimer?fixedRate=true&period=2000&delay=5000" /> - <to uri="nmr:ExampleRouter" /> - </route> - <!-- Route exchange from the NMR endpoint to a log endpoint --> - <route> - <from uri="nmr:ExampleRouter" /> - <bean ref="myTransform" method="transform" /> - <to uri="log:ExampleRouter" /> - </route> - </camelContext> - - <bean id="myTransform" class="org.apache.servicemix.examples.camel.MyTransform"> - <property name="prefix" value="${prefix}" /> - </bean> - -</blueprint> http://git-wip-us.apache.org/repos/asf/servicemix-features/blob/d358d2ea/examples/nmr/camel-nmr/README.txt ---------------------------------------------------------------------- diff --git a/examples/nmr/camel-nmr/README.txt b/examples/nmr/camel-nmr/README.txt deleted file mode 100644 index 078ebb7..0000000 --- a/examples/nmr/camel-nmr/README.txt +++ /dev/null @@ -1,191 +0,0 @@ -/* - * 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. - */ - -CAMEL OSGI NMR EXAMPLE -====================== - -Purpose -------- -Deploys two Camel EIP routes that communicate with each other -via the ServiceMix NMR. - - -Explanation ------------ -The NMR is a general-purpose message bus that applications can -use to communicate within the ServiceMix OSGi container. It is -modeled on the Normalized Message Router (NMR) defined in the -Java Business Integration (JBI) specification. - -The Camel routes are defined in the beans.xml file that is located -in the src/main/resources/META-INF/spring directory of this example. -The contents of the beans.xml file can be explained as follows: - -1. Imports the camel-nmr.xml file, which instantiates and - initializes the NMR component. - -2. Defines a route that generates a heartbeat message every - 2000ms and sends it to the NMR. - -3. Defines a second route that receives the message from the NMR, - transforms the heartbeat into a message containing the current - date and time, and logs the message. - -The routes are deployed in an OSGi bundle. - - -Prerequisites for Building and Running the Example --------------------------------------------------- -1. You must have the following installed on your machine: - - - JDK 1.6 or higher - - - Maven 2.2.1 or higher (for building) - - For more information, see the README in the top-level examples - directory. - - -2. Start ServiceMix by running the following command: - - <servicemix_home>/bin/servicemix (on UNIX) - <servicemix_home>\bin\servicemix (on Windows) - - -Running the Example -------------------- -You can run the example in two ways: - -- A. Using a Prebuilt Deployment Bundle: Quick and Easy - This option is useful if you want to see the example up and - running quickly. - -- B. Building the Example Bundle Yourself - This option is useful if you want to change the example in any - way. It tells you how to build and deploy the example. This - option might be slower than option A because if you do not - already have the required bundles in your local Maven - repository, Maven will have to download the bundles it needs. - -A. Using a Prebuilt Deployment Bundle:Quick and Easy ----------------------------------------------------- -To install and run a prebuilt version of this example, enter -the following command in the ServiceMix console: - - features:install examples-camel-nmr - -This command makes use of the ServiceMix features facility. For -more information about the features facility, see the README.txt -file in the examples parent directory. - -Once the example is running you should see output similar to -the following being logged to the console screen: - ->>>> MyTransform set body: Wed Aug 05 11:52:40 BST 2009 ->>>> MyTransform set body: Wed Aug 05 11:52:42 BST 2009 ->>>> MyTransform set body: Wed Aug 05 11:52:44 BST 2009 - -For information on how to stop and/or uninstall the example, -see "Stopping and Uninstalling the Example" below. - -B. Building the Example Bundle Yourself ---------------------------------------- -To install and run the example where you build the example -bundle yourself, complete the following steps: - -1. If you have already run the example using the prebuilt - version as described above, you must first uninstall the - examples-camel-nmr feature by entering the following command - in the ServiceMix console: - - features:uninstall examples-camel-nmr - -2. Build the example by opening a command prompt, changing - directory to examples/camel-nmr (this example) and entering - the following Maven command: - - mvn install - - If all of the required OSGi bundles are available in your - local Maven repository, the example will build quickly. - Otherwise it may take some time for Maven to download - everything it needs. - - The mvn install command builds the example deployment bundle and - copies it to your local Maven repository and to the target - directory of this example. - -3. Install the example by entering the following command in - the ServiceMix console: - - features:install examples-camel-nmr - - This command makes use of the ServiceMix features facility. For - more information about the features facility, see the README.txt - file in the examples parent directory. - -Once the example is running you should see output similar to the -following being logged to the console screen: - ->>>> MyTransform set body: Wed Aug 05 11:52:40 BST 2009 ->>>> MyTransform set body: Wed Aug 05 11:52:42 BST 2009 ->>>> MyTransform set body: Wed Aug 05 11:52:44 BST 2009 - - -Stopping and Uninstalling the Example -------------------------------------- -To stop the example, first you must know the bundle ID that ServiceMix -has assigned to it. To get the bundle ID, enter the following command -in the ServiceMix console (Note, the text you are typing will -intermingle with the output being logged. This is nothing to worry -about.): - - osgi:list - -At the end of the listing, you should see an entry similar to the -following: - - [160] [Active ] [Started] [ 60] Apache ServiceMix Example :: Camel NMR (4.1.0.0) - -In this case, the bundle ID is 160. - -To stop the example, enter the following command in the ServiceMix -console: - - osgi:stop <bundle_id> - -For example: - - osgi:stop 160 - -To uninstall the example, enter one of the following commands -in the ServiceMix console: - - features:uninstall examples-camel-nmr - -or - - osgi:uninstall <bundle_id> - - -Viewing the Log Entries ------------------------ -You can view the entries in the log file in the data/log -directory of your ServiceMix installation, or by typing the -following command in the ServiceMix console: - - log:display http://git-wip-us.apache.org/repos/asf/servicemix-features/blob/d358d2ea/examples/nmr/camel-nmr/pom.xml ---------------------------------------------------------------------- diff --git a/examples/nmr/camel-nmr/pom.xml b/examples/nmr/camel-nmr/pom.xml deleted file mode 100644 index 0ed1f8a..0000000 --- a/examples/nmr/camel-nmr/pom.xml +++ /dev/null @@ -1,60 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - - <!-- - - 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. - --> - - <modelVersion>4.0.0</modelVersion> - - <parent> - <groupId>org.apache.servicemix.examples</groupId> - <artifactId>nmr</artifactId> - <version>4.6.0-SNAPSHOT</version> - </parent> - - <artifactId>camel-nmr</artifactId> - <packaging>bundle</packaging> - <name>Apache ServiceMix :: Features :: Examples :: Camel NMR</name> - <description>Camel Example using the Camel NMR component</description> - - <dependencies> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-api</artifactId> - <scope>provided</scope> - </dependency> - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>org.apache.felix</groupId> - <artifactId>maven-bundle-plugin</artifactId> - <configuration> - <instructions> - <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName> - <Bundle-Description>${project.description}</Bundle-Description> - <Import-Package>org.apache.servicemix.camel.nmr,org.apache.servicemix.nmr.api,*</Import-Package> - <Private-Package>org.apache.servicemix.examples.camel</Private-Package> - </instructions> - </configuration> - </plugin> - </plugins> - </build> - -</project> http://git-wip-us.apache.org/repos/asf/servicemix-features/blob/d358d2ea/examples/nmr/camel-nmr/src/main/java/org/apache/servicemix/examples/camel/MyTransform.java ---------------------------------------------------------------------- diff --git a/examples/nmr/camel-nmr/src/main/java/org/apache/servicemix/examples/camel/MyTransform.java b/examples/nmr/camel-nmr/src/main/java/org/apache/servicemix/examples/camel/MyTransform.java deleted file mode 100644 index c803d74..0000000 --- a/examples/nmr/camel-nmr/src/main/java/org/apache/servicemix/examples/camel/MyTransform.java +++ /dev/null @@ -1,56 +0,0 @@ -/** - * 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. - */ -package org.apache.servicemix.examples.camel; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.Date; - -/** - * @version $Revision: 640450 $ - */ -public class MyTransform { - private static final transient Logger LOG = LoggerFactory.getLogger(MyTransform.class); - private boolean verbose = true; - private String prefix = "MyTransform"; - - public Object transform(Object body) { - String answer = prefix + " set body: " + new Date(); - if (verbose) { - System.out.println(">>>> " + answer); - } - LOG.info(">>>> " + answer); - return answer; - } - - public boolean isVerbose() { - return verbose; - } - - public void setVerbose(boolean verbose) { - this.verbose = verbose; - } - - public String getPrefix() { - return prefix; - } - - public void setPrefix(String prefix) { - this.prefix = prefix; - } -} http://git-wip-us.apache.org/repos/asf/servicemix-features/blob/d358d2ea/examples/nmr/camel-nmr/src/main/resources/META-INF/spring/beans.xml ---------------------------------------------------------------------- diff --git a/examples/nmr/camel-nmr/src/main/resources/META-INF/spring/beans.xml b/examples/nmr/camel-nmr/src/main/resources/META-INF/spring/beans.xml deleted file mode 100644 index 17b5f2b..0000000 --- a/examples/nmr/camel-nmr/src/main/resources/META-INF/spring/beans.xml +++ /dev/null @@ -1,48 +0,0 @@ -<?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. ---> - -<beans xmlns="http://www.springframework.org/schema/beans" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:osgi="http://www.springframework.org/schema/osgi" - xmlns:camel="http://camel.apache.org/schema/spring" - xsi:schemaLocation=" - http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd - http://www.springframework.org/schema/osgi http://www.springframework.org/schema/osgi/spring-osgi.xsd - http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd"> - - <import resource="classpath:org/apache/servicemix/camel/nmr/camel-nmr.xml" /> - - <camel:camelContext xmlns="http://camel.apache.org/schema/spring"> - <!-- Route periodically sent events into the NMR --> - <route> - <from uri="timer://myTimer?fixedRate=true&period=2000&delay=5000"/> - <to uri="nmr:ExampleRouter"/> - </route> - <!-- Route exchange from the NMR endpoint to a log endpoint --> - <route> - <from uri="nmr:ExampleRouter"/> - <bean ref="myTransform" method="transform"/> - <to uri="log:ExampleRouter"/> - </route> - </camel:camelContext> - - <bean id="myTransform" class="org.apache.servicemix.examples.camel.MyTransform"> - <property name="prefix" value="MyTransform"/> - </bean> - -</beans> http://git-wip-us.apache.org/repos/asf/servicemix-features/blob/d358d2ea/examples/nmr/cxf-camel-nmr/README.txt ---------------------------------------------------------------------- diff --git a/examples/nmr/cxf-camel-nmr/README.txt b/examples/nmr/cxf-camel-nmr/README.txt deleted file mode 100644 index c13a638..0000000 --- a/examples/nmr/cxf-camel-nmr/README.txt +++ /dev/null @@ -1,196 +0,0 @@ -/* - * 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. - */ - -CXF, CAMEL and NMR EXAMPLE -========================== - -Purpose -------- -Create a Camel route that transforms a message, then passes it to a -CXF web service via the NMR. - - -Explanation ------------ -The Camel route is defined in the beans.xml file that is located -in the src/main/resources/META-INF/spring directory of this example. - -The route is defined in the <route> element and can be explained -as follows: - -1. A message flow is triggered every five seconds. - -2. It is sent to the MyTransform bean, which adds a SOAP message. - -3. It is sent via the NMR to the HelloWorld web service. - -4. Responses are routed to the display method of the MyTransform - class. - -The web service is defined as follows: - - <jaxws:endpoint id="helloWorld" - implementor="org.apache.servicemix.examples.cxfcamel.HelloWorldImpl" - address="nmr:HelloWorld" /> - - -Prerequisites for Running the Example -------------------------------------- -1. You must have the following installed on your machine: - - - JDK 1.6 or higher - - - Maven 2.2.1 or higher - - For more information, see the README in the top-level examples - directory. - - -2. Start ServiceMix by running the following command: - - <servicemix_home>/bin/servicemix (on UNIX) - <servicemix_home>\bin\servicemix (on Windows) - - -Running the Example -------------------- -You can run the example in two ways: - -- A. Using a Prebuilt Deployment Bundle: Quick and Easy -This option is useful if you want to see the example up and -running as quickly as possible. - -- B. Building the Example Bundle Yourself -This option is useful if you want to change the example in any -way. It tells you how to build and deploy the example. This -option might be slower than option A because, if you do not -already have the required bundles in your local Maven -repository, Maven will have to download the bundles it needs. - - -A. Using a Prebuilt Deployment Bundle: Quick and Easy ------------------------------------------------------ -To install and run a prebuilt version of this example, enter -the following command in the ServiceMix console: - - features:install examples-cxf-camel-nmr - -This command makes use of the ServiceMix features facility. For -more information about the features facility, see the README.txt -file in the examples parent directory. - -Once the example is running, periodic SOAP messages are displayed by -the transform method of the MyTransform class. These messages are routed -to the CXF endpoint, and the responses are routed to the display method -of the MyTransform class. You should see output similar to the following -being logged to your console screen: - ->>>> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> -<soap:Body><ns1:sayHi xmlns:ns1="http://cxf.examples.servicemix.apache.org/ -"><arg0>Guillaume</arg0></ns1:sayHi></soap:Body></soap:Envelope> -<<<< <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> -<soap:Body><ns2:sayHiResponse xmlns:ns2="http://cxfcamel.examples. -servicemix.apache.org/"><return>Hello Guillaume</return> -</ns2:sayHiResponse></soap:Body></soap:Envelope> - -For information on how to stop and/or uninstall the example, -see "Stopping and Uninstalling the Example" below. - - -B. Building the Example Bundle Yourself ---------------------------------------- -To install and run the example where you build the example bundle -yourself, complete the following steps: - -1. If you have already run the example using the prebuilt version as - described above, you must first uninstall the examples-cxf-camel-nmr - feature by entering the following command in the ServiceMix console: - - features:uninstall examples-cxf-camel-nmr - -2. Build the example by opening a command prompt, changing directory to - examples/cxf-camel-nmr (this example) and entering the following Maven - command: - - mvn install - - If all of the required OSGi bundles are available in your local Maven - repository, the example will build very quickly. Otherwise it may - take some time for Maven to download everything it needs. - - The mvn install command builds the example deployment bundle and - copies it to your local Maven repository and to the target directory - of this example. - -3. Install the example by entering the following command in - the ServiceMix console: - - features:install examples-cxf-camel-nmr - - It makes use of the ServiceMix features facility. For more information - about the features facility, see the README.txt file in the examples - parent directory. - -Once the example is running, periodic SOAP messages are displayed by -the transform method of the MyTransform class. These messages are routed -to the CXF endpoint, and the responses are routed to the display method -of the MyTransform class. You should see the messages displayed on your -console. - - -Stopping and Uninstalling the Example -------------------------------------- -To stop the example, you must first know the bundle ID that ServiceMix -has assigned to it. To get the bundle ID, enter the following command -in the ServiceMix console (Note, the text you are typing will intermingle -with the output being logged. This is nothing to worry about.): - - osgi:list - -At the end of the listing, you should see an entry similar to the -following: - - [165] [Active ] [Started] [ 60] Apache ServiceMix Example :: CXF-Camel NMR (4.1.0) - -In this case, the bundle ID is 165. - -To stop the example, enter the following command in the ServiceMix -console: - - osgi:stop <bundle_id> - -For example: - - osgi:stop 165 - -To uninstall the example, enter one of the following commands in -the ServiceMix console: - - features:uninstall examples-cxf-camel-nmr - -or - - osgi:uninstall <bundle_id> - - -Viewing the Log Entries ------------------------ -You can view the entries in the log file in the data/log -directory of your ServiceMix installation, or by typing -the following command in the ServiceMix console: - - log:display \ No newline at end of file http://git-wip-us.apache.org/repos/asf/servicemix-features/blob/d358d2ea/examples/nmr/cxf-camel-nmr/pom.xml ---------------------------------------------------------------------- diff --git a/examples/nmr/cxf-camel-nmr/pom.xml b/examples/nmr/cxf-camel-nmr/pom.xml deleted file mode 100644 index eb4df51..0000000 --- a/examples/nmr/cxf-camel-nmr/pom.xml +++ /dev/null @@ -1,83 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - - <!-- - - 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. - --> - - <modelVersion>4.0.0</modelVersion> - - <parent> - <groupId>org.apache.servicemix.examples</groupId> - <artifactId>nmr</artifactId> - <version>4.6.0-SNAPSHOT</version> - </parent> - - <artifactId>cxf-camel-nmr</artifactId> - <packaging>bundle</packaging> - <name>Apache ServiceMix :: Features :: Examples :: CXF-Camel NMR</name> - <description>CXF Example using the CXF NMR integration</description> - - <dependencies> - <dependency> - <groupId>org.apache.camel</groupId> - <artifactId>camel-core</artifactId> - </dependency> - <dependency> - <groupId>org.apache.geronimo.specs</groupId> - <artifactId>geronimo-ws-metadata_2.0_spec</artifactId> - </dependency> - <dependency> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - <scope>provided</scope> - </dependency> - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>org.apache.felix</groupId> - <artifactId>maven-bundle-plugin</artifactId> - <configuration> - <instructions> - <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName> - <Bundle-Description>${project.description}</Bundle-Description> - <Import-Package> - javax.jws, - javax.xml.namespace, - javax.wsdl, - META-INF.cxf, - META-INF.cxf.transport.nmr, - org.apache.cxf.bus, - org.apache.servicemix.camel.nmr, - org.apache.servicemix.cxf.transport.nmr, - org.apache.servicemix.nmr.api, - org.apache.servicemix.nmr.api.event, - org.apache.servicemix.nmr.api.internal, - org.springframework.beans.factory.config, - * - </Import-Package> - <Private-Package>org.apache.servicemix.examples.cxfcamel</Private-Package> - <Require-Bundle>org.apache.cxf.bundle</Require-Bundle> - </instructions> - </configuration> - </plugin> - </plugins> - </build> - -</project> http://git-wip-us.apache.org/repos/asf/servicemix-features/blob/d358d2ea/examples/nmr/cxf-camel-nmr/src/main/java/org/apache/servicemix/examples/cxfcamel/HelloWorld.java ---------------------------------------------------------------------- diff --git a/examples/nmr/cxf-camel-nmr/src/main/java/org/apache/servicemix/examples/cxfcamel/HelloWorld.java b/examples/nmr/cxf-camel-nmr/src/main/java/org/apache/servicemix/examples/cxfcamel/HelloWorld.java deleted file mode 100644 index d1216dd..0000000 --- a/examples/nmr/cxf-camel-nmr/src/main/java/org/apache/servicemix/examples/cxfcamel/HelloWorld.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * 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. - */ -// START SNIPPET: service -package org.apache.servicemix.examples.cxfcamel; - -import javax.jws.WebService; - -@WebService -public interface HelloWorld { - String sayHi(String text); -} -// END SNIPPET: service http://git-wip-us.apache.org/repos/asf/servicemix-features/blob/d358d2ea/examples/nmr/cxf-camel-nmr/src/main/java/org/apache/servicemix/examples/cxfcamel/HelloWorldImpl.java ---------------------------------------------------------------------- diff --git a/examples/nmr/cxf-camel-nmr/src/main/java/org/apache/servicemix/examples/cxfcamel/HelloWorldImpl.java b/examples/nmr/cxf-camel-nmr/src/main/java/org/apache/servicemix/examples/cxfcamel/HelloWorldImpl.java deleted file mode 100644 index d66c691..0000000 --- a/examples/nmr/cxf-camel-nmr/src/main/java/org/apache/servicemix/examples/cxfcamel/HelloWorldImpl.java +++ /dev/null @@ -1,31 +0,0 @@ -/** - * 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. - */ -// START SNIPPET: service -package org.apache.servicemix.examples.cxfcamel; - -import javax.jws.WebService; - -@WebService(endpointInterface = "org.apache.servicemix.examples.cxfcamel.HelloWorld") -public class HelloWorldImpl implements HelloWorld { - - public String sayHi(String text) { - return "Hello " + text; - } -} -// END SNIPPET: service http://git-wip-us.apache.org/repos/asf/servicemix-features/blob/d358d2ea/examples/nmr/cxf-camel-nmr/src/main/java/org/apache/servicemix/examples/cxfcamel/MyTransform.java ---------------------------------------------------------------------- diff --git a/examples/nmr/cxf-camel-nmr/src/main/java/org/apache/servicemix/examples/cxfcamel/MyTransform.java b/examples/nmr/cxf-camel-nmr/src/main/java/org/apache/servicemix/examples/cxfcamel/MyTransform.java deleted file mode 100644 index 4f042f4..0000000 --- a/examples/nmr/cxf-camel-nmr/src/main/java/org/apache/servicemix/examples/cxfcamel/MyTransform.java +++ /dev/null @@ -1,66 +0,0 @@ -/** - * 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. - */ -package org.apache.servicemix.examples.cxfcamel; - -import java.util.logging.Logger; - -import javax.xml.transform.Source; - -import org.apache.camel.StringSource; -import org.apache.camel.converter.jaxp.XmlConverter; - -/** - * @version $Revision: 640450 $ - */ -public class MyTransform { - - private static final transient Logger LOG = Logger.getLogger(MyTransform.class.getName()); - private boolean verbose = true; - private String value; - - public Object transform(Object body) { - if (verbose) { - System.out.println(">>>> " + value); - } - LOG.info(">>>> " + value); - return new StringSource(value); - } - - public void display(Source body) throws Exception { - String str = new XmlConverter().toString(body); - if (verbose) { - System.out.println("<<<< " + str); - } - LOG.info("<<<< " + str); - } - - public boolean isVerbose() { - return verbose; - } - - public void setVerbose(boolean verbose) { - this.verbose = verbose; - } - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } -} http://git-wip-us.apache.org/repos/asf/servicemix-features/blob/d358d2ea/examples/nmr/cxf-camel-nmr/src/main/resources/META-INF/MANIFEST.MF ---------------------------------------------------------------------- diff --git a/examples/nmr/cxf-camel-nmr/src/main/resources/META-INF/MANIFEST.MF b/examples/nmr/cxf-camel-nmr/src/main/resources/META-INF/MANIFEST.MF deleted file mode 100644 index 69b54b5..0000000 --- a/examples/nmr/cxf-camel-nmr/src/main/resources/META-INF/MANIFEST.MF +++ /dev/null @@ -1,5 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-SymbolicName: org.apache.servicemix.examples.cxfcamel -Bundle-Version: 1.0.0.SNAPSHOT -Import-Package: META-INF.cxf,META-INF.cxf.osgi,META-INF.cxf.transport.nmr,javax.jws
