Package org.codehaus.classworlds

Examples of org.codehaus.classworlds.ClassWorld


     * @throws Exception
     */
    public void testMain()
        throws Exception
    {
        ClassWorld classWorld = new ClassWorld();

        PrintStream oldErr = System.err;
        PrintStream oldOut = System.out;

        OutputStream errOS = new StringOutputStream();
View Full Code Here


    }

    public static void customizeContext( PlexusContainer container, File basedir, File mavenHome, File mavenHomeLocal )
        throws Exception
    {
        ClassWorld classWorld = new ClassWorld();

        ClassRealm rootClassRealm = classWorld.newRealm( "root", Thread.currentThread().getContextClassLoader() );

        container.addContextValue( "rootClassRealm", rootClassRealm );

        container.addContextValue( "maven.home", mavenHome.getAbsolutePath() );
View Full Code Here

    CommandContainer commandContainer;
    CommandInfo commandInfoOne;
    CommandInfo commandInfoTwo;

    protected void setUp() throws Exception {
        world = new ClassWorld();
        world.newRealm(Command.DEFAULT_CLASS_REALM);
       
        commandContainer = new CommandContainer();

        CommandConfig config = new CommandConfig();
View Full Code Here

    /**
     * Set up instance variables required by this test case.
     */
    protected void setUp() throws Exception
    {
        world = new ClassWorld();
        world.newRealm(Command.DEFAULT_CLASS_REALM);
    }
View Full Code Here

     * Construct a <code>Twiddle</code> command processor using system
     * defaults for the input/output context and a default class world.
     */
    public Twiddle()
    {
        this(new ClassWorld());
    }
View Full Code Here

        if (trace) {
            log.trace("Processing classworld realm: " + name);
        }
       
        // Get or create a new realm for this name
        ClassWorld world = getTwiddle().getClassWorld();
        ClassRealm realm = null;
        try {
            realm = world.getRealm(name);
        }
        catch (NoSuchRealmException e) {
            realm = world.newRealm(name);
        }
       
        String[] constituents = config.getLoadURLConfig();
        if (constituents != null) {
            log.trace("Processing constituents...");
View Full Code Here

       
        CommandConfig[] commands = config.getCommandConfig();
        if (commands == null) return;
       
        CommandContainer container = twiddle.getCommandContainer();
        ClassWorld world = getTwiddle().getClassWorld();
       
        for (int i=0; i<commands.length; i++) {
            if (commands[i] == null) {
                throw new NullArgumentException("CommandConfig", i);
            }
View Full Code Here

   
    public static void main(final String[] args) throws Exception
    {
        // args are checked for null by Main
       
        ClassWorld world = new ClassWorld();
        main(args, world);
    }
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

    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

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.