1 /* 2 * Copyright 2004-2005 OpenSymphony 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 * use this file except in compliance with the License. You may obtain a copy 6 * of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 * License for the specific language governing permissions and limitations 14 * under the License. 15 * 16 */ 17 18 /* 19 * Previously Copyright (c) 2001-2004 James House 20 */ 21 package org.quartz.spi; 22 23 import java.net.URL; 24 import java.io.InputStream; 25 26 /** 27 * An interface for classes wishing to provide the service of loading classes 28 * and resources within the scheduler... 29 * 30 * @author jhouse 31 */ 32 public interface ClassLoadHelper { 33 34 /* 35 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 36 * 37 * Interface. 38 * 39 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 40 */ 41 42 /** 43 * Called to give the ClassLoadHelper a chance to initialize itself, 44 * including the oportunity to "steal" the class loader off of the calling 45 * thread, which is the thread that is initializing Quartz. 46 */ 47 void initialize(); 48 49 /** 50 * Return the class with the given name. 51 */ 52 Class loadClass(String name) throws ClassNotFoundException; 53 54 /** 55 * Finds a resource with a given name. This method returns null if no 56 * resource with this name is found. 57 * @param name name of the desired resource 58 * @return a java.net.URL object 59 */ 60 URL getResource(String name); 61 62 /** 63 * Finds a resource with a given name. This method returns null if no 64 * resource with this name is found. 65 * @param name name of the desired resource 66 * @return a java.io.InputStream object 67 */ 68 InputStream getResourceAsStream(String name); 69 } 70