remm 02/01/29 14:57:26
Modified: modeler/src/java/org/apache/commons/modeler
BaseModelMBean.java
Log:
- Add accessor for the managed object.
Patch submitted by Amy Roh.
Revision Changes Path
1.3 +29 -4
jakarta-commons-sandbox/modeler/src/java/org/apache/commons/modeler/BaseModelMBean.java
Index: BaseModelMBean.java
===================================================================
RCS file:
/home/cvs/jakarta-commons-sandbox/modeler/src/java/org/apache/commons/modeler/BaseModelMBean.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- BaseModelMBean.java 15 Jan 2002 19:28:46 -0000 1.2
+++ BaseModelMBean.java 29 Jan 2002 22:57:26 -0000 1.3
@@ -1,7 +1,7 @@
/*
- * $Header:
/home/cvs/jakarta-commons-sandbox/modeler/src/java/org/apache/commons/modeler/BaseModelMBean.java,v
1.2 2002/01/15 19:28:46 remm Exp $
- * $Revision: 1.2 $
- * $Date: 2002/01/15 19:28:46 $
+ * $Header:
/home/cvs/jakarta-commons-sandbox/modeler/src/java/org/apache/commons/modeler/BaseModelMBean.java,v
1.3 2002/01/29 22:57:26 remm Exp $
+ * $Revision: 1.3 $
+ * $Date: 2002/01/29 22:57:26 $
*
* ====================================================================
*
@@ -122,7 +122,7 @@
* </ul>
*
* @author Craig R. McClanahan
- * @version $Revision: 1.2 $ $Date: 2002/01/15 19:28:46 $
+ * @version $Revision: 1.3 $ $Date: 2002/01/29 22:57:26 $
*/
public class BaseModelMBean implements ModelMBean {
@@ -496,6 +496,31 @@
// ----------------------------------------------------- ModelMBean Methods
+
+
+ /**
+ * Get the instance handle of the object against which we execute
+ * all methods in this ModelMBean management interface.
+ *
+ * @exception InstanceNotFoundException if the managed resource object
+ * cannot be found
+ * @exception MBeanException if the initializer of the object throws
+ * an exception
+ * @exception RuntimeOperationsException if the managed resource or the
+ * resource type is <code>null</code> or invalid
+ */
+ public Object getManagedResource()
+ throws InstanceNotFoundException, InvalidTargetObjectTypeException,
+ MBeanException, RuntimeOperationsException {
+
+ if (resource == null)
+ throw new RuntimeOperationsException
+ (new IllegalArgumentException("Managed resource is null"),
+ "Managed resource is null");
+
+ return resource;
+
+ }
/**
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>