Package org.codehaus.plexus.classworlds

Examples of org.codehaus.plexus.classworlds.ClassWorld


        return ( (MutablePlexusContainer) container ).getClassWorld();
    }

    private ClassRealm newRealm( String id )
    {
        ClassWorld world = getClassWorld();

        synchronized ( world )
        {
            String realmId = id;

            Random random = new Random();

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

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


        conf.setClassPathScanning( containerClassPathScanning );
        conf.setComponentVisibility( containerComponentVisibility );

        conf.setContainerConfigurationURL( overridingComponentsXml );

        ClassWorld classWorld = new ClassWorld();

        ClassLoader tccl = Thread.currentThread().getContextClassLoader();

        containerRealm = new ClassRealm( classWorld, "maven", tccl );
View Full Code Here

        return ( (MutablePlexusContainer) container ).getClassWorld();
    }

    private ClassRealm newRealm( String id )
    {
        ClassWorld world = getClassWorld();

        synchronized ( world )
        {
            String realmId = id;

            Random random = new Random();

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

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

        conf.setClassPathScanning( containerClassPathScanning );
        conf.setComponentVisibility( containerComponentVisibility );

        conf.setContainerConfigurationURL( overridingComponentsXml );

        ClassWorld classWorld = new ClassWorld();

        ClassLoader tccl = Thread.currentThread().getContextClassLoader();

        containerRealm = new ClassRealm( classWorld, "maven", tccl );
View Full Code Here

        // no custom guice modules by default
    }

    protected ContainerConfiguration setupContainerConfiguration()
    {
        ClassWorld classWorld = new ClassWorld( "plexus.core", Thread.currentThread().getContextClassLoader() );

        ContainerConfiguration cc = new DefaultContainerConfiguration()
          .setClassWorld( classWorld )
          .setClassPathScanning( PlexusConstants.SCANNING_INDEX )
          .setAutoWiring( true )
View Full Code Here

        }  
    }

    protected ContainerConfiguration setupContainerConfiguration()
    {
        ClassWorld classWorld = new ClassWorld( "plexus.core", Thread.currentThread().getContextClassLoader() );

        return new DefaultContainerConfiguration().setClassWorld( classWorld ).setName( "embedder" );
    }
View Full Code Here

        assertEquals(2, StringUtils.split("hel|lo", "|").length);
        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());
      rScript.importFrom("mojo", Log.class.getPackage().getName());       
View Full Code Here

            Thread.currentThread().setContextClassLoader(currentCL);
        }
    }

    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

    private void container( CliRequest cliRequest )
        throws Exception
    {
        if ( cliRequest.classWorld == null )
        {
            cliRequest.classWorld = new ClassWorld( "plexus.core", Thread.currentThread().getContextClassLoader() );
        }

        DefaultPlexusContainer container = this.container;

        if ( container == null )
View Full Code Here

    private void container( CliRequest cliRequest )
        throws Exception
    {
        if ( cliRequest.classWorld == null )
        {
            cliRequest.classWorld = new ClassWorld( "plexus.core", Thread.currentThread().getContextClassLoader() );
        }

        DefaultPlexusContainer container = this.container;

        if ( container == null )
View Full Code Here

TOP

Related Classes of org.codehaus.plexus.classworlds.ClassWorld

Copyright © 2018 www.massapicom. 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.