KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > system > ServiceMBean


1 /*
2 * JBoss, Home of Professional Open Source
3 * Copyright 2005, JBoss Inc., and individual contributors as indicated
4 * by the @authors tag. See the copyright.txt in the distribution for a
5 * full listing of individual contributors.
6 *
7 * This is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU Lesser General Public License as
9 * published by the Free Software Foundation; either version 2.1 of
10 * the License, or (at your option) any later version.
11 *
12 * This software is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this software; if not, write to the Free
19 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21 */

22 package org.jboss.system;
23
24 /**
25  * An interface describing a JBoss service MBean.
26  *
27  * @see Service
28  * @see ServiceMBeanSupport
29  *
30  * @author <a HREF="mailto:rickard.oberg@telkel.com">Rickard Öberg</a>
31  * @author <a HREF="mailto:andreas@jboss.org">Andreas Schaefer</a>
32  * @author Scott.Stark@jboss.org
33  * @version $Revision: 57108 $
34  */

35 public interface ServiceMBean
36    extends Service
37 {
38    // Constants -----------------------------------------------------
39

40    /** ServiceController notification types corresponding to service lifecycle events */
41    public static final String JavaDoc CREATE_EVENT = "org.jboss.system.ServiceMBean.create";
42    public static final String JavaDoc START_EVENT = "org.jboss.system.ServiceMBean.start";
43    public static final String JavaDoc STOP_EVENT = "org.jboss.system.ServiceMBean.stop";
44    public static final String JavaDoc DESTROY_EVENT = "org.jboss.system.ServiceMBean.destroy";
45
46    public static final String JavaDoc[] states = {
47       "Stopped", "Stopping", "Starting", "Started", "Failed",
48       "Destroyed", "Created", "Unregistered", "Registered"
49    };
50
51    /** The Service.stop has completed */
52    public static final int STOPPED = 0;
53    /** The Service.stop has been invoked */
54    public static final int STOPPING = 1;
55    /** The Service.start has been invoked */
56    public static final int STARTING = 2;
57    /** The Service.start has completed */
58    public static final int STARTED = 3;
59    /** There has been an error during some operation */
60    public static final int FAILED = 4;
61    /** The Service.destroy has completed */
62    public static final int DESTROYED = 5;
63    /** The Service.create has completed */
64    public static final int CREATED = 6;
65    /** The MBean has been created but has not completed MBeanRegistration.postRegister */
66    public static final int UNREGISTERED = 7;
67    /** The MBean has been created and has completed MBeanRegistration.postRegister */
68    public static final int REGISTERED = 8;
69
70    // Public --------------------------------------------------------
71

72    String JavaDoc getName();
73    int getState();
74    String JavaDoc getStateString();
75    
76    /** Detyped lifecycle invocation */
77    void jbossInternalLifecycle(String JavaDoc method) throws Exception JavaDoc;
78 }
79
Popular Tags