Examples of PicoCompositionException


Examples of org.picocontainer.PicoCompositionException

            if (e.getTargetException() instanceof RuntimeException) {
                throw (RuntimeException)e.getTargetException();
            } else if (e.getTargetException() instanceof Error) {
                throw (Error)e.getTargetException();
            }
            throw new PicoCompositionException(e.getTargetException());
        } catch (InstantiationException e) {
            return caughtInstantiationException(componentMonitor, constructor, e, container);
        } catch (IllegalAccessException e) {
            return caughtIllegalAccessException(componentMonitor, constructor, e, container);
        }
View Full Code Here

Examples of org.picocontainer.PicoCompositionException

     */
    public ComponentMonitor currentMonitor() {
        if ( delegate instanceof ComponentMonitorStrategy ){
            return ((ComponentMonitorStrategy)delegate).currentMonitor();
        }
        throw new PicoCompositionException("No component monitor found in delegate");
    }
View Full Code Here

Examples of org.picocontainer.PicoCompositionException

    }

    private void verifyInterfacesOnly(Class<?>[] classes) {
        for (Class<?> clazz : classes) {
            if (!clazz.isInterface()) {
                throw new PicoCompositionException(
                    "Class keys must be interfaces. " + clazz + " is not an interface.");
            }
        }
    }
View Full Code Here

Examples of org.picocontainer.PicoCompositionException

        }
        return provideMethod;
    }

    private static PicoCompositionException newProviderMethodException(String str) {
        return new PicoCompositionException("There must be "+ str +" method named 'provide' in the AbstractProvider implementation");
    }
View Full Code Here

Examples of org.picocontainer.PicoCompositionException

                Object value = decorator.decorate(instance);
                field.setAccessible(true);
                try {
                    field.set(instance, value);
                } catch (IllegalAccessException e) {
                    throw new PicoCompositionException(e);
                }
            }
        }
        return instance;
    }
View Full Code Here

Examples of org.picocontainer.PicoCompositionException

                if (null == registeredObjectNames) {
                    registeredObjectNames = new ArrayList<ObjectName>();
                }
                registeredObjectNames.add(info.getObjectName());
                if (exception != null) {
                    throw new PicoCompositionException("Registering MBean failed", exception);
                }
            }
        }
        return componentInstance;
    }
View Full Code Here

Examples of org.picocontainer.PicoCompositionException

        this.proxyFactory = proxyFactory;
        final Class<T> delegationType = delegate.getComponentImplementation();
        this.isCompatible = type.isAssignableFrom(delegationType);
        if (!isCompatible) {
            if (!proxyFactory.canProxy(type)) {
                throw new PicoCompositionException("Cannot create proxy for type " + type.getName());
            }
            final Method[] methods = type.getMethods();
            for (final Method method : methods) {
                try {
                    delegationType.getMethod(method.getName(), method.getParameterTypes());
                } catch (final NoSuchMethodException e) {
                    throw new PicoCompositionException("Cannot create proxy for type "
                                                         + type.getName()
                                                         + ", because of incompatible method "
                                                         + method.toString());
                }
            }
View Full Code Here

Examples of org.picocontainer.PicoCompositionException

        } else {
            final Set allInterfaces = ReflectionUtils.getAllInterfaces(getComponentImplementation());
            interfaces = (Class[])allInterfaces.toArray(new Class[allInterfaces.size()]);
        }
        if (interfaces.length == 0) {
            throw new PicoCompositionException("Can't proxy implementation for "
                    + getComponentImplementation().getName()
                    + ". It does not implement any interfaces.");
        }
        return interfaces;
    }
View Full Code Here

Examples of org.picocontainer.PicoCompositionException

    } catch(NameNotFoundException e) {
      // this is not error, but normal situation - nothing
      // was stored yet
      return null;
    } catch (NamingException e) {
      throw new PicoCompositionException("unable to resolve jndi name:"
          + name, e);
    }
  }
View Full Code Here

Examples of org.picocontainer.PicoCompositionException

          // that's ok
        }
        ctx.bind(n, item);
      }
    } catch (NamingException e) {
      throw new PicoCompositionException("unable to bind to  jndi name:"
          + name, e);
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.