[jboss-cvs] JBossAS SVN: r73148 - projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu May 8 08:19:49 EDT 2008


Author: wolfc
Date: 2008-05-08 08:19:49 -0400 (Thu, 08 May 2008)
New Revision: 73148

Removed:
   projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/Ejb3JmxDeployment.java
   projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/Ejb3ModuleMBean.java
   projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/JmxClientKernelAbstraction.java
   projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/JmxDependencyPolicy.java
   projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/JmxDeploymentScopeImpl.java
   projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/JmxDeploymentUnit.java
   projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/JmxKernelAbstraction.java
Modified:
   projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/Ejb3Module.java
   projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/KernelAbstractionFactory.java
   projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/MCClientKernelAbstraction.java
Log:
EJBTHREE-1293: removed JMX deployment features

Deleted: projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/Ejb3JmxDeployment.java
===================================================================
--- projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/Ejb3JmxDeployment.java	2008-05-08 12:18:58 UTC (rev 73147)
+++ projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/Ejb3JmxDeployment.java	2008-05-08 12:19:49 UTC (rev 73148)
@@ -1,69 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ejb3;
-
-import javax.security.jacc.PolicyConfiguration;
-
-import org.jboss.deployment.DeploymentInfo;
-import org.jboss.ejb3.javaee.JavaEEComponent; 
-import org.jboss.logging.Logger;
-
-/**
- * JBoss 4.0 Microkernel specific implementation
- *
- * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
- * @version $Revision$
- */
- at Deprecated
-public class Ejb3JmxDeployment extends Ejb3Deployment
-{
-   private DeploymentInfo deploymentInfo;
-
-   private static final Logger log = Logger.getLogger(Ejb3JmxDeployment.class);
-
-   public Ejb3JmxDeployment(DeploymentInfo di, DeploymentScope deploymentScope)
-   {
-      super(new JmxDeploymentUnit(di), deploymentScope, null, null);
-      this.deploymentInfo = di;
-      kernelAbstraction = new JmxKernelAbstraction(di);
-
-      // todo maybe mbeanServer should be injected?
-      mbeanServer = di.getServer();
-   }
-
-   protected PolicyConfiguration createPolicyConfiguration() throws Exception
-   {
-	   throw new IllegalStateException("This method should not be called"); 	   
-   }
-
-   protected void putJaccInService(PolicyConfiguration pc, DeploymentUnit unit)
-   {
-	   throw new IllegalStateException("This method should not be called"); 
-   }
-
-   public DependencyPolicy createDependencyPolicy(JavaEEComponent component)
-   {
-      return new JmxDependencyPolicy();
-   }
-
-
-}

Modified: projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/Ejb3Module.java
===================================================================
--- projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/Ejb3Module.java	2008-05-08 12:18:58 UTC (rev 73147)
+++ projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/Ejb3Module.java	2008-05-08 12:19:49 UTC (rev 73148)
@@ -21,11 +21,6 @@
  */
 package org.jboss.ejb3;
 
-import java.util.Map;
-import javax.management.ObjectName;
-import org.jboss.deployment.DeploymentInfo;
-import org.jboss.system.ServiceMBeanSupport;
-import org.jboss.logging.Logger;
 
 /**
  * An EjbModule represents a collection of beans that are deployed as a unit.
@@ -34,108 +29,7 @@
  * @version $Revision$
  */
 @Deprecated
-public class Ejb3Module extends ServiceMBeanSupport implements Ejb3ModuleMBean
+public class Ejb3Module
 {
    public final static String BASE_EJB3_JMX_NAME = "jboss.j2ee:service=EJB3";
-   private static final Logger log = Logger.getLogger(Ejb3Module.class);
-
-   private Ejb3JmxDeployment deployment;
-   private DeploymentInfo di;
-
-    public Ejb3Module(DeploymentInfo di)
-    {
-       DeploymentScope deploymentScope = null;
-       if (di.parent != null)
-       {
-          if (di.parent.shortName.endsWith(".ear") || di.parent.shortName.endsWith(".ear/"))
-          {
-             synchronized(di.parent.context)
-             {
-                deploymentScope = (DeploymentScope)di.parent.context.get("EJB3_EAR_METADATA");
-                if (deploymentScope == null)
-                {
-                   deploymentScope = new JmxDeploymentScopeImpl(di.parent.shortName);
-                   di.parent.context.put("EJB3_EAR_METADATA", deploymentScope);
-                }
-             }
-          }
-       }
-       deployment = new Ejb3JmxDeployment(di, deploymentScope);
-       if (deploymentScope != null)
-       {
-          deploymentScope.register(deployment);
-       }
-       this.di = di;
-    }
-
-   protected void createService() throws Exception
-   {
-      super.createService();
-      ClassLoader old = Thread.currentThread().getContextClassLoader();
-      try
-      {
-         Thread.currentThread().setContextClassLoader(di.ucl);
-         deployment.create();
-      }
-      finally
-      {
-         Thread.currentThread().setContextClassLoader(old);
-      }
-   }
-
-   protected void startService() throws Exception
-   {
-      ClassLoader old = Thread.currentThread().getContextClassLoader();
-      try
-      {
-         Thread.currentThread().setContextClassLoader(di.ucl);
-         deployment.start();
-      }
-      finally
-      {
-         Thread.currentThread().setContextClassLoader(old);
-      }
-      super.startService();
-
-   }
-
-   protected void stopService() throws Exception
-   {
-      ClassLoader old = Thread.currentThread().getContextClassLoader();
-      try
-      {
-         Thread.currentThread().setContextClassLoader(di.ucl);
-         deployment.stop();
-      }
-      finally
-      {
-         Thread.currentThread().setContextClassLoader(old);
-      }
-      super.stopService();
-   }
-
-   protected void destroyService() throws Exception
-   {
-      ClassLoader old = Thread.currentThread().getContextClassLoader();
-      try
-      {
-         Thread.currentThread().setContextClassLoader(di.ucl);
-         deployment.destroy();
-      }
-      finally
-      {
-         Thread.currentThread().setContextClassLoader(old);
-      }
-      super.destroyService();
-   }
-
-   public Container getContainer(ObjectName name)
-   {
-      return deployment.getContainer(name);
-   }
-
-   public Map getContainers()
-   {
-      return deployment.getEjbContainers();
-   }
 }

Deleted: projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/Ejb3ModuleMBean.java
===================================================================
--- projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/Ejb3ModuleMBean.java	2008-05-08 12:18:58 UTC (rev 73147)
+++ projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/Ejb3ModuleMBean.java	2008-05-08 12:19:49 UTC (rev 73148)
@@ -1,39 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ejb3;
-
-
-/**
- * MBean interface.
- *
- * @see Container
- * @see EJBDeployer
- */
-
-public interface Ejb3ModuleMBean extends org.jboss.system.ServiceMBean
-
-{
-   Container getContainer(javax.management.ObjectName name);
-
-   java.util.Map getContainers();
-}
-

Deleted: projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/JmxClientKernelAbstraction.java
===================================================================
--- projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/JmxClientKernelAbstraction.java	2008-05-08 12:18:58 UTC (rev 73147)
+++ projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/JmxClientKernelAbstraction.java	2008-05-08 12:19:49 UTC (rev 73148)
@@ -1,60 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.ejb3;
-
-import java.util.Set;
-
-import javax.management.MBeanServerConnection;
-import javax.management.ObjectName;
-import org.jboss.logging.Logger;
-
-/**
- * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
- */
-public class JmxClientKernelAbstraction implements ClientKernelAbstraction
-{
-   private static final Logger log = Logger.getLogger(JmxKernelAbstraction.class);
-
-   private MBeanServerConnection server;
-
-   public JmxClientKernelAbstraction(MBeanServerConnection server)
-   {
-      this.server = server;
-   }
-   
-   public Object invoke(ObjectName name, String operationName, Object[] params, String[] signature) throws Exception
-   {
-      return server.invoke(name, operationName, params, signature);
-   }
-   
-   public Object getAttribute(ObjectName name, String attribute) throws Exception
-   {
-      return server.getAttribute(name, attribute);
-   }
-   
-   public Set getMBeans(ObjectName query) throws Exception
-   {
-      Set mbeans = server.queryMBeans(query, null);
-      
-      return mbeans;
-   }
-}

Deleted: projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/JmxDependencyPolicy.java
===================================================================
--- projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/JmxDependencyPolicy.java	2008-05-08 12:18:58 UTC (rev 73147)
+++ projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/JmxDependencyPolicy.java	2008-05-08 12:19:49 UTC (rev 73148)
@@ -1,90 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ejb3;
-
-import java.util.Collection;
-import java.util.HashSet;
-import javax.management.MalformedObjectNameException;
-import javax.management.ObjectName;
-
-/**
- * Old JMX Kernel dependency registry
- *
- * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
- * @version $Revision$
- */
- at Deprecated
-public class JmxDependencyPolicy implements DependencyPolicy
-{
-   protected HashSet<ObjectName> dependencies = new HashSet<ObjectName>();
-
-   public void addDependency(String dependency)
-   {
-      ObjectName on = null;
-      try
-      {
-         on = new ObjectName(dependency);
-      }
-      catch (MalformedObjectNameException e)
-      {
-         throw new RuntimeException(dependency, e);
-      }
-      dependencies.add(on);
-   }
-
-   public Collection getDependencies()
-   {
-      return dependencies;
-   }
-
-   public Collection getDependencies(Collection currentDependencies)
-   {
-      dependencies.addAll(currentDependencies);
-      return dependencies;
-   }
-
-   public void addDatasource(String jndiName)
-   {
-      String ds = jndiName;
-      if (ds.startsWith("java:/"))
-      {
-         ds = ds.substring(6);
-
-      }
-      else if (ds.startsWith("java:"))
-      {
-         ds = ds.substring(5);
-      }
-      //tring onStr = "jboss.jca:name=" + ds + ",service=ManagedConnectionFactory";
-      String onStr = "jboss.jca:name=" + ds + ",service=DataSourceBinding";
-
-      try
-      {
-         dependencies.add(new ObjectName(onStr));
-      }
-      catch (MalformedObjectNameException e)
-      {
-         throw new RuntimeException(e);
-      }
-   }
-
-}

Deleted: projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/JmxDeploymentScopeImpl.java
===================================================================
--- projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/JmxDeploymentScopeImpl.java	2008-05-08 12:18:58 UTC (rev 73147)
+++ projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/JmxDeploymentScopeImpl.java	2008-05-08 12:19:49 UTC (rev 73148)
@@ -1,94 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.ejb3;
-
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.Collection;
-
-/**
- * JMX JBoss 4.x Kernel abstraction for an ear.
- *
- * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
- * @version $Revision: 1.17 $
- */
-public class JmxDeploymentScopeImpl implements DeploymentScope
-{
-   private ConcurrentHashMap<String, Ejb3Deployment> deployments = new ConcurrentHashMap<String, Ejb3Deployment>();
-   private String shortName;
-   private String baseName;
-
-   public JmxDeploymentScopeImpl(String shortName)
-   {
-      this.shortName = shortName;
-      int idx = shortName.lastIndexOf('.');
-      baseName = shortName.substring(0, idx);
-   }
-
-   public Collection<Ejb3Deployment> getEjbDeployments()
-   {
-      return deployments.values();
-   }
-
-   public void register(Ejb3Deployment deployment)
-   {
-      deployments.put(deployment.getDeploymentUnit().getShortName(), deployment);
-   }
-
-   public void unregister(Ejb3Deployment deployment)
-   {
-      deployments.remove(deployment.getDeploymentUnit().getShortName());
-   }
-
-   public Ejb3Deployment findRelativeDeployment(String relativeName)
-   {
-      String relativeShortName = relativeName.substring(3);
-      return deployments.get(relativeShortName);
-   }
-
-   public EJBContainer getEjbContainer(Class businessIntf, String vfsContext)
-   {
-      // TODO Auto-generated method stub
-      return null;
-   }
-
-   public EJBContainer getEjbContainer(String ejbLink, Class businessIntf, String vfsContext)
-   {
-      // TODO Auto-generated method stub
-      return null;
-   }
-
-   public String getName()
-   {
-      return shortName;
-   }
-   
-   public String getShortName()
-   {
-      return shortName;
-   }
-
-   public String getBaseName()
-   {
-      return baseName;
-   }
-
-}

Deleted: projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/JmxDeploymentUnit.java
===================================================================
--- projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/JmxDeploymentUnit.java	2008-05-08 12:18:58 UTC (rev 73147)
+++ projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/JmxDeploymentUnit.java	2008-05-08 12:19:49 UTC (rev 73148)
@@ -1,276 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ejb3;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.HashMap;
-import java.util.Hashtable;
-import java.util.List;
-import java.util.Map;
-
-import org.jboss.deployment.DeploymentInfo;
-import org.jboss.ejb3.interceptor.InterceptorInfoRepository;
-import org.jboss.logging.Logger;
-import org.jboss.mx.util.MBeanProxyExt;
-import org.jboss.virtual.VFS;
-import org.jboss.virtual.VirtualFile;
-import org.jboss.virtual.VirtualFileFilter;
-import org.jboss.virtual.VisitorAttributes;
-import org.jboss.virtual.plugins.context.jar.JarUtils;
-import org.jboss.virtual.plugins.vfs.helpers.FilterVirtualFileVisitor;
-import org.jboss.virtual.plugins.vfs.helpers.SuffixesExcludeFilter;
-
-/**
- * Comment
- *
- * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
- * @version $Revision$
- */
- at Deprecated
-public class JmxDeploymentUnit implements DeploymentUnit
-{
-   protected static final Logger log = Logger.getLogger(JmxDeploymentUnit.class);
-
-   private DeploymentInfo deploymentInfo;
-   InterceptorInfoRepository interceptorInfoRepository = new InterceptorInfoRepository(null);
-   private VirtualFile vfsRoot;
-   private Map<String, Object> attachments = new HashMap<String, Object>();
-
-   public JmxDeploymentUnit(DeploymentInfo deploymentInfo)
-   {
-      this.deploymentInfo = deploymentInfo;
-      try
-      {
-         VFS vfs = VFS.getVFS(deploymentInfo.url);
-         vfsRoot = vfs.getRoot();
-      }
-      catch (IOException e)
-      {
-         throw new RuntimeException();
-      }
-   }
-
-   public Object addAttachment(String name, Object attachment)
-   {
-      return attachments.put(name, attachment);
-   }
-   public Object getAttachment(String name)
-   {
-      return attachments.get(name);
-   }
-   public Object removeAttachment(String name)
-   {
-      return attachments.remove(name);
-   }
-
-   public VirtualFile getRootFile()
-   {
-      return vfsRoot;
-   }
-   
-   public String getRelativePath()
-   {
-      // TODO Auto-generated method stub
-      return null;
-   }
-
-   public URL getRelativeURL(String jar)
-   {
-      URL url = null;
-      try
-      {
-         url = new URL(jar);
-      }
-      catch (MalformedURLException e)
-      {
-         try
-         {
-            if (jar.startsWith(".."))
-            {
-               if (getUrl() == null)
-                  throw new RuntimeException("relative <jar-file> not allowed when standalone deployment unit is used");
-               String base = getUrl().toString();
-               jar = jar.replaceAll("\\.\\./", "+");
-               int idx = jar.lastIndexOf('+');
-               jar = jar.substring(idx + 1);
-               for (int i = 0; i < idx + 1; i++)
-               {
-                  int slash = base.lastIndexOf('/');
-                  base = base.substring(0, slash + 1);
-               }
-               url = new URL(base + jar.substring(idx));
-            }
-            else
-            {
-               File fp = new File(jar);
-               url = fp.toURL();
-            }
-         }
-         catch (MalformedURLException e1)
-         {
-            throw new RuntimeException("Unable to find relative url: " + jar, e1);
-         }
-      }
-      return url;
-   }
-
-   URL extractDescriptorUrl(String resource)
-   {
-      String urlStr = deploymentInfo.url.getFile();
-      // However the jar must also contain at least one ejb-jar.xml
-      try
-      {
-         URL dd = deploymentInfo.localCl.findResource(resource);
-         if (dd == null)
-         {
-            return null;
-         }
-
-         // If the DD url is not a subset of the urlStr then this is coming
-         // from a jar referenced by the deployment jar manifest and the
-         // this deployment jar it should not be treated as an ejb-jar
-         if (deploymentInfo.localUrl != null)
-         {
-            urlStr = deploymentInfo.localUrl.toString();
-         }
-
-         String ddStr = dd.toString();
-         if (ddStr.indexOf(urlStr) >= 0)
-         {
-            return dd;
-         }
-      }
-      catch (Exception ignore)
-      {
-      }
-      return null;
-   }
-
-   public URL getPersistenceXml()
-   {
-      return extractDescriptorUrl("META-INF/persistence.xml");
-   }
-
-   public URL getEjbJarXml()
-   {
-      return extractDescriptorUrl("META-INF/ejb-jar.xml");
-   }
-
-   public URL getJbossXml()
-   {
-      return extractDescriptorUrl("META-INF/jboss.xml");
-   }
-
-   public List<Class> getClasses()
-   {
-      return null;
-   }
-
-   public ClassLoader getClassLoader()
-   {
-      return deploymentInfo.ucl;
-   }
-
-   public ClassLoader getResourceLoader()
-   {
-      return deploymentInfo.localCl;
-   }
-
-   public String getShortName()
-   {
-      return deploymentInfo.shortName;
-   }
-
-   public URL getUrl()
-   {
-      return deploymentInfo.url;
-   }
-
-   public String getDefaultEntityManagerName()
-   {
-      String url = getUrl().toString();
-      String name = url.substring(url.lastIndexOf('/') + 1, url.lastIndexOf('.'));
-      return name;
-   }
-
-   public Map getDefaultPersistenceProperties()
-   {
-      try
-      {
-         EJB3DeployerMBean deployer = (EJB3DeployerMBean) MBeanProxyExt.create(EJB3DeployerMBean.class, EJB3DeployerMBean.OBJECT_NAME,
-                 deploymentInfo.getServer());
-
-         return deployer.getDefaultProperties();
-      }
-      catch (Exception e)
-      {
-         throw new RuntimeException(e);
-      }
-   }
-
-
-   public Hashtable getJndiProperties()
-   {
-      return null;
-   }
-
-   public InterceptorInfoRepository getInterceptorInfoRepository()
-   {
-      return interceptorInfoRepository;
-   }
-
-
-   public List<VirtualFile> getResources(VirtualFileFilter filter)
-   {
-      VisitorAttributes va = new VisitorAttributes();
-      va.setLeavesOnly(true);
-      SuffixesExcludeFilter noJars = new SuffixesExcludeFilter(JarUtils.getSuffixes());
-      va.setRecurseFilter(noJars);
-      FilterVirtualFileVisitor visitor = new FilterVirtualFileVisitor(filter, va);
-      try
-      {
-         vfsRoot.visit(visitor);
-      }
-      catch (IOException e)
-      {
-         throw new RuntimeException(e);
-      }
-      return visitor.getMatched();
-
-   }
-
-   public VirtualFile getMetaDataFile(String path)
-   {
-      try
-      {
-         return vfsRoot.getChild(path);
-      }
-      catch (IOException e)
-      {
-         log.debug("Cannot get meta data file: " + path);
-         return null;
-      }
-   }
-}

Deleted: projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/JmxKernelAbstraction.java
===================================================================
--- projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/JmxKernelAbstraction.java	2008-05-08 12:18:58 UTC (rev 73147)
+++ projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/JmxKernelAbstraction.java	2008-05-08 12:19:49 UTC (rev 73148)
@@ -1,181 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ejb3;
-
-import javax.management.DynamicMBean;
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-import org.jboss.deployment.DeploymentInfo;
-import org.jboss.mx.util.MBeanProxyExt;
-import org.jboss.system.ServiceControllerMBean;
-import org.jboss.system.ServiceMBeanSupport;
-import org.jboss.logging.Logger;
-
-/**
- * Comment
- *
- * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
- * @version $Revision$
- */
-public class JmxKernelAbstraction
-   extends JmxClientKernelAbstraction
-   implements KernelAbstraction
-{
-   private static final Logger log = Logger.getLogger(JmxKernelAbstraction.class);
-
-   private MBeanServer server;
-   private ServiceControllerMBean serviceController;
-   private DeploymentInfo di;
-
-   public JmxKernelAbstraction(DeploymentInfo di)
-   {
-      super(di.getServer());
-      this.server = di.getServer();
-      serviceController = (ServiceControllerMBean) MBeanProxyExt.create(ServiceControllerMBean.class, ServiceControllerMBean.OBJECT_NAME,
-            di.getServer());
-      this.di = di;
-   }
-   
-   public JmxKernelAbstraction(MBeanServer server)
-   {
-      super(server);
-      serviceController = (ServiceControllerMBean) MBeanProxyExt.create(ServiceControllerMBean.class, ServiceControllerMBean.OBJECT_NAME,
-                                                                        server);
-   }
-   
-   public void setMbeanServer(MBeanServer server)
-   {
-      this.server = server;
-   }
-
-
-   public void install(String name, DependencyPolicy dependencies,
-         DeploymentUnit unit, Object service)
-   {
-      if (!(service instanceof ServiceMBeanSupport) && !(service instanceof DynamicMBean))
-      {
-         log.debug("creating wrapper delegate for: " + service.getClass().getName());
-         // create mbean delegate.
-         service = new ServiceDelegateWrapper(service);
-      }
-      JmxDependencyPolicy policy = (JmxDependencyPolicy)dependencies;
-      try
-      {
-         log.info("installing MBean: " + name + " with dependencies:");
-         for (Object obj : policy.getDependencies())
-         {
-            log.info("\t" + obj);
-         }
-         ObjectName on = new ObjectName(name);
-         
-         if(policy.getDependencies().contains(on))
-            throw new IllegalStateException("circular dependencies detected");
-         
-         server.registerMBean(service, on);
-         addParentDependency(on);
-
-         serviceController.create(on, policy.getDependencies());
-         serviceController.start(on);
-      }
-      catch (Exception e)
-      {
-         throw new RuntimeException(e);
-      }
-   }
-
-   private void addParentDependency(ObjectName on)
-   {
-      //di.mbeans.add(on);
-
-      // this is done so that we can get dependency error messages.
-      // and this is the only reason this is done.
-      // if you don't put add to the top DI mbean list, then no dependency
-      // error message is printed out if there is one.
-      DeploymentInfo parent = di;
-      while (parent.parent != null)
-      {
-         parent = parent.parent;
-      }
-      parent.mbeans.add(on);
-
-   }
-   
-   private void removeParentDependency(ObjectName on)
-   {
-      DeploymentInfo parent = di;
-      while (parent.parent != null)
-      {
-         parent = parent.parent;
-      }
-      parent.mbeans.remove(on);
-   }
-
-   public void installMBean(ObjectName on, DependencyPolicy dependencies, Object service)
-   {
-      JmxDependencyPolicy policy = (JmxDependencyPolicy)dependencies;
-      try
-      {
-         server.registerMBean(service, on);
-         addParentDependency(on);
-         serviceController.create(on, policy.getDependencies());
-         serviceController.start(on);
-      }
-      catch (Exception e)
-      {
-         throw new RuntimeException(e);
-      }
-   }
-
-   public void uninstallMBean(ObjectName on)
-   {
-      try
-      {
-         serviceController.stop(on);
-         serviceController.destroy(on);
-         serviceController.remove(on);
-         removeParentDependency(on);
-         if(server.isRegistered(on))
-            server.unregisterMBean(on);
-         else
-            log.warn(on + " is not registered");
-      }
-      catch (Exception e)
-      {
-         throw new RuntimeException(e);
-      }
-   }
-
-   public void uninstall(String name)
-   {
-      ObjectName on;
-      try
-      {
-         on = new ObjectName(name);
-      }
-      catch (Exception e)
-      {
-         throw new RuntimeException(e);
-      }
-      
-      uninstallMBean(on);
-   }
-}

Modified: projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/KernelAbstractionFactory.java
===================================================================
--- projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/KernelAbstractionFactory.java	2008-05-08 12:18:58 UTC (rev 73147)
+++ projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/KernelAbstractionFactory.java	2008-05-08 12:19:49 UTC (rev 73148)
@@ -44,12 +44,7 @@
       if (kernelAbstraction == null)
       {
          MBeanServer mbeanServer = (MBeanServer)getMBeanServer();
-         if (kernel != null)
-            kernelAbstraction = new MCKernelAbstraction(kernel, mbeanServer);
-         else
-         {
-            kernelAbstraction = new JmxKernelAbstraction(mbeanServer);
-         }
+         kernelAbstraction = new MCKernelAbstraction(kernel, mbeanServer);
       }
      
      return kernelAbstraction;
@@ -59,15 +54,7 @@
    {
       if (clientKernelAbstraction == null)
       {
-         if (kernel != null)
-         {
-            clientKernelAbstraction = new MCClientKernelAbstraction(kernel);
-         }
-         else
-         {
-            MBeanServerConnection mbeanServer = (MBeanServerConnection)getMBeanServer();
-            clientKernelAbstraction = new JmxClientKernelAbstraction(mbeanServer);
-         }
+         clientKernelAbstraction = new MCClientKernelAbstraction(kernel);
       }
      
      return clientKernelAbstraction;

Modified: projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/MCClientKernelAbstraction.java
===================================================================
--- projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/MCClientKernelAbstraction.java	2008-05-08 12:18:58 UTC (rev 73147)
+++ projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/MCClientKernelAbstraction.java	2008-05-08 12:19:49 UTC (rev 73148)
@@ -42,6 +42,8 @@
 
    public MCClientKernelAbstraction(Kernel kernel)
    {
+      assert kernel != null : "kernel is null";
+      
       this.kernel = kernel;
    }
 




More information about the jboss-cvs-commits mailing list