Package org.codehaus.classworlds

Examples of org.codehaus.classworlds.ClassWorld


        // Initialization is a bit ugly, but we might be in a sandbox
        AccessController.doPrivileged(new PrivilegedAction<Object>() {
            public Object run() {
                try {
                    // Try to create a new ClassWorld object
                    ClassPathManager.this.classWorld = new ClassWorld();

                    // Create a core realm (for internal and classpath://* plugins)
                    try {
                        ClassPathManager.this.classWorld.newRealm("core", getClass().getClassLoader());
                    } catch (DuplicateRealmException e) {
View Full Code Here


    /**
     * @param args
     * @throws Exception
     */
    public static void main(String[] args) throws Exception {
        ClassWorld cw = new ClassWorld();
        ClassRealm realm = cw.newRealm("http://x.as?2");       
        realm.addConstituent(new File("bin/").toURI().toURL());
        ClassLoader classLoader = realm.getClassLoader();
       
        Class<?> loadClass = classLoader.loadClass("net.xeoh.plugins.base.Plugin");
        System.out.println(loadClass);
       
        ClassRealm realm2 = cw.newRealm("ASd");
        ClassLoader classLoader2 = realm2.getClassLoader();
        Class<?> loadClass2 = classLoader2.loadClass("net.xeoh.plugins.base.Plugin");
        System.out.println(loadClass2);
       
       
View Full Code Here

    private static Embedder embedder;

    public static void main( String[] args )
    {
        ClassWorld classWorld = new ClassWorld( "plexus.core", Thread.currentThread().getContextClassLoader() );

        int result = main( args, classWorld );

        System.exit( result );
    }
View Full Code Here

    private PlexusContainer createContainer()
        throws PlexusContainerException
    {
        DefaultPlexusContainer child = new DefaultPlexusContainer();

        ClassWorld classWorld = container.getClassWorld();
        child.setClassWorld( classWorld );

        ClassRealm childRealm = null;

        // note: ideally extensions would live in their own realm, but this would mean that things like wagon-scm would
        // have no way to obtain SCM extensions
        String childRealmId = "plexus.core.child-container[" + CONTAINER_NAME + "]";
        try
        {
            childRealm = classWorld.getRealm( childRealmId );
        }
        catch ( NoSuchRealmException e )
        {
            try
            {
                childRealm = classWorld.newRealm( childRealmId );
            }
            catch ( DuplicateRealmException impossibleError )
            {
                getLogger().error( "An impossible error has occurred. After getRealm() failed, newRealm() " +
                    "produced duplication error on same id!", impossibleError );
View Full Code Here

public class CompatibleMain
{

    public static void main( String[] args )
    {
        ClassWorld classWorld = new ClassWorld( "plexus.core", Thread.currentThread().getContextClassLoader() );

        int result = main( args, classWorld );

        System.exit( result );
    }
View Full Code Here

    /**
     * @deprecated Use {@link Main#main(String[])} instead.
     */
    public static void main( String[] args )
    {
        ClassWorld classWorld = new ClassWorld( "plexus.core", Thread.currentThread().getContextClassLoader() );

        int result = main( args, classWorld );

        System.exit( result );
    }
View Full Code Here

    private void initializeClassWorlds()
        throws DuplicateRealmException
    {
        if ( classWorld == null )
        {
            classWorld = new ClassWorld();
        }

        // Create a name for our application if one doesn't exist.
        initializeName();
View Full Code Here

            throwFailureException(validationFailures.getNumberOfMessages() + " problems found.", validationFailures.getMessages());
        }
    }

    private ValidationFailures bootIsisThenShutdown() throws MojoExecutionException, MojoFailureException {
        ClassWorld classWorld = null;
        IsisMetaModel isisMetaModel = null;
        try {
            classWorld = new ClassWorld();
            final ClassRealm isisRealm = classWorld.newRealm(ISIS_REALM);

            addClassesToRealm(isisRealm);

            List<Object> serviceList = createServicesFromConfiguration(isisRealm);
View Full Code Here

            if ( container == null )
            {
                try
                {
                    ClassWorld classWorld = new ClassWorld();

                    classWorld.newRealm( "plexus.core", getClass().getClassLoader() );

                    Embedder embedder = new Embedder();

                    embedder.start( classWorld );
View Full Code Here

    private PlexusContainer createContainer()
        throws PlexusContainerException
    {
        DefaultPlexusContainer child = new DefaultPlexusContainer();

        ClassWorld classWorld = container.getClassWorld();
        child.setClassWorld( classWorld );

        ClassRealm childRealm = null;

        // note: ideally extensions would live in their own realm, but this would mean that things like wagon-scm would
        // have no way to obtain SCM extensions
        String childRealmId = "plexus.core.child-container[" + CONTAINER_NAME + "]";
        try
        {
            childRealm = classWorld.getRealm( childRealmId );
        }
        catch ( NoSuchRealmException e )
        {
            try
            {
                childRealm = classWorld.newRealm( childRealmId );
            }
            catch ( DuplicateRealmException impossibleError )
            {
                getLogger().error( "An impossible error has occurred. After getRealm() failed, newRealm() " +
                    "produced duplication error on same id!", impossibleError );
View Full Code Here

TOP

Related Classes of org.codehaus.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.