KickJava   Java API By Example, From Geeks To Geeks.

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


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 StartMethod extends UpgradeMethod
18 {
19
20    public StartMethod(Kernel kernel)
21    {
22       super(kernel);
23    }
24
25    protected void checkState(Entry entry) throws TransitionNotPossibleException
26    {
27       entry.machine.start(true);
28    }
29
30    protected boolean doesDependantPreventsInvoke(Entry entry)
31    {
32       return entry.getState() == State.UNREGISTERED || entry.getState() == State.REGISTERED || entry.getState() == State.STOPPED;
33    }
34
35    protected void invokeMethod(Entry entry) throws Exception JavaDoc
36    {
37       entry.implementation.service.start();
38       entry.machine.start(false);
39    }
40
41    protected void invokeMethodOnDependsOnMe(Entry entry) throws KernelException
42    {
43       if (entry.getState() == State.REGISTERED || entry.getState() == State.STOPPED)
44       {
45          kernel.start(entry.id);
46       }
47    }
48 }
49
Popular Tags