[jboss-cvs] JBossAS SVN: r85846 - in projects/webbeans-ri-int/trunk: jbossas/src/main/java/org/jboss/webbeans/integration/jbossas/ejb and 4 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Sat Mar 14 12:42:56 EDT 2009


Author: petemuir
Date: 2009-03-14 12:42:56 -0400 (Sat, 14 Mar 2009)
New Revision: 85846

Added:
   projects/webbeans-ri-int/trunk/ejb/src/main/java/org/jboss/webbeans/integration/ejb/JBossEjbReference.java
   projects/webbeans-ri-int/trunk/ejb/src/main/java/org/jboss/webbeans/integration/ejb/JBossEjbServices.java
   projects/webbeans-ri-int/trunk/microcontainer/src/test/java/org/jboss/test/webbeans/deployers/support/MockEjbServices.java
Removed:
   projects/webbeans-ri-int/trunk/ejb/src/main/java/org/jboss/webbeans/integration/ejb/JBossEjbResolver.java
   projects/webbeans-ri-int/trunk/microcontainer/src/test/java/org/jboss/test/webbeans/deployers/support/MockEjbResolver.java
Modified:
   projects/webbeans-ri-int/trunk/jbossas/src/main/java/org/jboss/webbeans/integration/jbossas/ejb/ServletJBossEjbResolver.java
   projects/webbeans-ri-int/trunk/jbossas/src/main/java/org/jboss/webbeans/integration/jbossas/vdf/plugins/JBossEjbResolverVDFConnector.java
   projects/webbeans-ri-int/trunk/microcontainer/src/main/java/org/jboss/webbeans/integration/microcontainer/deployer/env/WebBeansBootstrapDeployer.java
   projects/webbeans-ri-int/trunk/microcontainer/src/test/java/org/jboss/test/webbeans/deployers/support/MockBootDeployer.java
   projects/webbeans-ri-int/trunk/microcontainer/src/test/resources/org/jboss/test/webbeans/deployers/test/BootDeployerTestCase.xml
Log:
WBRI-159, WBRI-165, 

Added: projects/webbeans-ri-int/trunk/ejb/src/main/java/org/jboss/webbeans/integration/ejb/JBossEjbReference.java
===================================================================
--- projects/webbeans-ri-int/trunk/ejb/src/main/java/org/jboss/webbeans/integration/ejb/JBossEjbReference.java	                        (rev 0)
+++ projects/webbeans-ri-int/trunk/ejb/src/main/java/org/jboss/webbeans/integration/ejb/JBossEjbReference.java	2009-03-14 16:42:56 UTC (rev 85846)
@@ -0,0 +1,53 @@
+package org.jboss.webbeans.integration.ejb;
+import java.util.Iterator;
+
+import org.jboss.webbeans.ejb.api.EjbReference;
+import org.jboss.webbeans.ejb.spi.BusinessInterfaceDescriptor;
+import org.jboss.webbeans.ejb.spi.EjbDescriptor;
+import org.jboss.webbeans.resources.spi.NamingContext;
+
+
+public abstract class JBossEjbReference<T> implements EjbReference<T>
+{
+
+   private static final long serialVersionUID = 8227728506645839338L;
+   
+   // Hold a reference to the instance so EJB doesn't clean it up under us
+   private Object instance;
+   
+   private final String jndiName; 
+   
+   public JBossEjbReference(EjbDescriptor<T> descriptor)
+   {
+      Iterator<BusinessInterfaceDescriptor<?>> it = descriptor.getLocalBusinessInterfaces().iterator();
+      if (!it.hasNext())
+      {
+         throw new IllegalStateException("No local interfaces for " + descriptor);
+      }
+      String fullJndiName = it.next().getJndiName();
+      this.jndiName = fullJndiName.substring(0, fullJndiName.lastIndexOf("-"));
+   }
+   
+   public void create()
+   {
+      if (instance == null)
+      {
+         instance = getNamingContext().lookup(jndiName, Object.class);
+      }
+   }
+   
+   public <S> S get(Class<S> businessInterfaceType)
+   {
+      create();
+      return (S) instance;
+   }
+   
+   public void remove()
+   {
+      // TODO Auto-generated method stub
+      
+   }
+   
+   protected abstract NamingContext getNamingContext();
+   
+}


Property changes on: projects/webbeans-ri-int/trunk/ejb/src/main/java/org/jboss/webbeans/integration/ejb/JBossEjbReference.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Deleted: projects/webbeans-ri-int/trunk/ejb/src/main/java/org/jboss/webbeans/integration/ejb/JBossEjbResolver.java
===================================================================
--- projects/webbeans-ri-int/trunk/ejb/src/main/java/org/jboss/webbeans/integration/ejb/JBossEjbResolver.java	2009-03-14 12:49:14 UTC (rev 85845)
+++ projects/webbeans-ri-int/trunk/ejb/src/main/java/org/jboss/webbeans/integration/ejb/JBossEjbResolver.java	2009-03-14 16:42:56 UTC (rev 85846)
@@ -1,217 +0,0 @@
-package org.jboss.webbeans.integration.ejb;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-
-import javax.annotation.Resource;
-import javax.ejb.EJB;
-import javax.inject.manager.InjectionPoint;
-import javax.persistence.PersistenceContext;
-
-import org.jboss.deployers.structure.spi.DeploymentUnit;
-import org.jboss.ejb3.common.deployers.spi.AttachmentNames;
-import org.jboss.ejb3.common.resolvers.spi.EjbReference;
-import org.jboss.ejb3.common.resolvers.spi.EjbReferenceResolver;
-import org.jboss.jpa.deployment.ManagedEntityManagerFactory;
-import org.jboss.jpa.deployment.PersistenceUnitDeployment;
-import org.jboss.jpa.injection.InjectedEntityManagerFactory;
-import org.jboss.jpa.resolvers.PersistenceUnitDependencyResolver;
-import org.jboss.metadata.ejb.jboss.JBossMetaData;
-import org.jboss.metadata.web.jboss.JBossWebMetaData;
-import org.jboss.webbeans.ejb.spi.EjbResolver;
-import org.jboss.webbeans.integration.ejb.util.JBossEjb;
-import org.jboss.webbeans.integration.ejb.util.Reflections;
-import org.jboss.webbeans.integration.vdf.DeploymentUnitAware;
-import org.jboss.webbeans.resources.spi.NamingContext;
-
-/**
- * An implementation of JBossEjbResolver for JBoss AS
- *
- * @author Pete Muir
- * @author ales.justin at jboss.org
- */
-public class JBossEjbResolver implements EjbResolver, DeploymentUnitAware
-{
-   private static final String RESOURCE_LOOKUP_PREFIX = "java:/comp/env";
-   protected DeploymentUnit topLevelDeploymentUnit;
-
-   protected EjbReferenceResolver resolver;
-   protected PersistenceUnitDependencyResolver persistenceUnitDependencyResolver;
-   protected JBossEjb jbossEjb;
-
-   public void setDeploymentUnit(DeploymentUnit du)
-   {
-      if (du == null)
-         throw new IllegalArgumentException("Null deployment unit.");
-
-      topLevelDeploymentUnit = du.getTopLevel();
-   }
-
-   public void setResolver(EjbReferenceResolver resolver)
-   {
-      this.resolver = resolver;
-   }
-
-   public void setPersistenceUnitDependencyResolver(PersistenceUnitDependencyResolver persistenceUnitDependencyResolver)
-   {
-      this.persistenceUnitDependencyResolver = persistenceUnitDependencyResolver;
-   }
-
-   public void setJbossEjb(JBossEjb jbossEjb)
-   {
-      this.jbossEjb = jbossEjb;
-   }
-
-   private static String getPersistenceUnitSupplier(DeploymentUnit deploymentUnit, PersistenceUnitDependencyResolver persistenceUnitDependencyResolver, String persistenceUnitName)
-   {
-      if ((deploymentUnit.getAttachment(AttachmentNames.PROCESSED_METADATA, JBossMetaData.class) != null && deploymentUnit.getAttachment(JBossMetaData.class).isEJB3x()) || (deploymentUnit.getAttachment(JBossWebMetaData.class) != null))
-      {
-         try
-         {
-            return persistenceUnitDependencyResolver.resolvePersistenceUnitSupplier(deploymentUnit, persistenceUnitName);
-         }
-         catch (IllegalArgumentException e) 
-         {
-            // No-op, means we can't find the PU in this DU
-         }
-      }
-      for (DeploymentUnit child : deploymentUnit.getChildren())
-      {
-         String beanName = getPersistenceUnitSupplier(child, persistenceUnitDependencyResolver, persistenceUnitName);
-         if (beanName != null)
-         {
-            return beanName;
-         }
-      }
-      return null;
-   }
-   
-   public void removeEjb(Object instance)
-   {
-      // TODO Auto-generated method stub
-   }
-
-   public Object resolveEjb(InjectionPoint injectionPoint, NamingContext naming)
-   {
-      if (!injectionPoint.isAnnotationPresent(EJB.class))
-      {
-         throw new IllegalArgumentException("No @EJB annotation found on injection point " + injectionPoint);
-      }
-      if (injectionPoint.getMember() instanceof Method && ((Method) injectionPoint.getMember()).getParameterTypes().length != 1)
-      {
-         throw new IllegalArgumentException("Injection point represents a method which doesn't follow JavaBean conventions (must have exactly one parameter) " + injectionPoint);
-      }
-      EJB annotation = injectionPoint.getAnnotation(EJB.class);
-      // Get properties from the annotation
-      String beanName = annotation.beanName();
-      String beanInterface = annotation.beanInterface().getName();
-      String mappedName = annotation.mappedName();
-   
-      // Supply beanInterface from reflection if not explicitly-defined
-      if (beanInterface == null || beanInterface.equals(Object.class.getName()))
-      {
-         if (injectionPoint.getMember() instanceof Field && injectionPoint.getType() instanceof Class)
-         {
-            beanInterface = ((Class<?>) injectionPoint.getType()).getName();
-         }
-         else if (injectionPoint.getMember() instanceof Method)
-         {
-            Method method = (Method) injectionPoint.getMember();
-            beanInterface = method.getParameterTypes()[0].getName();
-         }
-      }
-   
-      String jndiName = resolver.resolveEjb(topLevelDeploymentUnit, new EjbReference(beanName, beanInterface, mappedName));
-      if (jndiName == null)
-      {
-         throw new IllegalStateException("No EJBs available which can be injected into " + injectionPoint);
-      }
-      return naming.lookup(jndiName, Object.class);
-   }
-
-   public Object resolvePersistenceContext(InjectionPoint injectionPoint, NamingContext naming)
-   {
-      if (!injectionPoint.isAnnotationPresent(PersistenceContext.class))
-      {
-         throw new IllegalArgumentException("No @PersistenceContext annotation found on injection point " + injectionPoint);
-      }
-      if (injectionPoint.getMember() instanceof Method && ((Method) injectionPoint.getMember()).getParameterTypes().length != 1)
-      {
-         throw new IllegalArgumentException("Injection point represents a method which doesn't follow JavaBean conventions (must have exactly one parameter) " + injectionPoint);
-      }
-      String persistenceUnitName = injectionPoint.getAnnotation(PersistenceContext.class).unitName(); 
-      String beanName = getPersistenceUnitSupplier(topLevelDeploymentUnit, persistenceUnitDependencyResolver, persistenceUnitName);
-      if (beanName == null)
-      {
-         throw new IllegalStateException("No persistence unit available which can be injected into " + injectionPoint);
-      }
-      PersistenceUnitDeployment deployment = jbossEjb.lookupPersistenceUnitDeployment(beanName);
-      ManagedEntityManagerFactory managedFactory = deployment.getManagedFactory();
-      return new InjectedEntityManagerFactory(managedFactory).createEntityManager();
-   }
-
-   public Object resolveResource(InjectionPoint injectionPoint, NamingContext naming)
-   {
-      if (!injectionPoint.isAnnotationPresent(Resource.class))
-      {
-         throw new IllegalArgumentException("No @Resource annotation found on injection point " + injectionPoint);
-      }
-      if (injectionPoint.getMember() instanceof Method && ((Method) injectionPoint.getMember()).getParameterTypes().length != 1)
-      {
-         throw new IllegalArgumentException("Injection point represents a method which doesn't follow JavaBean conventions (must have exactly one parameter) " + injectionPoint);
-      }
-      String name = getResourceName(injectionPoint);
-      return naming.lookup(name, Object.class);
-   }
-
-   public Class<? extends Annotation> getEJBAnnotation()
-   {
-      return EJB.class;
-   }
-
-   public Class<? extends Annotation> getPersistenceContextAnnotation()
-   {
-      return PersistenceContext.class;
-   }
-
-   public Class<? extends Annotation> getResourceAnnotation()
-   {
-      return Resource.class;
-   }
-
-   private static String getResourceName(InjectionPoint injectionPoint)
-   {
-      Resource resource = injectionPoint.getAnnotation(Resource.class);
-      String mappedName = resource.mappedName();
-      if (!mappedName.equals(""))
-      {
-         return mappedName;
-      }
-      String name = resource.name();
-      if (!name.equals(""))
-      {
-         return RESOURCE_LOOKUP_PREFIX + "/" + name;
-      }
-      String propertyName;
-      if (injectionPoint.getMember() instanceof Field)
-      {
-         propertyName = injectionPoint.getMember().getName();
-      }
-      else if (injectionPoint.getMember() instanceof Method)
-      {
-         propertyName = Reflections.getPropertyName((Method) injectionPoint.getMember());
-         if (propertyName == null)
-         {
-            throw new IllegalArgumentException("Injection point represents a method which doesn't follow JavaBean conventions (unable to determine property name) " + injectionPoint);
-         }
-      }
-      else
-      {
-         throw new AssertionError("Unable to inject into " + injectionPoint);
-      }
-      String className = injectionPoint.getMember().getDeclaringClass().getName();
-      return RESOURCE_LOOKUP_PREFIX + "/" + className + "/" + propertyName;
-   }
-   
-}

Copied: projects/webbeans-ri-int/trunk/ejb/src/main/java/org/jboss/webbeans/integration/ejb/JBossEjbServices.java (from rev 85812, projects/webbeans-ri-int/trunk/ejb/src/main/java/org/jboss/webbeans/integration/ejb/JBossEjbResolver.java)
===================================================================
--- projects/webbeans-ri-int/trunk/ejb/src/main/java/org/jboss/webbeans/integration/ejb/JBossEjbServices.java	                        (rev 0)
+++ projects/webbeans-ri-int/trunk/ejb/src/main/java/org/jboss/webbeans/integration/ejb/JBossEjbServices.java	2009-03-14 16:42:56 UTC (rev 85846)
@@ -0,0 +1,231 @@
+package org.jboss.webbeans.integration.ejb;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+
+import javax.annotation.Resource;
+import javax.ejb.EJB;
+import javax.inject.manager.InjectionPoint;
+import javax.persistence.PersistenceContext;
+
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.ejb3.common.deployers.spi.AttachmentNames;
+import org.jboss.ejb3.common.resolvers.spi.EjbReference;
+import org.jboss.ejb3.common.resolvers.spi.EjbReferenceResolver;
+import org.jboss.jpa.deployment.ManagedEntityManagerFactory;
+import org.jboss.jpa.deployment.PersistenceUnitDeployment;
+import org.jboss.jpa.injection.InjectedEntityManagerFactory;
+import org.jboss.jpa.resolvers.PersistenceUnitDependencyResolver;
+import org.jboss.metadata.ejb.jboss.JBossMetaData;
+import org.jboss.metadata.web.jboss.JBossWebMetaData;
+import org.jboss.webbeans.ejb.spi.EjbDescriptor;
+import org.jboss.webbeans.ejb.spi.EjbServices;
+import org.jboss.webbeans.integration.ejb.util.JBossEjb;
+import org.jboss.webbeans.integration.ejb.util.Reflections;
+import org.jboss.webbeans.integration.vdf.DeploymentUnitAware;
+import org.jboss.webbeans.resources.spi.NamingContext;
+
+/**
+ * An implementation of EjbServices for JBoss EJB3
+ *
+ * @author Pete Muir
+ * @author ales.justin at jboss.org
+ */
+public class JBossEjbServices implements EjbServices, DeploymentUnitAware
+{
+   private static final String RESOURCE_LOOKUP_PREFIX = "java:/comp/env";
+   protected DeploymentUnit topLevelDeploymentUnit;
+
+   protected EjbReferenceResolver resolver;
+   protected PersistenceUnitDependencyResolver persistenceUnitDependencyResolver;
+   protected JBossEjb jbossEjb;
+
+   public void setDeploymentUnit(DeploymentUnit du)
+   {
+      if (du == null)
+         throw new IllegalArgumentException("Null deployment unit.");
+
+      topLevelDeploymentUnit = du.getTopLevel();
+   }
+
+   public void setResolver(EjbReferenceResolver resolver)
+   {
+      this.resolver = resolver;
+   }
+
+   public void setPersistenceUnitDependencyResolver(PersistenceUnitDependencyResolver persistenceUnitDependencyResolver)
+   {
+      this.persistenceUnitDependencyResolver = persistenceUnitDependencyResolver;
+   }
+
+   public void setJbossEjb(JBossEjb jbossEjb)
+   {
+      this.jbossEjb = jbossEjb;
+   }
+
+   private static String getPersistenceUnitSupplier(DeploymentUnit deploymentUnit, PersistenceUnitDependencyResolver persistenceUnitDependencyResolver, String persistenceUnitName)
+   {
+      if ((deploymentUnit.getAttachment(AttachmentNames.PROCESSED_METADATA, JBossMetaData.class) != null && deploymentUnit.getAttachment(JBossMetaData.class).isEJB3x()) || (deploymentUnit.getAttachment(JBossWebMetaData.class) != null))
+      {
+         try
+         {
+            return persistenceUnitDependencyResolver.resolvePersistenceUnitSupplier(deploymentUnit, persistenceUnitName);
+         }
+         catch (IllegalArgumentException e) 
+         {
+            // No-op, means we can't find the PU in this DU
+         }
+      }
+      for (DeploymentUnit child : deploymentUnit.getChildren())
+      {
+         String beanName = getPersistenceUnitSupplier(child, persistenceUnitDependencyResolver, persistenceUnitName);
+         if (beanName != null)
+         {
+            return beanName;
+         }
+      }
+      return null;
+   }
+
+   public Object resolveEjb(InjectionPoint injectionPoint, NamingContext naming)
+   {
+      if (!injectionPoint.isAnnotationPresent(EJB.class))
+      {
+         throw new IllegalArgumentException("No @EJB annotation found on injection point " + injectionPoint);
+      }
+      if (injectionPoint.getMember() instanceof Method && ((Method) injectionPoint.getMember()).getParameterTypes().length != 1)
+      {
+         throw new IllegalArgumentException("Injection point represents a method which doesn't follow JavaBean conventions (must have exactly one parameter) " + injectionPoint);
+      }
+      EJB annotation = injectionPoint.getAnnotation(EJB.class);
+      // Get properties from the annotation
+      String beanName = annotation.beanName();
+      String beanInterface = annotation.beanInterface().getName();
+      String mappedName = annotation.mappedName();
+   
+      // Supply beanInterface from reflection if not explicitly-defined
+      if (beanInterface == null || beanInterface.equals(Object.class.getName()))
+      {
+         if (injectionPoint.getMember() instanceof Field && injectionPoint.getType() instanceof Class)
+         {
+            beanInterface = ((Class<?>) injectionPoint.getType()).getName();
+         }
+         else if (injectionPoint.getMember() instanceof Method)
+         {
+            Method method = (Method) injectionPoint.getMember();
+            beanInterface = method.getParameterTypes()[0].getName();
+         }
+      }
+   
+      String jndiName = resolver.resolveEjb(topLevelDeploymentUnit, new EjbReference(beanName, beanInterface, mappedName));
+      if (jndiName == null)
+      {
+         throw new IllegalStateException("No EJBs available which can be injected into " + injectionPoint);
+      }
+      return naming.lookup(jndiName, Object.class);
+   }
+   
+   public <T> org.jboss.webbeans.ejb.api.EjbReference<T> resolveEJB(EjbDescriptor<T> ejbDescriptor, final NamingContext naming)
+   {
+      return new JBossEjbReference<T>(ejbDescriptor)
+      {
+
+         private static final long serialVersionUID = -5063126026455936612L;
+
+         @Override
+         protected NamingContext getNamingContext()
+         {
+            return naming;
+         }
+         
+      };
+   }
+
+   public Object resolvePersistenceContext(InjectionPoint injectionPoint, NamingContext naming)
+   {
+      if (!injectionPoint.isAnnotationPresent(PersistenceContext.class))
+      {
+         throw new IllegalArgumentException("No @PersistenceContext annotation found on injection point " + injectionPoint);
+      }
+      if (injectionPoint.getMember() instanceof Method && ((Method) injectionPoint.getMember()).getParameterTypes().length != 1)
+      {
+         throw new IllegalArgumentException("Injection point represents a method which doesn't follow JavaBean conventions (must have exactly one parameter) " + injectionPoint);
+      }
+      String persistenceUnitName = injectionPoint.getAnnotation(PersistenceContext.class).unitName(); 
+      String beanName = getPersistenceUnitSupplier(topLevelDeploymentUnit, persistenceUnitDependencyResolver, persistenceUnitName);
+      if (beanName == null)
+      {
+         throw new IllegalStateException("No persistence unit available which can be injected into " + injectionPoint);
+      }
+      PersistenceUnitDeployment deployment = jbossEjb.lookupPersistenceUnitDeployment(beanName);
+      ManagedEntityManagerFactory managedFactory = deployment.getManagedFactory();
+      return new InjectedEntityManagerFactory(managedFactory).createEntityManager();
+   }
+
+   public Object resolveResource(InjectionPoint injectionPoint, NamingContext naming)
+   {
+      if (!injectionPoint.isAnnotationPresent(Resource.class))
+      {
+         throw new IllegalArgumentException("No @Resource annotation found on injection point " + injectionPoint);
+      }
+      if (injectionPoint.getMember() instanceof Method && ((Method) injectionPoint.getMember()).getParameterTypes().length != 1)
+      {
+         throw new IllegalArgumentException("Injection point represents a method which doesn't follow JavaBean conventions (must have exactly one parameter) " + injectionPoint);
+      }
+      String name = getResourceName(injectionPoint);
+      return naming.lookup(name, Object.class);
+   }
+   
+
+
+   public Class<? extends Annotation> getEJBAnnotation()
+   {
+      return EJB.class;
+   }
+
+   public Class<? extends Annotation> getPersistenceContextAnnotation()
+   {
+      return PersistenceContext.class;
+   }
+
+   public Class<? extends Annotation> getResourceAnnotation()
+   {
+      return Resource.class;
+   }
+
+   private static String getResourceName(InjectionPoint injectionPoint)
+   {
+      Resource resource = injectionPoint.getAnnotation(Resource.class);
+      String mappedName = resource.mappedName();
+      if (!mappedName.equals(""))
+      {
+         return mappedName;
+      }
+      String name = resource.name();
+      if (!name.equals(""))
+      {
+         return RESOURCE_LOOKUP_PREFIX + "/" + name;
+      }
+      String propertyName;
+      if (injectionPoint.getMember() instanceof Field)
+      {
+         propertyName = injectionPoint.getMember().getName();
+      }
+      else if (injectionPoint.getMember() instanceof Method)
+      {
+         propertyName = Reflections.getPropertyName((Method) injectionPoint.getMember());
+         if (propertyName == null)
+         {
+            throw new IllegalArgumentException("Injection point represents a method which doesn't follow JavaBean conventions (unable to determine property name) " + injectionPoint);
+         }
+      }
+      else
+      {
+         throw new AssertionError("Unable to inject into " + injectionPoint);
+      }
+      String className = injectionPoint.getMember().getDeclaringClass().getName();
+      return RESOURCE_LOOKUP_PREFIX + "/" + className + "/" + propertyName;
+   }
+   
+}

Modified: projects/webbeans-ri-int/trunk/jbossas/src/main/java/org/jboss/webbeans/integration/jbossas/ejb/ServletJBossEjbResolver.java
===================================================================
--- projects/webbeans-ri-int/trunk/jbossas/src/main/java/org/jboss/webbeans/integration/jbossas/ejb/ServletJBossEjbResolver.java	2009-03-14 12:49:14 UTC (rev 85845)
+++ projects/webbeans-ri-int/trunk/jbossas/src/main/java/org/jboss/webbeans/integration/jbossas/ejb/ServletJBossEjbResolver.java	2009-03-14 16:42:56 UTC (rev 85846)
@@ -3,8 +3,8 @@
 
 import javax.servlet.ServletContext;
 
-import org.jboss.webbeans.ejb.spi.EjbResolver;
-import org.jboss.webbeans.ejb.spi.helpers.ForwardingEjbResolver;
+import org.jboss.webbeans.ejb.spi.EjbServices;
+import org.jboss.webbeans.ejb.spi.helpers.ForwardingEjbServices;
 import org.jboss.webbeans.integration.jbossas.vdf.plugins.JBossEjbResolverVDFConnector;
 
 /**
@@ -13,9 +13,9 @@
  * @author Pete Muir
  * @author ales.justin at jboss.org
  */
-public class ServletJBossEjbResolver extends ForwardingEjbResolver
+public class ServletJBossEjbResolver extends ForwardingEjbServices
 {
-   private final EjbResolver delegate;
+   private final EjbServices delegate;
    
    public ServletJBossEjbResolver(ServletContext servletContext)
    {
@@ -27,7 +27,7 @@
    }
    
    @Override
-   public EjbResolver delegate()
+   public EjbServices delegate()
    {
       return delegate;
    }

Modified: projects/webbeans-ri-int/trunk/jbossas/src/main/java/org/jboss/webbeans/integration/jbossas/vdf/plugins/JBossEjbResolverVDFConnector.java
===================================================================
--- projects/webbeans-ri-int/trunk/jbossas/src/main/java/org/jboss/webbeans/integration/jbossas/vdf/plugins/JBossEjbResolverVDFConnector.java	2009-03-14 12:49:14 UTC (rev 85845)
+++ projects/webbeans-ri-int/trunk/jbossas/src/main/java/org/jboss/webbeans/integration/jbossas/vdf/plugins/JBossEjbResolverVDFConnector.java	2009-03-14 16:42:56 UTC (rev 85846)
@@ -23,7 +23,7 @@
 
 import javax.servlet.ServletContext;
 
-import org.jboss.webbeans.integration.ejb.JBossEjbResolver;
+import org.jboss.webbeans.integration.ejb.JBossEjbServices;
 import org.jboss.webbeans.integration.jbossas.vdf.AbstractBeanFactoryInitializerVDFConnector;
 
 /**
@@ -31,7 +31,7 @@
  *
  * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
  */
-public class JBossEjbResolverVDFConnector extends AbstractBeanFactoryInitializerVDFConnector<JBossEjbResolver>
+public class JBossEjbResolverVDFConnector extends AbstractBeanFactoryInitializerVDFConnector<JBossEjbServices>
 {
    public JBossEjbResolverVDFConnector(ServletContext servletContext)
    {
@@ -43,8 +43,8 @@
       return "JBossEjbResolver";
    }
 
-   protected Class<JBossEjbResolver> getUnwrappedType()
+   protected Class<JBossEjbServices> getUnwrappedType()
    {
-      return JBossEjbResolver.class;
+      return JBossEjbServices.class;
    }
 }
\ No newline at end of file

Modified: projects/webbeans-ri-int/trunk/microcontainer/src/main/java/org/jboss/webbeans/integration/microcontainer/deployer/env/WebBeansBootstrapDeployer.java
===================================================================
--- projects/webbeans-ri-int/trunk/microcontainer/src/main/java/org/jboss/webbeans/integration/microcontainer/deployer/env/WebBeansBootstrapDeployer.java	2009-03-14 12:49:14 UTC (rev 85845)
+++ projects/webbeans-ri-int/trunk/microcontainer/src/main/java/org/jboss/webbeans/integration/microcontainer/deployer/env/WebBeansBootstrapDeployer.java	2009-03-14 16:42:56 UTC (rev 85846)
@@ -59,7 +59,7 @@
       BeanMetaDataBuilder bootstrap = BeanMetaDataBuilder.createBuilder(bootstrapName, "org.jboss.webbeans.bootstrap.WebBeansBootstrap");
       bootstrap.addPropertyMetaData("webBeanDiscovery", bootstrap.createInject(envName));
       bootstrap.addPropertyMetaData("ejbDiscovery", createEjbConnector("JBossEjbDiscovery", "org.jboss.webbeans.integration.ejb.JBossEjbDiscovery", unit));
-      bootstrap.addPropertyMetaData("ejbResolver", createEjbConnector("JBossEjbResolver", "org.jboss.webbeans.integration.ejb.JBossEjbResolver", unit));
+      bootstrap.addPropertyMetaData("ejbServices", createEjbConnector("JBossEjbServices", "org.jboss.webbeans.integration.ejb.JBossEjbServices", unit));
       bootstrap.addPropertyMetaData("transactionServices", bootstrap.createInject("JBossTransactionServices"));
       bootstrap.addPropertyMetaData("applicationContext", createBeanStore());
       bootstrap.setCreate("initialize");

Modified: projects/webbeans-ri-int/trunk/microcontainer/src/test/java/org/jboss/test/webbeans/deployers/support/MockBootDeployer.java
===================================================================
--- projects/webbeans-ri-int/trunk/microcontainer/src/test/java/org/jboss/test/webbeans/deployers/support/MockBootDeployer.java	2009-03-14 12:49:14 UTC (rev 85845)
+++ projects/webbeans-ri-int/trunk/microcontainer/src/test/java/org/jboss/test/webbeans/deployers/support/MockBootDeployer.java	2009-03-14 16:42:56 UTC (rev 85846)
@@ -60,7 +60,7 @@
       BeanMetaDataBuilder bootstrap = BeanMetaDataBuilder.createBuilder(bootstrapName, "org.jboss.test.webbeans.deployers.support.MockWBBootstrap");
       bootstrap.addPropertyMetaData("webBeanDiscovery", bootstrap.createInject(envName));
       bootstrap.addPropertyMetaData("ejbDiscovery", createEjbConnector("JBossEjbDiscovery", "org.jboss.test.webbeans.deployers.support.MockEjbDiscovery", unit));
-      bootstrap.addPropertyMetaData("ejbResolver", createEjbConnector("JBossEjbResolver", "org.jboss.test.webbeans.deployers.support.MockEjbResolver", unit));
+      bootstrap.addPropertyMetaData("ejbServices", createEjbConnector("JBossEjbServices", "org.jboss.test.webbeans.deployers.support.MockEjbServices", unit));
       bootstrap.addPropertyMetaData("transactionServices", bootstrap.createInject("JBossTransactionServices"));
       bootstrap.addPropertyMetaData("applicationContext", createBeanStore());
       bootstrap.setCreate("initialize");

Deleted: projects/webbeans-ri-int/trunk/microcontainer/src/test/java/org/jboss/test/webbeans/deployers/support/MockEjbResolver.java
===================================================================
--- projects/webbeans-ri-int/trunk/microcontainer/src/test/java/org/jboss/test/webbeans/deployers/support/MockEjbResolver.java	2009-03-14 12:49:14 UTC (rev 85845)
+++ projects/webbeans-ri-int/trunk/microcontainer/src/test/java/org/jboss/test/webbeans/deployers/support/MockEjbResolver.java	2009-03-14 16:42:56 UTC (rev 85846)
@@ -1,76 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, 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.test.webbeans.deployers.support;
-
-import java.lang.annotation.Annotation;
-
-import javax.inject.manager.InjectionPoint;
-
-import org.jboss.deployers.structure.spi.DeploymentUnit;
-import org.jboss.webbeans.ejb.spi.EjbResolver;
-import org.jboss.webbeans.resources.spi.NamingContext;
-
-/**
- * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
- */
-public class MockEjbResolver implements EjbResolver
-{
-   public void setDeploymentUnit(DeploymentUnit unit)
-   {
-   }
-   
-   public Object resolveEjb(InjectionPoint injectionPoint, NamingContext namingContext)
-   {
-      return null;
-   }
-
-   public Object resolvePersistenceContext(InjectionPoint injectionPoint, NamingContext namingContext)
-   {
-      return null;
-   }
-
-   public Object resolveResource(InjectionPoint injectionPoint, NamingContext namingContext)
-   {
-      return null;
-   }
-
-   public Class<? extends Annotation> getEJBAnnotation()
-   {
-      return null;
-   }
-
-   public Class<? extends Annotation> getPersistenceContextAnnotation()
-   {
-      return null;
-   }
-
-   public Class<? extends Annotation> getResourceAnnotation()
-   {
-      return null;
-   }
-   
-   public void removeEjb(Object instance)
-   {
-      // TODO Auto-generated method stub
-   }
-   
-}

Copied: projects/webbeans-ri-int/trunk/microcontainer/src/test/java/org/jboss/test/webbeans/deployers/support/MockEjbServices.java (from rev 85812, projects/webbeans-ri-int/trunk/microcontainer/src/test/java/org/jboss/test/webbeans/deployers/support/MockEjbResolver.java)
===================================================================
--- projects/webbeans-ri-int/trunk/microcontainer/src/test/java/org/jboss/test/webbeans/deployers/support/MockEjbServices.java	                        (rev 0)
+++ projects/webbeans-ri-int/trunk/microcontainer/src/test/java/org/jboss/test/webbeans/deployers/support/MockEjbServices.java	2009-03-14 16:42:56 UTC (rev 85846)
@@ -0,0 +1,84 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, 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.test.webbeans.deployers.support;
+
+import java.lang.annotation.Annotation;
+
+import javax.inject.manager.InjectionPoint;
+
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.webbeans.ejb.api.EjbReference;
+import org.jboss.webbeans.ejb.spi.EjbDescriptor;
+import org.jboss.webbeans.ejb.spi.EjbServices;
+import org.jboss.webbeans.resources.spi.NamingContext;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public class MockEjbServices implements EjbServices
+{
+   public void setDeploymentUnit(DeploymentUnit unit)
+   {
+   }
+   
+   public Object resolveEjb(InjectionPoint injectionPoint, NamingContext namingContext)
+   {
+      return null;
+   }
+
+   public Object resolvePersistenceContext(InjectionPoint injectionPoint, NamingContext namingContext)
+   {
+      return null;
+   }
+
+   public Object resolveResource(InjectionPoint injectionPoint, NamingContext namingContext)
+   {
+      return null;
+   }
+
+   public Class<? extends Annotation> getEJBAnnotation()
+   {
+      return null;
+   }
+
+   public Class<? extends Annotation> getPersistenceContextAnnotation()
+   {
+      return null;
+   }
+
+   public Class<? extends Annotation> getResourceAnnotation()
+   {
+      return null;
+   }
+   
+   public void removeEjb(Object instance)
+   {
+   }
+
+   public <T> EjbReference<T> resolveEJB(EjbDescriptor<T> descriptor, NamingContext namingContext)
+   {
+      return null;
+   }
+   
+   
+   
+}

Modified: projects/webbeans-ri-int/trunk/microcontainer/src/test/resources/org/jboss/test/webbeans/deployers/test/BootDeployerTestCase.xml
===================================================================
--- projects/webbeans-ri-int/trunk/microcontainer/src/test/resources/org/jboss/test/webbeans/deployers/test/BootDeployerTestCase.xml	2009-03-14 12:49:14 UTC (rev 85845)
+++ projects/webbeans-ri-int/trunk/microcontainer/src/test/resources/org/jboss/test/webbeans/deployers/test/BootDeployerTestCase.xml	2009-03-14 16:42:56 UTC (rev 85846)
@@ -11,7 +11,7 @@
 
   <!-- Mock EJB utils -->
 
-  <beanfactory name="JBossEjbResolver" class="org.jboss.test.webbeans.deployers.support.MockEjbResolver"/>
+  <beanfactory name="JBossEjbServices" class="org.jboss.test.webbeans.deployers.support.MockEjbServices"/>
 
   <beanfactory name="JBossEjbDiscovery" class="org.jboss.test.webbeans.deployers.support.MockEjbDiscovery"/>
 




More information about the jboss-cvs-commits mailing list