cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Berin Loritsch <blorit...@d-haven.org>
Subject Re: dispose() problem
Date Tue, 25 May 2004 16:46:40 GMT
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.


Mime
View raw message