1 /*
   2  * reserved comment block
   3  * DO NOT REMOVE OR ALTER!
   4  */
   5 /*
   6  * Licensed to the Apache Software Foundation (ASF) under one or more
   7  * contributor license agreements.  See the NOTICE file distributed with
   8  * this work for additional information regarding copyright ownership.
   9  * The ASF licenses this file to You under the Apache License, Version 2.0
  10  * (the "License"); you may not use this file except in compliance with
  11  * the License.  You may obtain a copy of the License at
  12  *
  13  *      http://www.apache.org/licenses/LICENSE-2.0
  14  *
  15  * Unless required by applicable law or agreed to in writing, software
  16  * distributed under the License is distributed on an "AS IS" BASIS,
  17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  18  * See the License for the specific language governing permissions and
  19  * limitations under the License.
  20  */
  21 
  22 package com.sun.org.apache.bcel.internal.util;
  23 
  24 
  25 import com.sun.org.apache.bcel.internal.classfile.JavaClass;
  26 
  27 /**
  28  * Abstract definition of a class repository. Instances may be used
  29  * to load classes from different sources and may be used in the
  30  * Repository.setRepository method.
  31  *
  32  * @see com.sun.org.apache.bcel.internal.Repository
  33  * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
  34  * @author David Dixon-Peugh
  35  */
  36 public interface Repository extends java.io.Serializable {
  37   /**
  38    * Store the provided class under "clazz.getClassName()"
  39    */
  40   public void storeClass(JavaClass clazz);
  41 
  42   /**
  43    * Remove class from repository
  44    */
  45   public void removeClass(JavaClass clazz);
  46 
  47   /**
  48    * Find the class with the name provided, if the class
  49    * isn't there, return NULL.
  50    */
  51   public JavaClass findClass(String className);
  52 
  53   /**
  54    * Find the class with the name provided, if the class
  55    * isn't there, make an attempt to load it.
  56    */
  57   public JavaClass loadClass(String className)
  58     throws java.lang.ClassNotFoundException;
  59 
  60   /**
  61    * Find the JavaClass instance for the given run-time class object
  62    */
  63   public JavaClass loadClass(Class clazz)
  64     throws java.lang.ClassNotFoundException;
  65 
  66   /** Clear all entries from cache.
  67    */
  68   public void clear();
  69 }