Package org.codehaus.plexus.classworlds

Examples of org.codehaus.plexus.classworlds.ClassWorld


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

        DefaultPlexusContainer container = null;

        ContainerConfiguration cc = new DefaultContainerConfiguration()
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

        throws PlexusContainerException
    {
        ClassRealm realm = configuration.getRealm();
        if ( null == realm )
        {
            ClassWorld world = configuration.getClassWorld();
            if ( null == world )
            {
                world = new ClassWorld( DEFAULT_REALM_NAME, Thread.currentThread().getContextClassLoader() );
            }
            try
            {
                realm = world.getRealm( DEFAULT_REALM_NAME );
            }
            catch ( final NoSuchRealmException e )
            {
                final Iterator<?> realmIterator = world.getRealms().iterator();
                if ( realmIterator.hasNext() )
                {
                    realm = (ClassRealm) realmIterator.next();
                }
            }
View Full Code Here

                logSummary(child, references, indent, showErrors);
            }
        }

        private void cleanup() {
            ClassWorld world = container.getClassWorld();
            log.debug("Removing all realms from: {}", world);

            //noinspection unchecked
            for (ClassRealm realm : (List<ClassRealm>)world.getRealms()) {
                String id = realm.getId();
                try {
                    log.debug("Disposing class realm: {}", id);
                    world.disposeRealm(id);
                }
                catch (Exception e) {
                    log.warn("Failed to dispose class realm: {}", id, e);
                }
            }

            //noinspection unchecked
            purgeStrayShutdownHooks(world.getRealms());

            container.dispose();
        }
View Full Code Here

        this(null);
    }

    public PlexusHelper(ClassWorld classWorld) throws Exception {
        if (classWorld == null) {
            classWorld = new ClassWorld("plexus.core", Thread.currentThread()
                    .getContextClassLoader());
        }

        final ContainerConfiguration cc = new DefaultContainerConfiguration().setClassWorld(classWorld)
                .setName("ruby-tools");
View Full Code Here

        for ( File jarFile : jarFiles ) {
            antClassLoader.addPathComponent( jarFile );
        }
       
        if (world == null) {
            world = new ClassWorld();
        }
       
        ClassRealm classRealm = new ClassRealm( world, "plexus.core", parentClassLoader == null ? antClassLoader : parentClassLoader );

        for ( File jarFile : jarFiles ) {
View Full Code Here

        }
        return classRealm;
    }
   
    public static PlexusContainer buildPlexusContainer(File mavenHome, MavenRequest mavenRequest) throws MavenEmbedderException {
        ClassWorld world = new ClassWorld("plexus.core", Thread.currentThread().getContextClassLoader());

        ClassRealm classRealm = MavenEmbedderUtils.buildClassRealm( mavenHome, world, Thread.currentThread().getContextClassLoader() );

        DefaultContainerConfiguration conf = new DefaultContainerConfiguration();
View Full Code Here

        conf.setClassPathScanning( mavenRequest.getContainerClassPathScanning() );
        conf.setComponentVisibility( mavenRequest.getContainerComponentVisibility() );

        conf.setContainerConfigurationURL( mavenRequest.getOverridingComponentsXml() );

        ClassWorld classWorld = new ClassWorld();

        ClassRealm classRealm = new ClassRealm( classWorld, "maven", mavenClassLoader );
        classRealm.setParentRealm( new ClassRealm( classWorld, "maven-parent",
                                                   parent == null ? Thread.currentThread().getContextClassLoader()
                                                                   : parent ) );
View Full Code Here

    userProps.put("testForgeServiceURL", System.getProperty("forge.base.url"));
    FileUtils.rmR(new File(pom.getParent(), "target"));
  }

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

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

  private final TeslaModelTranslator translator;

  public PolyglotTranslatorCli(ClassWorld classWorld) throws Exception {
    if (classWorld == null) {
      classWorld = new ClassWorld("plexus.core", Thread.currentThread().getContextClassLoader());
    }

    ContainerConfiguration cc = new DefaultContainerConfiguration().setClassWorld(classWorld).setName("translator");
    container = new DefaultPlexusContainer(cc);
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.