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 */
019 package org.apache.felix.framework.searchpolicy;
020
021 import org.apache.felix.moduleloader.IModule;
022 import org.apache.felix.moduleloader.IRequirement;
023
024 /**
025 * <p>
026 * This exception is thrown if a module cannot be resolved. The module
027 * that failed to be resolved is recorded, along with the failed import target
028 * identifier and version number. If the error was a result of a propagation
029 * conflict, then the propagation error flag is set.
030 * </p>
031 * @see org.apache.felix.moduleloader.search.ImportSearchPolicy#validate(org.apache.felix.moduleloader.Module)
032 **/
033 public class ResolveException extends Exception
034 {
035 private IModule m_module = null;
036 private IRequirement m_req = null;
037
038 /**
039 * Constructs an exception with the specified message, module,
040 * import identifier, import version number, and propagation flag.
041 **/
042 public ResolveException(String msg, IModule module, IRequirement req)
043 {
044 super(msg);
045 m_module = module;
046 m_req = req;
047 }
048
049 /**
050 * Returns the module that was being resolved.
051 * @return the module that was being resolved.
052 **/
053 public IModule getModule()
054 {
055 return m_module;
056 }
057
058 public IRequirement getRequirement()
059 {
060 return m_req;
061 }
062 }