Author: nextgens
Date: 2006-02-22 21:34:06 +0000 (Wed, 22 Feb 2006)
New Revision: 8114

Added:
   trunk/plugins/HelloWorld/
   trunk/plugins/HelloWorld/HelloWorld.java
Log:
A small HelloWorld plugin writing a date every seconds on TCMI

Added: trunk/plugins/HelloWorld/HelloWorld.java
===================================================================
--- trunk/plugins/HelloWorld/HelloWorld.java    2006-02-22 21:12:38 UTC (rev 
8113)
+++ trunk/plugins/HelloWorld/HelloWorld.java    2006-02-22 21:34:06 UTC (rev 
8114)
@@ -0,0 +1,39 @@
+package plugins;
+
+import freenet.pluginmanager.*;
+
+import java.util.Date;
+
+
+public class HelloWorld implements FredPlugin {
+       boolean goon = true;
+       PluginRespirator pr;
+
+       public void terminate() {
+               goon = false;
+       }
+
+       public void runPlugin(PluginRespirator pr) {
+               this.pr = pr;
+               
+               while(goon) {
+                       System.err.println("Heartbeat from HelloWorld-plugin: " 
+ (new Date()));
+                       try {
+                               Thread.sleep(1000);
+                       } catch (InterruptedException e) {
+                               e.printStackTrace();
+                       }
+               }
+       }
+       
+       public boolean handles(int thing) {
+               switch (thing) {
+                       case FredPlugin.handleFproxy: return false;
+                       //We don't handle it
+               }
+               return false;
+       }
+
+       public String handleHTTPGet(String path){
+       }
+}


Reply via email to