You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@karaf.apache.org by ld...@apache.org on 2011/12/28 13:48:21 UTC

svn commit: r1225175 - in /karaf/webconsole/trunk/examples: ./ scr/ scr/src/ scr/src/main/ scr/src/main/java/ scr/src/main/java/org/ scr/src/main/java/org/apache/ scr/src/main/java/org/apache/karaf/ scr/src/main/java/org/apache/karaf/webconsole/ scr/sr...

Author: ldywicki
Date: Wed Dec 28 12:48:21 2011
New Revision: 1225175

URL: http://svn.apache.org/viewvc?rev=1225175&view=rev
Log:
Example scr module to let webconsole display component state

Signed-off-by: Lukasz Dywicki <lu...@code-house.org>

Added:
    karaf/webconsole/trunk/examples/scr/
    karaf/webconsole/trunk/examples/scr/pom.xml
    karaf/webconsole/trunk/examples/scr/src/
    karaf/webconsole/trunk/examples/scr/src/main/
    karaf/webconsole/trunk/examples/scr/src/main/java/
    karaf/webconsole/trunk/examples/scr/src/main/java/org/
    karaf/webconsole/trunk/examples/scr/src/main/java/org/apache/
    karaf/webconsole/trunk/examples/scr/src/main/java/org/apache/karaf/
    karaf/webconsole/trunk/examples/scr/src/main/java/org/apache/karaf/webconsole/
    karaf/webconsole/trunk/examples/scr/src/main/java/org/apache/karaf/webconsole/examples/
    karaf/webconsole/trunk/examples/scr/src/main/java/org/apache/karaf/webconsole/examples/scr/
    karaf/webconsole/trunk/examples/scr/src/main/java/org/apache/karaf/webconsole/examples/scr/ExampleComparator.java
    karaf/webconsole/trunk/examples/scr/src/main/resources/
    karaf/webconsole/trunk/examples/scr/src/main/resources/OSGI-INF/
    karaf/webconsole/trunk/examples/scr/src/main/resources/OSGI-INF/comparator.xml
      - copied, changed from r1225174, karaf/webconsole/trunk/examples/pom.xml
Modified:
    karaf/webconsole/trunk/examples/pom.xml

Modified: karaf/webconsole/trunk/examples/pom.xml
URL: http://svn.apache.org/viewvc/karaf/webconsole/trunk/examples/pom.xml?rev=1225175&r1=1225174&r2=1225175&view=diff
==============================================================================
--- karaf/webconsole/trunk/examples/pom.xml (original)
+++ karaf/webconsole/trunk/examples/pom.xml Wed Dec 28 12:48:21 2011
@@ -33,6 +33,7 @@
     <modules>
         <module>branding</module>
         <module>events</module>
+        <module>scr</module>
     </modules>
 
 </project>

Added: karaf/webconsole/trunk/examples/scr/pom.xml
URL: http://svn.apache.org/viewvc/karaf/webconsole/trunk/examples/scr/pom.xml?rev=1225175&view=auto
==============================================================================
--- karaf/webconsole/trunk/examples/scr/pom.xml (added)
+++ karaf/webconsole/trunk/examples/scr/pom.xml Wed Dec 28 12:48:21 2011
@@ -0,0 +1,61 @@
+<?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 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">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache.karaf.webconsole</groupId>
+        <artifactId>examples</artifactId>
+        <version>0.3.0-SNAPSHOT</version>
+    </parent>
+
+    <groupId>org.apache.karaf.webconsole.examples</groupId>
+    <artifactId>org.apache.karaf.webconsole.examples.scr</artifactId>
+    <name>Apache Karaf :: WebConsole :: Examples :: Scr</name>
+    <packaging>bundle</packaging>
+
+
+<!--     <dependencies> -->
+<!--         <dependency> -->
+<!--             <groupId>org.osgi</groupId> -->
+<!--             <artifactId>org.osgi.compendium</artifactId> -->
+<!--         </dependency> -->
+<!--     </dependencies> -->
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <version>2.3.5</version>
+                <extensions>true</extensions>
+                <configuration>
+                    <instructions>
+                        <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
+                        <Service-Component>OSGI-INF/comparator.xml</Service-Component>
+                        <Import-Package>
+                            *
+                        </Import-Package>
+                    </instructions>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>

Added: karaf/webconsole/trunk/examples/scr/src/main/java/org/apache/karaf/webconsole/examples/scr/ExampleComparator.java
URL: http://svn.apache.org/viewvc/karaf/webconsole/trunk/examples/scr/src/main/java/org/apache/karaf/webconsole/examples/scr/ExampleComparator.java?rev=1225175&view=auto
==============================================================================
--- karaf/webconsole/trunk/examples/scr/src/main/java/org/apache/karaf/webconsole/examples/scr/ExampleComparator.java (added)
+++ karaf/webconsole/trunk/examples/scr/src/main/java/org/apache/karaf/webconsole/examples/scr/ExampleComparator.java Wed Dec 28 12:48:21 2011
@@ -0,0 +1,27 @@
+/*
+ * 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.karaf.webconsole.examples.scr;
+
+import java.util.Comparator;
+
+public class ExampleComparator implements Comparator<String> {
+
+    public int compare(String o1, String o2) {
+        return o1.compareTo(o2);
+    }
+
+}

Copied: karaf/webconsole/trunk/examples/scr/src/main/resources/OSGI-INF/comparator.xml (from r1225174, karaf/webconsole/trunk/examples/pom.xml)
URL: http://svn.apache.org/viewvc/karaf/webconsole/trunk/examples/scr/src/main/resources/OSGI-INF/comparator.xml?p2=karaf/webconsole/trunk/examples/scr/src/main/resources/OSGI-INF/comparator.xml&p1=karaf/webconsole/trunk/examples/pom.xml&r1=1225174&r2=1225175&rev=1225175&view=diff
==============================================================================
--- karaf/webconsole/trunk/examples/pom.xml (original)
+++ karaf/webconsole/trunk/examples/scr/src/main/resources/OSGI-INF/comparator.xml Wed Dec 28 12:48:21 2011
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8" ?>
+<?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
@@ -15,24 +15,10 @@
    See the License for the specific language governing permissions and
    limitations under the License.
 -->
-<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">
-    <modelVersion>4.0.0</modelVersion>
-
-    <parent>
-        <groupId>org.apache.karaf</groupId>
-        <artifactId>webconsole</artifactId>
-        <version>0.3.0-SNAPSHOT</version>
-    </parent>
-
-    <groupId>org.apache.karaf.webconsole</groupId>
-    <artifactId>examples</artifactId>
-    <name>Apache Karaf :: WebConsole :: Examples</name>
-    <packaging>pom</packaging>
-
-    <modules>
-        <module>branding</module>
-        <module>events</module>
-    </modules>
-
-</project>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="comparator">
+   <implementation class="org.apache.karaf.webconsole.examples.scr.ExampleComparator"/>
+   <service>
+      <provide interface="java.util.Comparator"/>
+   </service>
+   <property name="type" type="String" value="java.lang.String"/>
+</scr:component>