felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From don...@apache.org
Subject svn commit: r713732 - in /felix/sandbox/donsez/monitor.sample.usagemonitor: pom.xml src/main/java/org/apache/felix/sandbox/monitor/sample/Activator.java src/main/java/org/apache/felix/sandbox/monitor/sample/cpumonitor/CPUUsageMonitor.java
Date Thu, 13 Nov 2008 14:25:28 GMT
Author: donsez
Date: Thu Nov 13 06:25:28 2008
New Revision: 713732

URL: http://svn.apache.org/viewvc?rev=713732&view=rev
Log:
change dependencies versions in pom.xml and add a test checking if the platform is running
under Linux/Unix

Modified:
    felix/sandbox/donsez/monitor.sample.usagemonitor/pom.xml
    felix/sandbox/donsez/monitor.sample.usagemonitor/src/main/java/org/apache/felix/sandbox/monitor/sample/Activator.java
    felix/sandbox/donsez/monitor.sample.usagemonitor/src/main/java/org/apache/felix/sandbox/monitor/sample/cpumonitor/CPUUsageMonitor.java

Modified: felix/sandbox/donsez/monitor.sample.usagemonitor/pom.xml
URL: http://svn.apache.org/viewvc/felix/sandbox/donsez/monitor.sample.usagemonitor/pom.xml?rev=713732&r1=713731&r2=713732&view=diff
==============================================================================
--- felix/sandbox/donsez/monitor.sample.usagemonitor/pom.xml (original)
+++ felix/sandbox/donsez/monitor.sample.usagemonitor/pom.xml Thu Nov 13 06:25:28 2008
@@ -23,35 +23,42 @@
 		<description>provides a sample of Monitorable service.</description>
 	</properties>  
 
+<!--
   <parent>
-    <groupId>org.apache.felix</groupId>
-    <artifactId>felix</artifactId>
-    <version>0.9.0-incubator-SNAPSHOT</version>
+    <groupId>org.apache.felix.sandbox</groupId>
+    <artifactId>sandbox</artifactId>
+    <version>0.1.0-SNAPSHOT</version>
   </parent>
-  
+-->
+
   <modelVersion>4.0.0</modelVersion>
   <packaging>bundle</packaging>
   <name>Apache Felix Monitor Admin Sample : OS Memory and CPU Monitors</name>
+  
   <artifactId>org.apache.felix.sandbox.monitor.sample.usagemonitor</artifactId>
+ <groupId>org.apache.felix.sandbox</groupId>
+  <version>0.1.0-SNAPSHOT</version>
+
   <description>${description}</description>
 
   <dependencies>
     <dependency>
-      <groupId>${pom.groupId}</groupId>
+      <groupId>org.apache.felix</groupId>
       <artifactId>org.osgi.core</artifactId>
-      <version>${pom.version}</version>
+      <version>1.0.0</version>
     </dependency>
     <dependency>
-      <groupId>${pom.groupId}</groupId>
+      <groupId>org.apache.felix</groupId>
       <artifactId>org.osgi.compendium</artifactId>
-      <version>${pom.version}</version>
+      <version>1.0.0</version>
     </dependency>
     <dependency>
-      <groupId>${pom.groupId}</groupId>
       <artifactId>org.apache.felix.sandbox.monitor</artifactId>
-      <version>${pom.version}</version>
+      <groupId>org.apache.felix.sandbox</groupId>
+      <version>0.1.0-SNAPSHOT</version>
     </dependency>
   </dependencies>
+
   <build>
     <plugins>
       <plugin>
@@ -67,42 +74,13 @@
             	org.osgi.service.monitor.Monitorable
             </Export-Service>
 
-            <Private-Package>org.apache.felix.sandbox.monitor.sample.usagemonitor,org.apache.felix.sandbox.monitor.sample</Private-Package>
+            <Private-Package>org.apache.felix.sandbox.monitor.sample,org.apache.felix.sandbox.monitor.sample.*</Private-Package>
             <Import-Package>*</Import-Package>
             
             <Bundle-Activator>org.apache.felix.sandbox.monitor.sample.Activator</Bundle-Activator>
-
-            <!--
-            <Bundle-DocURL>${repositoryLocation}${pom.artifactId}/index.html</Bundle-DocURL>
-            <Bundle-Url>${repositoryLocation}${pom.artifactId}/${pom.artifactId}-${pom.version}.jar</Bundle-Url>
-            <Bundle-Source>${repositoryLocation}${pom.artifactId}/${pom.artifactId}-${pom.version}-src.jar</Bundle-Source>
-			-->
-			
-            <!--
-            <Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName>
-            <Bundle-Description>${description}</Bundle-Description>
-            <Bundle-Vendor>Apache Software Foundation</Bundle-Vendor>
-			-->
-
           </instructions>
         </configuration>
       </plugin>
     </plugins>
   </build>
-  <!--
-  <repositories>
-    <repository>
-      <id>apache.m2.incubator</id>
-      <name>Apache M2 Incubator Repository</name>
-      <url>http://people.apache.org/repo/m2-incubating-repository/</url>
-    </repository>
-  </repositories>
-  <pluginRepositories>
-    <pluginRepository>
-      <id>apache.m2.incubator</id>
-      <name>Apache M2 Incubator Repository</name>
-      <url>http://people.apache.org/repo/m2-incubating-repository/</url>
-    </pluginRepository>
-  </pluginRepositories>
-  -->
 </project>

Modified: felix/sandbox/donsez/monitor.sample.usagemonitor/src/main/java/org/apache/felix/sandbox/monitor/sample/Activator.java
URL: http://svn.apache.org/viewvc/felix/sandbox/donsez/monitor.sample.usagemonitor/src/main/java/org/apache/felix/sandbox/monitor/sample/Activator.java?rev=713732&r1=713731&r2=713732&view=diff
==============================================================================
--- felix/sandbox/donsez/monitor.sample.usagemonitor/src/main/java/org/apache/felix/sandbox/monitor/sample/Activator.java
(original)
+++ felix/sandbox/donsez/monitor.sample.usagemonitor/src/main/java/org/apache/felix/sandbox/monitor/sample/Activator.java
Thu Nov 13 06:25:28 2008
@@ -37,10 +37,7 @@
 	private List bundleActivators=new ArrayList();
 
 	public void start(BundleContext bundleContext) throws Exception {
-		
-		// TODO test if the operating system is Unix-based
-		
-		
+				
 		BundleActivator bundleActivator;
 		
 		bundleActivator=new OSMemoryUsageMonitor();

Modified: felix/sandbox/donsez/monitor.sample.usagemonitor/src/main/java/org/apache/felix/sandbox/monitor/sample/cpumonitor/CPUUsageMonitor.java
URL: http://svn.apache.org/viewvc/felix/sandbox/donsez/monitor.sample.usagemonitor/src/main/java/org/apache/felix/sandbox/monitor/sample/cpumonitor/CPUUsageMonitor.java?rev=713732&r1=713731&r2=713732&view=diff
==============================================================================
--- felix/sandbox/donsez/monitor.sample.usagemonitor/src/main/java/org/apache/felix/sandbox/monitor/sample/cpumonitor/CPUUsageMonitor.java
(original)
+++ felix/sandbox/donsez/monitor.sample.usagemonitor/src/main/java/org/apache/felix/sandbox/monitor/sample/cpumonitor/CPUUsageMonitor.java
Thu Nov 13 06:25:28 2008
@@ -57,7 +57,13 @@
 
 	}
 
+	private static final String badOSErrorMessage="This bundle could only run under Linux";
 	public void start(BundleContext context) throws Exception {
+		if(!context.getProperty(Constants.FRAMEWORK_OS_NAME).equals("Linux")) {
+			System.out.println(badOSErrorMessage);
+			throw new Exception(badOSErrorMessage);
+		}
+
 		Dictionary properties = new Hashtable();
 		properties.put(Constants.SERVICE_PID, SERVICE_PID);
 		properties.put(Constants.SERVICE_DESCRIPTION,



Mime
View raw message