Tony Collen wrote:
jitong wang wrote:
Hello, Berrin yes! this is the source code: public void dispose() { try{ File f = new File("E:\\file.txt"); PrintWriter out = new PrintWriter(new FileWriter(f)); out.println("The server is shutting down!"); out.flush(); out.close(); }catch (IOException e){}
}
I think what Berin was getting at was whether you declared your generator to implement the Disposable interface.
Correct. does the class declaration look something like this:
public class MyComponent implements ..., ..., Disposable, ...
{
public void dispose() {
// ....
}
}If it does not declare that it implements that interface, then the framework will not know that the method exists--it is not using reflection to find and call the method.
