diff --git a/spring-integration-samples/README.txt b/spring-integration-samples/README.txt index 3d792f5e72..11f1e5cb6e 100644 --- a/spring-integration-samples/README.txt +++ b/spring-integration-samples/README.txt @@ -56,35 +56,4 @@ Open any project and you will see the 'lib' directory with all of the JARs required to run the demos. Now you can configure your IDE to point to those directories. -=============================================================================== -OSGi Samples ------------- - -The Hello World and Cafe samples listed above are both OSGi-enabled. Instead -of running those as standalone applications via their main() methods, you can -deploy them to an OSGi runtime and rely on the included BundleActivators. - -Before running those or any other OSGi-based applications that rely on Spring -Integration, you will need to deploy the necessary Spring Integration bundles -into the OSGi deployment environment (you can just copy all of the JARs within -the 'dist' directory of the distribution). You may also need some of the other -dependencies that are located within the 'lib' directory of the distribution. -For the detailed instructions, refer to the "Samples" Appendix of the Spring -Integration Reference Manual. - -This release also includes two new samples that are dedicated to showcasing -capabilities of the Spring Integration and OSGi combination. They form a -producer/consumer pair: osgi-inbound and osgi-outbound. Unlike the others, -they are not Maven-enabled, but instead they are ready to run directly within -SpringSource dm Server, and with the SpringSource Tool Suite support, this -requires only an import, adding "OSGi Bundle Project Nature" via the 'Spring -Tools' context menu, and deploying to a dm server instance as the project's -targeted runtime. A comprehensive overview of those OSGi samples is included -in the "Samples" Appendix of the Spring Integration Reference Manual. - -NOTE: Starting dmServer v2.0.M5 OSGi console is not available by default in -favor of dmShell. However you can re-enable the OSGi console by going to -{dm_home}/lib and adding osgi.console= to the -com.springsource.kernel.launch.properties file. - Happy integration :-) diff --git a/spring-integration-samples/osgi-inbound/.classpath b/spring-integration-samples/osgi-inbound/.classpath deleted file mode 100644 index bd5d5e5fc1..0000000000 --- a/spring-integration-samples/osgi-inbound/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/spring-integration-samples/osgi-inbound/.project b/spring-integration-samples/osgi-inbound/.project deleted file mode 100644 index 2d2281c566..0000000000 --- a/spring-integration-samples/osgi-inbound/.project +++ /dev/null @@ -1,30 +0,0 @@ - - - osgi-inbound - - - - - - org.eclipse.wst.common.project.facet.core.builder - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.springframework.ide.eclipse.core.springbuilder - - - - - - com.springsource.server.ide.facet.core.bundlenature - org.springframework.ide.eclipse.core.springnature - org.eclipse.jdt.core.javanature - org.eclipse.wst.common.project.facet.core.nature - - diff --git a/spring-integration-samples/osgi-inbound/build.xml b/spring-integration-samples/osgi-inbound/build.xml deleted file mode 100644 index 62b2d7f7c6..0000000000 --- a/spring-integration-samples/osgi-inbound/build.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/spring-integration-samples/osgi-inbound/src/META-INF/MANIFEST.MF b/spring-integration-samples/osgi-inbound/src/META-INF/MANIFEST.MF deleted file mode 100644 index 1fc003ca7f..0000000000 --- a/spring-integration-samples/osgi-inbound/src/META-INF/MANIFEST.MF +++ /dev/null @@ -1,13 +0,0 @@ -Manifest-Version: 1.0 -Bundle-Version: 2.0.0.BUILD-SNAPSHOT -Bundle-Name: org.springframework.integration.samples.osgi.inbound -Bundle-ManifestVersion: 2 -Bundle-SymbolicName: org.springframework.integration.samples.osgi.inbound -Bundle-Activator: org.springframework.integration.samples.osgi.inbound.InboundDemoBundleActivator -Import-Package: org.eclipse.osgi.framework.console;version="1.0.0", - org.osgi.framework;version="1.4.0", - org.osgi.service.packageadmin;version="1.2.0", - org.eclipse.osgi.util -Import-Library: org.springframework.spring;version="[3.0.0, 3.1.0)" -Import-Bundle: org.springframework.integration;version="[2.0.0, 2.1.0)", - org.springframework.integration.file;version="[2.0.0, 2.1.0)" diff --git a/spring-integration-samples/osgi-inbound/src/META-INF/spring/osgi-inbound.xml b/spring-integration-samples/osgi-inbound/src/META-INF/spring/osgi-inbound.xml deleted file mode 100644 index 32c1db800e..0000000000 --- a/spring-integration-samples/osgi-inbound/src/META-INF/spring/osgi-inbound.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - diff --git a/spring-integration-samples/osgi-inbound/src/org/springframework/integration/samples/osgi/inbound/InboundDemoBundleActivator.java b/spring-integration-samples/osgi-inbound/src/org/springframework/integration/samples/osgi/inbound/InboundDemoBundleActivator.java deleted file mode 100644 index fa78901770..0000000000 --- a/spring-integration-samples/osgi-inbound/src/org/springframework/integration/samples/osgi/inbound/InboundDemoBundleActivator.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright 2002-2009 the original author or authors. - * - * Licensed 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.springframework.integration.samples.osgi.inbound; - -import java.io.File; -import java.util.Dictionary; -import java.util.Hashtable; - -import org.eclipse.osgi.framework.console.CommandInterpreter; -import org.eclipse.osgi.framework.console.CommandProvider; -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; -import org.osgi.framework.Constants; -import org.osgi.framework.ServiceEvent; -import org.osgi.framework.ServiceListener; -import org.osgi.framework.ServiceReference; - -import org.springframework.context.ApplicationContext; -import org.springframework.util.Assert; - -/** - * Simple BundleActivator which will register a ServiceListener and serve as a - * CommandProvider for interpreting the 'siSend' command. It invokes a Spring - * Integration Gateway proxy when the command is invoked. - * - * @author Oleg Zhurakousky - * @since 1.0.3 - */ -public class InboundDemoBundleActivator implements BundleActivator, CommandProvider, ServiceListener { - - private BundleContext context; - - private InboundGateway gateway; - - - @SuppressWarnings("unchecked") - public void start(BundleContext context) throws Exception { - this.context = context; - this.context.addServiceListener(this); - Dictionary props = new Hashtable(); - context.registerService(CommandProvider.class.getName(), this, props); - } - - public void stop(BundleContext arg0) throws Exception {} - - public String getHelp() { - return "\n---Spring Integration CLI-based OSGi Demo---\n\t" + - "siSend - send text to be written to a file\n"; - } - - public void serviceChanged(ServiceEvent serviceEvent) { - ServiceReference sr = serviceEvent.getServiceReference(); - if (context.getBundle().getSymbolicName().equals(sr.getProperty(Constants.BUNDLE_SYMBOLICNAME))) { - ApplicationContext applicationContext = (ApplicationContext) context.getService(sr); - gateway = (InboundGateway) applicationContext.getBean("inboundGateway"); - } - } - - public void _siSend(CommandInterpreter ci){ - String message = ci.nextArgument(); - String filename = ci.nextArgument(); - Assert.notNull(message, "You must provide message as the first argument."); - Assert.notNull(filename, "You must provide a filename as the second argument."); - ci.println("Sending message: '" + message + "'"); - File file = gateway.sendMessage(message, filename); - ci.println("Message sent and its contents were written to: " + file.getAbsolutePath()); - } - -} diff --git a/spring-integration-samples/osgi-inbound/src/org/springframework/integration/samples/osgi/inbound/InboundGateway.java b/spring-integration-samples/osgi-inbound/src/org/springframework/integration/samples/osgi/inbound/InboundGateway.java deleted file mode 100644 index 16dd20f384..0000000000 --- a/spring-integration-samples/osgi-inbound/src/org/springframework/integration/samples/osgi/inbound/InboundGateway.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2002-2009 the original author or authors. - * - * Licensed 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.springframework.integration.samples.osgi.inbound; - -import java.io.File; - -import org.springframework.integration.annotation.Header; -import org.springframework.integration.file.FileHeaders; - -/** - * @author Oleg Zhurakousky - */ -public interface InboundGateway { - - public File sendMessage(String message, @Header(FileHeaders.FILENAME) String filename); - -} diff --git a/spring-integration-samples/osgi-outbound/.classpath b/spring-integration-samples/osgi-outbound/.classpath deleted file mode 100644 index bd5d5e5fc1..0000000000 --- a/spring-integration-samples/osgi-outbound/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/spring-integration-samples/osgi-outbound/.project b/spring-integration-samples/osgi-outbound/.project deleted file mode 100644 index e9d513d969..0000000000 --- a/spring-integration-samples/osgi-outbound/.project +++ /dev/null @@ -1,30 +0,0 @@ - - - osgi-outbound - - - - - - org.eclipse.wst.common.project.facet.core.builder - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.springframework.ide.eclipse.core.springbuilder - - - - - - com.springsource.server.ide.facet.core.bundlenature - org.springframework.ide.eclipse.core.springnature - org.eclipse.jdt.core.javanature - org.eclipse.wst.common.project.facet.core.nature - - diff --git a/spring-integration-samples/osgi-outbound/build.xml b/spring-integration-samples/osgi-outbound/build.xml deleted file mode 100644 index 73be1294f8..0000000000 --- a/spring-integration-samples/osgi-outbound/build.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/spring-integration-samples/osgi-outbound/src/META-INF/MANIFEST.MF b/spring-integration-samples/osgi-outbound/src/META-INF/MANIFEST.MF deleted file mode 100644 index 8b893f6f30..0000000000 --- a/spring-integration-samples/osgi-outbound/src/META-INF/MANIFEST.MF +++ /dev/null @@ -1,8 +0,0 @@ -Manifest-Version: 1.0 -Bundle-Version: 2.0.0.BUILD-SNAPSHOT -Bundle-Name: org.springframework.integration.samples.osgi.outbound -Bundle-ManifestVersion: 2 -Bundle-SymbolicName: org.springframework.integration.samples.osgi.outbound -Import-Bundle: org.springframework.integration;version="[2.0.0, 2.1.0)", - org.springframework.integration.file;version="[2.0.0, 2.1.0)" -Import-Library: org.springframework.spring;version="[3.0.0, 3.1.0)" \ No newline at end of file diff --git a/spring-integration-samples/osgi-outbound/src/META-INF/spring/osgi-outbound.xml b/spring-integration-samples/osgi-outbound/src/META-INF/spring/osgi-outbound.xml deleted file mode 100644 index c924111506..0000000000 --- a/spring-integration-samples/osgi-outbound/src/META-INF/spring/osgi-outbound.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - -