Package org.glassfish.hk2.api

Examples of org.glassfish.hk2.api.MultiException


        if (preDestroy == null) return;

        try {
            ReflectionHelper.invoke(preMe, preDestroy, new Object[0]);
        } catch (Throwable e) {
            throw new MultiException(e);
        }
    }
View Full Code Here


        if (postConstruct == null) return;

        try {
            ReflectionHelper.invoke(postMe, postConstruct, new Object[0]);
        } catch (Throwable e) {
            throw new MultiException(e);
        }
    }
View Full Code Here

           
            try {
                ReflectionHelper.setField(field, injectMe, fieldValue);
            }
            catch (Throwable th) {
                throw new MultiException(th);
            }
        }

        for (Method method : methods) {
            List<Injectee> injectees = Utilities.getMethodInjectees(method, null);

            validateSelfInjectees(null, injectees, collector);
            collector.throwIfErrors();

            Object args[] = new Object[injectees.size()];

            for (Injectee injectee : injectees) {
                InjectionResolver<?> resolver = getInjectionResolver(locator, injectee);
                args[injectee.getPosition()] = resolver.resolve(injectee, null);
            }

            try {
                ReflectionHelper.invoke(injectMe, method, args);
            } catch (Throwable e) {
                throw new MultiException(e);
            }
        }

    }
View Full Code Here

        }

        try {
          return (T) ReflectionHelper.makeMe(c, args);
        } catch (Throwable th) {
            throw new MultiException(th);
        }
    }
View Full Code Here

            catch (Throwable th) {
                Exception addMe = new IllegalArgumentException("While attempting to create a Proxy for " + proxyClass.getName() +
                        " in proxiable scope " + root.getScope() + " an error occured while creating the proxy");

                if (th instanceof MultiException) {
                    MultiException me = (MultiException) th;

                    me.addError(addMe);

                    throw me;
                }

                MultiException me = new MultiException(th);
                me.addError(addMe);
                throw me;
            }

            return proxy;
        }

        Context<?> context;
        try {
            context = locator.resolveContext(root.getScopeAnnotation());
        }
        catch (Throwable th) {
            Exception addMe = new IllegalStateException("While attempting to create a service for " + root +
                    " in scope " + root.getScope() + " an error occured while locating the context");
           
            if (th instanceof MultiException) {
                MultiException me = (MultiException) th;

                me.addError(addMe);

                throw me;
            }

            MultiException me = new MultiException(th);
            me.addError(addMe);
            throw me;
        }

        try {
            service = context.findOrCreate(root, handle);
        }
        catch (MultiException me) {
            throw me;
        }
        catch (Throwable th) {
            throw new MultiException(th);
        }
       
        if (service == null && !context.supportsNullCreation()) {
            throw new MultiException(new IllegalStateException("Context " +
                context + " findOrCreate returned a null for descriptor " + root +
                " and handle " + handle));
        }

        return service;
View Full Code Here

                    break;
                }     
            }
           
            if (!validOption) {
                throw new MultiException(new IllegalArgumentException(" Invalid option: " + key));
            }
        }
        parameters.mergeAll(adds);
    }
View Full Code Here

                        ErrorInformation.ErrorAction.GO_TO_NEXT_LOWER_LEVEL_AND_STOP, listeners);
               
                if (ErrorInformation.ErrorAction.IGNORE.equals(info.getAction())) return;
               
                if (exception == null) {
                    exception = new MultiException();
                }
               
                exception.addError(th);
            }
        }
View Full Code Here

                    break;
                }     
            }
           
            if (!validOption) {
                throw new MultiException(new IllegalArgumentException(" Invalid option: " + key));
            }
        }
        parameters.mergeAll(adds);
    }
View Full Code Here

                    break;
                }     
            }
           
            if (!validOption) {
                throw new MultiException(new IllegalArgumentException(" Invalid option: " + key));
            }
        }
        parameters.mergeAll(adds);
    }
View Full Code Here

          Object addMe;
          try {
              addMe = ReflectionHelper.invoke(annotation, annotationMethod, new Object[0]);
          }
          catch (Throwable th) {
              throw new MultiException(th);
          }
         
          if (addMe == null) continue;
         
          String addMeString;
View Full Code Here

TOP

Related Classes of org.glassfish.hk2.api.MultiException

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.