public Class loadClass( String name ) throws ClassNotFoundException { return realm.loadClass( name ); }
public Class loadClass( String name ) throws ClassNotFoundException { return realm.loadClass( name ); }
public Class loadClass( String name ) throws ClassNotFoundException { return realm.loadClass( name ); }
public Class loadClass( String name ) throws ClassNotFoundException { return realm.loadClass( name ); }
public Class loadClass( String name ) throws ClassNotFoundException { return realm.loadClass( name ); }
/** * Retrieve the main entry class. * * @return The main entry class. * @throws ClassNotFoundException If the class cannot be found. * @throws NoSuchRealmException If the specified main entry realm does not exist. */ public Class getMainClass() throws ClassNotFoundException, NoSuchRealmException { return getMainRealm().loadClass( getMainClassName() ); }
/** * Retrieve the enhanced main entry method. * * @return The enhanced main entry method. * @throws ClassNotFoundException If the main entry class cannot be found. * @throws NoSuchMethodException If the main entry method cannot be found. * @throws NoSuchRealmException If the main entry realm cannot be found. */ protected Method getEnhancedMainMethod() throws ClassNotFoundException, NoSuchMethodException, NoSuchRealmException { Method[] methods = getMainClass().getMethods(); Class cwClass = getMainRealm().loadClass( ClassWorld.class.getName() ); Method m = getMainClass().getMethod( "main", new Class[] { String[].class, cwClass } ); int modifiers = m.getModifiers(); if ( Modifier.isStatic( modifiers ) && Modifier.isPublic( modifiers ) ) { if ( m.getReturnType() == Integer.TYPE || m.getReturnType() == Void.TYPE ) { return m; } } throw new NoSuchMethodException( "public static void main(String[] args, ClassWorld world)" ); }
/** * Retrieve the main entry class. * * @return The main entry class. * @throws ClassNotFoundException If the class cannot be found. * @throws NoSuchRealmException If the specified main entry realm does not exist. */ public Class getMainClass() throws ClassNotFoundException, NoSuchRealmException { return getMainRealm().loadClass( getMainClassName() ); }
/** Retrieve the main entry class. * * @return The main entry class. * * @throws ClassNotFoundException If the class cannot be found. * @throws NoSuchRealmException If the specified main entry realm does not exist. */ public Class getMainClass() throws ClassNotFoundException, NoSuchRealmException { return getMainRealm().loadClass(getMainClassName()); }
private Class<?> getMojoClassForMaven2(MojoDescriptor md, PluginDescriptor pd) throws ClassNotFoundException { Method method = ReflectionUtils.getPublicMethodNamed( pd.getClass(), "getClassRealm" ); org.codehaus.classworlds.ClassRealm cl = (org.codehaus.classworlds.ClassRealm) ReflectionUtils.invokeMethod( method, pd ); Class<?> clazz = cl.loadClass( md.getImplementation() ); return clazz; }
private Class<?> getMojoClassForMaven2(MojoDescriptor md, PluginDescriptor pd) throws ClassNotFoundException { Method method = ReflectionUtils.getPublicMethodNamed( pd.getClass(), "getClassRealm" ); org.codehaus.classworlds.ClassRealm cl = (org.codehaus.classworlds.ClassRealm) ReflectionUtils.invokeMethod( method, pd ); if (cl==null) { return null; } Class<?> clazz = cl.loadClass( md.getImplementation() ); return clazz; }
public Object newInstance( ComponentDescriptor componentDescriptor, ClassRealm classRealm, PlexusContainer container ) throws ComponentInstantiationException { ClassLoader currentContextLoader = Thread.currentThread().getContextClassLoader(); try { ClassLoader cl = classRealm.getClassLoader(); Class loader = classRealm.loadClass("clojure.plexus.factory.ClojureLoader"); Method m = loader.getDeclaredMethod("instantiate",String.class); Thread.currentThread().setContextClassLoader(cl); Object obj=m.invoke(loader,componentDescriptor.getImplementation()); return obj; } catch ( Exception e ) { classRealm.display(); throw new ComponentInstantiationException( "Failed to extract Clojure component for: " + componentDescriptor.getHumanReadableKey(), e ); } finally { Thread.currentThread() .setContextClassLoader(currentContextLoader); } }
Class remotingLauncher = remoting.loadClass("hudson.remoting.Launcher"); remotingLauncher.getMethod("main",new Class[]{InputStream.class,OutputStream.class}).invoke(null, new Object[]{
Class remotingLauncher = remoting.loadClass("hudson.remoting.Launcher"); remotingLauncher.getMethod("main",new Class[]{InputStream.class,OutputStream.class}).invoke(null, new Object[]{
Class<?> clazz = realm.loadClass("org.jruby.runtime.Constants"); if ( jrubyVerbose ){ String version = clazz.getField( "VERSION" ).get(clazz).toString();
@SuppressWarnings("rawtypes") @Override protected synchronized Class loadClass(String classname, boolean resolve) throws ClassNotFoundException { // 'sync' is needed - otherwise 2 threads can load the same class // twice, resulting in LinkageError: duplicated class definition. // findLoadedClass avoids that, but without sync it won't work. Class theClass = findLoadedClass(classname); if (theClass != null) { return theClass; } if (!forked) { // KTH changed try { theClass = realm.loadClass(classname); log("Class " + classname + " loaded from class realm " , Project.MSG_DEBUG); } catch (ClassNotFoundException cnfe) { theClass = findClass(classname); } } else { theClass = super.loadClass(classname, resolve); } return theClass; } }
Class<?> clazz = realm.loadClass("org.jruby.runtime.Constants"); if ( jrubyVerbose ){ String version = clazz.getField( "VERSION" ).get(clazz).toString();
type = containerRealm.loadClass( implementation );