hi
I have created the following plug-in and using it into my application. The problem
which I am facing is when I am running tomcat. The plug -in is not starting. The basic
idea behind this plugin is to start a thread and peform some logic after some interval
of time.
ANy suggestions will be of great help.
Following is the code for Plugin Class and the struts-config.xml
PlugTest.java
package efit;
import java.io.PrintStream;
import javax.servlet.ServletException;
import org.apache.struts.action.ActionServlet;
import org.apache.struts.action.PlugIn;
import org.apache.struts.config.ApplicationConfig;
public class PluginTest
implements PlugIn, Runnable
{
public PluginTest()
{
t = null;
}
public void init(ActionServlet servlet, ApplicationConfig applicationConfig)
throws ServletException
{
System.out.println("The Plugin is starting");
t = new Thread(this);
t.start();
}
public void destroy()
{
System.err.println("\u2212\u2212\u2212\u2212>The Plugin is
stopping<\u2212\u2212\u2212\u2212");
}
public void run()
{
do
{
System.out.println("Plugin is Running");
try
{
Thread.sleep(1000L);
}
catch(Exception t)
{
System.out.println("Exception in Thread" + t.getMessage());
}
} while(true);
}
Thread t;
}
in the Struts-config.xml I m using the plugin usiong the following tag
<plug-in className="efit.PluginTest"/>
Thanks
Gary