Package org.codehaus.plexus.classworlds.realm

Examples of org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass()


    }
   
    private Class<?> getMojoClass(MojoDescriptor md, PluginDescriptor pd) throws ClassNotFoundException {
        try {
            ClassRealm classRealm = pd.getClassRealm();
            return classRealm == null ? null : classRealm.loadClass( md.getImplementation() );
        } catch (NoSuchMethodError e) {
            // maybe we are in maven2 build ClassRealm package has changed
            return getMojoClassForMaven2( md, pd );
        }
    }
View Full Code Here


        {
            ClassRealm realm = container.getLookupRealm();

            if ( realm != null )
            {
                return realm.loadClass( role );
            }
        }
        catch ( Throwable e )
        {
        }
View Full Code Here

        {
            ClassRealm realm = getLookupRealm();

            if ( realm != null )
            {
                return realm.loadClass( role );
            }
        }
        catch ( Throwable e )
        {
        }
View Full Code Here

            {
                ClassRealm realm = getLookupRealm();

                if ( realm != null )
                {
                    return realm.loadClass( role );
                }
                else
                {                   
                    ClassLoader loader = cd.getImplementationClass().getClassLoader();
View Full Code Here

            if ( sourceRealm != getRealm() )
            {
                try
                {
                    return sourceRealm.loadClass( name );
                }
                catch ( ClassNotFoundException cnfe )
                {
                    // Do nothing as we will load directly
                }
View Full Code Here

      if (olderjar.exists()) {
        System.out.println("found older jar");
        rScript.addURL(olderjar.toURI().toURL());
        String clname = "scala_maven.ScalaScriptMojo";
        //assertNotSame(s.loadClass(clname), getClass().getClassLoader().loadClass(clname));
        assertNotSame(rScript.loadClass(clname), getClass().getClassLoader().loadClass(clname));
        assertSame(rMojo.loadClass(clname), getClass().getClassLoader().loadClass(clname));
        assertSame(rScript.loadClass(MavenProject.class.getCanonicalName()), MavenProject.class);
        assertSame(rScript.loadClass(MavenSession.class.getCanonicalName()), MavenSession.class);
        assertSame(rScript.loadClass(Log.class.getCanonicalName()), Log.class);
      }
View Full Code Here

        rScript.addURL(olderjar.toURI().toURL());
        String clname = "scala_maven.ScalaScriptMojo";
        //assertNotSame(s.loadClass(clname), getClass().getClassLoader().loadClass(clname));
        assertNotSame(rScript.loadClass(clname), getClass().getClassLoader().loadClass(clname));
        assertSame(rMojo.loadClass(clname), getClass().getClassLoader().loadClass(clname));
        assertSame(rScript.loadClass(MavenProject.class.getCanonicalName()), MavenProject.class);
        assertSame(rScript.loadClass(MavenSession.class.getCanonicalName()), MavenSession.class);
        assertSame(rScript.loadClass(Log.class.getCanonicalName()), Log.class);
      }
    }
}
View Full Code Here

        String clname = "scala_maven.ScalaScriptMojo";
        //assertNotSame(s.loadClass(clname), getClass().getClassLoader().loadClass(clname));
        assertNotSame(rScript.loadClass(clname), getClass().getClassLoader().loadClass(clname));
        assertSame(rMojo.loadClass(clname), getClass().getClassLoader().loadClass(clname));
        assertSame(rScript.loadClass(MavenProject.class.getCanonicalName()), MavenProject.class);
        assertSame(rScript.loadClass(MavenSession.class.getCanonicalName()), MavenSession.class);
        assertSame(rScript.loadClass(Log.class.getCanonicalName()), Log.class);
      }
    }
}
View Full Code Here

        //assertNotSame(s.loadClass(clname), getClass().getClassLoader().loadClass(clname));
        assertNotSame(rScript.loadClass(clname), getClass().getClassLoader().loadClass(clname));
        assertSame(rMojo.loadClass(clname), getClass().getClassLoader().loadClass(clname));
        assertSame(rScript.loadClass(MavenProject.class.getCanonicalName()), MavenProject.class);
        assertSame(rScript.loadClass(MavenSession.class.getCanonicalName()), MavenSession.class);
        assertSame(rScript.loadClass(Log.class.getCanonicalName()), Log.class);
      }
    }
}
View Full Code Here

        // Parent class loader cannot see Snappy.class
        ClassLoader parent = this.getClass().getClassLoader().getParent();
        ClassWorld cw = new ClassWorld();
        ClassRealm P = cw.newRealm("P", parent);
        try {
            P.loadClass("org.xerial.snappy.Snappy");
            fail("org.xerial.snappy.Snappy is found in the parent");
        }
        catch (ClassNotFoundException e) {
            // OK
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.