[weld-commits] Weld SVN: r5215 - in core/trunk/impl/src/main: java/org/jboss/weld/context and 2 other directories.

weld-commits at lists.jboss.org weld-commits at lists.jboss.org
Sat Dec 5 16:25:26 EST 2009


Author: dallen6
Date: 2009-12-05 16:25:26 -0500 (Sat, 05 Dec 2009)
New Revision: 5215

Added:
   core/trunk/impl/src/main/java/org/jboss/weld/AmbiguousResolutionException.java
   core/trunk/impl/src/main/java/org/jboss/weld/InjectionException.java
   core/trunk/impl/src/main/java/org/jboss/weld/UnproxyableResolutionException.java
   core/trunk/impl/src/main/java/org/jboss/weld/UnsatisfiedResolutionException.java
   core/trunk/impl/src/main/java/org/jboss/weld/context/ContextNotActiveException.java
Modified:
   core/trunk/impl/src/main/java/org/jboss/weld/BeanManagerImpl.java
   core/trunk/impl/src/main/java/org/jboss/weld/Container.java
   core/trunk/impl/src/main/java/org/jboss/weld/SimpleInjectionTarget.java
   core/trunk/impl/src/main/java/org/jboss/weld/logging/messages/BeanManagerMessage.java
   core/trunk/impl/src/main/resources/org/jboss/weld/messages/beanmanager_en.properties
Log:
Conversion of BeanManager exceptions to localized messages

Added: core/trunk/impl/src/main/java/org/jboss/weld/AmbiguousResolutionException.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/AmbiguousResolutionException.java	                        (rev 0)
+++ core/trunk/impl/src/main/java/org/jboss/weld/AmbiguousResolutionException.java	2009-12-05 21:25:26 UTC (rev 5215)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat, Inc. and/or its affiliates, 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.weld;
+
+import static org.jboss.weld.logging.LoggerFactory.loggerFactory;
+import ch.qos.cal10n.IMessageConveyor;
+
+/**
+ * Provides message localization service for the
+ * {@link javax.enterprise.inject.AmbiguousResolutionException}.
+ * 
+ * @author David Allen
+ */
+public class AmbiguousResolutionException extends javax.enterprise.inject.AmbiguousResolutionException
+{
+   private static final long serialVersionUID = 1L;
+
+   // Exception messages
+   private static final IMessageConveyor messageConveyer = loggerFactory().getMessageConveyor();
+
+   public AmbiguousResolutionException(Throwable throwable)
+   {
+      super(throwable.getLocalizedMessage(), throwable);
+   }
+
+   public <E extends Enum<?>> AmbiguousResolutionException(E key, Object... args)
+   {
+      super(messageConveyer.getMessage(key, args));
+   }
+}


Property changes on: core/trunk/impl/src/main/java/org/jboss/weld/AmbiguousResolutionException.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Modified: core/trunk/impl/src/main/java/org/jboss/weld/BeanManagerImpl.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/BeanManagerImpl.java	2009-12-04 14:52:43 UTC (rev 5214)
+++ core/trunk/impl/src/main/java/org/jboss/weld/BeanManagerImpl.java	2009-12-05 21:25:26 UTC (rev 5215)
@@ -16,6 +16,25 @@
  */
 package org.jboss.weld;
 
+import static org.jboss.weld.logging.messages.BeanManagerMessage.AMBIGUOUS_BEANS_FOR_DEPENDENCY;
+import static org.jboss.weld.logging.messages.BeanManagerMessage.CONTEXT_NOT_ACTIVE;
+import static org.jboss.weld.logging.messages.BeanManagerMessage.DUPLICATE_ACTIVE_CONTEXTS;
+import static org.jboss.weld.logging.messages.BeanManagerMessage.DUPLICATE_INTERCEPTOR_BINDING;
+import static org.jboss.weld.logging.messages.BeanManagerMessage.DUPLICATE_QUALIFIERS;
+import static org.jboss.weld.logging.messages.BeanManagerMessage.INTERCEPTOR_BINDINGS_EMPTY;
+import static org.jboss.weld.logging.messages.BeanManagerMessage.INTERCEPTOR_RESOLUTION_WITH_NONBINDING_TYPE;
+import static org.jboss.weld.logging.messages.BeanManagerMessage.INVALID_QUALIFIER;
+import static org.jboss.weld.logging.messages.BeanManagerMessage.NON_NORMAL_SCOPE;
+import static org.jboss.weld.logging.messages.BeanManagerMessage.NOT_INTERCEPTOR_BINDING_TYPE;
+import static org.jboss.weld.logging.messages.BeanManagerMessage.NOT_PROXYABLE;
+import static org.jboss.weld.logging.messages.BeanManagerMessage.NOT_STEREOTYPE;
+import static org.jboss.weld.logging.messages.BeanManagerMessage.NO_DECORATOR_TYPES;
+import static org.jboss.weld.logging.messages.BeanManagerMessage.SPECIFIED_TYPE_NOT_BEAN_TYPE;
+import static org.jboss.weld.logging.messages.BeanManagerMessage.TOO_MANY_ACTIVITIES;
+import static org.jboss.weld.logging.messages.BeanManagerMessage.UNPROXYABLE_RESOLUTION;
+import static org.jboss.weld.logging.messages.BeanManagerMessage.UNRESOLVABLE_ELEMENT;
+import static org.jboss.weld.logging.messages.BeanManagerMessage.UNRESOLVABLE_TYPE;
+
 import java.io.Serializable;
 import java.lang.annotation.Annotation;
 import java.lang.reflect.Member;
@@ -38,14 +57,9 @@
 
 import javax.el.ELResolver;
 import javax.el.ExpressionFactory;
-import javax.enterprise.context.ContextNotActiveException;
 import javax.enterprise.context.spi.Context;
 import javax.enterprise.context.spi.Contextual;
 import javax.enterprise.context.spi.CreationalContext;
-import javax.enterprise.inject.AmbiguousResolutionException;
-import javax.enterprise.inject.InjectionException;
-import javax.enterprise.inject.UnproxyableResolutionException;
-import javax.enterprise.inject.UnsatisfiedResolutionException;
 import javax.enterprise.inject.spi.Annotated;
 import javax.enterprise.inject.spi.AnnotatedType;
 import javax.enterprise.inject.spi.Bean;
@@ -67,6 +81,7 @@
 import org.jboss.weld.bean.proxy.ClientProxyProvider;
 import org.jboss.weld.bootstrap.api.ServiceRegistry;
 import org.jboss.weld.bootstrap.events.AbstractProcessInjectionTarget;
+import org.jboss.weld.context.ContextNotActiveException;
 import org.jboss.weld.context.CreationalContextImpl;
 import org.jboss.weld.context.WeldCreationalContext;
 import org.jboss.weld.ejb.EjbDescriptors;
@@ -677,12 +692,12 @@
       {
          if (!getServices().get(MetaAnnotationStore.class).getBindingTypeModel(annotation.annotationType()).isValid())
          {
-            throw new IllegalArgumentException("Not a binding type " + annotation);
+            throw new ForbiddenArgumentException(INVALID_QUALIFIER, annotation);
          }
       }
       if (bindingAnnotations.size() < bindings.size())
       {
-         throw new IllegalArgumentException("Duplicate binding types: " + bindings);
+         throw new ForbiddenArgumentException(DUPLICATE_QUALIFIERS, bindings);
       }
 
    }
@@ -756,7 +771,7 @@
       {
          if (!getServices().get(MetaAnnotationStore.class).getBindingTypeModel(annotation.annotationType()).isValid())
          {
-            throw new IllegalArgumentException("Not a binding type " + annotation);
+            throw new ForbiddenArgumentException(INVALID_QUALIFIER, annotation);
          }
       }
 //      for (Type type : element.getActualTypeArguments())
@@ -772,7 +787,7 @@
 //      }
       if (bindings != null && bindings.length > element.getMetaAnnotations(Qualifier.class).size())
       {
-         throw new IllegalArgumentException("Duplicate bindings (" + Arrays.asList(bindings) + ") type passed " + element.toString());
+         throw new ForbiddenArgumentException(DUPLICATE_QUALIFIERS, Arrays.asList(bindings));
       }
       return beanResolver.resolve(ResolvableFactory.of(element));
    }
@@ -925,11 +940,11 @@
       }
       if (activeContexts.isEmpty())
       {
-         throw new ContextNotActiveException("No active contexts for scope type " + scopeType.getName());
+         throw new ContextNotActiveException(CONTEXT_NOT_ACTIVE, scopeType.getName());
       }
       if (activeContexts.size() > 1)
       {
-         throw new IllegalStateException("More than one context active for scope type " + scopeType.getName());
+         throw new ForbiddenStateException(DUPLICATE_ACTIVE_CONTEXTS, scopeType.getName());
       }
       return activeContexts.iterator().next();
 
@@ -979,7 +994,7 @@
    {
       if (!Reflections.isAssignableFrom(bean.getTypes(), beanType))
       {
-         throw new IllegalArgumentException("The given beanType is not a type " + beanType +" of the bean " + bean );
+         throw new ForbiddenArgumentException(SPECIFIED_TYPE_NOT_BEAN_TYPE, beanType, bean );
       }
       return getReference(bean, creationalContext, false);
    }
@@ -1005,7 +1020,7 @@
          }
          if (getServices().get(MetaAnnotationStore.class).getScopeModel(resolvedBean.getScope()).isNormal() && !Proxies.isTypeProxyable(injectionPoint.getType()))
          {
-            throw new UnproxyableResolutionException("Attempting to inject an unproxyable normal scoped bean " + resolvedBean + " into " + injectionPoint);
+            throw new UnproxyableResolutionException(UNPROXYABLE_RESOLUTION, resolvedBean, injectionPoint);
          }
          // TODO Can we move this logic to getReference?
          if (creationalContext instanceof WeldCreationalContext<?>)
@@ -1057,7 +1072,7 @@
       Bean<?> bean = resolve(beans);
       if (bean == null)
       {
-         throw new UnsatisfiedResolutionException("Unable to resolve any beans. Class: " + beanType + "; Qualifiers: " + Arrays.toString(bindings)); 
+         throw new UnsatisfiedResolutionException(UNRESOLVABLE_TYPE, beanType, Arrays.toString(bindings)); 
       }
       Object reference = getReference(bean, beanType, createCreationalContext(bean));
       
@@ -1072,13 +1087,13 @@
       Bean<T> bean = (Bean<T>) resolve(getBeans(element, bindings));
       if (bean == null)
       {
-         throw new UnsatisfiedResolutionException(element + "Unable to resolve any Managed Beans");
+         throw new UnsatisfiedResolutionException(UNRESOLVABLE_ELEMENT, element);
       }
       
       boolean normalScoped = getServices().get(MetaAnnotationStore.class).getScopeModel(bean.getScope()).isNormal();
       if (normalScoped && !Beans.isBeanProxyable(bean))
       {
-         throw new UnproxyableResolutionException("Normal scoped bean " + bean + " is not proxyable");
+         throw new UnproxyableResolutionException(NOT_PROXYABLE, bean);
       }
       return bean;
    }
@@ -1116,7 +1131,7 @@
    {
       if (types.isEmpty())
       {
-         throw new IllegalArgumentException("No decorator types were specified in the set");
+         throw new ForbiddenArgumentException(NO_DECORATOR_TYPES);
       }
       checkBindingTypes(bindings);
    }
@@ -1135,14 +1150,14 @@
    public List<Interceptor<?>> resolveInterceptors(InterceptionType type, Annotation... interceptorBindings)
    {
       if (interceptorBindings.length == 0)
-         throw new IllegalArgumentException("Interceptor bindings list cannot be empty");
+         throw new ForbiddenArgumentException(INTERCEPTOR_BINDINGS_EMPTY);
       Set<Class<?>> uniqueInterceptorBindings = new HashSet<Class<?>>();
       for (Annotation interceptorBinding: interceptorBindings)
       {
          if (uniqueInterceptorBindings.contains(interceptorBinding.annotationType()))
-            throw new IllegalArgumentException("Duplicate interceptor binding type: " + interceptorBinding.annotationType());
+            throw new ForbiddenArgumentException(DUPLICATE_INTERCEPTOR_BINDING, interceptorBinding.annotationType());
          if (!isInterceptorBinding(interceptorBinding.annotationType()))
-            throw new IllegalArgumentException("Trying to resolve interceptors with non-binding type: " + interceptorBinding.annotationType());
+            throw new ForbiddenArgumentException(INTERCEPTOR_RESOLUTION_WITH_NONBINDING_TYPE, interceptorBinding.annotationType());
          uniqueInterceptorBindings.add(interceptorBinding.annotationType());
       }
       return new ArrayList<Interceptor<?>>(interceptorResolver.resolve(ResolvableFactory.of(type,interceptorBindings)));
@@ -1207,7 +1222,7 @@
    {
       if (!getServices().get(MetaAnnotationStore.class).getScopeModel(scopeType).isNormal())
       {
-         throw new IllegalArgumentException("Scope must be a normal scope type " + scopeType);
+         throw new ForbiddenArgumentException(NON_NORMAL_SCOPE, scopeType);
       }
       currentActivities.add(new CurrentActivity(getContext(scopeType), this));
       return this;
@@ -1231,7 +1246,7 @@
       {
          return activeCurrentActivities.get(0).getManager();
       }
-      throw new IllegalStateException("More than one current activity for an active context " + currentActivities);
+      throw new ForbiddenStateException(TOO_MANY_ACTIVITIES, currentActivities);
    }
 
    public ServiceRegistry getServices()
@@ -1391,7 +1406,7 @@
       }
       catch (DeploymentException e) 
       {
-         throw new InjectionException(e.getMessage(), e.getCause());
+         throw new InjectionException(e.getLocalizedMessage(), e.getCause());
       }
    }
 
@@ -1403,7 +1418,7 @@
       }
       else
       {
-         throw new IllegalArgumentException("Not a interception binding :" + bindingType);
+         throw new ForbiddenArgumentException(NOT_INTERCEPTOR_BINDING_TYPE, bindingType);
       }
    }
 
@@ -1420,7 +1435,7 @@
       }
       else
       {
-         throw new IllegalArgumentException("Not a stereotype " + stereotype);
+         throw new ForbiddenArgumentException(NOT_STEREOTYPE, stereotype);
       }
    }
 
@@ -1489,7 +1504,7 @@
       }
       else
       {
-         throw new AmbiguousResolutionException("Cannot resolve an ambiguous dependency between " + beans);
+         throw new AmbiguousResolutionException(AMBIGUOUS_BEANS_FOR_DEPENDENCY, beans);
       }
    }
 

Modified: core/trunk/impl/src/main/java/org/jboss/weld/Container.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/Container.java	2009-12-04 14:52:43 UTC (rev 5214)
+++ core/trunk/impl/src/main/java/org/jboss/weld/Container.java	2009-12-05 21:25:26 UTC (rev 5215)
@@ -16,6 +16,8 @@
  */
 package org.jboss.weld;
 
+import static org.jboss.weld.logging.messages.BeanManagerMessage.NULL_BEAN_MANAGER_ID;
+
 import java.util.Map;
 import java.util.Map.Entry;
 import java.util.concurrent.ConcurrentHashMap;
@@ -196,7 +198,7 @@
       String id = manager.getId();
       if (manager.getId() == null)
       {
-         throw new IllegalArgumentException("Bean manager must not be null " + manager.toString());
+         throw new ForbiddenArgumentException(NULL_BEAN_MANAGER_ID, manager);
       }
       managers.put(id, manager);
       return id;

Added: core/trunk/impl/src/main/java/org/jboss/weld/InjectionException.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/InjectionException.java	                        (rev 0)
+++ core/trunk/impl/src/main/java/org/jboss/weld/InjectionException.java	2009-12-05 21:25:26 UTC (rev 5215)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat, Inc. and/or its affiliates, 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.weld;
+
+import static org.jboss.weld.logging.LoggerFactory.loggerFactory;
+import ch.qos.cal10n.IMessageConveyor;
+
+/**
+ * Provides message localization service for the
+ * {@link javax.enterprise.inject.InjectionException}.
+ * 
+ * @author David Allen
+ */
+public class InjectionException extends javax.enterprise.inject.InjectionException
+{
+   private static final long serialVersionUID = 1L;
+
+   // Exception messages
+   private static final IMessageConveyor messageConveyer = loggerFactory().getMessageConveyor();
+
+   public InjectionException(Throwable throwable)
+   {
+      super(throwable.getLocalizedMessage(), throwable);
+   }
+
+   public InjectionException(String message, Throwable throwable)
+   {
+      super(message, throwable);
+   }
+
+   public <E extends Enum<?>> InjectionException(E key, Object... args)
+   {
+      super(messageConveyer.getMessage(key, args));
+   }
+}


Property changes on: core/trunk/impl/src/main/java/org/jboss/weld/InjectionException.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Modified: core/trunk/impl/src/main/java/org/jboss/weld/SimpleInjectionTarget.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/SimpleInjectionTarget.java	2009-12-04 14:52:43 UTC (rev 5214)
+++ core/trunk/impl/src/main/java/org/jboss/weld/SimpleInjectionTarget.java	2009-12-05 21:25:26 UTC (rev 5215)
@@ -16,6 +16,11 @@
  */
 package org.jboss.weld;
 
+import static org.jboss.weld.logging.messages.BeanManagerMessage.ERROR_INVOKING_POST_CONSTRUCT;
+import static org.jboss.weld.logging.messages.BeanManagerMessage.ERROR_INVOKING_PRE_DESTROY;
+import static org.jboss.weld.logging.messages.BeanManagerMessage.INJECTION_ON_NON_CONTEXTUAL;
+import static org.jboss.weld.logging.messages.BeanManagerMessage.MISSING_BEAN_CONSTRUCTOR_FOUND;
+
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
@@ -84,7 +89,7 @@
       {
          if (ip.getType().equals(InjectionPoint.class))
          {
-            throw new DefinitionException("Cannot inject an InjectionPoint on a non-contextual type. Type: " + type + "; InjectionPoint: " + ip);
+            throw new DefinitionException(INJECTION_ON_NON_CONTEXTUAL, type, ip);
          }
       }
    }
@@ -98,8 +103,7 @@
          // try again so the correct DefinitionException is thrown
          Beans.getBeanConstructor(null, type);
          // should not be reached
-         throw new IllegalStateException(
-               "We were not previously able to find the bean constructor, but now are?");
+         throw new ForbiddenStateException(MISSING_BEAN_CONSTRUCTOR_FOUND);
       }
       return constructor.newInstance(beanManager, ctx);
    }
@@ -130,7 +134,7 @@
       }
       catch (Exception e)
       {
-         throw new RuntimeException("Error invoking postConstruct() " + postConstruct, e);
+         throw new WeldException(ERROR_INVOKING_POST_CONSTRUCT, e, postConstruct);
       }
    }
 
@@ -145,7 +149,7 @@
       }
       catch (Exception e)
       {
-         throw new RuntimeException("Error invoking preDestroy() " + preDestroy, e);
+         throw new WeldException(ERROR_INVOKING_PRE_DESTROY, e, preDestroy);
       }
    }
 

Added: core/trunk/impl/src/main/java/org/jboss/weld/UnproxyableResolutionException.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/UnproxyableResolutionException.java	                        (rev 0)
+++ core/trunk/impl/src/main/java/org/jboss/weld/UnproxyableResolutionException.java	2009-12-05 21:25:26 UTC (rev 5215)
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat, Inc. and/or its affiliates, 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.weld;
+
+import static org.jboss.weld.logging.LoggerFactory.loggerFactory;
+import ch.qos.cal10n.IMessageConveyor;
+
+/**
+ * Provides message localization service for the
+ * {@link javax.enterprise.inject.UnproxyableResolutionException}.
+ * 
+ * @author David Allen
+ */
+public class UnproxyableResolutionException extends javax.enterprise.inject.UnproxyableResolutionException
+{
+   private static final long serialVersionUID = 1L;
+
+   // Exception messages
+   private static final IMessageConveyor messageConveyer = loggerFactory().getMessageConveyor();
+
+   public UnproxyableResolutionException(Throwable throwable)
+   {
+      super(throwable.getLocalizedMessage(), throwable);
+   }
+
+   public <E extends Enum<?>> UnproxyableResolutionException(E key, Object... args)
+   {
+      super(messageConveyer.getMessage(key, args));
+   }
+
+}


Property changes on: core/trunk/impl/src/main/java/org/jboss/weld/UnproxyableResolutionException.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: core/trunk/impl/src/main/java/org/jboss/weld/UnsatisfiedResolutionException.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/UnsatisfiedResolutionException.java	                        (rev 0)
+++ core/trunk/impl/src/main/java/org/jboss/weld/UnsatisfiedResolutionException.java	2009-12-05 21:25:26 UTC (rev 5215)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat, Inc. and/or its affiliates, 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.weld;
+
+import static org.jboss.weld.logging.LoggerFactory.loggerFactory;
+import ch.qos.cal10n.IMessageConveyor;
+
+/**
+ * Provides message localization service for the
+ * {@link javax.enterprise.inject.UnsatisfiedResolutionException}.
+ * 
+ * @author David Allen
+ *
+ */
+public class UnsatisfiedResolutionException extends javax.enterprise.inject.UnsatisfiedResolutionException
+{
+   private static final long serialVersionUID = 1L;
+
+   // Exception messages
+   private static final IMessageConveyor messageConveyer = loggerFactory().getMessageConveyor();
+
+   public UnsatisfiedResolutionException(Throwable throwable)
+   {
+      super(throwable.getLocalizedMessage(), throwable);
+   }
+
+   public <E extends Enum<?>> UnsatisfiedResolutionException(E key, Object... args)
+   {
+      super(messageConveyer.getMessage(key, args));
+   }
+
+}


Property changes on: core/trunk/impl/src/main/java/org/jboss/weld/UnsatisfiedResolutionException.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: core/trunk/impl/src/main/java/org/jboss/weld/context/ContextNotActiveException.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/context/ContextNotActiveException.java	                        (rev 0)
+++ core/trunk/impl/src/main/java/org/jboss/weld/context/ContextNotActiveException.java	2009-12-05 21:25:26 UTC (rev 5215)
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat, Inc. and/or its affiliates, 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.weld.context;
+
+import static org.jboss.weld.logging.LoggerFactory.loggerFactory;
+import ch.qos.cal10n.IMessageConveyor;
+
+/**
+ * A localized message version of the {@link javax.enterprise.context.ContextNotActiveException}.
+ * 
+ * @author David Allen
+ *
+ */
+public class ContextNotActiveException extends javax.enterprise.context.ContextNotActiveException
+{
+
+   private static final long serialVersionUID = 1L;
+
+   // Exception messages
+   private static final IMessageConveyor messageConveyer = loggerFactory().getMessageConveyor();
+
+   public ContextNotActiveException(Throwable throwable)
+   {
+      super(throwable.getLocalizedMessage(), throwable);
+   }
+
+   public <E extends Enum<?>> ContextNotActiveException(E key, Object... args)
+   {
+      super(messageConveyer.getMessage(key, args));
+   }
+}


Property changes on: core/trunk/impl/src/main/java/org/jboss/weld/context/ContextNotActiveException.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Modified: core/trunk/impl/src/main/java/org/jboss/weld/logging/messages/BeanManagerMessage.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/logging/messages/BeanManagerMessage.java	2009-12-04 14:52:43 UTC (rev 5214)
+++ core/trunk/impl/src/main/java/org/jboss/weld/logging/messages/BeanManagerMessage.java	2009-12-05 21:25:26 UTC (rev 5215)
@@ -37,5 +37,28 @@
  */
 public enum BeanManagerMessage
 {
-   @MessageId("001300") CANNOT_LOCATE_BEAN_MANAGER
+   @MessageId("001300") CANNOT_LOCATE_BEAN_MANAGER,
+   @MessageId("001301") INVALID_QUALIFIER,
+   @MessageId("001302") DUPLICATE_QUALIFIERS,
+   @MessageId("001303") CONTEXT_NOT_ACTIVE,
+   @MessageId("001304") DUPLICATE_ACTIVE_CONTEXTS,
+   @MessageId("001305") SPECIFIED_TYPE_NOT_BEAN_TYPE,
+   @MessageId("001306") UNPROXYABLE_RESOLUTION,
+   @MessageId("001307") UNRESOLVABLE_TYPE,
+   @MessageId("001308") UNRESOLVABLE_ELEMENT,
+   @MessageId("001309") NOT_PROXYABLE,
+   @MessageId("001310") NO_DECORATOR_TYPES,
+   @MessageId("001311") INTERCEPTOR_BINDINGS_EMPTY,
+   @MessageId("001312") DUPLICATE_INTERCEPTOR_BINDING,
+   @MessageId("001313") INTERCEPTOR_RESOLUTION_WITH_NONBINDING_TYPE,
+   @MessageId("001314") NON_NORMAL_SCOPE,
+   @MessageId("001315") TOO_MANY_ACTIVITIES,
+   @MessageId("001316") NOT_INTERCEPTOR_BINDING_TYPE,
+   @MessageId("001317") NOT_STEREOTYPE,
+   @MessageId("001318") AMBIGUOUS_BEANS_FOR_DEPENDENCY,
+   @MessageId("001319") NULL_BEAN_MANAGER_ID,
+   @MessageId("001320") INJECTION_ON_NON_CONTEXTUAL,
+   @MessageId("001321") MISSING_BEAN_CONSTRUCTOR_FOUND,
+   @MessageId("001322") ERROR_INVOKING_POST_CONSTRUCT,
+   @MessageId("001323") ERROR_INVOKING_PRE_DESTROY;
 }

Modified: core/trunk/impl/src/main/resources/org/jboss/weld/messages/beanmanager_en.properties
===================================================================
--- core/trunk/impl/src/main/resources/org/jboss/weld/messages/beanmanager_en.properties	2009-12-04 14:52:43 UTC (rev 5214)
+++ core/trunk/impl/src/main/resources/org/jboss/weld/messages/beanmanager_en.properties	2009-12-05 21:25:26 UTC (rev 5215)
@@ -1 +1,24 @@
 CANNOT_LOCATE_BEAN_MANAGER=Unable to locate BeanManager
+INVALID_QUALIFIER=Annotation {0} is not a qualifier
+DUPLICATE_QUALIFIERS=Duplicate qualifiers\:  {0}
+CONTEXT_NOT_ACTIVE=No active contexts for scope type {0}
+DUPLICATE_ACTIVE_CONTEXTS=More than one context active for scope type {0}
+SPECIFIED_TYPE_NOT_BEAN_TYPE=The given type {0} is not a type of the bean {1}
+UNPROXYABLE_RESOLUTION=Attempting to inject an unproxyable normal scoped bean {0} into {1}
+UNRESOLVABLE_TYPE=Unable to resolve any beans of type {0} with qualifiers {1}
+UNRESOLVABLE_ELEMENT=Unable to resolve managed beans for {0}
+NOT_PROXYABLE=Normal scoped bean {0} is not proxyable
+NO_DECORATOR_TYPES=No decorator types were specified in the set
+INTERCEPTOR_BINDINGS_EMPTY=Interceptor bindings list cannot be empty
+DUPLICATE_INTERCEPTOR_BINDING=Duplicate interceptor binding type {0} found
+INTERCEPTOR_RESOLUTION_WITH_NONBINDING_TYPE=Trying to resolve interceptors with non-binding type {0}
+NON_NORMAL_SCOPE={0} is expected to be a normal scope type
+TOO_MANY_ACTIVITIES=More than one current activity for an active context\:  {0}
+NOT_INTERCEPTOR_BINDING_TYPE={0} is not an interceptor binding type
+NOT_STEREOTYPE={0} is not a stereotype
+AMBIGUOUS_BEANS_FOR_DEPENDENCY=Cannot resolve an ambiguous dependency between {0}
+NULL_BEAN_MANAGER_ID=Bean manager ID must not be null
+INJECTION_ON_NON_CONTEXTUAL=Cannot inject into a non-contextual type\:  {0}
+MISSING_BEAN_CONSTRUCTOR_FOUND=Bean constructor was not found before but appears to be found now
+ERROR_INVOKING_POST_CONSTRUCT=Error invoking post construct method {0}
+ERROR_INVOKING_PRE_DESTROY=Error invoking pre-destroy method {0}



More information about the weld-commits mailing list