felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From don...@apache.org
Subject svn commit: r640175 - in /felix/sandbox/donsez/wireadminbinder: ./ src/main/java/org/apache/felix/sandbox/wireadminbinder/ src/site/
Date Sun, 23 Mar 2008 08:00:24 GMT
Author: donsez
Date: Sun Mar 23 01:00:23 2008
New Revision: 640175

URL: http://svn.apache.org/viewvc?rev=640175&view=rev
Log:
add consumerPID and producerPID support; add more metadata examples; add Extender as activator.

Added:
    felix/sandbox/donsez/wireadminbinder/src/site/wab1a.xml
      - copied, changed from r611494, felix/sandbox/donsez/wireadminbinder/src/site/wab1.xml
    felix/sandbox/donsez/wireadminbinder/src/site/wab1b.xml   (with props)
    felix/sandbox/donsez/wireadminbinder/src/site/wab2a.xml   (with props)
    felix/sandbox/donsez/wireadminbinder/src/site/wab2b.xml   (with props)
    felix/sandbox/donsez/wireadminbinder/src/site/wab3.xml   (with props)
Removed:
    felix/sandbox/donsez/wireadminbinder/src/site/wab1.xml
Modified:
    felix/sandbox/donsez/wireadminbinder/pom.xml
    felix/sandbox/donsez/wireadminbinder/src/main/java/org/apache/felix/sandbox/wireadminbinder/Extender.java
    felix/sandbox/donsez/wireadminbinder/src/main/java/org/apache/felix/sandbox/wireadminbinder/WireSetManager.java
    felix/sandbox/donsez/wireadminbinder/src/site/readme.html
    felix/sandbox/donsez/wireadminbinder/src/site/script.txt

Modified: felix/sandbox/donsez/wireadminbinder/pom.xml
URL: http://svn.apache.org/viewvc/felix/sandbox/donsez/wireadminbinder/pom.xml?rev=640175&r1=640174&r2=640175&view=diff
==============================================================================
--- felix/sandbox/donsez/wireadminbinder/pom.xml (original)
+++ felix/sandbox/donsez/wireadminbinder/pom.xml Sun Mar 23 01:00:23 2008
@@ -79,6 +79,9 @@
             		org.apache.felix.sandbox.util.*,
             		org.kxml2.io,org.xmlpull.*,org.apache.felix.bundlerepository.metadataparser.*
            		
             </Private-Package>
+                                
+            <Bundle-Activator>${pom.groupId}.${pom.artifactId}.Extender</Bundle-Activator>
+                                
                                     
           </instructions>
         </configuration>

Modified: felix/sandbox/donsez/wireadminbinder/src/main/java/org/apache/felix/sandbox/wireadminbinder/Extender.java
URL: http://svn.apache.org/viewvc/felix/sandbox/donsez/wireadminbinder/src/main/java/org/apache/felix/sandbox/wireadminbinder/Extender.java?rev=640175&r1=640174&r2=640175&view=diff
==============================================================================
--- felix/sandbox/donsez/wireadminbinder/src/main/java/org/apache/felix/sandbox/wireadminbinder/Extender.java
(original)
+++ felix/sandbox/donsez/wireadminbinder/src/main/java/org/apache/felix/sandbox/wireadminbinder/Extender.java
Sun Mar 23 01:00:23 2008
@@ -33,6 +33,7 @@
  */
 public class Extender implements BundleActivator, BundleListener {
 	
+	public static final String WAB_MANIFEST_ENTRY_FOR_EXTENDER = BaseActivator.WAB_MANIFEST_ENTRY+"-Extender";
 	private Map/*<Bundle,BaseActivator>*/ baseActivators=new HashMap/*<Bundle,BaseActivator>*/();
 
 	public void start(BundleContext bundleContext) throws Exception {
@@ -71,7 +72,7 @@
 			// TODO log something
 			return;
 		}
-		if(bundle.getHeaders().get(BaseActivator.WAB_MANIFEST_ENTRY)!=null) {
+		if(bundle.getHeaders().get(WAB_MANIFEST_ENTRY_FOR_EXTENDER)!=null) {
 			synchronized (baseActivators) {
 				if(!baseActivators.containsKey(bundle)) {
 					BaseActivator baseActivator=new BaseActivator();

Modified: felix/sandbox/donsez/wireadminbinder/src/main/java/org/apache/felix/sandbox/wireadminbinder/WireSetManager.java
URL: http://svn.apache.org/viewvc/felix/sandbox/donsez/wireadminbinder/src/main/java/org/apache/felix/sandbox/wireadminbinder/WireSetManager.java?rev=640175&r1=640174&r2=640175&view=diff
==============================================================================
--- felix/sandbox/donsez/wireadminbinder/src/main/java/org/apache/felix/sandbox/wireadminbinder/WireSetManager.java
(original)
+++ felix/sandbox/donsez/wireadminbinder/src/main/java/org/apache/felix/sandbox/wireadminbinder/WireSetManager.java
Sun Mar 23 01:00:23 2008
@@ -191,10 +191,15 @@
             public ConsumerListener(WireSetManager wireSetManager)
                     throws InvalidSyntaxException {
                 this.wireSetManager = wireSetManager;
-                this.filterStr = "(&"+filterConsumerStr
-                        + wireSetManager.wireSet.getConsumersFilter() + ")";
-                this.filter = bundleContext.createFilter(filterStr);
+                if(wireSetManager.wireSet.getConsumerPID()==null){
+	                this.filterStr = "(&"+filterConsumerStr
+	                        + wireSetManager.wireSet.getConsumersFilter() + ")";
+                } else {
+	                this.filterStr = "(&"+filterConsumerStr
+                    	+ "("+Constants.SERVICE_PID+"="+wireSetManager.wireSet.getConsumerPID()+")"
+ ")";                	
+                }
                 trace(this.getClass().getName()+":filterStr="+filterStr);
+                this.filter = bundleContext.createFilter(filterStr);
             }
         
             public void fillServices() throws InvalidSyntaxException {
@@ -342,10 +347,15 @@
         
             public ProducerListener(WireSetManager wireSetManager) throws InvalidSyntaxException
{
                 this.wireSetManager = wireSetManager;
-                this.filterStr = "(&"+filterProducerStr
-                        + wireSetManager.wireSet.getProducersFilter() + ")";
-                this.filter = bundleContext.createFilter(filterStr);
+                if(wireSetManager.wireSet.getProducerPID()==null) {
+	                this.filterStr = "(&"+filterProducerStr
+	                        + wireSetManager.wireSet.getProducersFilter() + ")";
+                } else {
+	                this.filterStr = "(&"+filterProducerStr
+                    	+ "("+Constants.SERVICE_PID+"="+wireSetManager.wireSet.getProducerPID()+")"
+ ")";                	
+                }
                 trace(this.getClass().getName()+":filterStr="+filterStr);
+                this.filter = bundleContext.createFilter(filterStr);
             }
         
             public void fillServices() throws InvalidSyntaxException {

Modified: felix/sandbox/donsez/wireadminbinder/src/site/readme.html
URL: http://svn.apache.org/viewvc/felix/sandbox/donsez/wireadminbinder/src/site/readme.html?rev=640175&r1=640174&r2=640175&view=diff
==============================================================================
--- felix/sandbox/donsez/wireadminbinder/src/site/readme.html (original)
+++ felix/sandbox/donsez/wireadminbinder/src/site/readme.html Sun Mar 23 01:00:23 2008
@@ -94,7 +94,7 @@
 </p>
 
 <p id="platforms">
-<b>Tested platforms</b><br>
+<b>Tested OSGi platforms</b><br>
 <ul>
 <li>Felix (done)</li>
 <li><a href="http://oscar.objectweb.org/">Oscar</a> (done)</li>
@@ -103,6 +103,15 @@
 </ul>
 </p>
 
+<p id="wa">
+<b>Tested WireAdmin implementations</b><br>
+<ul>
+<li>Apache Felix WireAdmin (done)</li>
+<li>Equinox WireAdmin (to do)</li>
+</ul>
+</p>
+
+
 
 <p id="versions">
 <b>Versions history</b><br>
@@ -116,7 +125,7 @@
 <ul>
 <li>2008-01-12: add a extended model to start and stop wired applications described
in other bundles manifest</li>
 <li>2007-12-19: add consumersFilter and producersFilter elements to set LDAP filters
in CDATA section</li>
-<li>2007-12-19: add consumerPid and producerPid attributes in wireset elements to simplify
PID setting</li>
+<li>2007-12-19 (DONE 2008-03-23): add consumerPid and producerPid attributes in wireset
elements to simplify PID setting</li>
 <li>2007-12-19: add wireapp lifecycle control in wiresets</li>
 <li>2007-12-19: provides a XML schema definition of the metadata</li>
 </ul>

Modified: felix/sandbox/donsez/wireadminbinder/src/site/script.txt
URL: http://svn.apache.org/viewvc/felix/sandbox/donsez/wireadminbinder/src/site/script.txt?rev=640175&r1=640174&r2=640175&view=diff
==============================================================================
--- felix/sandbox/donsez/wireadminbinder/src/site/script.txt (original)
+++ felix/sandbox/donsez/wireadminbinder/src/site/script.txt Sun Mar 23 01:00:23 2008
@@ -2,13 +2,32 @@
 obr remove-url file:C:\Docume~1\donsez\.m2\repository\repository.xml
 obr add-url file:C:\Docume~1\donsez\.m2\repository\repository.xml
 
+obr start "Apache Felix Declarative Services"	
 obr start "WireAdmin"
+obr start "Apache Felix WireAdmin Command"
 obr start "Apache Felix Wire Admin Binder";0.1.0
 obr start "Apache Felix Wire Admin Binder Command";0.1.0
+
+
+wa consumers
+wa producers
+wa wires
+wa create org.apache.felix.sandbox.wireadmin.sample.fictivemeasurementproducer org.apache.felix.sandbox.wireadmin.sample.simpleconsumer
+wa create org.apache.felix.sandbox.wireadmin.sample.vmfreememproducer org.apache.felix.sandbox.wireadmin.sample.simpleconsumer
+
 wab list
 
 wab base file:F:\osgi\felix\sandbox\donsez\wireadminbinder.cmd\src\site\
+wab base file:F:\osgi\felix-sandbox-donsez-2\wireadminbinder\src\site\
 wab base
 
-wab start wab1.xml
+wa 
+
+wab start wab1a.xml
+wab start wab1b.xml
+wab start wab2.xml
 wab start wab10.xml
+
+obr start "Fictive Measurement Producer"
+obr start "VM Free Memory Producer"
+obr start "Simple Consumer"
\ No newline at end of file

Copied: felix/sandbox/donsez/wireadminbinder/src/site/wab1a.xml (from r611494, felix/sandbox/donsez/wireadminbinder/src/site/wab1.xml)
URL: http://svn.apache.org/viewvc/felix/sandbox/donsez/wireadminbinder/src/site/wab1a.xml?p2=felix/sandbox/donsez/wireadminbinder/src/site/wab1a.xml&p1=felix/sandbox/donsez/wireadminbinder/src/site/wab1.xml&r1=611494&r2=640175&rev=640175&view=diff
==============================================================================
--- felix/sandbox/donsez/wireadminbinder/src/site/wab1.xml (original)
+++ felix/sandbox/donsez/wireadminbinder/src/site/wab1a.xml Sun Mar 23 01:00:23 2008
@@ -28,16 +28,16 @@
 
   Author : Felix Project Team
 -->
-<wireapp id="org.apache.felix.sandbox.wireadminbinder.wab1"
+<wireapp id="org.apache.felix.sandbox.wireadminbinder.wab1a"
 			description="A simple Wired application">
 
 		<!-- one-to-one wire set with a wire property-->
-		<!-- + keepAlive remove policy -->
+		<!-- + ifDisconnected remove policy -->
 		<wireset
 			id="one2one"
 			description="only one wire between one simple producer and one simple consumer"
-			producersFilter="(service.pid=org.apache.felix.sample.clock)"
-			consumersFilter="(service.pid=org.apache.felix.sample.stringconsumer)"
-			removepolicy="keepAlive"
+			producersFilter="(service.pid=org.apache.felix.sandbox.wireadmin.sample.fictivemeasurementproducer)"
+			consumersFilter="(service.pid=org.apache.felix.sandbox.wireadmin.sample.simpleconsumer)"
+			removepolicy="ifDisconnected"
 		/>
 </wireapp>

Added: felix/sandbox/donsez/wireadminbinder/src/site/wab1b.xml
URL: http://svn.apache.org/viewvc/felix/sandbox/donsez/wireadminbinder/src/site/wab1b.xml?rev=640175&view=auto
==============================================================================
--- felix/sandbox/donsez/wireadminbinder/src/site/wab1b.xml (added)
+++ felix/sandbox/donsez/wireadminbinder/src/site/wab1b.xml Sun Mar 23 01:00:23 2008
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+<!DOCTYPE wireadminbinder SYSTEM "wireapp.dtd">
+-->
+
+<!--
+ 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.
+-->
+
+<!--
+  descriptor sample for org.apache.felix.sandbox.wireadminbinder
+
+  Author : Felix Project Team
+-->
+<wireapp id="org.apache.felix.sandbox.wireadminbinder.wab1b"
+			description="A simple Wired application">
+
+		<!-- one-to-one wire set with a wire property-->
+		<!-- + ifDisconnected remove policy -->
+		<wireset
+			id="one2one"
+			description="only one wire between one simple producer and one simple consumer"
+			producerPID="org.apache.felix.sandbox.wireadmin.sample.fictivemeasurementproducer"
+			consumerPID="org.apache.felix.sandbox.wireadmin.sample.simpleconsumer"
+			removepolicy="ifDisconnected"
+		/>
+</wireapp>

Propchange: felix/sandbox/donsez/wireadminbinder/src/site/wab1b.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: felix/sandbox/donsez/wireadminbinder/src/site/wab2a.xml
URL: http://svn.apache.org/viewvc/felix/sandbox/donsez/wireadminbinder/src/site/wab2a.xml?rev=640175&view=auto
==============================================================================
--- felix/sandbox/donsez/wireadminbinder/src/site/wab2a.xml (added)
+++ felix/sandbox/donsez/wireadminbinder/src/site/wab2a.xml Sun Mar 23 01:00:23 2008
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+<!DOCTYPE wireadminbinder SYSTEM "wireapp.dtd">
+-->
+
+<!--
+ 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.
+-->
+
+<!--
+  descriptor sample for org.apache.felix.sandbox.wireadminbinder
+
+  Author : Felix Project Team
+-->
+<wireapp 
+	id="org.apache.felix.sandbox.wireadminbinder.wab2a"
+	description="A simple Wired application">
+
+		<!-- a many-to-one wireset without wire properties -->
+		<!-- + whileConsumer remove policy -->
+		<wireset
+			id="consumerservlet" 
+			description="all producer and the simple consumer"
+			producers-filter="(|(|(|(|(wireadmin.producer.flavors=*org.osgi.util.position.Position)(wireadmin.producer.flavors=*org.osgi.util.measurement.Measurement))(wireadmin.producer.flavors=*java.lang.Long))(wireadmin.producer.flavors=*java.lang.Double))(wireadmin.producer.flavors=*java.awt.Image))"
+			consumers-filter="(service.pid=org.apache.felix.sandbox.wireadmin.sample.simpleconsumer)"
+			removepolicy="whileConsumer"
+		/>
+</wireapp>

Propchange: felix/sandbox/donsez/wireadminbinder/src/site/wab2a.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: felix/sandbox/donsez/wireadminbinder/src/site/wab2b.xml
URL: http://svn.apache.org/viewvc/felix/sandbox/donsez/wireadminbinder/src/site/wab2b.xml?rev=640175&view=auto
==============================================================================
--- felix/sandbox/donsez/wireadminbinder/src/site/wab2b.xml (added)
+++ felix/sandbox/donsez/wireadminbinder/src/site/wab2b.xml Sun Mar 23 01:00:23 2008
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+<!DOCTYPE wireadminbinder SYSTEM "wireapp.dtd">
+-->
+
+<!--
+ 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.
+-->
+
+<!--
+  descriptor sample for org.apache.felix.sandbox.wireadminbinder
+
+  Author : Felix Project Team
+-->
+<wireapp 
+	id="org.apache.felix.sandbox.wireadminbinder.wab2b"
+	description="A simple Wired application">
+
+		<!-- a many-to-one wireset without wire properties -->
+		<!-- + whileConsumer remove policy -->
+		<wireset
+			id="consumerservlet" 
+			description="all producer and the simple consumer"
+			producersFilter="(|(|(|(|(wireadmin.producer.flavors=*org.osgi.util.position.Position)(wireadmin.producer.flavors=*org.osgi.util.measurement.Measurement))(wireadmin.producer.flavors=*java.lang.Long))(wireadmin.producer.flavors=*java.lang.Double))(wireadmin.producer.flavors=*java.awt.Image))"
+			consumerPID="org.apache.felix.sandbox.wireadmin.sample.simpleconsumer"
+			removepolicy="whileConsumer"
+		/>
+</wireapp>

Propchange: felix/sandbox/donsez/wireadminbinder/src/site/wab2b.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: felix/sandbox/donsez/wireadminbinder/src/site/wab3.xml
URL: http://svn.apache.org/viewvc/felix/sandbox/donsez/wireadminbinder/src/site/wab3.xml?rev=640175&view=auto
==============================================================================
--- felix/sandbox/donsez/wireadminbinder/src/site/wab3.xml (added)
+++ felix/sandbox/donsez/wireadminbinder/src/site/wab3.xml Sun Mar 23 01:00:23 2008
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+<!DOCTYPE wireadminbinder SYSTEM "wireapp.dtd">
+-->
+
+<!--
+ 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.
+-->
+
+<!--
+  descriptor sample for org.apache.felix.sandbox.wireadminbinder
+
+  Author : Felix Project Team
+-->
+<wireapp 
+	id="org.apache.felix.sandbox.wireadminbinder.wab3"
+	description="A complex Wired application">
+
+		<!-- many-to-many wire set with a wire property-->
+		<!-- + ifDisconnected remove policy -->
+		<wireset
+			id="manyposition2manyposition"
+			description="wires between position producers and position consumers"
+			producersFilter="(wireadmin.producer.flavors=*org.osgi.position.Position)"
+			consumersFilter="(wireadmin.consumer.flavors=*org.osgi.position.Position)"
+			removepolicy="ifDisconnected"
+		>
+			<property
+				name="wireadmin.filter"
+				type="java.lang.String"
+			><![CDATA[(wirevalue.elapsed>=2000)]]></property>
+		</wireset>
+
+</wireapp>

Propchange: felix/sandbox/donsez/wireadminbinder/src/site/wab3.xml
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message