Author: rfeng
Date: Fri Oct 24 16:15:04 2008
New Revision: 707779

URL: http://svn.apache.org/viewvc?rev=707779&view=rev
Log:
Add pom, mf and activator

Added:
    tuscany/branches/sca-equinox/samples/calculator-osgi/META-INF/
    tuscany/branches/sca-equinox/samples/calculator-osgi/META-INF/MANIFEST.MF
    tuscany/branches/sca-equinox/samples/calculator-osgi/pom.xml   (with props)
    
tuscany/branches/sca-equinox/samples/calculator-osgi/src/main/java/calculator/CalculatorActivator.java
   (with props)

Added: tuscany/branches/sca-equinox/samples/calculator-osgi/META-INF/MANIFEST.MF
URL: 
http://svn.apache.org/viewvc/tuscany/branches/sca-equinox/samples/calculator-osgi/META-INF/MANIFEST.MF?rev=707779&view=auto
==============================================================================
--- tuscany/branches/sca-equinox/samples/calculator-osgi/META-INF/MANIFEST.MF 
(added)
+++ tuscany/branches/sca-equinox/samples/calculator-osgi/META-INF/MANIFEST.MF 
Fri Oct 24 16:15:04 2008
@@ -0,0 +1,19 @@
+Manifest-Version: 1.0
+Private-Package: calculator;version="1.4"
+Tool: Bnd-0.0.255
+Bundle-Name: Apache Tuscany SCA Calculator OSGi Sample
+Created-By: 1.6.0_07 (Sun Microsystems Inc.)
+Bundle-Vendor: The Apache Software Foundation
+Eclipse-LazyStart: false
+Bundle-Version: 1.4
+Bnd-LastModified: 1223949424781
+Bundle-Activator: calculator.CalculatorActivator
+Bundle-ManifestVersion: 2
+Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
+Bundle-Description: Apache Tuscany SCA Calculator RCP Sample
+Import-Package: org.apache.tuscany.sca.node;version="1.4",
+ org.osgi.framework;version="1.4",
+ org.osoa.sca.annotations;version="1.4"
+Bundle-SymbolicName: sample-calculator-osgi
+Bundle-DocURL: http://www.apache.org/
+

Added: tuscany/branches/sca-equinox/samples/calculator-osgi/pom.xml
URL: 
http://svn.apache.org/viewvc/tuscany/branches/sca-equinox/samples/calculator-osgi/pom.xml?rev=707779&view=auto
==============================================================================
--- tuscany/branches/sca-equinox/samples/calculator-osgi/pom.xml (added)
+++ tuscany/branches/sca-equinox/samples/calculator-osgi/pom.xml Fri Oct 24 
16:15:04 2008
@@ -0,0 +1,147 @@
+<?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.    
+-->
+<project>
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.tuscany.sca</groupId>
+        <artifactId>tuscany-sca</artifactId>
+        <version>1.4-SNAPSHOT</version>
+        <relativePath>../../pom.xml</relativePath>
+    </parent>
+    <artifactId>sample-calculator-osgi</artifactId>
+    <name>Apache Tuscany SCA Calculator OSGi Sample</name>
+    <repositories>
+        <repository>
+            <id>apache.incubator</id>
+            <url>http://people.apache.org/repo/m2-incubating-repository
+            </url>
+        </repository>
+    </repositories>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-node-api</artifactId>
+            <version>1.4-SNAPSHOT</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-node-impl</artifactId>
+            <version>1.4-SNAPSHOT</version>
+            <scope>runtime</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-implementation-java-runtime</artifactId>
+            <version>1.4-SNAPSHOT</version>
+            <scope>runtime</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-implementation-node-runtime</artifactId>
+            <version>1.4-SNAPSHOT</version>
+            <scope>runtime</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.eclipse</groupId>
+            <artifactId>osgi</artifactId>
+            <version>3.3.0-v20070530</version>
+            <scope>compile</scope>
+        </dependency>
+        
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-extensibility-equinox</artifactId>
+            <version>1.4-SNAPSHOT</version>
+            <scope>runtime</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>4.5</version>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <finalName>${artifactId}</finalName>
+        <plugins>
+            <plugin>
+                <artifactId>maven-eclipse-plugin</artifactId>
+                <version>2.5.1</version>
+                <configuration>
+                    <buildcommands>
+                        
<buildcommand>org.eclipse.pde.ManifestBuilder</buildcommand>
+                        
<buildcommand>org.eclipse.jdt.core.javabuilder</buildcommand>
+                    </buildcommands>
+                    <projectnatures>
+                        
<projectnature>org.eclipse.jdt.core.javanature</projectnature>
+                        
<projectnature>org.eclipse.pde.PluginNature</projectnature>
+                    </projectnatures>
+                    <classpathContainers>
+                        
<classpathContainer>org.eclipse.jdt.launching.JRE_CONTAINER
+                        </classpathContainer>
+                    </classpathContainers>
+                </configuration>
+            </plugin>
+
+           <plugin>
+               <groupId>org.apache.felix</groupId>
+               <artifactId>maven-bundle-plugin</artifactId>
+               <version>1.4.3</version>
+               <extensions>true</extensions>
+               <executions>
+                   <execution>
+                       <id>bundle-manifest</id>
+                       <phase>process-classes</phase>
+                       <goals>
+                           <goal>manifest</goal>
+                       </goals>
+                       <configuration>
+                          <instructions>
+                              <Bundle-Version>1.4</Bundle-Version>
+                              
<Bundle-SymbolicName>sample.calculator.rcp;singleton:=true</Bundle-SymbolicName>
+                              
<Bundle-Description>${pom.name}</Bundle-Description>
+                              
<Bundle-Activator>calculator.rcp.Activator</Bundle-Activator>
+                              <Eclipse-LazyStart>true</Eclipse-LazyStart>
+                              <Export-Package></Export-Package>
+                          </instructions>
+                          
<manifestLocation>${basedir}/META-INF</manifestLocation>
+                       </configuration>
+                   </execution>
+               </executions>
+           </plugin> 
+
+            <plugin>
+                <artifactId>maven-jar-plugin</artifactId>
+                <configuration>
+                    <archive>
+                        
<manifestFile>${basedir}/META-INF/MANIFEST.MF</manifestFile>
+                    </archive>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+</project>

Propchange: tuscany/branches/sca-equinox/samples/calculator-osgi/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/branches/sca-equinox/samples/calculator-osgi/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: 
tuscany/branches/sca-equinox/samples/calculator-osgi/src/main/java/calculator/CalculatorActivator.java
URL: 
http://svn.apache.org/viewvc/tuscany/branches/sca-equinox/samples/calculator-osgi/src/main/java/calculator/CalculatorActivator.java?rev=707779&view=auto
==============================================================================
--- 
tuscany/branches/sca-equinox/samples/calculator-osgi/src/main/java/calculator/CalculatorActivator.java
 (added)
+++ 
tuscany/branches/sca-equinox/samples/calculator-osgi/src/main/java/calculator/CalculatorActivator.java
 Fri Oct 24 16:15:04 2008
@@ -0,0 +1,50 @@
+/*
+ * 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 calculator;
+
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.ContributionLocationHelper;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+/**
+ * Bundle Activator for Calculator
+ *
+ */
+public class CalculatorActivator implements BundleActivator {
+    private Node node;
+
+    public void start(BundleContext context) throws Exception {
+        NodeFactory factory = NodeFactory.newInstance();
+        String url = 
ContributionLocationHelper.getContributionLocation(getClass());
+        Contribution contrib = new Contribution("c1", url);
+        node = factory.createNode("Calculator.composite", contrib);
+        node.start();
+    }
+
+    public void stop(BundleContext context) throws Exception {
+        if (node != null) {
+            node.stop();
+            node = null;
+        }
+    }
+
+}

Propchange: 
tuscany/branches/sca-equinox/samples/calculator-osgi/src/main/java/calculator/CalculatorActivator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
tuscany/branches/sca-equinox/samples/calculator-osgi/src/main/java/calculator/CalculatorActivator.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date


Reply via email to