[webbeans-commits] Webbeans SVN: r438 - in ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans: bean and 2 other directories.

webbeans-commits at lists.jboss.org webbeans-commits at lists.jboss.org
Sun Dec 7 11:46:10 EST 2008


Author: pete.muir at jboss.org
Date: 2008-12-07 11:46:10 -0500 (Sun, 07 Dec 2008)
New Revision: 438

Removed:
   ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/XmlEnterpriseBean.java
   ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/XmlSimpleBean.java
   ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/exceptions/Location.java
   ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/exceptions/NameResolutionLocation.java
Modified:
   ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java
   ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractBean.java
   ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractClassBean.java
   ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java
   ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java
   ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/SimpleBean.java
   ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/BeanFactory.java
Log:
Remove XML stuff, there is a new way of doing it, other tidy ups

Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java	2008-12-07 16:37:02 UTC (rev 437)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java	2008-12-07 16:46:10 UTC (rev 438)
@@ -52,7 +52,6 @@
 import org.jboss.webbeans.contexts.DependentContext;
 import org.jboss.webbeans.ejb.DefaultEnterpriseBeanLookup;
 import org.jboss.webbeans.event.EventManager;
-import org.jboss.webbeans.exceptions.NameResolutionLocation;
 import org.jboss.webbeans.introspector.AnnotatedItem;
 import org.jboss.webbeans.introspector.AnnotatedMethod;
 import org.jboss.webbeans.introspector.jlr.AnnotatedClassImpl;
@@ -474,7 +473,7 @@
       }
       else if (beans.size() > 1)
       {
-         throw new AmbiguousDependencyException(new NameResolutionLocation(name) + "Resolved multiple Web Beans");
+         throw new AmbiguousDependencyException("Resolved multiple Web Beans with " + name);
       }
       else
       {

Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractBean.java	2008-12-07 16:37:02 UTC (rev 437)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractBean.java	2008-12-07 16:46:10 UTC (rev 438)
@@ -146,42 +146,23 @@
    protected void initBindingTypes()
    {
       this.bindingTypes = new HashSet<Annotation>();
-      if (isDefinedInXml())
+      boolean specialization = getAnnotatedItem().isAnnotationPresent(Specializes.class);
+      this.bindingTypes.addAll(getAnnotatedItem().getMetaAnnotations(BindingType.class));
+      if (specialization)
       {
-         boolean xmlSpecialization = false;
-         Set<Annotation> xmlBindingTypes = null;
-         this.bindingTypes.addAll(xmlBindingTypes);
-         if (xmlSpecialization)
-         {
-            this.bindingTypes.addAll(bindingTypes);
-            log.trace("Using binding types " + this.bindingTypes + " specified in XML and specialized type");
-         }
-         else
-         {
-            log.trace("Using binding types " + this.bindingTypes + " specified in XML");
-         }
-         return;
+         this.bindingTypes.addAll(getSpecializedType().getBindingTypes());
+         log.trace("Using binding types " + bindingTypes + " specified by annotations and specialized supertype");
       }
-      else if (!mergedStereotypes.isDeclaredInXml())
+      else if (bindingTypes.size() == 0)
       {
-         boolean specialization = getAnnotatedItem().isAnnotationPresent(Specializes.class);
-         this.bindingTypes.addAll(getAnnotatedItem().getMetaAnnotations(BindingType.class));
-         if (specialization)
-         {
-            this.bindingTypes.addAll(getSpecializedType().getBindingTypes());
-            log.trace("Using binding types " + bindingTypes + " specified by annotations and specialized supertype");
-         }
-         else if (bindingTypes.size() == 0)
-         {
-            log.trace("Adding default @Current binding type");
-            this.bindingTypes.add(new CurrentAnnotationLiteral());
-         }
-         else
-         {
-            log.trace("Using binding types " + bindingTypes + " specified by annotations");
-         }
-         return;
+         log.trace("Adding default @Current binding type");
+         this.bindingTypes.add(new CurrentAnnotationLiteral());
       }
+      else
+      {
+         log.trace("Using binding types " + bindingTypes + " specified by annotations");
+      }
+      return;
    }
 
    /**
@@ -190,42 +171,24 @@
    @SuppressWarnings("null")
    protected void initDeploymentType()
    {
-      if (isDefinedInXml())
-      {
-         Set<Annotation> xmlDeploymentTypes = null;
-         if (xmlDeploymentTypes.size() > 1)
-         {
-            throw new DefinitionException("At most one deployment type may be specified (" + xmlDeploymentTypes + " are specified)");
-         }
+      Set<Annotation> deploymentTypes = getAnnotatedItem().getMetaAnnotations(DeploymentType.class);
 
-         if (xmlDeploymentTypes.size() == 1)
-         {
-            this.deploymentType = xmlDeploymentTypes.iterator().next().annotationType();
-            log.trace("Deployment type " + deploymentType + " specified in XML");
-            return;
-         }
+      if (deploymentTypes.size() > 1)
+      {
+         throw new DefinitionException("At most one deployment type may be specified (" + deploymentTypes + " are specified) on " + getAnnotatedItem().toString());
       }
-      else
+      if (deploymentTypes.size() == 1)
       {
-         Set<Annotation> deploymentTypes = getAnnotatedItem().getMetaAnnotations(DeploymentType.class);
+         this.deploymentType = deploymentTypes.iterator().next().annotationType();
+         log.trace("Deployment type " + deploymentType + " specified by annotation");
+         return;
+      }
 
-         if (deploymentTypes.size() > 1)
-         {
-            throw new DefinitionException("At most one deployment type may be specified (" + deploymentTypes + " are specified) on " + getAnnotatedItem().toString());
-         }
-         if (deploymentTypes.size() == 1)
-         {
-            this.deploymentType = deploymentTypes.iterator().next().annotationType();
-            log.trace("Deployment type " + deploymentType + " specified by annotation");
-            return;
-         }
-
-         if (getMergedStereotypes().getPossibleDeploymentTypes().size() > 0)
-         {
-            this.deploymentType = getDeploymentType(manager.getEnabledDeploymentTypes(), getMergedStereotypes().getPossibleDeploymentTypes());
-            log.trace("Deployment type " + deploymentType + " specified by stereotype");
-            return;
-         }
+      if (getMergedStereotypes().getPossibleDeploymentTypes().size() > 0)
+      {
+         this.deploymentType = getDeploymentType(manager.getEnabledDeploymentTypes(), getMergedStereotypes().getPossibleDeploymentTypes());
+         log.trace("Deployment type " + deploymentType + " specified by stereotype");
+         return;
       }
 
       this.deploymentType = getDefaultDeploymentType();
@@ -256,54 +219,31 @@
    protected void initName()
    {
       boolean beanNameDefaulted = false;
-      if (isDefinedInXml())
+      boolean specialization = getAnnotatedItem().isAnnotationPresent(Specializes.class);
+      if (getAnnotatedItem().isAnnotationPresent(Named.class))
       {
-         boolean xmlSpecialization = false;
-         if (xmlSpecialization)
+         if (specialization)
          {
-            throw new DefinitionException("Name specified for specialized bean (declared in XML)");
+            throw new DefinitionException("Name specified for specialized bean");
          }
-         String xmlName = "";
-         if ("".equals(xmlName))
+         String javaName = getAnnotatedItem().getAnnotation(Named.class).value();
+         if ("".equals(javaName))
          {
-            log.trace("Using default name (specified in XML)");
+            log.trace("Using default name (specified by annotations)");
             beanNameDefaulted = true;
          }
          else
          {
-            log.trace("Using name " + xmlName + " specified in XML");
-            this.name = xmlName;
+            log.trace("Using name " + javaName + " specified by annotations");
+            this.name = javaName;
             return;
          }
       }
-      else
+      else if (specialization)
       {
-         boolean specialization = getAnnotatedItem().isAnnotationPresent(Specializes.class);
-         if (getAnnotatedItem().isAnnotationPresent(Named.class))
-         {
-            if (specialization)
-            {
-               throw new DefinitionException("Name specified for specialized bean");
-            }
-            String javaName = getAnnotatedItem().getAnnotation(Named.class).value();
-            if ("".equals(javaName))
-            {
-               log.trace("Using default name (specified by annotations)");
-               beanNameDefaulted = true;
-            }
-            else
-            {
-               log.trace("Using name " + javaName + " specified by annotations");
-               this.name = javaName;
-               return;
-            }
-         }
-         else if (specialization)
-         {
-            this.name = getSpecializedType().getName();
-            log.trace("Using supertype name");
-            return;
-         }
+         this.name = getSpecializedType().getName();
+         log.trace("Using supertype name");
+         return;
       }
 
       if (beanNameDefaulted || getMergedStereotypes().isBeanNameDefaulted())
@@ -327,34 +267,16 @@
    @SuppressWarnings("null")
    protected void initScopeType()
    {
-      if (isDefinedInXml())
+      if (getAnnotatedItem().getMetaAnnotations(ScopeType.class).size() > 1)
       {
-         Set<Class<? extends Annotation>> scopeTypes = null;
-         if (scopeTypes.size() > 1)
-         {
-            throw new DefinitionException("At most one scope may be specified in XML");
-         }
-
-         if (scopeTypes.size() == 1)
-         {
-            this.scopeType = scopeTypes.iterator().next();
-            log.trace("Scope " + scopeType + " specified in XML");
-            return;
-         }
+         throw new DefinitionException("At most one scope may be specified");
       }
-      else
-      {
-         if (getAnnotatedItem().getMetaAnnotations(ScopeType.class).size() > 1)
-         {
-            throw new DefinitionException("At most one scope may be specified");
-         }
 
-         if (getAnnotatedItem().getMetaAnnotations(ScopeType.class).size() == 1)
-         {
-            this.scopeType = getAnnotatedItem().getMetaAnnotations(ScopeType.class).iterator().next().annotationType();
-            log.trace("Scope " + scopeType + " specified by annotation");
-            return;
-         }
+      if (getAnnotatedItem().getMetaAnnotations(ScopeType.class).size() == 1)
+      {
+         this.scopeType = getAnnotatedItem().getMetaAnnotations(ScopeType.class).iterator().next().annotationType();
+         log.trace("Scope " + scopeType + " specified by annotation");
+         return;
       }
 
       if (getMergedStereotypes().getPossibleScopeTypes().size() == 1)
@@ -580,16 +502,6 @@
    }
 
    /**
-    * Indicates if bean was defined in XML
-    * 
-    * @return True if defined in XML, false if defined with annotations
-    */
-   protected boolean isDefinedInXml()
-   {
-      return false;
-   }
-
-   /**
     * Inicates if bean is nullable
     * 
     * @return True if nullable, false otherwise

Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractClassBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractClassBean.java	2008-12-07 16:37:02 UTC (rev 437)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractClassBean.java	2008-12-07 16:46:10 UTC (rev 438)
@@ -88,15 +88,8 @@
     */
    protected void initType()
    {
-      if (isDefinedInXml())
-      {
-         log.trace("Bean type specified in Java");
-      }
-      else
-      {
-         log.trace("Bean type specified in Java");
-         this.type = getAnnotatedItem().getType();
-      }
+      log.trace("Bean type specified in Java");
+      this.type = getAnnotatedItem().getType();
    }
 
    /**
@@ -154,40 +147,33 @@
     */
    protected void initInitializerMethods()
    {
-      if (isDefinedInXml())
+      initializerMethods = new HashSet<AnnotatedMethod<Object>>();
+      for (AnnotatedMethod<Object> annotatedMethod : annotatedItem.getAnnotatedMethods(Initializer.class))
       {
-
-      }
-      else
-      {
-         initializerMethods = new HashSet<AnnotatedMethod<Object>>();
-         for (AnnotatedMethod<Object> annotatedMethod : annotatedItem.getAnnotatedMethods(Initializer.class))
+         if (annotatedMethod.isStatic())
          {
-            if (annotatedMethod.isStatic())
-            {
-               throw new DefinitionException("Initializer method " + annotatedMethod.toString() + " cannot be static");
-            }
-            else if (annotatedMethod.getAnnotation(Produces.class) != null)
-            {
-               throw new DefinitionException("Initializer method " + annotatedMethod.toString() + " cannot be annotated @Produces");
-            }
-            else if (annotatedMethod.getAnnotation(Destructor.class) != null)
-            {
-               throw new DefinitionException("Initializer method " + annotatedMethod.toString() + " cannot be annotated @Destructor");
-            }
-            else if (annotatedMethod.getAnnotatedParameters(Disposes.class).size() > 0)
-            {
-               throw new DefinitionException("Initializer method " + annotatedMethod.toString() + " cannot have parameters annotated @Disposes");
-            }
-            else if (annotatedMethod.getAnnotatedParameters(Observes.class).size() > 0)
-            {
-               throw new DefinitionException("Initializer method " + annotatedMethod.toString() + " cannot be annotated @Observes");
-            }
-            else
-            {
-               initializerMethods.add(annotatedMethod);
-            }
+            throw new DefinitionException("Initializer method " + annotatedMethod.toString() + " cannot be static");
          }
+         else if (annotatedMethod.getAnnotation(Produces.class) != null)
+         {
+            throw new DefinitionException("Initializer method " + annotatedMethod.toString() + " cannot be annotated @Produces");
+         }
+         else if (annotatedMethod.getAnnotation(Destructor.class) != null)
+         {
+            throw new DefinitionException("Initializer method " + annotatedMethod.toString() + " cannot be annotated @Destructor");
+         }
+         else if (annotatedMethod.getAnnotatedParameters(Disposes.class).size() > 0)
+         {
+            throw new DefinitionException("Initializer method " + annotatedMethod.toString() + " cannot have parameters annotated @Disposes");
+         }
+         else if (annotatedMethod.getAnnotatedParameters(Observes.class).size() > 0)
+         {
+            throw new DefinitionException("Initializer method " + annotatedMethod.toString() + " cannot be annotated @Observes");
+         }
+         else
+         {
+            initializerMethods.add(annotatedMethod);
+         }
       }
    }
 

Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java	2008-12-07 16:37:02 UTC (rev 437)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java	2008-12-07 16:46:10 UTC (rev 438)
@@ -50,8 +50,6 @@
 public class EnterpriseBean<T> extends AbstractClassBean<T>
 {
 
-   private String location;
-
    private EjbMetaData<T> ejbMetaData;
 
    /**
@@ -138,20 +136,10 @@
       {
          return;
       }
-      if (!isDefinedInXml())
+      if (!MetaDataCache.instance().getEjbMetaData(getAnnotatedItem().getSuperclass().getType()).isEjb())
       {
-         if (!MetaDataCache.instance().getEjbMetaData(getAnnotatedItem().getSuperclass().getType()).isEjb())
-         {
-            throw new DefinitionException("Annotation defined specializing EJB must have EJB superclass");
-         }
+         throw new DefinitionException("Annotation defined specializing EJB must have EJB superclass");
       }
-      else
-      {
-         if (MetaDataCache.instance().getEjbMetaData(getAnnotatedItem().getSuperclass().getType()).isEjb())
-         {
-            throw new DefinitionException("XML defined specializing EJB must have annotation defined EJB implementation");
-         }
-      }
    }
 
    /**
@@ -281,20 +269,6 @@
    }
 
    /**
-    * Gets the debugging location info
-    * 
-    * @return The location string
-    */
-   public String getLocation()
-   {
-      if (location == null)
-      {
-         location = "type: Enterprise Bean; declaring class: " + getType() + ";";
-      }
-      return location;
-   }
-
-   /**
     * Returns the specializes type of the bean
     * 
     * @return The specialized type

Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java	2008-12-07 16:37:02 UTC (rev 437)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java	2008-12-07 16:46:10 UTC (rev 438)
@@ -47,9 +47,6 @@
    
    private AnnotatedMethod<T> method;
    private AbstractClassBean<?> declaringBean;
-   
-   // Cached values
-   private String location;
 
    /**
     * Constructor
@@ -176,7 +173,7 @@
       else if (disposalMethods.size() > 1)
       {
          // TODO List out found disposal methods
-         throw new DefinitionException (getLocation() + "Cannot declare multiple disposal methods for this producer method");
+         throw new DefinitionException ("Cannot declare multiple disposal methods for this producer method");
       }
    }
    
@@ -218,7 +215,7 @@
       }
       catch (ClassCastException e) 
       {
-         throw new RuntimeException(getLocation() + " Cannot cast producer method return type " + method.getType() + " to bean type " + (getDeclaredBeanType() == null ? " unknown " : getDeclaredBeanType()), e);
+         throw new RuntimeException(" Cannot cast producer method return type " + method.getType() + " to bean type " + (getDeclaredBeanType() == null ? " unknown " : getDeclaredBeanType()), e);
       }
    }
    
@@ -246,20 +243,6 @@
    }
    
    /**
-    * Gets the debugging location info
-    * 
-    * @return The location string
-    */   
-   public String getLocation()
-   {
-      if (location == null)
-      {
-         location = "type: Producer Method; declaring class: " + method.getDeclaringClass() +"; producer method: " + method.toString() + ";";
-      }
-      return location;
-   }
-   
-   /**
     * Returns the disposal method
     * 
     * @return The method representation
@@ -285,7 +268,6 @@
       StringBuilder buffer = new StringBuilder();
       buffer.append("ProducerMethodBean:\n");
       buffer.append(super.toString() + "\n");
-      buffer.append("Location: " + location + "\n");
       buffer.append("Declaring bean: " + declaringBean.toString() + "\n");
       buffer.append("Method: " + method.toString() + "\n");
       return buffer.toString();      

Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/SimpleBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/SimpleBean.java	2008-12-07 16:37:02 UTC (rev 437)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/SimpleBean.java	2008-12-07 16:46:10 UTC (rev 438)
@@ -51,7 +51,6 @@
    private static List<Class<?>> NO_ARGUMENTS = Collections.emptyList();
 
    private AnnotatedConstructor<T> constructor;
-   private String location;
 
    private AnnotatedMethod<Object> postConstruct;
    private AnnotatedMethod<Object> preDestroy;
@@ -306,20 +305,6 @@
    }
 
    /**
-    * Gets the debugging location info
-    * 
-    * @return The location string
-    */
-   public String getLocation()
-   {
-      if (location == null)
-      {
-         location = "type: Simple Bean; declaring class: " + getType() + ";";
-      }
-      return location;
-   }
-
-   /**
     * Returns the specializes type of the bean
     * 
     * @return The specialized type
@@ -383,7 +368,6 @@
       StringBuilder buffer = new StringBuilder();
       buffer.append("SimpleBean\n");
       buffer.append(super.toString() + "\n");
-      buffer.append("Location: " + location + "\n");
       buffer.append("Constructor: " + constructor.toString() + "\n");
       buffer.append("Post-construct: " + (postConstruct == null ? "null" : postConstruct.toString()) + "\n");
       buffer.append("Pre-destroy: " + (preDestroy == null ? "null" : preDestroy.toString()) + "\n");

Deleted: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/XmlEnterpriseBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/XmlEnterpriseBean.java	2008-12-07 16:37:02 UTC (rev 437)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/XmlEnterpriseBean.java	2008-12-07 16:46:10 UTC (rev 438)
@@ -1,59 +0,0 @@
-/*
- * 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.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,  
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.jboss.webbeans.bean;
-
-import org.jboss.webbeans.ManagerImpl;
-
-
-/**
- * Represents an XML defined enterprise bean
- * 
- * @author Pete Muir
- * 
- * @param <T>
- */
-public class XmlEnterpriseBean<T> extends EnterpriseBean<T>
-{
-
-   /**
-    * Constructor
-    * 
-    * @param type The type of the bean
-    */
-   public XmlEnterpriseBean(Class<T> type, ManagerImpl manager)
-   {
-      super(type, manager);
-   }
-
-   /**
-    * Indicates the bean was defined in XML
-    */
-   protected boolean isDefinedInXml()
-   {
-      return true;
-   }
-   
-   @Override
-   public String toString()
-   {
-      StringBuilder buffer = new StringBuilder();
-      buffer.append("XmlEnterpriseBean\n");
-      buffer.append(super.toString() + "\n");
-      return buffer.toString();
-   }   
-}

Deleted: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/XmlSimpleBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/XmlSimpleBean.java	2008-12-07 16:37:02 UTC (rev 437)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/XmlSimpleBean.java	2008-12-07 16:46:10 UTC (rev 438)
@@ -1,59 +0,0 @@
-/*
- * 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.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,  
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.jboss.webbeans.bean;
-
-import org.jboss.webbeans.ManagerImpl;
-
-
-/**
- * Represents a simple, XML defined bean
- * 
- * @author Pete Muir
- * 
- * @param <T>
- */
-public class XmlSimpleBean<T> extends SimpleBean<T>
-{
-
-   /**
-    * Constructor
-    * 
-    * @param type The type of the bean
-    */
-   public XmlSimpleBean(Class<T> type, ManagerImpl manager)
-   {
-      super(type, manager);
-   }
-
-   /**
-    * Indicates the bean was defined in XML
-    */
-   protected boolean isDefinedInXml()
-   {
-      return true;
-   }
-
-   @Override
-   public String toString()
-   {
-      StringBuilder buffer = new StringBuilder();
-      buffer.append("XmlLSimpleBean\n");
-      buffer.append(super.toString() + "\n");
-      return buffer.toString();
-   }
-}

Deleted: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/exceptions/Location.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/exceptions/Location.java	2008-12-07 16:37:02 UTC (rev 437)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/exceptions/Location.java	2008-12-07 16:46:10 UTC (rev 438)
@@ -1,138 +0,0 @@
-/*
- * 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.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,  
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.jboss.webbeans.exceptions;
-
-/**
- * Helper superclass for exception information
- * 
- * @author Pete Muir
- */
-public class Location
-{
-   // The category of the exception 
-   private String type;
-   // The bean the exception occurred in
-   private String bean;
-   // The element the exception occurred in
-   private String element;
-
-   /**
-    * Constructor
-    * 
-    * @param type The category
-    * @param bean The bean
-    * @param element The element
-    */
-   public Location(String type, String bean, String element)
-   {
-      super();
-      this.type = type;
-      this.bean = bean;
-      this.element = element;
-   }
-
-   /**
-    * Gets the type of the exception
-    * 
-    * @return The type
-    */
-   public String getType()
-   {
-      return type;
-   }
-
-   /**
-    * Sets the type of the exception
-    * 
-    * @param type The type
-    */
-   public void setType(String type)
-   {
-      this.type = type;
-   }
-
-   /**
-    * Gets the bean the exception occurred in
-    * 
-    * @return The bean
-    */
-   public String getBean()
-   {
-      return bean;
-   }
-
-   /**
-    * Sets the bean the exception occurred in
-    * 
-    * @param bean The bean
-    */
-   public void setBean(String bean)
-   {
-      this.bean = bean;
-   }
-
-   /**
-    * Gets the element the exception occurred in
-    * 
-    * @return The element
-    */
-   public String getElement()
-   {
-      return element;
-   }
-
-   /**
-    * Sets the element the exception occurred in
-    * 
-    * @param element The element
-    */
-   public void setElement(String element)
-   {
-      this.element = element;
-   }
-   
-   /**
-    * Gets the summarizing message
-    * 
-    * @return The message
-    */
-   protected String getMessage()
-   {
-      String location = "";
-      if (getType() != null)
-      {
-         location += "type: " + getType() + "; ";
-      }
-      if (getBean() != null)
-      {
-         location += "bean: " + getBean() + "; ";
-      }
-      if (getElement() != null)
-      {
-         location += "element: " + getElement() + "; ";
-      }
-      return location;
-   }
-   
-   @Override
-   public String toString()
-   {
-      return getMessage();
-   }
-   
-}

Deleted: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/exceptions/NameResolutionLocation.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/exceptions/NameResolutionLocation.java	2008-12-07 16:37:02 UTC (rev 437)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/exceptions/NameResolutionLocation.java	2008-12-07 16:46:10 UTC (rev 438)
@@ -1,77 +0,0 @@
-/*
- * 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.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,  
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.jboss.webbeans.exceptions;
-
-/**
- * Exception location info for name resolution exceptions
- * 
- * @author Pete Muir
- */
-public class NameResolutionLocation extends Location
-{
-   // The target of the failure
-   private String target;
-   
-   /**
-    * Constructor
-    * 
-    * @param target The target of the failure 
-    */
-   public NameResolutionLocation(String target)
-   {
-      super("Named Based Resolution", null, null);
-      
-   }
-   
-   /**
-    * Gets the target
-    * 
-    * @return The target
-    */
-   public String getTarget()
-   {
-      return target;
-   }
-   
-   /** 
-    * Sets the target
-    * 
-    * @param target The target
-    */
-   public void setTarget(String target)
-   {
-      this.target = target;
-   }
-   
-   /**
-    * Gets the exception message
-    * 
-    * @return The message
-    */
-   @Override
-   protected String getMessage()
-   {
-      String location = super.getMessage();
-      if (getTarget() != null)
-      {
-         location += "target: " + getTarget() + ";"; 
-      }
-      return location;
-   }
-   
-}

Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/BeanFactory.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/BeanFactory.java	2008-12-07 16:37:02 UTC (rev 437)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/BeanFactory.java	2008-12-07 16:46:10 UTC (rev 438)
@@ -25,8 +25,6 @@
 import org.jboss.webbeans.bean.EventBean;
 import org.jboss.webbeans.bean.ProducerMethodBean;
 import org.jboss.webbeans.bean.SimpleBean;
-import org.jboss.webbeans.bean.XmlEnterpriseBean;
-import org.jboss.webbeans.bean.XmlSimpleBean;
 import org.jboss.webbeans.event.ObserverImpl;
 import org.jboss.webbeans.introspector.AnnotatedField;
 import org.jboss.webbeans.introspector.AnnotatedMethod;
@@ -51,18 +49,6 @@
    }
 
    /**
-    * Creates a simple, XML defined Web Bean
-    * 
-    * @param <T> The type
-    * @param clazz The class
-    * @return A Web Bean
-    */
-   public static <T> XmlSimpleBean<T> createXmlSimpleBean(Class<T> clazz)
-   {
-      return new XmlSimpleBean<T>(clazz, CurrentManager.rootManager());
-   }
-
-   /**
     * Creates a simple, annotation defined Enterprise Web Bean
     * 
     * @param <T> The type
@@ -75,18 +61,6 @@
    }
 
    /**
-    * Creates a simple, XML defined Enterprise Web Bean
-    * 
-    * @param <T> The type
-    * @param clazz The class
-    * @return An Enterprise Web Bean
-    */
-   public static <T> XmlEnterpriseBean<T> createXmlEnterpriseBean(Class<T> clazz)
-   {
-      return new XmlEnterpriseBean<T>(clazz, CurrentManager.rootManager());
-   }
-
-   /**
     * Creates a producer method Web Bean
     * 
     * @param <T> The type




More information about the weld-commits mailing list