protected Class loadClass()

in src/java/org/apache/fulcrum/factory/DefaultFactoryService.java [404:439]


	protected <T> Class<T> loadClass(String className) throws ClassNotFoundException 
	{
		ClassLoader loader = this.getClass().getClassLoader();
		try 
		{
			Class<T> clazz;

			if (loader != null) 
			{
				clazz = (Class<T>) loader.loadClass(className);
			} 
			else 
			{
				clazz = (Class<T>) Class.forName(className);
			}

			return clazz;
		} 
		catch (ClassNotFoundException x) 
		{
			/* Go through additional loaders. */
			for (ClassLoader l : classLoaders) 
			{
				try 
				{
					return (Class<T>) l.loadClass(className);
				} 
				catch (ClassNotFoundException xx) 
				{
					// continue
				}
			}
			/* Give up. */
			throw x;
		}
	}