Package org.picocontainer

Examples of org.picocontainer.PicoLifecycleException


                                          Object instance,
                                          RuntimeException cause) {
        if (cause instanceof PicoLifecycleException) {
            throw cause;
        }
        throw new PicoLifecycleException(method, instance, cause);
    }
View Full Code Here


    private void doLifecycleMethod(Object component, Method lifecycleMethod) {
        try {
            lifecycleMethod.invoke(component);
        } catch (IllegalAccessException e) {
            throw new PicoLifecycleException(lifecycleMethod, component, e);
        } catch (InvocationTargetException e) {
            if (e.getTargetException() instanceof RuntimeException) {
                throw (RuntimeException) e.getTargetException();
            }
            throw new PicoLifecycleException(lifecycleMethod, component, e.getTargetException());
        }
    }
View Full Code Here

                    long str = System.currentTimeMillis();
                    currentMonitor().invoking(null, null, method, component);
                    method.invoke(component);
                    currentMonitor().invoked(null, null, method, component, System.currentTimeMillis() - str);
                } catch (IllegalAccessException e) {
                    throw new PicoLifecycleException(method, component, e);
                } catch (InvocationTargetException e) {
                    throw new PicoLifecycleException(method, component, e);
                }
            }
        }
    }
View Full Code Here

    assertThat(th.getMessage()).isEqualTo("A good reason to fail");
  }

  @Test
  public void shouldSanitizePicoLifecycleException_no_wrapper_message() {
    Throwable th = PicoUtils.sanitize(new PicoLifecycleException(null, null, new IllegalStateException("msg")));

    assertThat(th).isInstanceOf(IllegalStateException.class);
    assertThat(th.getMessage()).isEqualTo("msg");
  }
View Full Code Here

TOP

Related Classes of org.picocontainer.PicoLifecycleException

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.