donaldp 01/04/24 22:28:01
Modified: src/java/org/apache/phoenix/engine/facilities/application
DefaultApplicationManager.java
Log:
implement new ApplicationManager interface by delegating to SystemManager.
Revision Changes Path
1.4 +39 -0
jakarta-avalon-phoenix/src/java/org/apache/phoenix/engine/facilities/application/DefaultApplicationManager.java
Index: DefaultApplicationManager.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon-phoenix/src/java/org/apache/phoenix/engine/facilities/application/DefaultApplicationManager.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- DefaultApplicationManager.java 2001/04/24 09:54:48 1.3
+++ DefaultApplicationManager.java 2001/04/25 05:28:01 1.4
@@ -7,6 +7,7 @@
*/
package org.apache.phoenix.engine.facilities.application;
+import org.apache.avalon.atlantis.ManagerException;
import org.apache.avalon.atlantis.SystemManager;
import org.apache.avalon.component.ComponentException;
import org.apache.avalon.component.ComponentManager;
@@ -14,6 +15,7 @@
import org.apache.avalon.context.Context;
import org.apache.avalon.context.ContextException;
import org.apache.avalon.context.Contextualizable;
+import org.apache.phoenix.Block;
import org.apache.phoenix.engine.facilities.ApplicationManager;
/**
@@ -40,5 +42,42 @@
{
m_systemManager = (SystemManager)componentManager.
lookup( "org.apache.avalon.atlantis.SystemManager" );
+ }
+
+ /**
+ * Register a block for management.
+ * The block is exported through some management scheme
+ * (typically JMX) and the management is restricted
+ * to the interfaces passed in as a parameter to method.
+ *
+ * @param name the name to register block under
+ * @param block the block
+ * @param interfaces the interfaces to register the component under
+ * @exception ManagerException if an error occurs. An error could occur if the
block doesn't
+ * implement the interfaces, the interfaces parameter contain
non-instance
+ * classes, the name is already registered etc.
+ * @exception IllegalArgumentException if block or interfaces is null
+ */
+ public void register( final String name, final Block block, final Class[]
interfaces )
+ throws ManagerException, IllegalArgumentException
+ {
+ m_systemManager.register( getFQNFor( name ), block, interfaces );
+ }
+
+ /**
+ * Unregister named block.
+ *
+ * @param name the name of block to unregister
+ * @exception ManagerException if an error occurs such as when no such block
registered.
+ */
+ public void unregister( final String name )
+ throws ManagerException
+ {
+ m_systemManager.unregister( getFQNFor( name ) );
+ }
+
+ protected String getFQNFor( final String name )
+ {
+ return m_name + "/" + name;
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]