001: /* ====================================================================
002: The Jicarilla Software License
003:
004: Copyright (c) 2003 Leo Simons.
005: All rights reserved.
006:
007: Permission is hereby granted, free of charge, to any person obtaining
008: a copy of this software and associated documentation files (the
009: "Software"), to deal in the Software without restriction, including
010: without limitation the rights to use, copy, modify, merge, publish,
011: distribute, sublicense, and/or sell copies of the Software, and to
012: permit persons to whom the Software is furnished to do so, subject to
013: the following conditions:
014:
015: The above copyright notice and this permission notice shall be
016: included in all copies or substantial portions of the Software.
017:
018: THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
019: EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
020: MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
021: IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
022: CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
023: TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
024: SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
025: ==================================================================== */
026: package org.jicarilla.container.builder;
027:
028: import org.jicarilla.container.JicarillaException;
029:
030: /**
031: * A {@link JicarillaException} that is thrown by a builder if a request to
032: * add some provider cannot be satisfied because the builder does not know how
033: * to handle providers of that type.
034: *
035: * @author <a href="lsimons at jicarilla dot org">Leo Simons</a>
036: * @version $Id: NoUsableHelperException.java,v 1.2 2004/01/11 11:49:27 lsimons Exp $
037: */
038: public class NoUsableHelperException extends JicarillaException {
039: /** the provider for which no helper could be found. */
040: protected Object m_provider;
041:
042: /**
043: * Construct a new <code>NoUsableHelperException</code> instance.
044: *
045: * @param provider the provider for which no helper could be found.
046: */
047: public NoUsableHelperException(final Object provider) {
048: this (provider, "No usable helper exists for the provider "
049: + provider);
050: }
051:
052: /**
053: * Construct a new <code>NoUsableHelperException</code> instance.
054: *
055: * @param message the detail message for this exception.
056: * @param provider the provider for which no helper could be found.
057: */
058: public NoUsableHelperException(final Object provider,
059: final String message) {
060: super (message);
061: if (provider == null)
062: throw new NullPointerException("provider");
063: m_provider = provider;
064: }
065:
066: /**
067: * Construct a new <code>NoUsableHelperException</code> instance.
068: *
069: * @param throwable the root cause of the exception.
070: * @param provider the provider for which no helper could be found.
071: */
072: public NoUsableHelperException(final Object provider,
073: final Throwable throwable) {
074: this (provider, "No usable helper exists for the provider "
075: + provider, throwable);
076: }
077:
078: /**
079: * Construct a new <code>NoUsableHelperException</code> instance.
080: *
081: * @param message the detail message for this exception.
082: * @param throwable the root cause of the exception.
083: * @param provider the provider for which no helper could be found.
084: */
085: public NoUsableHelperException(final Object provider,
086: final String message, final Throwable throwable) {
087: super (message, throwable);
088: if (provider == null)
089: throw new NullPointerException("provider");
090: m_provider = provider;
091: }
092:
093: /**
094: * Retrieve the provider for which no helper could be found.
095: *
096: * @return the provider for which no helper could be found.
097: */
098: public Object getProvider() {
099: return m_provider;
100: }
101: }
|