[jboss-cvs] JBossAS SVN: r72729 - in trunk/ejb3/src/main/org/jboss/ejb3: clientmodule and 1 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Apr 25 10:18:29 EDT 2008


Author: scott.stark at jboss.org
Date: 2008-04-25 10:18:29 -0400 (Fri, 25 Apr 2008)
New Revision: 72729

Added:
   trunk/ejb3/src/main/org/jboss/ejb3/client/ClientEJBHandler.java
   trunk/ejb3/src/main/org/jboss/ejb3/client/ClientJavaEEComponent.java
   trunk/ejb3/src/main/org/jboss/ejb3/client/ClientResourceHandler.java
   trunk/ejb3/src/main/org/jboss/ejb3/client/NoopDependencyPolicy.java
   trunk/ejb3/src/main/org/jboss/ejb3/client/URLPropertyInjector.java
   trunk/ejb3/src/main/org/jboss/ejb3/client/Utils.java
Modified:
   trunk/ejb3/src/main/org/jboss/ejb3/client/ClientContainer.java
   trunk/ejb3/src/main/org/jboss/ejb3/clientmodule/ClientENCInjectionContainer.java
   trunk/ejb3/src/main/org/jboss/ejb3/clientmodule/EJBRemoteHandler.java
   trunk/ejb3/src/main/org/jboss/ejb3/deployers/Ejb3JBoss5Deployment.java
Log:
checkpoint the client container changes at the point the tck samples are running

Modified: trunk/ejb3/src/main/org/jboss/ejb3/client/ClientContainer.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/ejb3/client/ClientContainer.java	2008-04-25 14:15:31 UTC (rev 72728)
+++ trunk/ejb3/src/main/org/jboss/ejb3/client/ClientContainer.java	2008-04-25 14:18:29 UTC (rev 72729)
@@ -43,6 +43,7 @@
 import org.jboss.ejb3.Container;
 import org.jboss.ejb3.DependencyPolicy;
 import org.jboss.ejb3.InitialContextFactory;
+import org.jboss.ejb3.clientmodule.EJBRemoteHandler;
 import org.jboss.ejb3.entity.PersistenceUnitDeployment;
 import org.jboss.injection.DependsHandler;
 import org.jboss.injection.EJBInjectionHandler;
@@ -67,6 +68,7 @@
  * Injection of the application client main class is handled from here.
  *
  * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @author Scott.Stark at jboss.org
  * @version $Revision$
  */
 public class ClientContainer implements InjectionContainer
@@ -80,10 +82,11 @@
    // for performance there is an array.
    private List<Injector> injectors = new ArrayList<Injector>();
    private Map<String, Map<AccessibleObject, Injector>> encInjections = new HashMap<String, Map<AccessibleObject, Injector>>();
-   private Map<String, EncInjector> encInjectors = new HashMap<String, EncInjector>();
+//   private Map<String, EncInjector> encInjectors = new HashMap<String, EncInjector>();
    
    private Context enc;
    private Context encEnv;
+   private DependencyPolicy dependsPolicy;
    
    private List<Method> postConstructs = new ArrayList<Method>();
 
@@ -98,7 +101,9 @@
       this.xml = xml;
       this.mainClass = mainClass;
       this.applicationClientName = applicationClientName;
-      
+      ClientJavaEEComponent client = new ClientJavaEEComponent(applicationClientName);
+      this.dependsPolicy = new NoopDependencyPolicy(client);
+
       //Context ctx = getInitialContext();
       Context ctx = InitialContextFactory.getInitialContext(jndiEnv);
       enc = (Context) ctx.lookup(applicationClientName);
@@ -114,16 +119,10 @@
 //      encEnv = Util.createSubcontext(enc, "env");
       
       processMetadata(null);
-      
-      for (EncInjector injector : encInjectors.values())
-      {
-         log.trace("encInjector: " + injector);
-//         injector.inject(this);
-      }
-      
+
       for(Injector injector : injectors)
       {
-         log.trace("injector: " + injector);
+         log.debug("injector: " + injector);
          injector.inject((Object) null);
       }
       
@@ -184,7 +183,7 @@
     */
    public DependencyPolicy getDependencyPolicy()
    {
-      throw new RuntimeException("NYI");
+      return dependsPolicy;
    }
 
    /* (non-Javadoc)
@@ -236,7 +235,7 @@
     */
    public Map<String, EncInjector> getEncInjectors()
    {
-      return encInjectors;
+      throw new IllegalStateException("ENC setup happens on the server");
    }
 
    /* (non-Javadoc)
@@ -263,7 +262,7 @@
     */
    public List<Injector> getInjectors()
    {
-      throw new NotImplementedException();
+      return injectors;
    }
 
    public Class<?> getMainClass()
@@ -322,13 +321,11 @@
       
       // TODO: check which handlers a client container should support
       Collection<InjectionHandler<RemoteEnvironment>> handlers = new ArrayList<InjectionHandler<RemoteEnvironment>>();
-      handlers.add(new EJBInjectionHandler<RemoteEnvironment>());
-      //handlers.add(new ClientEJBHandler());
+      handlers.add(new ClientEJBHandler<RemoteEnvironment>());
       handlers.add(new DependsHandler<RemoteEnvironment>());
       handlers.add(new JndiInjectHandler<RemoteEnvironment>());
       handlers.add(new PersistenceUnitHandler<RemoteEnvironment>());
-      // since enc injectors live on the server side, we don't want to check those
-      handlers.add(new ResourceHandler<RemoteEnvironment>(false));
+      handlers.add(new ClientResourceHandler<RemoteEnvironment>(this.mainClass));
       handlers.add(new WebServiceRefHandler<RemoteEnvironment>());
       
       // TODO: we're going to use a jar class loader
@@ -337,25 +334,13 @@
       try
       {
          // EJB container's XML must be processed before interceptor's as it may override interceptor's references
-         for (InjectionHandler<RemoteEnvironment> handler : handlers) handler.loadXml(xml, this);
+         for (InjectionHandler<RemoteEnvironment> handler : handlers)
+            handler.loadXml(xml, this);
 
+         /*
          Map<AccessibleObject, Injector> tmp = InjectionUtil.processAnnotations(this, handlers, getMainClass());
          injectors.addAll(tmp.values());
-
-//         initialiseInterceptors();
-//         for (InterceptorInfo interceptorInfo : applicableInterceptors)
-//         {
-//            for (InjectionHandler handler : handlers)
-//            {
-//               handler.loadXml(interceptorInfo.getXml(), this);
-//            }
-//         }
-//         for (InterceptorInfo interceptorInfo : applicableInterceptors)
-//         {
-//            Map<AccessibleObject, Injector> tmpInterceptor = InjectionUtil.processAnnotations(this, handlers, interceptorInfo.getClazz());
-//            InterceptorInjector injector = new InterceptorInjector(this, interceptorInfo, tmpInterceptor);
-//            interceptorInjectors.put(interceptorInfo.getClazz(), injector);
-//         }
+         */
       }
       finally
       {
@@ -372,8 +357,6 @@
     */
    private void processPostConstructs() throws ClassNotFoundException, SecurityException, NoSuchMethodException
    {
-      processPostConstructs(mainClass);
-      
       LifecycleCallbacksMetaData callbacks = xml.getPostConstructs();
       if(callbacks != null)
       {
@@ -393,27 +376,6 @@
       }
    }
    
-   private void processPostConstructs(Class<?> cls)
-   {
-      if(cls == null)
-         return;
-      
-      for(Method method : cls.getDeclaredMethods())
-      {
-         PostConstruct postConstruct = method.getAnnotation(PostConstruct.class);
-         if(postConstruct != null)
-         {
-            // TODO: sure?
-            // http://java.sun.com/javase/6/docs/api/javax/annotation/PostConstruct.html
-            if(postConstructs.size() > 0)
-               throw new IllegalStateException("only one @PostConstruct allowed");
-            postConstructs.add(method);
-         }
-      }
-      
-      processPostConstructs(cls.getSuperclass());
-   }
-   
    /* (non-Javadoc)
     * @see org.jboss.injection.InjectionContainer#resolveEjbContainer(java.lang.String, java.lang.Class)
     */

Added: trunk/ejb3/src/main/org/jboss/ejb3/client/ClientEJBHandler.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/ejb3/client/ClientEJBHandler.java	                        (rev 0)
+++ trunk/ejb3/src/main/org/jboss/ejb3/client/ClientEJBHandler.java	2008-04-25 14:18:29 UTC (rev 72729)
@@ -0,0 +1,182 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * 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.client;
+
+import java.lang.reflect.AccessibleObject;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.util.Collection;
+import java.util.Map;
+import java.util.Set;
+
+import javax.ejb.EJB;
+
+import org.jboss.ejb3.clientmodule.EJBRemoteHandler;
+import org.jboss.injection.AbstractHandler;
+import org.jboss.injection.EJBInjectionHandler;
+import org.jboss.injection.InjectionContainer;
+import org.jboss.injection.InjectionUtil;
+import org.jboss.injection.Injector;
+import org.jboss.injection.JndiPropertyInjector;
+import org.jboss.injection.lang.reflect.BeanProperty;
+import org.jboss.injection.lang.reflect.BeanPropertyFactory;
+import org.jboss.logging.Logger;
+import org.jboss.metadata.javaee.spec.AbstractEJBReferenceMetaData;
+import org.jboss.metadata.javaee.spec.AnnotatedEJBReferenceMetaData;
+import org.jboss.metadata.javaee.spec.AnnotatedEJBReferencesMetaData;
+import org.jboss.metadata.javaee.spec.EJBReferenceMetaData;
+import org.jboss.metadata.javaee.spec.RemoteEnvironment;
+import org.jboss.metadata.javaee.spec.ResourceInjectionTargetMetaData;
+
+/**
+ * @author Scott.Stark at jboss.org
+ * @version $Revision:$
+ */
+public class ClientEJBHandler<X extends RemoteEnvironment>
+   extends AbstractHandler<X>
+{
+   private static final Logger log = Logger.getLogger(EJBRemoteHandler.class);
+
+   public void loadXml(X xml, InjectionContainer container)
+   {
+      if (xml != null)
+      {
+         log.trace("ejbRefs = " + xml.getEjbReferences());
+         try
+         {
+         if (xml.getAnnotatedEjbReferences() != null)
+            loadEjbRefXml(xml.getAnnotatedEjbReferences(), container);
+         if (xml.getEjbReferences() != null)
+            loadEjbRefXml(xml.getEjbReferences(), container);
+         }
+         catch(Exception e)
+         {
+            throw new IllegalStateException(e);
+         }
+      }
+   }
+
+   public void handleClassAnnotations(Class<?> clazz, InjectionContainer container)
+   {
+      throw new IllegalStateException("Annotations are not handled");
+   }
+   public void handleFieldAnnotations(Field field, InjectionContainer container, Map<AccessibleObject, Injector> injectors)
+   {
+      throw new IllegalStateException("Annotations are not handled");
+   }
+   public void handleMethodAnnotations(Method method, InjectionContainer container, Map<AccessibleObject, Injector> injectors)
+   {
+      throw new IllegalStateException("Annotations are not handled");
+   }
+
+   protected void loadEjbRefXml(AnnotatedEJBReferencesMetaData refs,
+         InjectionContainer container)
+      throws Exception
+   {
+      for (AnnotatedEJBReferenceMetaData ref : refs)
+      {
+         String interfaceName = ref.getBeanInterface().getName();
+         String errorType = "@EJB";
+
+         ejbRefXml(ref, interfaceName, container, errorType);
+      }      
+   }
+
+   protected void loadEjbRefXml(Collection<EJBReferenceMetaData> refs, InjectionContainer container)
+      throws Exception
+   {
+      for (EJBReferenceMetaData ref : refs)
+      {
+         String interfaceName = ref.getRemote();
+         String errorType = "<ejb-ref>";
+
+         ejbRefXml(ref, interfaceName, container, errorType);
+      }
+   }
+
+   protected void ejbRefXml(AbstractEJBReferenceMetaData ref, String interfaceName, InjectionContainer container, String errorType)
+      throws Exception
+   {
+      String encName = "env/" + ref.getEjbRefName();
+      Utils.injectionTarget(encName, ref, container);
+
+      /*
+      String mappedName = ref.getMappedName();
+      if (mappedName != null && mappedName.equals(""))
+         mappedName = null;
+      if(mappedName == null && ref.getResolvedJndiName() != null)
+         mappedName = ref.getResolvedJndiName();
+
+      if(mappedName == null)
+         throw new IllegalStateException(ref+" has no mapped name");
+      // Handle the injection targets
+      ClassLoader loader = container.getClassloader();
+      Set<ResourceInjectionTargetMetaData> targets = ref.getInjectionTargets();
+      if(targets != null)
+      {
+         for(ResourceInjectionTargetMetaData target : targets)
+         {
+            String className = target.getInjectionTargetClass();
+            String targetName = target.getInjectionTargetName();
+            Class<?> c = loader.loadClass(className);
+            AccessibleObject ao = Utils.getAccessibleObject(c, targetName);
+            BeanProperty prop = BeanPropertyFactory.create(ao);
+            JndiPropertyInjector propInjector = new JndiPropertyInjector(prop, encName, container.getEnc());
+            container.getInjectors().add(propInjector);
+         }
+      }
+      else
+      {
+         log.warn("No injection targets seen for: "+ref);
+      }
+      */
+   }
+
+   protected String getEncName(EJB ref, Field field)
+   {
+      String encName = ref.name();
+      if (encName == null || encName.equals(""))
+      {
+         encName = InjectionUtil.getEncName(field);
+      }
+      else
+      {
+         encName = "env/" + encName;
+      }
+      return encName;
+   }
+   
+   protected String getEncName(EJB ref, Method method)
+   {
+      String encName = ref.name();
+      if (encName == null || encName.equals(""))
+      {
+         encName = InjectionUtil.getEncName(method);
+      }
+      else
+      {
+         encName = "env/" + encName;
+      }
+      return encName;
+   }
+
+}

Added: trunk/ejb3/src/main/org/jboss/ejb3/client/ClientJavaEEComponent.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/ejb3/client/ClientJavaEEComponent.java	                        (rev 0)
+++ trunk/ejb3/src/main/org/jboss/ejb3/client/ClientJavaEEComponent.java	2008-04-25 14:18:29 UTC (rev 72729)
@@ -0,0 +1,51 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * 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.client;
+
+import org.jboss.ejb3.javaee.AbstractJavaEEComponent;
+import org.jboss.ejb3.javaee.JavaEEModule;
+import org.jboss.ejb3.javaee.SimpleJavaEEModule;
+
+/**
+ * @author Scott.Stark at jboss.org
+ * @version $Revision:$
+ */
+public class ClientJavaEEComponent extends AbstractJavaEEComponent
+{
+   public ClientJavaEEComponent(String clientName)
+   {
+      super(new SimpleJavaEEModule(clientName));
+   }
+
+   @Override
+   public String createObjectName(String unitName, String ejbName)
+   {
+      return "org.jboss.client:jar="+unitName;
+   }
+
+   @Override
+   public String createObjectName(String ejbName)
+   {
+      return "org.jboss.client:jar="+ejbName;
+   }
+
+}

Added: trunk/ejb3/src/main/org/jboss/ejb3/client/ClientResourceHandler.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/ejb3/client/ClientResourceHandler.java	                        (rev 0)
+++ trunk/ejb3/src/main/org/jboss/ejb3/client/ClientResourceHandler.java	2008-04-25 14:18:29 UTC (rev 72729)
@@ -0,0 +1,285 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * 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.client;
+
+import java.lang.reflect.AccessibleObject;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Collection;
+import java.util.Map;
+
+import javax.ejb.EJBContext;
+import javax.ejb.EJBException;
+import javax.transaction.UserTransaction;
+
+import org.jboss.injection.EJBContextPropertyInjector;
+import org.jboss.injection.InjectionContainer;
+import org.jboss.injection.InjectionHandler;
+import org.jboss.injection.InjectionUtil;
+import org.jboss.injection.Injector;
+import org.jboss.injection.InjectorFactory;
+import org.jboss.injection.JndiPropertyInjector;
+import org.jboss.injection.UserTransactionPropertyInjector;
+import org.jboss.injection.lang.reflect.BeanProperty;
+import org.jboss.injection.lang.reflect.BeanPropertyFactory;
+import org.jboss.logging.Logger;
+import org.jboss.metadata.javaee.spec.EnvironmentEntryMetaData;
+import org.jboss.metadata.javaee.spec.MessageDestinationReferenceMetaData;
+import org.jboss.metadata.javaee.spec.RemoteEnvironment;
+import org.jboss.metadata.javaee.spec.ResourceEnvironmentReferenceMetaData;
+import org.jboss.metadata.javaee.spec.ResourceReferenceMetaData;
+import org.omg.CORBA.ORB;
+
+/**
+ * Handler for @Resources on the client
+ * 
+ * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
+ * @author Scott.Stark at jboss.org
+ * @version $Revision:$
+ */
+public class ClientResourceHandler<X extends RemoteEnvironment>
+   implements InjectionHandler<X>
+{
+   private static final Logger log = Logger.getLogger(ClientResourceHandler.class);
+   private Class<?> clientClass;
+
+   public ClientResourceHandler(Class<?> clientClass)
+   {
+      this.clientClass = clientClass;
+   }
+   
+   private void loadEnvEntry(InjectionContainer container, Collection<EnvironmentEntryMetaData> envEntries)
+   {
+      for (EnvironmentEntryMetaData envEntry : envEntries)
+      {
+         String encName = "env/" + envEntry.getEnvEntryName();
+         // 16.4.1.3: If the env-entry-value is not specified, no value will be injected and it
+         // will not be initialized into the naming context.
+         if(envEntry.getValue() == null)
+         {
+            log.debug("ignoring env-entry " + envEntry);
+            continue;
+         }
+         /* Handle the injection targets
+         ClassLoader loader = container.getClassloader();
+         Set<ResourceInjectionTargetMetaData> targets = envEntry.getInjectionTargets();
+         if(targets != null)
+         {
+            for(ResourceInjectionTargetMetaData target : targets)
+            {
+               String className = target.getInjectionTargetClass();
+               String targetName = target.getInjectionTargetName();
+               Class<?> c = loader.loadClass(className);
+               AccessibleObject ao = Utils.getAccessibleObject(c, targetName);
+               BeanProperty prop = BeanPropertyFactory.create(ao);
+               JndiPropertyInjector propInjector = new JndiPropertyInjector(prop, encName, container.getEnc());
+               container.getInjectors().add(propInjector);
+            }
+         }
+         else
+         {
+            log.warn("No injection targets seen for: "+envEntry);
+         }
+         */
+         AccessibleObject ao = Utils.getAccessibleObject(clientClass, envEntry.getEnvEntryName());
+         BeanProperty prop = BeanPropertyFactory.create(ao);
+         JndiPropertyInjector propInjector = new JndiPropertyInjector(prop, encName, container.getEnc());
+         container.getInjectors().add(propInjector);         
+      }
+   }
+
+   private void loadXmlResourceRefs(InjectionContainer container, Collection<ResourceReferenceMetaData> refs)
+   {
+      for (ResourceReferenceMetaData envRef : refs)
+      {
+         String encName = "env/" + envRef.getResourceRefName();
+
+         if (envRef.getMappedName() == null || envRef.getMappedName().equals(""))
+         {
+            if (envRef.getResUrl() != null)
+            {
+               try
+               {
+                  URL resURL = new URL(envRef.getResUrl().trim());
+                  AccessibleObject ao = Utils.getAccessibleObject(clientClass, envRef.getResourceRefName());
+                  BeanProperty prop = BeanPropertyFactory.create(ao);
+                  URLPropertyInjector propInjector = new URLPropertyInjector(prop, resURL);
+                  container.getInjectors().add(propInjector); 
+               }
+               catch (MalformedURLException e)
+               {
+                  throw new RuntimeException(e);
+               }
+            }
+            else if (UserTransaction.class.getName().equals(envRef.getType()))
+            {
+               final InjectionContainer ic = container;
+               InjectorFactory<?> factory = new InjectorFactory<UserTransactionPropertyInjector>()
+               {
+                  public UserTransactionPropertyInjector create(BeanProperty property)
+                  {
+                     return new UserTransactionPropertyInjector(property, ic);
+                  }
+               };
+               if(envRef.getInjectionTargets() != null)
+               {
+                  InjectionUtil.createInjectors(container.getInjectors(), container.getClassloader(), factory, envRef.getInjectionTargets());
+                  continue;
+               }
+               else
+               {
+                  encName = "java:comp/UserTransaction";
+               }
+            }
+            else if (ORB.class.getName().equals(envRef.getType()))
+            {
+               encName = "java:comp/ORB";
+            }
+            else
+            {
+               throw new RuntimeException("mapped-name is required for " + envRef.getResourceRefName() + " of deployment " + container.getIdentifier());
+            }
+         }
+         Utils.injectionTarget(encName, envRef, container);
+      }
+   }
+
+   private static void loadXmlResourceEnvRefs(InjectionContainer container, Collection<ResourceEnvironmentReferenceMetaData> refs)
+   {
+      for (ResourceEnvironmentReferenceMetaData envRef : refs)
+      {
+         // EJBTHREE-712
+         String resTypeName = envRef.getType();
+         String mappedName = envRef.getMappedName();
+         try
+         {
+            if(resTypeName != null)
+            {
+               Class<?> resType = Class.forName(resTypeName);
+               if(EJBContext.class.isAssignableFrom(resType))
+               {
+                  InjectorFactory<?> factory = new InjectorFactory<EJBContextPropertyInjector>()
+                  {
+                     public EJBContextPropertyInjector create(BeanProperty property)
+                     {
+                        return new EJBContextPropertyInjector(property);
+                     }
+                  };
+                  InjectionUtil.createInjectors(container.getInjectors(), container.getClassloader(), factory, envRef.getInjectionTargets());
+                  continue;
+               }
+               else if (resType.equals(UserTransaction.class))
+               {
+                  final InjectionContainer ic = container;
+                  InjectorFactory<?> factory = new InjectorFactory<UserTransactionPropertyInjector>()
+                  {
+                     public UserTransactionPropertyInjector create(BeanProperty property)
+                     {
+                        return new UserTransactionPropertyInjector(property, ic);
+                     }
+                  };
+                  if(envRef.getInjectionTargets() != null)
+                  {
+                     InjectionUtil.createInjectors(container.getInjectors(), container.getClassloader(), factory, envRef.getInjectionTargets());
+                     continue;
+                  }
+                  else
+                  {
+                     mappedName = "java:comp/UserTransaction";
+                  }
+               }
+               else if (resType.equals(ORB.class))
+               {
+                  mappedName = "java:comp/ORB";
+                  continue;
+               }
+            }
+         }
+         catch(ClassNotFoundException e)
+         {
+            throw new EJBException(e);
+         }
+         
+         String encName = "env/" + envRef.getResourceEnvRefName();
+         if (mappedName == null || mappedName.equals(""))
+         {
+            throw new RuntimeException("mapped-name is required for " + envRef.getResourceEnvRefName() + " of deployment " + container.getIdentifier());
+         }
+         Utils.injectionTarget(encName, envRef, container);
+      }
+   }
+
+   private static void loadXmlMessageDestinationRefs(InjectionContainer container, Collection<MessageDestinationReferenceMetaData> refs)
+   {
+      for (MessageDestinationReferenceMetaData envRef : refs)
+      {
+         String encName = "env/" + envRef.getMessageDestinationRefName();
+         String jndiName = envRef.getMappedName();
+         if (jndiName == null || jndiName.equals(""))
+         {
+            // Look for a message-destination-link
+            String link = envRef.getLink();
+            if( link != null )
+            {
+               jndiName = container.resolveMessageDestination(link);
+               if (jndiName == null)
+                  throw new RuntimeException("message-destination-link not found " + link + " of deployment " + container.getIdentifier());
+               // TODO: add dependency
+            }
+            else
+               throw new RuntimeException("mapped-name or message-destination-link is required for " + envRef.getMessageDestinationRefName() + " of deployment " + container.getIdentifier());
+         }
+         Utils.injectionTarget(encName, envRef, container);
+      }
+   }
+
+   public void loadXml(X xml, InjectionContainer container)
+   {
+      if (xml == null)
+         return;
+      if (xml.getMessageDestinationReferences() != null)
+         loadXmlMessageDestinationRefs(container, xml.getMessageDestinationReferences());
+      if (xml.getResourceEnvironmentReferences() != null)
+         loadXmlResourceEnvRefs(container, xml.getResourceEnvironmentReferences());
+      if (xml.getResourceReferences() != null)
+         loadXmlResourceRefs(container, xml.getResourceReferences());
+      if (xml.getEnvironmentEntries() != null)
+         loadEnvEntry(container, xml.getEnvironmentEntries());
+   }
+
+   public void handleClassAnnotations(Class<?> clazz, InjectionContainer container)
+   {
+      throw new IllegalStateException("Annotations are not handled");
+   }
+
+   public void handleMethodAnnotations(Method method, InjectionContainer container, Map<AccessibleObject, Injector> injectors)
+   {
+      throw new IllegalStateException("Annotations are not handled");
+   }
+   
+   public void handleFieldAnnotations(Field field, InjectionContainer container, Map<AccessibleObject, Injector> injectors)
+   {
+      throw new IllegalStateException("Annotations are not handled");
+   }
+}

Added: trunk/ejb3/src/main/org/jboss/ejb3/client/NoopDependencyPolicy.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/ejb3/client/NoopDependencyPolicy.java	                        (rev 0)
+++ trunk/ejb3/src/main/org/jboss/ejb3/client/NoopDependencyPolicy.java	2008-04-25 14:18:29 UTC (rev 72729)
@@ -0,0 +1,99 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * 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.client;
+
+import java.util.Collections;
+import java.util.Set;
+
+import org.jboss.beans.metadata.spi.DemandMetaData;
+import org.jboss.beans.metadata.spi.DependencyMetaData;
+import org.jboss.beans.metadata.spi.SupplyMetaData;
+import org.jboss.ejb3.deployers.JBoss5DependencyPolicy;
+import org.jboss.ejb3.javaee.JavaEEComponent;
+
+/**
+ * @author Scott.Stark at jboss.org
+ * @version $Revision:$
+ */
+public class NoopDependencyPolicy
+   extends JBoss5DependencyPolicy
+{
+
+   public NoopDependencyPolicy(JavaEEComponent component)
+   {
+      super(component);
+   }
+
+   @Override
+   public void addDependency(Class<?> businessInterface)
+   {
+   }
+
+   @Override
+   public void addDependency(DemandMetaData dependency)
+   {
+   }
+
+   @Override
+   public void addDependency(DependencyMetaData dependency)
+   {
+   }
+
+   @Override
+   public void addDependency(String ejbLink, Class<?> businessInterface)
+   {
+   }
+
+   @Override
+   public void addDependency(String dependency)
+   {
+   }
+
+   @Override
+   public void addJNDIName(String name)
+   {
+   }
+
+   @Override
+   public void addSupply(Class<?> businessInterface)
+   {
+   }
+
+   @Override
+   public Set<DemandMetaData> getDemands()
+   {
+      return Collections.emptySet();
+   }
+
+   @Override
+   public Set<DependencyMetaData> getDependencies()
+   {
+      return Collections.emptySet();
+   }
+
+   @Override
+   public Set<SupplyMetaData> getSupplies()
+   {
+      return Collections.emptySet();
+   }
+
+}

Added: trunk/ejb3/src/main/org/jboss/ejb3/client/URLPropertyInjector.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/ejb3/client/URLPropertyInjector.java	                        (rev 0)
+++ trunk/ejb3/src/main/org/jboss/ejb3/client/URLPropertyInjector.java	2008-04-25 14:18:29 UTC (rev 72729)
@@ -0,0 +1,49 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * 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.client;
+
+import java.net.URL;
+
+import org.jboss.injection.AbstractPropertyInjector;
+import org.jboss.injection.lang.reflect.BeanProperty;
+
+/**
+ * Injects a URL into a bean property
+ * 
+ * @author Scott.Stark at jboss.org
+ * @version $Revision:$
+ */
+public class URLPropertyInjector extends AbstractPropertyInjector
+{
+   private URL url;
+
+   URLPropertyInjector(BeanProperty property, URL url)
+   {
+      super(property);
+      this.url = url;
+   }
+
+   public void inject(Object instance)
+   {
+      property.set(instance, url);
+   }
+}

Added: trunk/ejb3/src/main/org/jboss/ejb3/client/Utils.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/ejb3/client/Utils.java	                        (rev 0)
+++ trunk/ejb3/src/main/org/jboss/ejb3/client/Utils.java	2008-04-25 14:18:29 UTC (rev 72729)
@@ -0,0 +1,119 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * 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.client;
+
+import java.lang.reflect.AccessibleObject;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.jboss.injection.InjectionContainer;
+import org.jboss.injection.Injector;
+import org.jboss.injection.JndiFieldInjector;
+import org.jboss.injection.JndiMethodInjector;
+import org.jboss.metadata.javaee.spec.ResourceInjectionMetaData;
+import org.jboss.metadata.javaee.spec.ResourceInjectionTargetMetaData;
+
+/**
+ * @author Scott.Stark at jboss.org
+ * @version $Revision:$
+ */
+public class Utils
+{
+   static AccessibleObject getAccessibleObject(Class<?> c, String name)
+   {
+      AccessibleObject ao = null;
+      try
+      {
+         Field f = c.getDeclaredField(name);
+         ao = f;
+      }
+      catch (NoSuchFieldException e)
+      {
+         String setter = "set" + Character.toUpperCase(name.charAt(0)) + name.substring(1);
+         // TODO
+      }
+      return ao;
+   }
+
+   public static Class<?> injectionTarget(String encName,
+         ResourceInjectionMetaData ref,
+         InjectionContainer container)
+   {
+      Class<?> injectionType = null;
+      
+      if(ref.getInjectionTargets() == null)
+         return injectionType;
+      
+      for(ResourceInjectionTargetMetaData injectionTarget : ref.getInjectionTargets())
+      {
+         // todo, get injection target class
+         AccessibleObject ao = findInjectionTarget(container.getClassloader(), injectionTarget);
+         Class<?> type;
+         if (ao instanceof Field)
+         {
+            type = ((Field) ao).getType();
+            container.getInjectors().add(new JndiFieldInjector((Field) ao, encName, container.getEnc()));
+         }
+         else
+         {
+            type = ((Method) ao).getParameterTypes()[0];
+            container.getInjectors().add(new JndiMethodInjector((Method) ao, encName, container.getEnc()));
+         }
+         if(injectionType == null)
+            injectionType = type;
+         else
+         {
+            if(!injectionType.equals(type))
+               throw new IllegalStateException("Found multiple injection targets with different types");
+         }
+      }
+      
+      return injectionType;
+   }
+   public static AccessibleObject findInjectionTarget(ClassLoader loader, ResourceInjectionTargetMetaData target)
+   {
+      Class<?> clazz = null;
+      try
+      {
+         clazz = loader.loadClass(target.getInjectionTargetClass());
+      }
+      catch (ClassNotFoundException e)
+      {
+         throw new RuntimeException("<injection-target> class: " + target.getInjectionTargetClass() + " was not found in deployment");
+      }
+
+      for (Field field : clazz.getDeclaredFields())
+      {
+         if (target.getInjectionTargetName().equals(field.getName())) return field;
+      }
+
+      for (java.lang.reflect.Method method : clazz.getDeclaredMethods())
+      {
+         if (method.getName().equals(target.getInjectionTargetName())) return method;
+      }
+
+      throw new RuntimeException("<injection-target> could not be found: " + target.getInjectionTargetClass() + "." + target.getInjectionTargetName());
+
+   }
+}

Modified: trunk/ejb3/src/main/org/jboss/ejb3/clientmodule/ClientENCInjectionContainer.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/ejb3/clientmodule/ClientENCInjectionContainer.java	2008-04-25 14:15:31 UTC (rev 72728)
+++ trunk/ejb3/src/main/org/jboss/ejb3/clientmodule/ClientENCInjectionContainer.java	2008-04-25 14:18:29 UTC (rev 72729)
@@ -318,9 +318,10 @@
          // EJB container's XML must be processed before interceptor's as it may override interceptor's references
          for (InjectionHandler<JBossClientMetaData> handler : handlers)
             handler.loadXml(clientMetaData, this);
-
+/*
          Map<AccessibleObject, Injector> tmp = InjectionUtil.processAnnotations(this, handlers, getMainClass());
          injectors.addAll(tmp.values());
+*/
 
          //         initialiseInterceptors();
          //         for (InterceptorInfo interceptorInfo : applicableInterceptors)

Modified: trunk/ejb3/src/main/org/jboss/ejb3/clientmodule/EJBRemoteHandler.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/ejb3/clientmodule/EJBRemoteHandler.java	2008-04-25 14:15:31 UTC (rev 72728)
+++ trunk/ejb3/src/main/org/jboss/ejb3/clientmodule/EJBRemoteHandler.java	2008-04-25 14:18:29 UTC (rev 72729)
@@ -53,6 +53,7 @@
  * for a remote environment.
  *
  * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
+ * @author Scott.Stark at jboss.org
  * @version $Revision: 70399 $
  */
 public class EJBRemoteHandler<X extends RemoteEnvironment> extends EJBInjectionHandler<X>
@@ -64,10 +65,25 @@
       if (xml != null)
       {
          log.trace("ejbRefs = " + xml.getEjbReferences());
-         if (xml.getEjbReferences() != null) loadEjbRefXml(xml.getEjbReferences(), container);
+         if (xml.getAnnotatedEjbReferences() != null)
+            loadEjbRefXml(xml.getAnnotatedEjbReferences(), container);
+         if (xml.getEjbReferences() != null)
+            loadEjbRefXml(xml.getEjbReferences(), container);
       }
    }
 
+   protected void loadEjbRefXml(AnnotatedEJBReferencesMetaData refs,
+         InjectionContainer container)
+   {
+      for (AnnotatedEJBReferenceMetaData ref : refs)
+      {
+         String interfaceName = ref.getBeanInterface().getName();
+         String errorType = "@EJB";
+
+         ejbRefXml(ref, interfaceName, container, errorType);
+      }      
+   }
+
    protected void loadEjbRefXml(Collection<EJBReferenceMetaData> refs, InjectionContainer container)
    {
       for (EJBReferenceMetaData ref : refs)
@@ -281,84 +297,22 @@
 
    public void handleClassAnnotations(Class<?> clazz, InjectionContainer container)
    {
-      EJBs ref = container.getAnnotation(EJBs.class, clazz);
-      if (ref != null)
-      {
-         EJB[] ejbs = ref.value();
-
-         for (EJB ejb : ejbs)
-         {
-            handleClassAnnotation(ejb, clazz, container);
-         }
-      }
-      EJB ejbref = container.getAnnotation(EJB.class, clazz);
-      if (ejbref != null) handleClassAnnotation(ejbref, clazz, container);
+      throw new IllegalStateException("handleClassAnnotation cannot be used in a client");
    }
 
    protected void handleClassAnnotation(EJB ejb, Class<?> clazz, InjectionContainer container)
    {
-      String encName = ejb.name();
-      if (encName == null || encName.equals(""))
-      {
-         throw new RuntimeException("JBoss requires the name of the @EJB in the @EJBs: " + clazz);
-      }
-      encName = "env/" + encName;
-
-      if (container.getEncInjectors().containsKey(encName)) return;
-      ejbRefEncInjector(ejb.mappedName(), encName, null, ejb.beanInterface(), ejb.beanName(), "@EJB", container);
-
-      // handle dependencies
-
-      if (isIgnoreDependency(container, ejb))
-         log.debug("IGNORING <ejb-ref> DEPENDENCY: " + encName);
-      else
-         ejbRefDependency(ejb.mappedName(), ejb.beanName(), container, ejb.beanInterface(), "@EJB", encName);
+      throw new IllegalStateException("handleClassAnnotation cannot be used in a client");
    }
 
    public void handleMethodAnnotations(Method method, InjectionContainer container, Map<AccessibleObject, Injector> injectors)
    {
-      EJB ref = container.getAnnotation(EJB.class, method);
-      if (ref != null)
-      {
-         if (!method.getName().startsWith("set"))
-            throw new RuntimeException("@EJB can only be used with a set method: " + method);
-         String encName = getEncName(ref, method);
-         if (!container.getEncInjectors().containsKey(encName))
-         {
-            ejbRefEncInjector(ref.mappedName(), encName, method.getName().substring(0), method.getParameterTypes()[0], ref.beanName(), "@EJB", container);
-            
-            if (container.getAnnotation(IgnoreDependency.class, method) == null)
-            {
-               if (isIgnoreDependency(container, ref))
-                  log.debug("IGNORING <ejb-ref> DEPENDENCY: " + encName);
-               else
-                  ejbRefDependency(ref.mappedName(), ref.beanName(), container, method.getParameterTypes()[0], "@EJB", encName);
-            }
-         }
-
-         super.handleMethodAnnotations(method, container, injectors);
-      }
+      throw new IllegalStateException("handleMethodAnnotations cannot be used in a client");
    }
 
    public void handleFieldAnnotations(Field field, InjectionContainer container, Map<AccessibleObject, Injector> injectors)
    {
-      EJB ref = container.getAnnotation(EJB.class, field);
-      if (ref != null)
-      {
-         String encName = getEncName(ref, field);
-         if (!container.getEncInjectors().containsKey(encName))
-         {
-            if (container.getAnnotation(IgnoreDependency.class, field) == null)
-            {
-               if (isIgnoreDependency(container, ref))
-                  log.debug("IGNORING <ejb-ref> DEPENDENCY: " + encName);
-               else
-                  ejbRefDependency(ref.mappedName(), ref.beanName(), container, field.getType(), "@EJB", encName);
-            }
-            ejbRefEncInjector(ref.mappedName(), encName, field.getName(), field.getType(), ref.beanName(), "@EJB", container);
-         }
-         super.handleFieldAnnotations(field, container, injectors);
-      }
+      throw new IllegalStateException("handleFieldAnnotations cannot be used in a client");
    }
 
    protected boolean isIgnoreDependency(InjectionContainer container, EJB ref)

Modified: trunk/ejb3/src/main/org/jboss/ejb3/deployers/Ejb3JBoss5Deployment.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/ejb3/deployers/Ejb3JBoss5Deployment.java	2008-04-25 14:15:31 UTC (rev 72728)
+++ trunk/ejb3/src/main/org/jboss/ejb3/deployers/Ejb3JBoss5Deployment.java	2008-04-25 14:18:29 UTC (rev 72729)
@@ -21,20 +21,32 @@
 */
 package org.jboss.ejb3.deployers;
 
+import java.util.Map;
+
 import javax.management.MBeanServer;
 import javax.security.jacc.PolicyConfiguration;
 
+import org.jboss.beans.metadata.plugins.AbstractSupplyMetaData;
+import org.jboss.deployment.MappedReferenceMetaDataResolverDeployer;
+import org.jboss.deployment.dependency.ContainerDependencyMetaData;
+import org.jboss.ejb3.Container;
 import org.jboss.ejb3.DependencyPolicy;
 import org.jboss.ejb3.DeploymentScope;
 import org.jboss.ejb3.DeploymentUnit;
+import org.jboss.ejb3.EJBContainer;
 import org.jboss.ejb3.Ejb3Deployment;
+import org.jboss.ejb3.MCDependencyPolicy;
 import org.jboss.ejb3.javaee.JavaEEComponent;
+import org.jboss.ejb3.kernel.JNDIKernelRegistryPlugin;
 import org.jboss.ejb3.metadata.jpa.spec.PersistenceUnitsMetaData;
 import org.jboss.kernel.Kernel;
+import org.jboss.metadata.ejb.jboss.JBossEnterpriseBeanMetaData;
 import org.jboss.metadata.ejb.jboss.JBossMetaData;
+import org.jboss.metadata.ejb.jboss.JBossSessionBeanMetaData;
+import org.jboss.metadata.ejb.jboss.jndipolicy.spi.EjbDeploymentSummary;
 
 /**
- * JBoss 4.0 Microkernel specific implementation
+ * JBoss 5.0 Microkernel specific implementation
  *
  * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
  * @author adrian at jboss.org
@@ -43,6 +55,7 @@
 public class Ejb3JBoss5Deployment extends Ejb3Deployment
 {  
    private org.jboss.deployers.structure.spi.DeploymentUnit jbossUnit;
+   private Map<String, ContainerDependencyMetaData> endpoints;
 
    public Ejb3JBoss5Deployment(DeploymentUnit ejb3Unit, Kernel kernel, MBeanServer mbeanServer, org.jboss.deployers.structure.spi.DeploymentUnit jbossUnit, DeploymentScope deploymentScope, JBossMetaData metaData, PersistenceUnitsMetaData persistenceUnitsMetaData)
    {
@@ -52,6 +65,7 @@
 
       // todo maybe mbeanServer should be injected?
       this.mbeanServer = mbeanServer;
+      endpoints = (Map<String, ContainerDependencyMetaData>) jbossUnit.getAttachment(MappedReferenceMetaDataResolverDeployer.ENDPOINT_MAP_KEY);
    }
 
    protected PolicyConfiguration createPolicyConfiguration() throws Exception
@@ -68,4 +82,51 @@
    {
       return new JBoss5DependencyPolicy(component);
    }
+
+   @Override
+   protected void registerEJBContainer(Container container) throws Exception
+   {
+      // Add the jndi supplies
+      MCDependencyPolicy dependsPolicy = (MCDependencyPolicy) container.getDependencyPolicy();
+      EJBContainer ejbContainer = (EJBContainer) container;
+      JBossEnterpriseBeanMetaData beanMD = ejbContainer.getXml();
+      EjbDeploymentSummary defaultsInfo = getUnitSummary(this.getDeploymentUnit(), beanMD);
+      ContainerDependencyMetaData cdmd = null;
+      if(endpoints != null)
+      {
+         String ejbKey = "ejb/" + jbossUnit.getRelativePath() + "#" + container.getEjbName();
+         cdmd = endpoints.get(ejbKey);
+      }
+      if(cdmd != null)
+      {
+         for(String jndiName : cdmd.getJndiNames())
+         {
+         String supplyName = JNDIKernelRegistryPlugin.JNDI_DEPENDENCY_PREFIX + jndiName;
+         AbstractSupplyMetaData supply = new AbstractSupplyMetaData(supplyName);
+         dependsPolicy.getSupplies().add(supply);
+         }
+      }
+      super.registerEJBContainer(container);
+   }
+
+   private static EjbDeploymentSummary getUnitSummary(DeploymentUnit unit, JBossEnterpriseBeanMetaData beanMD)
+   {
+      ClassLoader loader = unit.getClassLoader();
+      EjbDeploymentSummary summary = new EjbDeploymentSummary();
+      summary.setBeanMD(beanMD);
+      summary.setBeanClassName(beanMD.getEjbClass());
+      summary.setDeploymentName(unit.getShortName());
+      String baseName = unit.getRootFile().getName();
+      summary.setDeploymentScopeBaseName(baseName);
+      summary.setEjbName(beanMD.getEjbName());
+      summary.setLoader(loader);
+      summary.setLocal(beanMD.isMessageDriven());
+      if(beanMD instanceof JBossSessionBeanMetaData)
+      {
+         JBossSessionBeanMetaData sbeanMD = (JBossSessionBeanMetaData) beanMD;
+         summary.setStateful(sbeanMD.isStateful());
+      }
+      summary.setService(beanMD.isService());
+      return summary;
+   }
 }




More information about the jboss-cvs-commits mailing list