Examples of ClassRealm


Examples of org.codehaus.plexus.classworlds.realm.ClassRealm

    }

    public synchronized void disposeRealm( String id )
        throws NoSuchRealmException
    {
        ClassRealm realm = (ClassRealm) realms.remove( id );

        if ( realm != null )
        {
            closeIfJava7( realm );
            for ( ClassWorldListener listener : listeners )
View Full Code Here

Examples of org.codehaus.plexus.classworlds.realm.ClassRealm

     */
    protected void launchEnhanced( String[] args )
        throws ClassNotFoundException, IllegalAccessException, InvocationTargetException, NoSuchMethodException,
        NoSuchRealmException
    {
        ClassRealm mainRealm = getMainRealm();

        Class<?> mainClass = getMainClass();

        Method mainMethod = getEnhancedMainMethod();

View Full Code Here

Examples of org.codehaus.plexus.classworlds.realm.ClassRealm

     */
    protected void launchStandard( String[] args )
        throws ClassNotFoundException, IllegalAccessException, InvocationTargetException, NoSuchMethodException,
        NoSuchRealmException
    {
        ClassRealm mainRealm = getMainRealm();

        Class<?> mainClass = getMainClass();

        Method mainMethod = getMainMethod();

View Full Code Here

Examples of org.codehaus.plexus.classworlds.realm.ClassRealm

        {
            launcher.launch( args );
        }
        catch ( InvocationTargetException e )
        {
            ClassRealm realm = launcher.getWorld().getRealm( launcher.getMainRealmName() );

            URL[] constituents = realm.getURLs();

            System.out.println( "---------------------------------------------------" );

            for ( int i = 0; i < constituents.length; i++ )
            {
View Full Code Here

Examples of org.codehaus.plexus.classworlds.realm.ClassRealm

            if ( j > 0 )
            {
                String parentRealmName = realmName.substring( 0, j );

                ClassRealm parentRealm = configuredRealms.get( parentRealmName );

                if ( parentRealm != null )
                {
                    ClassRealm realm = configuredRealms.get( realmName );

                    realm.setParentRealm( parentRealm );
                }
            }
        }
    }
View Full Code Here

Examples of org.codehaus.plexus.classworlds.realm.ClassRealm

         }
    }

  private String addArtifactsToClasspath(final Set<Artifact> artifacts) {
        final StringBuilder wikiFormatClasspath = new StringBuilder("\n");
    final ClassRealm realm = this.pluginDescriptor.getClassRealm();
      setupLocalTestClasspath(realm, wikiFormatClasspath);
        for (Artifact artifact : artifacts) {
        final File artifactFile = artifact.getFile();
            if(artifactFile != null) {
                getLog().debug(String.format("Adding artifact to FitNesse classpath [%s]", artifact));
View Full Code Here

Examples of org.codehaus.plexus.classworlds.realm.ClassRealm

            // It seems there is nothing we can do if the current class loader is not a ClassRealm.
            return;
        }

        // Modify the current class loader so that classes that was not loaded during the Maven build will be loaded by the new class loader.
        final ClassRealm classRealm = (ClassRealm) classLoader;
        ClassLoader newClassLoader = new URLClassLoader(classRealm.getURLs(), classRealm.getParentClassLoader()) {
            @Override
            protected Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException {
                // We should first check whether the requested class was already loaded by the old class loader in order not to break compatibility with already loaded classes.
                Class<?> clazz = classRealm.loadClassFromSelf(name);
                return clazz != null ? clazz : super.loadClass(name, resolve);
            }
        };
        classRealm.setParentClassLoader(newClassLoader);
    }
View Full Code Here

Examples of org.codehaus.plexus.classworlds.realm.ClassRealm

    private List<MavenReportExecution> buildReports( ReportSet... javadocReportSets )
        throws Exception
    {
        ClassLoader orig = Thread.currentThread().getContextClassLoader();
        ClassRealm realm = getContainer().getContainerRealm();

        Thread.currentThread().setContextClassLoader( realm );
        try
        {
            MavenReportExecutorRequest mavenReportExecutorRequest = new MavenReportExecutorRequest();
View Full Code Here

Examples of org.codehaus.plexus.classworlds.realm.ClassRealm

            return tomcatRealm;
        }
        try
        {
            ClassWorld world = new ClassWorld();
            ClassRealm root = world.newRealm( "tomcat", Thread.currentThread().getContextClassLoader() );

            for ( Artifact pluginArtifact : pluginArtifacts )
            {
                // add all plugin artifacts see https://issues.apache.org/jira/browse/MTOMCAT-122
                if ( pluginArtifact.getFile() != null )
                {
                    root.addURL( pluginArtifact.getFile().toURI().toURL() );
                }

            }
            tomcatRealm = root;
            return root;
View Full Code Here

Examples of org.codehaus.plexus.classworlds.realm.ClassRealm

            return tomcatRealm;
        }
        try
        {
            ClassWorld world = new ClassWorld();
            ClassRealm root = world.newRealm( "tomcat", Thread.currentThread().getContextClassLoader() );

            for ( @SuppressWarnings( "rawtypes" ) Iterator i = pluginArtifacts.iterator(); i.hasNext(); )
            {
                Artifact pluginArtifact = (Artifact) i.next();
                // add all plugin artifacts see https://issues.apache.org/jira/browse/MTOMCAT-122
                if ( pluginArtifact.getFile() != null )
                {
                    root.addURL( pluginArtifact.getFile().toURI().toURL() );
                }

            }
            tomcatRealm = root;
            return root;
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.