User: schaefera
Date: 01/05/30 22:38:51
Added: src/main/org/jboss/mgt ContainerMgt.java
ContainerMgtMBean.java
Log:
Added a MBean Wrapper for each created Container (as mentioned earlier
in an Email) to be able to get a handle on deployed EJBs.
Revision Changes Path
1.1 jboss/src/main/org/jboss/mgt/ContainerMgt.java
Index: ContainerMgt.java
===================================================================
/*
* JBoss, the OpenSource EJB server
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
*/
package org.jboss.mgt;
/*
import java.beans.Beans;
import java.beans.beancontext.BeanContextServicesSupport;
import java.net.URL;
import java.net.URLClassLoader;
import java.net.MalformedURLException;
import java.io.File;
import java.io.InputStream;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.rmi.RemoteException;
import java.rmi.ServerException;
import java.rmi.server.UnicastRemoteObject;
import java.util.Properties;
import java.util.Iterator;
import java.util.HashMap;
import java.util.ArrayList;
import java.util.StringTokenizer;
import java.util.jar.JarFile;
import java.util.jar.Manifest;
import java.util.jar.Attributes;
*/
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.Name;
import javax.naming.NameNotFoundException;
import javax.naming.NamingException;
import javax.management.MBeanServer;
import javax.management.MBeanRegistration;
import javax.management.ObjectName;
import javax.transaction.TransactionManager;
import org.jboss.ejb.Container;
import org.jboss.logging.Log;
import org.jboss.logging.ConsoleLogging;
import org.jboss.logging.ConsoleLoggingMBean;
import org.jboss.util.MBeanProxy;
import org.jboss.web.WebServiceMBean;
import org.jboss.metadata.ApplicationMetaData;
import org.jboss.metadata.BeanMetaData;
import org.jboss.metadata.SessionMetaData;
import org.jboss.metadata.EntityMetaData;
import org.jboss.metadata.MessageDrivenMetaData;
import org.jboss.metadata.ConfigurationMetaData;
import org.jboss.metadata.XmlLoadable;
import org.jboss.metadata.XmlFileLoader;
import org.jboss.logging.Logger;
import org.jboss.mgt.EJB;
import org.jboss.mgt.Module;
/**
* A ContainerMgt is used as the long arm of a deployed EJB's container.
*
* @see Container
* @author Andreas Schaefer ([EMAIL PROTECTED])
*
* @version $Revision: 1.1 $
*/
public class ContainerMgt
extends org.jboss.util.ServiceMBeanSupport
implements ContainerMgtMBean
{
// Attributes ----------------------------------------------------
// Container this is the management proxy for
Container mContainer = null;
// The logger of this service
Log mLog = Log.createLog( getName() );
// Public --------------------------------------------------------
public void setContainer( Container pContainer ) {
mContainer = pContainer;
}
public Container getContainer() {
return mContainer;
}
/**
* Implements the abstract <code>getObjectName()</code> method in superclass
* to return this service's name.
*
* @param server
* @param name
*
* @exception MalformedObjectNameException
* @return
*/
public ObjectName getObjectName( MBeanServer server, ObjectName name )
throws javax.management.MalformedObjectNameException
{
return name;
}
/**
* Implements the abstract <code>getName()</code> method in superclass to
* return the name of this object.
*
* @return <tt>'Container factory'</code>
*/
public String getName() {
return "Container Management Proxy";
}
/**
* Implements the template method in superclass. This method stops all the
* applications in this server.
*/
public void stopService() {
}
/**
* Implements the template method in superclass. This method destroys all
* the applications in this server and clears the deployments list.
*/
public void destroyService() {
}
}
1.1 jboss/src/main/org/jboss/mgt/ContainerMgtMBean.java
Index: ContainerMgtMBean.java
===================================================================
/*
* JBoss, the OpenSource EJB server
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
*/
package org.jboss.mgt;
import org.jboss.ejb.Container;
/**
* This is the interface of the ContainerMgt that is exposed for administration
*
* @see ContainerMgt
* @author Andreas Schaefer ([EMAIL PROTECTED])
*
* @version $Revision: 1.1 $
*/
public interface ContainerMgtMBean
extends org.jboss.util.ServiceMBean
{
// Constants -----------------------------------------------------
// Public --------------------------------------------------------
/**
* Sets the container this is the management proxy for
*
* @param pContainer Container which this refers to. Must not be null.
**/
public void setContainer( Container pContainer );
/**
* @return Container this is a proxy for
**/
public Container getContainer();
}
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development