001 /*****************************************************************************
002 * Copyright (c) PicoContainer Organization. All rights reserved. *
003 * ------------------------------------------------------------------------- *
004 * The software in this package is published under the terms of the BSD *
005 * style license a copy of which has been included with this distribution in *
006 * the LICENSE.txt file. *
007 * *
008 *****************************************************************************/
009
010 package org.picocontainer;
011
012 import java.lang.reflect.Method;
013
014 public class PicoLifecycleException extends PicoException {
015
016 private final Method method;
017 private final Object instance;
018
019 public PicoLifecycleException(final Method method, final Object instance, final RuntimeException cause) {
020 super(cause);
021 this.method = method;
022 this.instance = instance;
023 }
024
025 public Method getMethod() {
026 return method;
027 }
028
029 public Object getInstance() {
030 return instance;
031 }
032
033 public String getMessage() {
034 return "PicoLifecycleException: method '" + method + "', instance '"+ instance + ", " + super.getMessage();
035 }
036
037 }