Package org.codehaus.classworlds

Examples of org.codehaus.classworlds.ClassWorld


    public void start() throws TuscanyDependencyException {

        try {

            Embedder embedder = new Embedder();
            ClassWorld classWorld = new ClassWorld();

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

            // Evil hack for Tomcat classloader issue - starts
            Field realmsField = ClassWorld.class.getDeclaredField("realms");
            realmsField.setAccessible(true);
            Map realms = (Map) realmsField.get(classWorld);
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

    /**
     * Perform a proper initialization
     */
    void properInit() {
        this.classWorld = new ClassWorld();

        try {
            this.classWorld.newRealm("core", getClass().getClassLoader());
        } catch (DuplicateRealmException e) {
            e.printStackTrace();
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

            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

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.