Package javax.enterprise.inject

Examples of javax.enterprise.inject.IllegalProductException


        return value;
     
      if (Dependent.class.equals(getScope()))
        return null;
     
      throw new IllegalProductException(L.l("producer {0} returned null, which is not allowed by the CDI spec.",
                                            this));
    } catch (RuntimeException e) {
      throw e;
    } catch (InvocationTargetException e) {
      if (e.getCause() instanceof RuntimeException)
View Full Code Here


          && ! Serializable.class.isAssignableFrom(cl)
          && ! isPassivationCapable(prodBean)) {
        RuntimeException exn;

        if (isProduct(prodBean))
          exn = new IllegalProductException(L.l("'{0}' is an invalid injection point of type {1} because it's not serializable for {2}",
                                                ip.getMember().getName(),
                                                ip.getType(),
                                                bean));
        else
          exn = new ConfigException(L.l("'{0}.{1}' is an invalid injection point of type {2} ({3}) because it's not serializable for {4}",
View Full Code Here

                                                   ij.getMember().getDeclaringClass().getName(),
                                                   ij.getMember().getName(),
                                                   e.getMessage()),
                                   e);
    } catch (IllegalProductException e) {
      throw new IllegalProductException(L.l("{0}.{1}: {2}",
                                            ij.getMember().getDeclaringClass().getName(),
                                            ij.getMember().getName(),
                                            e.getMessage()),
                                   e);
    } catch (Exception e) {
View Full Code Here

       
        throw new UnsatisfiedResolutionException(loc + e.getMessage(), e);
      } catch (IllegalProductException e) {
        String loc = getLocation(_field);
       
        throw new IllegalProductException(loc + e.getMessage(), e);
      } catch (InjectionException e) {
        String loc = getLocation(_field);
     
        throw new InjectionException(loc + e.getMessage(), e);
      }
View Full Code Here

       
        _field.set(instance, value);
      } catch (AmbiguousResolutionException e) {
        throw new AmbiguousResolutionException(getFieldName(_field) + e.getMessage(), e);
      } catch (IllegalProductException e) {
        throw new IllegalProductException(getFieldName(_field) + e.getMessage(), e);
      } catch (InjectionException e) {
        throw new InjectionException(getFieldName(_field) + e.getMessage(), e);
      } catch (Exception e) {
        throw ConfigException.create(_field, e);
      }
View Full Code Here

        // _producerBean.destroy(factory, factoryEnv);
      }

     
      if (_isPassivating && ! (instance instanceof Serializable))
        throw new IllegalProductException(L.l("'{0}' is an invalid @{1} instance because it's not serializable for bean {2}",
                                              instance, getScope().getSimpleName(), this));
     
      return instance;
    }
View Full Code Here

          return value;
       
        if (Dependent.class.equals(getScope()))
          return null;
       
        throw new IllegalProductException(L.l("producer {0} returned null, which is not allowed by the CDI spec.",
                                              this));
      } catch (RuntimeException e) {
        throw e;
      } catch (InvocationTargetException e) {
        if (e.getCause() instanceof RuntimeException)
View Full Code Here

     
      if (_producerBean.getScope() == Dependent.class)
        _producerBean.destroy(factory, producerCxt);
     
      if (_isPassivating && ! (instance instanceof Serializable))
        throw new IllegalProductException(L.l("'{0}' is an invalid @{1} instance because it's not serializable for bean {2}",
                                              instance, getScope().getSimpleName(), this));
     
     
      return instance;
    }
View Full Code Here

     
        if (value != null)
          return value;
     
        if (! Dependent.class.equals(getScope()))
          throw new IllegalProductException(L.l("'{0}' is an invalid producer because it returns null",
                                              bean));

        return value;
      } catch (RuntimeException e) {
        throw e;
View Full Code Here

TOP

Related Classes of javax.enterprise.inject.IllegalProductException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.