felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From don...@apache.org
Subject svn commit: r706078 - in /felix/sandbox/donsez/shutdownhook/src/main: java/org/apache/felix/sandbox/shutdownhook/ShutdownHook.java resources/ resources/shutdownbanner.txt
Date Sun, 19 Oct 2008 22:30:41 GMT
Author: donsez
Date: Sun Oct 19 15:30:40 2008
New Revision: 706078

URL: http://svn.apache.org/viewvc?rev=706078&view=rev
Log:
add a shutdown banner in resources

Added:
    felix/sandbox/donsez/shutdownhook/src/main/resources/
    felix/sandbox/donsez/shutdownhook/src/main/resources/shutdownbanner.txt   (with props)
Modified:
    felix/sandbox/donsez/shutdownhook/src/main/java/org/apache/felix/sandbox/shutdownhook/ShutdownHook.java

Modified: felix/sandbox/donsez/shutdownhook/src/main/java/org/apache/felix/sandbox/shutdownhook/ShutdownHook.java
URL: http://svn.apache.org/viewvc/felix/sandbox/donsez/shutdownhook/src/main/java/org/apache/felix/sandbox/shutdownhook/ShutdownHook.java?rev=706078&r1=706077&r2=706078&view=diff
==============================================================================
--- felix/sandbox/donsez/shutdownhook/src/main/java/org/apache/felix/sandbox/shutdownhook/ShutdownHook.java
(original)
+++ felix/sandbox/donsez/shutdownhook/src/main/java/org/apache/felix/sandbox/shutdownhook/ShutdownHook.java
Sun Oct 19 15:30:40 2008
@@ -18,6 +18,11 @@
  */
 package org.apache.felix.sandbox.shutdownhook;
 
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+
 import org.osgi.framework.BundleActivator;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.BundleException;
@@ -42,11 +47,21 @@
 		hook=new Thread() {
 		    public void run() {
 		    	shutdownFlag=true;
-		    	log(bundleContext.getProperty(Constants.FRAMEWORK_VENDOR) + ": Bye bye !");
+		    	try {
+			    	BufferedReader br = new BufferedReader(new InputStreamReader(this.getClass().getClassLoader().getResourceAsStream("/shutdownbanner.txt")));
+			    	log(bundleContext.getProperty(Constants.FRAMEWORK_VENDOR));		    		
+			    	String line;
+			    	while((line=br.readLine())!=null) {
+				    	log(line);		    		
+			    	}
+					br.close();
+				} catch (IOException ioe) {
+					ioe.printStackTrace();
+				}
 		    	try {
 					bundleContext.getBundle(0).stop();
-				} catch (BundleException e) {
-					e.printStackTrace();
+				} catch (BundleException be) {
+					be.printStackTrace();
 				}
 		    }
 		};

Added: felix/sandbox/donsez/shutdownhook/src/main/resources/shutdownbanner.txt
URL: http://svn.apache.org/viewvc/felix/sandbox/donsez/shutdownhook/src/main/resources/shutdownbanner.txt?rev=706078&view=auto
==============================================================================
--- felix/sandbox/donsez/shutdownhook/src/main/resources/shutdownbanner.txt (added)
+++ felix/sandbox/donsez/shutdownhook/src/main/resources/shutdownbanner.txt Sun Oct 19 15:30:40
2008
@@ -0,0 +1,3 @@
+==================================
+Bye Bye !
+==================================
\ No newline at end of file

Propchange: felix/sandbox/donsez/shutdownhook/src/main/resources/shutdownbanner.txt
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message