Package org.codehaus.plexus.classworlds

Examples of org.codehaus.plexus.classworlds.ClassWorld.newRealm()


            while ( true )
            {
                try
                {
                    ClassRealm classRealm = world.newRealm( realmId, null );

                    if ( logger.isDebugEnabled() )
                    {
                        logger.debug( "Created new class realm " + realmId );
                    }
View Full Code Here


            while ( true )
            {
                try
                {
                    ClassRealm classRealm = world.newRealm( realmId, null );

                    if ( logger.isDebugEnabled() )
                    {
                        logger.debug( "Created new class realm " + realmId );
                    }
View Full Code Here

            while ( true )
            {
                try
                {
                    ClassRealm classRealm = world.newRealm( realmId, null );

                    if ( logger.isDebugEnabled() )
                    {
                        logger.debug( "Created new class realm " + realmId );
                    }
View Full Code Here

            while ( true )
            {
                try
                {
                    ClassRealm classRealm = world.newRealm( realmId, null );

                    if ( logger.isDebugEnabled() )
                    {
                        logger.debug( "Created new class realm " + realmId );
                    }
View Full Code Here

        assertEquals(2, StringUtils.split("hel||lo", "|").length);
    }
   
    public void testClassworldSeftFirstStrategy() throws Exception {
      ClassWorld w = new ClassWorld("zero", null);
      ClassRealm rMojo = w.newRealm("mojo", getClass().getClassLoader());
      Strategy s = new SelfFirstStrategy(w.newRealm("scalaScript", null));
      ClassRealm rScript = s.getRealm();
      rScript.setParentClassLoader(getClass().getClassLoader());
      rScript.importFrom("mojo", MavenProject.class.getPackage().getName());
      rScript.importFrom("mojo", MavenSession.class.getPackage().getName());
View Full Code Here

    }
   
    public void testClassworldSeftFirstStrategy() throws Exception {
      ClassWorld w = new ClassWorld("zero", null);
      ClassRealm rMojo = w.newRealm("mojo", getClass().getClassLoader());
      Strategy s = new SelfFirstStrategy(w.newRealm("scalaScript", null));
      ClassRealm rScript = s.getRealm();
      rScript.setParentClassLoader(getClass().getClassLoader());
      rScript.importFrom("mojo", MavenProject.class.getPackage().getName());
      rScript.importFrom("mojo", MavenSession.class.getPackage().getName());
      rScript.importFrom("mojo", Log.class.getPackage().getName());       
View Full Code Here

        }
    }

    private URLClassLoader createScriptClassloader(File scriptDir, Set<String> classpath) throws Exception {
        ClassWorld w = new ClassWorld("zero", null);
        w.newRealm("mojo", getClass().getClassLoader());
        Strategy s = new SelfFirstStrategy(w.newRealm("scalaScript", null));
        ClassRealm rScript = s.getRealm();
        rScript.setParentClassLoader(getClass().getClassLoader());
        //rScript.importFrom("mojo", MavenProject.class.getPackage().getName());
        //rScript.importFrom("mojo", MavenSession.class.getPackage().getName());
View Full Code Here

    }

    private URLClassLoader createScriptClassloader(File scriptDir, Set<String> classpath) throws Exception {
        ClassWorld w = new ClassWorld("zero", null);
        w.newRealm("mojo", getClass().getClassLoader());
        Strategy s = new SelfFirstStrategy(w.newRealm("scalaScript", null));
        ClassRealm rScript = s.getRealm();
        rScript.setParentClassLoader(getClass().getClassLoader());
        //rScript.importFrom("mojo", MavenProject.class.getPackage().getName());
        //rScript.importFrom("mojo", MavenSession.class.getPackage().getName());
        //rScript.importFrom("mojo", Log.class.getPackage().getName());
View Full Code Here

            while ( true )
            {
                try
                {
                    ClassRealm classRealm = world.newRealm( realmId, null );

                    if ( logger.isDebugEnabled() )
                    {
                        logger.debug( "Created new class realm " + realmId );
                    }
View Full Code Here

    public void loadSnappyByDiffentClassloadersInTheSameJVM() throws Exception {

        // 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) {
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.