KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > portal > server > kernel > StopMethod


1 /*****************************************
2  * *
3  * JBoss Portal: The OpenSource Portal *
4  * *
5  * Distributable under LGPL license. *
6  * See terms of license at gnu.org. *
7  * *
8  *****************************************/

9 package org.jboss.portal.server.kernel;
10
11 import org.jboss.portal.server.kernel.state.State;
12
13 /**
14  * @author <a HREF="mailto:julien@jboss.org">Julien Viet</a>
15  * @version $Revision: 1.1.1.1 $
16  */

17 public class StopMethod extends DowngradeMethod
18 {
19
20    public StopMethod(Kernel kernel)
21    {
22       super(kernel);
23    }
24
25    protected void checkState(Entry entry) throws TransitionNotPossibleException
26    {
27       entry.machine.stop(true);
28    }
29
30    protected void invokeMethod(Entry entry) throws Exception JavaDoc
31    {
32       entry.implementation.service.stop();
33       entry.machine.stop(false);
34    }
35
36    protected void invokeMethodOnDependsOnMe(Entry entry) throws KernelException
37    {
38       if (entry.getState() == State.STARTED)
39       {
40          kernel.stop(entry.id);
41       }
42    }
43 }
44
Popular Tags