View Javadoc

1   /*
2   Karma core - Core of the Karma application
3   Copyright (C) 2004  Toolforge <www.toolforge.nl>
4   
5   This library is free software; you can redistribute it and/or
6   modify it under the terms of the GNU Lesser General Public
7   License as published by the Free Software Foundation; either
8   version 2.1 of the License, or (at your option) any later version.
9   
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  Lesser General Public License for more details.
14  
15  You should have received a copy of the GNU Lesser General Public
16  License along with this library; if not, write to the Free Software
17  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18  */
19  package nl.toolforge.karma.core.cmd.impl;
20  
21  import nl.toolforge.karma.core.cmd.CommandDescriptor;
22  import nl.toolforge.karma.core.cmd.CommandException;
23  import nl.toolforge.karma.core.cmd.CommandResponse;
24  import nl.toolforge.karma.core.cmd.DefaultCommand;
25  import org.apache.commons.logging.Log;
26  import org.apache.commons.logging.LogFactory;
27  
28  import java.sql.Timestamp;
29  
30  /***
31   *
32   * @author W.G. Helmantel
33   * @version $Id: ExitCleanCommand.java,v 1.3 2004/10/09 21:24:25 asmedes Exp $
34   */
35  public class ExitCleanCommand extends DefaultCommand {
36  
37    private static Log logger = LogFactory.getLog(ExitCleanCommand.class);
38  
39    protected CommandResponse response = new CommandResponse();
40  
41    /***
42     *
43     * @param descriptor The command descriptor for this command.
44     */
45    public ExitCleanCommand(CommandDescriptor descriptor) {
46      super(descriptor);
47    }
48  
49    public void execute() throws CommandException {
50  
51  		// Consider clean exit specifics here ...
52  
53  		logger.info("Karma has left the building at: "+new Timestamp(System.currentTimeMillis()));
54  		System.exit(0);
55    }
56  
57    public CommandResponse getCommandResponse() {
58      return response;
59    }
60  }