User: schaefera
Date: 01/12/03 19:24:36
Modified: src/main/org/jboss/system ServiceMBean.java
ServiceMBeanSupport.java
Log:
Remove any error logs. Implemented MEJBBean code therefore it works
like the EJB-Adaptor. Later on it will migrate to the definit JSR-77
implementation as soon as the spec. is more specific.
Revision Changes Path
1.3 +15 -5 jboss/src/main/org/jboss/system/ServiceMBean.java
Index: ServiceMBean.java
===================================================================
RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/system/ServiceMBean.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ServiceMBean.java 2001/09/08 00:53:57 1.2
+++ ServiceMBean.java 2001/12/04 03:24:36 1.3
@@ -8,25 +8,35 @@
/**
* An interface describing a JBoss service MBean.
- *
+ *
* @see Service
* @see ServiceMBeanSupport
+ *
+ * @author <a href="mailto:[EMAIL PROTECTED]">Rickard �berg</a>
+ * @author <a href="mailto:[EMAIL PROTECTED]">Scott Stark</a>
+ * @author <a href="mailto:[EMAIL PROTECTED]">Andreas Schaefer</a>
+ * @version $Revision: 1.3 $
+ *
+ * <p><b>Revisions:</b>
*
- * @author <a href="mailto:[EMAIL PROTECTED]">Rickard �berg</a>.
- * @author <a href="mailto:[EMAIL PROTECTED]">Scott Stark</a>.
- * @version $Revision: 1.2 $
+ * <p><b>20011202 Andreas Schaefer:</b>
+ * <ul>
+ * <li> Added new state FAILED which the Service goes to when starting
+ * or stopping fails.
+ * </ul>
*/
public interface ServiceMBean
extends Service
{
// Constants -----------------------------------------------------
- String[] states = { "Stopped", "Stopping", "Starting", "Started" };
+ String[] states = { "Stopped", "Stopping", "Starting", "Started", "Failed" };
int STOPPED = 0;
int STOPPING = 1;
int STARTING = 2;
int STARTED = 3;
+ int FAILED = 4;
// Public --------------------------------------------------------
1.8 +14 -8 jboss/src/main/org/jboss/system/ServiceMBeanSupport.java
Index: ServiceMBeanSupport.java
===================================================================
RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/system/ServiceMBeanSupport.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- ServiceMBeanSupport.java 2001/12/03 02:26:01 1.7
+++ ServiceMBeanSupport.java 2001/12/04 03:24:36 1.8
@@ -29,7 +29,7 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Rickard �berg</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Scott Stark</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Andreas Schaefer</a>
- * @version $Revision: 1.7 $
+ * @version $Revision: 1.8 $
*
* <p><b>Revisions:</b>
*
@@ -117,7 +117,7 @@
public void start()
throws Exception
{
- if (getState() != STOPPED)
+ if (getState() != STOPPED && getState() != FAILED)
return;
state = STARTING;
@@ -131,10 +131,10 @@
}
catch (Exception e)
{
- state = STOPPED;
+ state = FAILED;
//AS It seems that the first attribute is not needed anymore and use a
long instead of a Date
- sendNotification(new AttributeChangeNotification(this, id++, new
Date().getTime(), getName()+" stopped", "State", "java.lang.Integer", new
Integer(STARTING), new Integer(STOPPED)));
- log.error("Stopped", e);
+ sendNotification(new AttributeChangeNotification(this, id++, new
Date().getTime(), getName()+" failed", "State", "java.lang.Integer", new
Integer(STARTING), new Integer(FAILED)));
+ log.error("Failed", e);
throw e;
}
finally
@@ -164,14 +164,20 @@
}
catch (Throwable e)
{
- log.error(e);
+ state = FAILED;
+ //AS It seems that the first attribute is not needed anymore and use a
long instead of a Date
+ sendNotification(new AttributeChangeNotification(this, id++, new
Date().getTime(), getName()+" failed", "State", "java.lang.Integer", new
Integer(STOPPING), new Integer(FAILED)));
+ log.error("Failed", e);
+ return;
}
-
+ finally
+ {
+ NDC.pop();
+ }
state = STOPPED;
//AS It seems that the first attribute is not needed anymore and use a long
instead of a Date
sendNotification(new AttributeChangeNotification(this, id++, new
Date().getTime(), getName()+" stopped", "State", "java.lang.Integer", new
Integer(STOPPING), new Integer(STOPPED)));
log.info("Stopped");
- NDC.pop();
}
public void init() throws Exception
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development