001/* 
002 * Licensed to the Apache Software Foundation (ASF) under one
003 * or more contributor license agreements.  See the NOTICE file
004 * distributed with this work for additional information
005 * regarding copyright ownership.  The ASF licenses this file
006 * to you under the Apache License, Version 2.0 (the
007 * "License"); you may not use this file except in compliance
008 * with the License.  You may obtain a copy of the License at
009 *
010 *   http://www.apache.org/licenses/LICENSE-2.0
011 *
012 * Unless required by applicable law or agreed to in writing,
013 * software distributed under the License is distributed on an
014 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015 * KIND, either express or implied.  See the License for the
016 * specific language governing permissions and limitations
017 * under the License.
018 */
019package org.apache.felix.ipojo;
020
021import java.util.List;
022
023/**
024 * Missing Handler Exception.
025 * This exception occurs when an handler factory is missing to create an instance.
026 * In fact, when a required handler factory is not avialable or valid, the {@link Handler}
027 * object cannot be created, and so the instance container cannot be completed.
028 * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
029 */
030public class MissingHandlerException extends Exception {
031    
032    /**
033     * Serialization Id. 
034     */
035    private static final long serialVersionUID = 5047792897590881478L;
036    
037    /**
038     * The message. 
039     */
040    private String m_message;
041    
042    /**
043     * Creates a MissingHandlerException.
044     * This methods computes the message from
045     * the given list.
046     * @param missing the list of missing handlers.
047     */
048    public MissingHandlerException(List missing) {
049        super();
050        m_message = "Missing handlers : ";
051        for (int i = 0; i < missing.size(); i++) {
052            m_message += (String) missing.get(i) + " ";
053        }
054    }
055    
056    /**
057     * Gets the error message.
058     * @return the error message
059     * @see java.lang.Throwable#getMessage()
060     */
061    public String getMessage() {
062        return m_message;
063    }
064
065}