You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by mi...@apache.org on 2014/03/16 10:06:01 UTC

[12/50] [abbrv] git commit: [OLINGO-142] Enabled OSGi support

[OLINGO-142] Enabled OSGi support


Project: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/commit/1b4e3eeb
Tree: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/tree/1b4e3eeb
Diff: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/diff/1b4e3eeb

Branch: refs/heads/Olingo-129_PocJpaDataStore
Commit: 1b4e3eebdfafabaeb8019e73bebd95447e790135
Parents: 7c281ff
Author: Michael Bolz <mi...@apache.org>
Authored: Tue Feb 4 16:05:48 2014 +0100
Committer: Michael Bolz <mi...@apache.org>
Committed: Tue Feb 4 16:05:48 2014 +0100

----------------------------------------------------------------------
 .../annotation-processor-api/pom.xml            | 42 +++++++++++++
 .../processor/api/AnnotationServiceFactory.java |  2 +-
 .../annotation-processor-core/pom.xml           | 40 ++++++++++++
 .../core/AnnotationServiceFactoryImpl.java      | 63 -------------------
 .../core/rt/AnnotationServiceFactoryImpl.java   | 64 ++++++++++++++++++++
 .../core/AnnotationServiceFactoryImplTest.java  |  1 +
 .../annotation-processor-ref/pom.xml            | 38 ++++++++++++
 odata2-lib/odata-annotation/pom.xml             | 41 +++++++++++++
 8 files changed, 227 insertions(+), 64 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/1b4e3eeb/odata2-annotation-processor/annotation-processor-api/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-api/pom.xml b/odata2-annotation-processor/annotation-processor-api/pom.xml
index 0182f33..ecbb7e0 100644
--- a/odata2-annotation-processor/annotation-processor-api/pom.xml
+++ b/odata2-annotation-processor/annotation-processor-api/pom.xml
@@ -31,6 +31,48 @@
 
   <artifactId>olingo-odata2-annotation-processor-api-incubating</artifactId>
   <name>${project.artifactId}</name>
+
+  <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-jar-plugin</artifactId>
+        <configuration>
+          <archive>
+            <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
+          </archive>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.felix</groupId>
+        <artifactId>maven-bundle-plugin</artifactId>
+        <extensions>true</extensions>
+        <executions>
+          <execution>
+            <id>bundle-manifest</id>
+            <phase>process-classes</phase>
+            <goals>
+              <goal>manifest</goal>
+            </goals>
+          </execution>
+        </executions>
+        <configuration>
+          <instructions>
+            <Import-Package>
+              org.apache.olingo.odata2.annotation.processor.core.rt;resolution:=optional,
+              *
+            </Import-Package>
+            <Export-Package>
+              org.apache.olingo.odata2.annotation.processor.api;version=${project.version},
+              org.apache.olingo.odata2.annotation.processor.api.*;version=${project.version}
+            </Export-Package>
+            <Bundle-DocURL>${project.url}</Bundle-DocURL>
+            <Bundle-ActivationPolicy>lazy</Bundle-ActivationPolicy>
+            <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
+          </instructions>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
         
   <dependencies>
     <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/1b4e3eeb/odata2-annotation-processor/annotation-processor-api/src/main/java/org/apache/olingo/odata2/annotation/processor/api/AnnotationServiceFactory.java
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-api/src/main/java/org/apache/olingo/odata2/annotation/processor/api/AnnotationServiceFactory.java b/odata2-annotation-processor/annotation-processor-api/src/main/java/org/apache/olingo/odata2/annotation/processor/api/AnnotationServiceFactory.java
index aa03f38..9db29ff 100644
--- a/odata2-annotation-processor/annotation-processor-api/src/main/java/org/apache/olingo/odata2/annotation/processor/api/AnnotationServiceFactory.java
+++ b/odata2-annotation-processor/annotation-processor-api/src/main/java/org/apache/olingo/odata2/annotation/processor/api/AnnotationServiceFactory.java
@@ -31,7 +31,7 @@ import org.apache.olingo.odata2.api.exception.ODataException;
 public abstract class AnnotationServiceFactory {
 
   private static final String IMPLEMENTATION =
-      "org.apache.olingo.odata2.annotation.processor.core.AnnotationServiceFactoryImpl";
+      "org.apache.olingo.odata2.annotation.processor.core.rt.AnnotationServiceFactoryImpl";
 
   /**
    * Create a runtime delegate instance from the core library. The core

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/1b4e3eeb/odata2-annotation-processor/annotation-processor-core/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-core/pom.xml b/odata2-annotation-processor/annotation-processor-core/pom.xml
index 8ed093e..89d85f5 100644
--- a/odata2-annotation-processor/annotation-processor-core/pom.xml
+++ b/odata2-annotation-processor/annotation-processor-core/pom.xml
@@ -24,6 +24,46 @@
     <relativePath>..</relativePath>
   </parent>
 
+  <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-jar-plugin</artifactId>
+        <configuration>
+          <archive>
+            <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
+          </archive>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.felix</groupId>
+        <artifactId>maven-bundle-plugin</artifactId>
+        <extensions>true</extensions>
+        <executions>
+          <execution>
+            <id>bundle-manifest</id>
+            <phase>process-classes</phase>
+            <goals>
+              <goal>manifest</goal>
+            </goals>
+          </execution>
+        </executions>
+        <configuration>
+          <instructions>
+            <Import-Package>
+              *
+            </Import-Package>
+            <Export-Package>
+              org.apache.olingo.odata2.annotation.processor.core.rt;version=${project.version}
+            </Export-Package>
+            <Bundle-DocURL>${project.url}</Bundle-DocURL>
+            <Bundle-ActivationPolicy>lazy</Bundle-ActivationPolicy>
+            <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
+          </instructions>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+
   <dependencies>
     <dependency>
       <groupId>org.apache.olingo</groupId>

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/1b4e3eeb/odata2-annotation-processor/annotation-processor-core/src/main/java/org/apache/olingo/odata2/annotation/processor/core/AnnotationServiceFactoryImpl.java
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-core/src/main/java/org/apache/olingo/odata2/annotation/processor/core/AnnotationServiceFactoryImpl.java b/odata2-annotation-processor/annotation-processor-core/src/main/java/org/apache/olingo/odata2/annotation/processor/core/AnnotationServiceFactoryImpl.java
deleted file mode 100644
index d8e0c7e..0000000
--- a/odata2-annotation-processor/annotation-processor-core/src/main/java/org/apache/olingo/odata2/annotation/processor/core/AnnotationServiceFactoryImpl.java
+++ /dev/null
@@ -1,63 +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.olingo.odata2.annotation.processor.core;
-
-import java.util.Collection;
-
-import org.apache.olingo.odata2.annotation.processor.api.AnnotationServiceFactory.AnnotationServiceFactoryInstance;
-import org.apache.olingo.odata2.annotation.processor.core.datasource.AnnotationInMemoryDs;
-import org.apache.olingo.odata2.annotation.processor.core.datasource.AnnotationValueAccess;
-import org.apache.olingo.odata2.annotation.processor.core.edm.AnnotationEdmProvider;
-import org.apache.olingo.odata2.api.ODataService;
-import org.apache.olingo.odata2.api.exception.ODataException;
-import org.apache.olingo.odata2.api.rt.RuntimeDelegate;
-
-/**
- * AnnotationServiceFactoryInstance (ODataServiceFactory) implementation based on ListProcessor
- * in combination with Annotation-Support-Classes for EdmProvider, DataSource and ValueAccess.
- */
-public class AnnotationServiceFactoryImpl implements AnnotationServiceFactoryInstance {
-  /**
-   * {@inheritDoc}
-   */
-  @Override
-  public ODataService createAnnotationService(final String modelPackage) throws ODataException {
-    AnnotationEdmProvider edmProvider = new AnnotationEdmProvider(modelPackage);
-    AnnotationInMemoryDs dataSource = new AnnotationInMemoryDs(modelPackage);
-    AnnotationValueAccess valueAccess = new AnnotationValueAccess();
-
-    // Edm via Annotations and ListProcessor via AnnotationDS with AnnotationsValueAccess
-    return RuntimeDelegate.createODataSingleProcessorService(edmProvider,
-        new ListsProcessor(dataSource, valueAccess));
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  @Override
-  public ODataService createAnnotationService(final Collection<Class<?>> annotatedClasses) throws ODataException {
-    AnnotationEdmProvider edmProvider = new AnnotationEdmProvider(annotatedClasses);
-    AnnotationInMemoryDs dataSource = new AnnotationInMemoryDs(annotatedClasses);
-    AnnotationValueAccess valueAccess = new AnnotationValueAccess();
-
-    // Edm via Annotations and ListProcessor via AnnotationDS with AnnotationsValueAccess
-    return RuntimeDelegate.createODataSingleProcessorService(edmProvider,
-        new ListsProcessor(dataSource, valueAccess));
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/1b4e3eeb/odata2-annotation-processor/annotation-processor-core/src/main/java/org/apache/olingo/odata2/annotation/processor/core/rt/AnnotationServiceFactoryImpl.java
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-core/src/main/java/org/apache/olingo/odata2/annotation/processor/core/rt/AnnotationServiceFactoryImpl.java b/odata2-annotation-processor/annotation-processor-core/src/main/java/org/apache/olingo/odata2/annotation/processor/core/rt/AnnotationServiceFactoryImpl.java
new file mode 100644
index 0000000..ed99a4b
--- /dev/null
+++ b/odata2-annotation-processor/annotation-processor-core/src/main/java/org/apache/olingo/odata2/annotation/processor/core/rt/AnnotationServiceFactoryImpl.java
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * 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.olingo.odata2.annotation.processor.core.rt;
+
+import java.util.Collection;
+
+import org.apache.olingo.odata2.annotation.processor.api.AnnotationServiceFactory.AnnotationServiceFactoryInstance;
+import org.apache.olingo.odata2.annotation.processor.core.ListsProcessor;
+import org.apache.olingo.odata2.annotation.processor.core.datasource.AnnotationInMemoryDs;
+import org.apache.olingo.odata2.annotation.processor.core.datasource.AnnotationValueAccess;
+import org.apache.olingo.odata2.annotation.processor.core.edm.AnnotationEdmProvider;
+import org.apache.olingo.odata2.api.ODataService;
+import org.apache.olingo.odata2.api.exception.ODataException;
+import org.apache.olingo.odata2.api.rt.RuntimeDelegate;
+
+/**
+ * AnnotationServiceFactoryInstance (ODataServiceFactory) implementation based on ListProcessor
+ * in combination with Annotation-Support-Classes for EdmProvider, DataSource and ValueAccess.
+ */
+public class AnnotationServiceFactoryImpl implements AnnotationServiceFactoryInstance {
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public ODataService createAnnotationService(final String modelPackage) throws ODataException {
+    AnnotationEdmProvider edmProvider = new AnnotationEdmProvider(modelPackage);
+    AnnotationInMemoryDs dataSource = new AnnotationInMemoryDs(modelPackage);
+    AnnotationValueAccess valueAccess = new AnnotationValueAccess();
+
+    // Edm via Annotations and ListProcessor via AnnotationDS with AnnotationsValueAccess
+    return RuntimeDelegate.createODataSingleProcessorService(edmProvider,
+        new ListsProcessor(dataSource, valueAccess));
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public ODataService createAnnotationService(final Collection<Class<?>> annotatedClasses) throws ODataException {
+    AnnotationEdmProvider edmProvider = new AnnotationEdmProvider(annotatedClasses);
+    AnnotationInMemoryDs dataSource = new AnnotationInMemoryDs(annotatedClasses);
+    AnnotationValueAccess valueAccess = new AnnotationValueAccess();
+
+    // Edm via Annotations and ListProcessor via AnnotationDS with AnnotationsValueAccess
+    return RuntimeDelegate.createODataSingleProcessorService(edmProvider,
+        new ListsProcessor(dataSource, valueAccess));
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/1b4e3eeb/odata2-annotation-processor/annotation-processor-core/src/test/java/org/apache/olingo/odata2/annotation/processor/core/AnnotationServiceFactoryImplTest.java
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-core/src/test/java/org/apache/olingo/odata2/annotation/processor/core/AnnotationServiceFactoryImplTest.java b/odata2-annotation-processor/annotation-processor-core/src/test/java/org/apache/olingo/odata2/annotation/processor/core/AnnotationServiceFactoryImplTest.java
index ddac573..f730d3a 100644
--- a/odata2-annotation-processor/annotation-processor-core/src/test/java/org/apache/olingo/odata2/annotation/processor/core/AnnotationServiceFactoryImplTest.java
+++ b/odata2-annotation-processor/annotation-processor-core/src/test/java/org/apache/olingo/odata2/annotation/processor/core/AnnotationServiceFactoryImplTest.java
@@ -27,6 +27,7 @@ import org.apache.olingo.odata2.annotation.processor.core.model.Photo;
 import org.apache.olingo.odata2.annotation.processor.core.model.RefBase;
 import org.apache.olingo.odata2.annotation.processor.core.model.Room;
 import org.apache.olingo.odata2.annotation.processor.core.model.Team;
+import org.apache.olingo.odata2.annotation.processor.core.rt.AnnotationServiceFactoryImpl;
 import org.apache.olingo.odata2.api.ODataService;
 import org.apache.olingo.odata2.api.exception.ODataException;
 import org.junit.Test;

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/1b4e3eeb/odata2-annotation-processor/annotation-processor-ref/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-ref/pom.xml b/odata2-annotation-processor/annotation-processor-ref/pom.xml
index 91aaaa2..bd247f2 100644
--- a/odata2-annotation-processor/annotation-processor-ref/pom.xml
+++ b/odata2-annotation-processor/annotation-processor-ref/pom.xml
@@ -26,6 +26,44 @@
 
   <build>
     <finalName>${project.artifactId}</finalName>
+    <plugins>
+      <plugin>
+        <artifactId>maven-jar-plugin</artifactId>
+        <configuration>
+          <archive>
+            <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
+          </archive>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.felix</groupId>
+        <artifactId>maven-bundle-plugin</artifactId>
+        <extensions>true</extensions>
+        <executions>
+          <execution>
+            <id>bundle-manifest</id>
+            <phase>process-classes</phase>
+            <goals>
+              <goal>manifest</goal>
+            </goals>
+          </execution>
+        </executions>
+        <configuration>
+          <instructions>
+            <Import-Package>
+              *
+            </Import-Package>
+            <Export-Package>
+              org.apache.olingo.odata2.annotation.processor.ref;version=${project.version},
+              org.apache.olingo.odata2.annotation.processor.ref.*;version=${project.version}
+            </Export-Package>
+            <Bundle-DocURL>${project.url}</Bundle-DocURL>
+            <Bundle-ActivationPolicy>lazy</Bundle-ActivationPolicy>
+            <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
+          </instructions>
+        </configuration>
+      </plugin>
+    </plugins>
   </build>
 
   <dependencies>

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/1b4e3eeb/odata2-lib/odata-annotation/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-annotation/pom.xml b/odata2-lib/odata-annotation/pom.xml
index 650bd49..ba9b975 100644
--- a/odata2-lib/odata-annotation/pom.xml
+++ b/odata2-lib/odata-annotation/pom.xml
@@ -23,4 +23,45 @@
 
   <artifactId>olingo-odata2-api-annotation-incubating</artifactId>
   <name>${project.artifactId}</name>
+    <build>
+        <plugins>
+            <plugin>
+                <artifactId>maven-jar-plugin</artifactId>
+                <configuration>
+                    <archive>
+                        <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
+                    </archive>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <extensions>true</extensions>
+                <executions>
+                    <execution>
+                        <id>bundle-manifest</id>
+                        <phase>process-classes</phase>
+                        <goals>
+                            <goal>manifest</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <configuration>
+                    <instructions>
+                        <Import-Package>
+                            org.apache.olingo.odata2.core.rt;resolution:=optional,
+                            *
+                        </Import-Package>
+                        <Export-Package>
+                            org.apache.olingo.odata2.api;version=${project.version},
+                            org.apache.olingo.odata2.api.*;version=${project.version}
+                        </Export-Package>
+                        <Bundle-DocURL>${project.url}</Bundle-DocURL>
+                        <Bundle-ActivationPolicy>lazy</Bundle-ActivationPolicy>
+                        <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
+                    </instructions>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
 </project>