KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > fulcrum > yaafi > cli > Shutdown


1 package org.apache.fulcrum.yaafi.cli;
2
3 /*
4  * Copyright 2004 Apache Software Foundation
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
14  * implied.
15  *
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */

19
20 import org.apache.avalon.framework.activity.Disposable;
21 import org.apache.avalon.framework.logger.Logger;
22
23 /**
24  * This class process the shutdown notification from the JVM.
25  *
26  * @author <a HREF="mailto:siegfried.goeschl@it20one.at">Siegfried Goeschl</a>
27  * @version $Id: Shutdown.java,v 1.1 2004/10/19 22:03:51 epugh Exp $
28  */

29
30 public class Shutdown implements Runnable JavaDoc
31 {
32     /** The service manager tobe disposed */
33     private Disposable disposable;
34     
35     /** The logger to use */
36     private Logger logger;
37     
38     /**
39      * Constructor
40      * @param disposable The service manager to be disposed
41      */

42     public Shutdown( Disposable disposable, Logger logger )
43     {
44         this.disposable = disposable;
45         this.logger = logger;
46     }
47
48     /**
49      * @see java.lang.Runnable#run()
50      */

51     public void run()
52     {
53         this.logger.debug("The JVM is shutting down");
54         this.disposable.dispose();
55         this.disposable = null;
56     }
57 }
Popular Tags