You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by do...@apache.org on 2008/01/15 15:22:26 UTC

svn commit: r612122 - in /felix/sandbox/donsez/wireadmin.sample.freevmmemproducer: ./ src/ src/main/ src/main/java/ src/main/java/org/ src/main/java/org/apache/ src/main/java/org/apache/felix/ src/main/java/org/apache/felix/sandbox/ src/main/java/org/a...

Author: donsez
Date: Tue Jan 15 06:22:23 2008
New Revision: 612122

URL: http://svn.apache.org/viewvc?rev=612122&view=rev
Log:
creation of the "VM Free Memory Producer" bundle : a sample Producer that poll objects containing the VM free memory

Added:
    felix/sandbox/donsez/wireadmin.sample.freevmmemproducer/
    felix/sandbox/donsez/wireadmin.sample.freevmmemproducer/pom.xml   (with props)
    felix/sandbox/donsez/wireadmin.sample.freevmmemproducer/src/
    felix/sandbox/donsez/wireadmin.sample.freevmmemproducer/src/main/
    felix/sandbox/donsez/wireadmin.sample.freevmmemproducer/src/main/java/
    felix/sandbox/donsez/wireadmin.sample.freevmmemproducer/src/main/java/org/
    felix/sandbox/donsez/wireadmin.sample.freevmmemproducer/src/main/java/org/apache/
    felix/sandbox/donsez/wireadmin.sample.freevmmemproducer/src/main/java/org/apache/felix/
    felix/sandbox/donsez/wireadmin.sample.freevmmemproducer/src/main/java/org/apache/felix/sandbox/
    felix/sandbox/donsez/wireadmin.sample.freevmmemproducer/src/main/java/org/apache/felix/sandbox/util/
    felix/sandbox/donsez/wireadmin.sample.freevmmemproducer/src/main/java/org/apache/felix/sandbox/util/Configuration.java   (with props)
    felix/sandbox/donsez/wireadmin.sample.freevmmemproducer/src/main/java/org/apache/felix/sandbox/wireadmin/
    felix/sandbox/donsez/wireadmin.sample.freevmmemproducer/src/main/java/org/apache/felix/sandbox/wireadmin/sample/
    felix/sandbox/donsez/wireadmin.sample.freevmmemproducer/src/main/java/org/apache/felix/sandbox/wireadmin/sample/vmfreememproducer/
    felix/sandbox/donsez/wireadmin.sample.freevmmemproducer/src/main/java/org/apache/felix/sandbox/wireadmin/sample/vmfreememproducer/VMFreeMemoryProducer.java   (with props)
    felix/sandbox/donsez/wireadmin.sample.freevmmemproducer/src/main/resources/
    felix/sandbox/donsez/wireadmin.sample.freevmmemproducer/src/main/resources/config.properties   (with props)
    felix/sandbox/donsez/wireadmin.sample.freevmmemproducer/src/site/
    felix/sandbox/donsez/wireadmin.sample.freevmmemproducer/src/site/readme.html   (with props)

Added: felix/sandbox/donsez/wireadmin.sample.freevmmemproducer/pom.xml
URL: http://svn.apache.org/viewvc/felix/sandbox/donsez/wireadmin.sample.freevmmemproducer/pom.xml?rev=612122&view=auto
==============================================================================
--- felix/sandbox/donsez/wireadmin.sample.freevmmemproducer/pom.xml (added)
+++ felix/sandbox/donsez/wireadmin.sample.freevmmemproducer/pom.xml Tue Jan 15 06:22:23 2008
@@ -0,0 +1,72 @@
+<!--
+ 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>
+	<properties>
+		<repositoryLocation>http://people.apache.org/~donsez/dev/felix/sandbox/</repositoryLocation>
+		<description>VM free memory producer : a example for the Wire Admin service.</description>
+	</properties>  
+
+  <modelVersion>4.0.0</modelVersion>
+  <packaging>bundle</packaging>
+  <name>VM Free Memory Producer</name>
+  <description>${description}</description>
+  <groupId>org.apache.felix.sandbox</groupId>
+  <version>0.1.0-SNAPSHOT</version>
+  <artifactId>wireadmin.sample.vmfreememproducer</artifactId>
+
+  <dependencies>
+
+	<dependency>
+		<groupId>org.apache.felix</groupId>
+		<artifactId>org.osgi.core</artifactId>
+  		<version>1.1.0-SNAPSHOT</version>
+	</dependency>
+	
+	<dependency>
+		<groupId>org.apache.felix</groupId>
+		<artifactId>org.osgi.compendium</artifactId>
+  		<version>0.9.0-SNAPSHOT</version>
+	</dependency>
+        
+  </dependencies>
+  
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.felix</groupId>
+        <artifactId>maven-bundle-plugin</artifactId>
+        <extensions>true</extensions>
+        <configuration>
+          <instructions>
+            <Import-Package>*</Import-Package>
+            <Private-Package>
+              ${pom.groupId}.${pom.artifactId},
+              ${pom.groupId}.util
+            </Private-Package>
+           	<Bundle-Activator>${pom.groupId}.${pom.artifactId}.VMFreeMemoryProducer</Bundle-Activator>
+            
+            <!-- docs in http://cwiki.apache.org/FELIX/bundle-plugin-for-maven-bnd.html and http://cwiki.apache.org/FELIX/osgi-plugin-for-maven-2.html -->
+            <Export-Service>org.osgi.service.wireadmin.Producer</Export-Service>
+                        
+          </instructions>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>

Propchange: felix/sandbox/donsez/wireadmin.sample.freevmmemproducer/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: felix/sandbox/donsez/wireadmin.sample.freevmmemproducer/src/main/java/org/apache/felix/sandbox/util/Configuration.java
URL: http://svn.apache.org/viewvc/felix/sandbox/donsez/wireadmin.sample.freevmmemproducer/src/main/java/org/apache/felix/sandbox/util/Configuration.java?rev=612122&view=auto
==============================================================================
--- felix/sandbox/donsez/wireadmin.sample.freevmmemproducer/src/main/java/org/apache/felix/sandbox/util/Configuration.java (added)
+++ felix/sandbox/donsez/wireadmin.sample.freevmmemproducer/src/main/java/org/apache/felix/sandbox/util/Configuration.java Tue Jan 15 06:22:23 2008
@@ -0,0 +1,194 @@
+/*
+ * 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.felix.sandbox.util;
+
+import java.io.FileInputStream;
+import java.io.InputStream;
+import java.util.Hashtable;
+import java.util.Map;
+import java.util.Properties;
+import java.util.StringTokenizer;
+import java.util.Vector;
+
+/**
+ * this class provides utilities methods for bundle configuration.
+ * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
+ */
+public class Configuration {
+	static String DEFAULT_PROPERTIES_FILE = "config.properties";
+
+
+	/**
+	 *  loads properties from a file
+	 *
+	 *@param  filename  the properties file name
+	 *@return           the properties
+	 */
+	public static Properties loadProperties(String filename) {
+		if (filename == null) {
+			filename = System.getProperty("fr.imag.adele.bundle.util.configuration.file", DEFAULT_PROPERTIES_FILE);
+		}
+		try {
+			return loadProperties(new FileInputStream(filename));
+		} catch (Exception ex) {
+			ex.printStackTrace();
+			return null;
+		}
+	}
+
+
+	/**
+	 *  loads properties from a input stream
+	 *
+	 *@param  in	  the imput stream
+	 *@return           the properties
+	 */
+	public static Properties loadProperties(InputStream in) {
+		Properties prop = new Properties();
+		try {
+			prop.load(in);
+		} catch (Exception ex) {
+			ex.printStackTrace();
+			return null;
+		}
+		return prop;
+	}
+
+	/**
+	 *  builds a map from properties. the key list is in the property keyListPropertyName
+	 * <br>Example getMap(props,"keylist") returns a hashtable with 3 key-value entry
+	 * <pre>
+	 * keylist=bar;bubba;foo
+	 * bar=BAR
+	 * foo=1.5;float
+	 * bubba=100;int
+	 * </pre>
+	 *
+	 *@param  props                the properties
+	 *@param  keyListPropertyName  the property name of the key list (separed by ;)
+	 *@return                      The map
+	 */
+	public static Map getMap(Properties props, String keyListPropertyName) {
+		return getHashtable(props, keyListPropertyName);
+	}	
+	
+	/**
+	 *  builds a hashtable from properties. the key list is in the property keyListPropertyName
+	 * <br>Example getHashtable(props,"keylist") returns a hashtable with 3 key-value entry
+	 * <pre>
+	 * keylist=bar;bubba;foo
+	 * bar=BAR
+	 * foo=1.5;float
+	 * bubba=100;int
+	 * </pre>
+	 *
+	 *@param  props                the properties
+	 *@param  keyListPropertyName  the property name of the key list (separed by ;)
+	 *@return                      The hashtable
+	 */
+	public static Hashtable getHashtable(Properties props, String keyListPropertyName) {
+
+		StringTokenizer st = new StringTokenizer(props.getProperty(keyListPropertyName), ";");
+		Hashtable map = new Hashtable();
+
+		while (st.hasMoreTokens()) {
+			String key = st.nextToken();
+			StringTokenizer stvaluetype = new StringTokenizer(props.getProperty(key), ";");
+			Object obj = null;
+			if (stvaluetype.hasMoreTokens()) {
+				String value = stvaluetype.nextToken();
+				if (stvaluetype.hasMoreTokens()) {
+					String type = stvaluetype.nextToken();
+					if (type.equals("int")) {
+						obj = new Integer(value);
+					} else if (type.equals("long")) {
+						obj = new Long(value);
+					} else if (type.equals("float")) {
+						obj = new Float(value);
+					} else if (type.equals("double")) {
+						obj = new Double(value);
+					} else if (type.equals("string")) {
+						obj = value;
+					} else {
+						// default : string
+						obj = value;
+					}
+				} else {
+					// no type means String
+					obj = value;
+				}
+
+			}
+			map.put(key, obj);
+		}
+		return map;
+	}
+	
+	/**
+	 *  builds a (ordered) vector from properties. the index list is in the property keyListPropertyName
+	 * <br>Example getVector(props,"tab") returns a 4 elements vector (tab.5 is ignored since tab.4 does not exist)
+	 * <pre>
+	 * tab.0=bar
+	 * tab.1=foo
+	 * tab.2=1.5;float
+	 * tab.3=100;int
+	 * tab.5=10000;long
+	 * </pre>
+	 *@param  props                the properties
+	 *@param  vectorPropertyName  the property name of the key list (separed by ;)
+	 *@return                      The vector
+	 */
+	public static Vector getVector(Properties props, String vectorPropertyName) {
+
+		Vector vect = new Vector();
+
+		for(int i=0;true;i++) {
+			String valuetype = props.getProperty(vectorPropertyName)+"."+i;
+			if(valuetype==null) break;
+			StringTokenizer stvaluetype = new StringTokenizer(valuetype, ";");
+			Object obj = null;
+			if (stvaluetype.hasMoreTokens()) {
+				String value = stvaluetype.nextToken();
+				if (stvaluetype.hasMoreTokens()) {
+					String type = stvaluetype.nextToken();
+					if (type.equals("int")) {
+						obj = new Integer(value);
+					} else if (type.equals("long")) {
+						obj = new Long(value);
+					} else if (type.equals("float")) {
+						obj = new Float(value);
+					} else if (type.equals("double")) {
+						obj = new Double(value);
+					} else if (type.equals("string")) {
+						obj = value;
+					} else {
+						// default : string
+						obj = value;
+					}
+				} else {
+					// no type means String
+					obj = value;
+				}
+
+			}
+			vect.addElement(obj);
+		}
+		return vect;
+	}
+}

Propchange: felix/sandbox/donsez/wireadmin.sample.freevmmemproducer/src/main/java/org/apache/felix/sandbox/util/Configuration.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: felix/sandbox/donsez/wireadmin.sample.freevmmemproducer/src/main/java/org/apache/felix/sandbox/wireadmin/sample/vmfreememproducer/VMFreeMemoryProducer.java
URL: http://svn.apache.org/viewvc/felix/sandbox/donsez/wireadmin.sample.freevmmemproducer/src/main/java/org/apache/felix/sandbox/wireadmin/sample/vmfreememproducer/VMFreeMemoryProducer.java?rev=612122&view=auto
==============================================================================
--- felix/sandbox/donsez/wireadmin.sample.freevmmemproducer/src/main/java/org/apache/felix/sandbox/wireadmin/sample/vmfreememproducer/VMFreeMemoryProducer.java (added)
+++ felix/sandbox/donsez/wireadmin.sample.freevmmemproducer/src/main/java/org/apache/felix/sandbox/wireadmin/sample/vmfreememproducer/VMFreeMemoryProducer.java Tue Jan 15 06:22:23 2008
@@ -0,0 +1,252 @@
+/*
+ * 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.felix.sandbox.wireadmin.sample.vmfreememproducer;
+
+import java.io.InputStream;
+import java.io.PrintStream;
+import java.util.Dictionary;
+import java.util.Enumeration;
+import java.util.Hashtable;
+import java.util.Properties;
+
+import org.apache.felix.sandbox.util.Configuration;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceRegistration;
+import org.osgi.service.cm.ConfigurationException;
+import org.osgi.service.cm.ManagedService;
+import org.osgi.service.wireadmin.Producer;
+import org.osgi.service.wireadmin.Wire;
+import org.osgi.util.measurement.Measurement;
+import org.osgi.util.measurement.Unit;
+
+/**
+ * The class provides a producer on free memory amount of the JVM 
+ * It's a sample for the Wire Admin service
+ * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
+ * TODO check synchroniztions on wires[]
+ */
+public class VMFreeMemoryProducer implements Producer, Runnable, BundleActivator, ManagedService {
+
+	private static final String CONFIGFILE = "/config.properties";
+	private static final String PRODUCER_PID = "org.apache.felix.sandbox.wireadmin.sample.vmfreememory";
+	
+	private BundleContext bundleContext;
+	private Wire wires[];
+	private ServiceRegistration serviceRegistration;
+	
+	private PrintStream traceout = null;
+	private int pollDelay = 1000;
+	private boolean quit=false;
+	private boolean pause=true;
+
+
+	/**
+	 * set the new set of Wires connected to this producers. This method is invoked by the WireAdmin service each time a wire is created or removed
+	 * @see org.osgi.service.wireadmin.Producer#consumersConnected(org.osgi.service.wireadmin.Wire[])
+	 */
+	public synchronized void consumersConnected(Wire wires[]) {
+		this.wires = wires;
+		if(wires==null || wires.length==0){
+			pause=true;
+		} else {
+			pause=false;
+		}
+	}
+
+	/**
+	 * @param wire
+	 * @return
+	 * @see org.osgi.service.wireadmin.Producer#polled(org.osgi.service.wireadmin.Wire)
+	 */
+	public Object polled(Wire wire) {
+		long freemem = Runtime.getRuntime().freeMemory();
+		return polled(wire, freemem, System.currentTimeMillis());
+	}
+
+	/**
+	 * Method producing a Object according to the consumer flavor priority
+	 * @param wire
+	 * @param freemem
+	 * @param currentTimeMillis
+	 * @return
+	 */
+	private Object polled(Wire wire, long freemem, long currentTimeMillis) {
+		if(wire.isConnected() && wire.isValid()) {
+			Class clazzes[] = wire.getFlavors();
+			for (int i = 0; i < clazzes.length; i++) {
+				Class clazz = clazzes[i];
+				if (clazz.isAssignableFrom(Long.class))
+					return new Long(freemem);
+				if (clazz.isAssignableFrom(Measurement.class))
+					return new Measurement((double) freemem, 0.0, Unit.unity, currentTimeMillis);
+				if (clazz.isAssignableFrom(String.class))
+					return new Long(freemem).toString();
+			}
+		}
+		return null;
+	}
+
+	/**
+	 * update the values of the configuration properties
+	 * @see org.osgi.service.cm.ManagedService#updated(java.util.Dictionary)
+	 */
+	public void updated(Dictionary properties) throws ConfigurationException {
+		String ptraceout = (String) properties.get("traceout");
+		PrintStream traceout = null;
+		if (ptraceout != null) {
+			if (ptraceout.equals("System.out")) {
+				traceout = System.out;
+			} else if (ptraceout.equals("System.err")) {
+				traceout = System.err;
+			} else {
+				// TODO instanciante the class with the name	
+				System.err.println("custom trace is not implemented !");
+			}
+		}
+
+		String polldelayprops = (String) properties.get("poll.delay");
+		if (polldelayprops != null) {
+			pollDelay = Integer.parseInt(polldelayprops);
+		}
+	}
+
+	
+	/**
+	 * Called upon starting of the bundle. This method invokes configure() which
+	 * load the configuration file, registers the services
+	 *
+	 * @param   	bundleContext  The bundle bundleContext passed by the framework
+	 * @exception   Exception
+	 * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
+	 */
+	public void start(BundleContext context) throws Exception {
+		this.bundleContext = context;
+		configure();
+		
+		// register the producer service
+		Hashtable registrationProperties = new Hashtable();
+		registrationProperties.put(
+			org.osgi.service.wireadmin.WireConstants.WIREADMIN_PRODUCER_FLAVORS,
+			new Class[] { Long.class, Measurement.class, String.class });
+		registrationProperties.put(
+			org.osgi.framework.Constants.SERVICE_PID,
+			PRODUCER_PID);
+		registrationProperties.put(
+			org.osgi.framework.Constants.SERVICE_DESCRIPTION,
+			"a simple Producer that poll objects containing the VM free memory");
+
+		serviceRegistration=context.registerService(new String[]{Producer.class.getName(),ManagedService.class.getName()}, this, registrationProperties);
+		
+		// start the thread
+		quit = false;
+		new Thread(this).start();
+	}
+
+	/**
+	 * load the configuration properties and set them
+	 */
+	private void configure() throws Exception {
+
+		if (bundleContext == null)
+			return;
+
+		// Get the Config-Location value from the manifest
+
+		String configLocation = null;
+		Dictionary dict = bundleContext.getBundle().getHeaders();
+		Enumeration enumeration = dict.keys();
+		while (enumeration.hasMoreElements()) {
+			Object nextKey = enumeration.nextElement();
+			Object nextElem = dict.get(nextKey);
+			if (nextKey.equals("Config-Location")) {
+				configLocation = nextElem.toString();
+				break;
+			}
+		}
+		if (configLocation == null) {
+			configLocation = CONFIGFILE;
+		}
+
+		
+		// Load properties from configLocation file
+		InputStream is = getClass().getResourceAsStream(configLocation);
+		Properties props = Configuration.loadProperties(is);
+		
+		updated(props);
+	}
+
+	/**
+	 * this thread run() method pushed the new value each pollDelay !
+	 * @see java.lang.Runnable#run()
+	 * TODO the thread could be "paused" until wires.lenght > 0
+	 */
+	public synchronized void run() {
+		while (!quit)
+			try {
+				long freemem = Runtime.getRuntime().freeMemory(); // consumers will received the same value for free memory
+				long currentTimeMillis = System.currentTimeMillis(); // and the same timestamp
+				for (int i = 0; wires != null && i < wires.length; i++) {
+					Wire wire = wires[i];
+					// check if wire is valid and connected ?
+					if (!wire.isConnected() || !wire.isValid())
+						continue;
+					wire.update(polled(wire,freemem,currentTimeMillis));
+				}
+				Thread.sleep(pollDelay);
+			} catch (InterruptedException ie) {
+				/* will recheck quit */
+			}
+	}
+
+	
+	/**
+	 * Called upon stopping of the bundle. This method unregisters the registered services
+	 * @param   	bundleContext  The bundle bundleContext passed by the framework
+	 * @exception   Exception
+	 * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
+	 */
+	public void stop(BundleContext bundleContext) throws Exception {
+		 //stop the thread 
+		quit = true;
+		
+		serviceRegistration.unregister();
+	}
+	/**
+	 * print a trace 
+	 * @param message message to trace
+	 */
+	private void traceln(String message) {
+		if (traceout != null) {
+			trace(message);
+			trace("\n");
+		}
+	}
+
+	/**
+	 * print a trace 
+	 * @param message message to trace
+	 */
+	private void trace(String message) {
+		if (traceout != null) {
+			traceout.print(message);
+		}
+	}
+
+}
\ No newline at end of file

Propchange: felix/sandbox/donsez/wireadmin.sample.freevmmemproducer/src/main/java/org/apache/felix/sandbox/wireadmin/sample/vmfreememproducer/VMFreeMemoryProducer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: felix/sandbox/donsez/wireadmin.sample.freevmmemproducer/src/main/resources/config.properties
URL: http://svn.apache.org/viewvc/felix/sandbox/donsez/wireadmin.sample.freevmmemproducer/src/main/resources/config.properties?rev=612122&view=auto
==============================================================================
--- felix/sandbox/donsez/wireadmin.sample.freevmmemproducer/src/main/resources/config.properties (added)
+++ felix/sandbox/donsez/wireadmin.sample.freevmmemproducer/src/main/resources/config.properties Tue Jan 15 06:22:23 2008
@@ -0,0 +1,3 @@
+
+# poll delay
+poll.delay=5000

Propchange: felix/sandbox/donsez/wireadmin.sample.freevmmemproducer/src/main/resources/config.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Added: felix/sandbox/donsez/wireadmin.sample.freevmmemproducer/src/site/readme.html
URL: http://svn.apache.org/viewvc/felix/sandbox/donsez/wireadmin.sample.freevmmemproducer/src/site/readme.html?rev=612122&view=auto
==============================================================================
--- felix/sandbox/donsez/wireadmin.sample.freevmmemproducer/src/site/readme.html (added)
+++ felix/sandbox/donsez/wireadmin.sample.freevmmemproducer/src/site/readme.html Tue Jan 15 06:22:23 2008
@@ -0,0 +1,85 @@
+<html>
+<head>
+<title>VM Free Memory Producer</title>
+</head>
+<body>
+
+<!-- Start of Felix Bundle Documentation -->
+<hr width="100%" size="2">
+<h1><i><a name="wireadmin.sample.vmfreememproducer"></a><font color="#0000aa">VM Free Memory Producer</font></i></h1>
+
+<p>
+<b>Description</b><br>
+This bundle provides a simple Producer service which poll the amount of the VM free memory
+</p>
+
+<p>
+<b>Contributors</b><br>
+<ul>
+<li>Author:<a href="dev@felix.apache.org">Felix Project Team</a></li>
+</ul>
+</p>
+
+<p>
+<b>License</b><br>
+ASL2
+</p>
+
+<p>
+<b>Services</b><br>
+<code>org.osgi.service.wireadmin.Producer</code>
+</p>
+
+<p>
+<b>Properties</b><br>
+<ul>
+<li><code>service.pid=org.apache.felix.wireadmin.sample.vmfreememory</code></li>
+<li><code>wireadmin.producer.flavors=[class java.lang.Long,class org.osgi.util.measurement.Measurement,class java.lang.String]</code><li>
+</ul>
+</p>
+
+<p><b>Requirements</b><br>
+<ul>
+<li><code>org.osgi.service.wireadmin; specification-version=1.0.0</code></li>
+<li><code>org.osgi.util.measurement; specification-version=1.0.0</code></li>
+</ul>
+</p>
+
+
+<!-- End of Felix Bundle Documentation -->
+
+<hr width="100%" size="2">
+
+<!-- Start of extra information  -->
+
+<p>
+<b>Build</b><br>
+<ol>
+<li>setup the properties in src/main/resources/config.properties</li>
+<li>build with <code>mvn clean install</code></li>
+</ol>
+</p>
+
+<b>Test</b><br>
+Launch commands in <a href="http://www.apache.org/~donsez/dev/osgi/script/wa.txt">http://www.apache.org/~donsez/dev/osgi/script/wa.txt</a> 
+</p>
+
+<p id="gateways">
+<b>Tested gateways</b><br>
+<ul>
+<li><a href="http//oscar.objectweb.org/">OSCAR</a> (done)</li>
+<li><a href="http://cwiki.apache.org/FELIX/">Felix</a> (done)</li>
+<li><a href="http://www.knopflerfish.org">Knopflerfish OSGi</a> (to do)</li>
+<li>Equinox (to do)</li>
+<li>Prosyst mbs pro(to do)</li>
+</ul>
+</p>
+
+<p>
+<b>TODO (contributions are welcome)</b><br>
+<ul>
+</ul>
+</p>
+
+</body>
+</html>

Propchange: felix/sandbox/donsez/wireadmin.sample.freevmmemproducer/src/site/readme.html
------------------------------------------------------------------------------
    svn:eol-style = native