Package org.apache.avalon.framework.context

Examples of org.apache.avalon.framework.context.DefaultContext


        Hierarchy.getDefaultHierarchy().setDefaultLogTarget(servTarget);
        Hierarchy.getDefaultHierarchy().setDefaultPriority(logPriority);
        final Logger logger = Hierarchy.getDefaultHierarchy().getLoggerFor("");
        final DefaultLogKitManager logKitManager = new DefaultLogKitManager(Hierarchy.getDefaultHierarchy());
        logKitManager.setLogger(logger);
        final DefaultContext subcontext = new DefaultContext(this.appContext);
        subcontext.put("servlet-context", this.servletContext);
        if (this.servletContextPath == null) {
            File logSCDir = new File(this.workDir, "log");
            logSCDir.mkdirs();
            if (logger.isWarnEnabled()) {
                logger.warn("Setting servlet-context for LogKit to " + logSCDir);
            }
            subcontext.put("context-root", logSCDir.toString());
        } else {
            subcontext.put("context-root", this.servletContextPath);
        }

        try {
            logKitManager.contextualize(subcontext);
            this.logKitManager = logKitManager;
View Full Code Here


      this.manager.setRoleManager(roles);
        }
        // Setup ECM
        this.manager.setLoggerManager(lm);
        this.manager.enableLogging(lm.getLoggerForCategory("org.apache.fulcrum"));
        DefaultContext context = new DefaultContext();
        String absolutePath = new File("").getAbsolutePath();
        context.put(COMPONENT_APP_ROOT, absolutePath);
        context.put(URN_AVALON_HOME, absolutePath);
        this.manager.contextualize(context);
       
        this.manager.configure(sysConfig);
        // Init ECM!!!!
        this.manager.initialize();
View Full Code Here

            usersStore = (UsersStore) compMgr.lookup( UsersStore.ROLE );
        } catch (Exception e) {
            getLogger().warn("Can't get Store: " + e);
        }
        getLogger().debug("Using UsersStore: " + usersStore.toString());
        context = new DefaultContext();

        String hostName = null;
        try {
            hostName = InetAddress.getLocalHost().getHostName();
        } catch  (UnknownHostException ue) {
View Full Code Here

    private Configuration rmiObjects;


    public void contextualize(Context context)
            throws ContextException {
        this.context = new DefaultContext(context);
    }
View Full Code Here

            usersStore = (UsersStore) compMgr.lookup( UsersStore.ROLE );
        } catch (Exception e) {
            getLogger().warn("Can't get Store: " + e);
        }
        getLogger().debug("Using UsersStore: " + usersStore.toString());
        context = new DefaultContext();

        String hostName = null;
        try {
            hostName = InetAddress.getLocalHost().getHostName();
        } catch  (UnknownHostException ue) {
View Full Code Here

        this.conf = conf;
        threads = conf.getChild("threads").getValueAsInteger(1);
    }

    public void contextualize(Context context) {
        this.context = new DefaultContext( context );
    }
View Full Code Here

    public void contextualize( final Context context )
        throws ContextException
    {
        // Add System output streams
        final DefaultContext newContext = new DefaultContext( context );

        newContext.put( "System.out", System.out );
        newContext.put( "System.err", System.err );

        super.contextualize( newContext );
    }
View Full Code Here

            hostName = InetAddress.getLocalHost().getHostName();
        } catch  (UnknownHostException ue) {
            hostName = "localhost";
        }

        context = new DefaultContext();
        context.put("HostName", hostName);
        getLogger().info("Local host is: " + hostName);

        // Get the domains and hosts served by this instance
        serverNames = new HashSet();
View Full Code Here

        }
        catch ( UnknownHostException ue ) {
            hostName = "localhost";
        }

        context = new DefaultContext();
        context.put( "HostName", hostName );
        getLogger().info( "Local host is: " + hostName );

        // Get the domains and hosts served by this instance
        serverNames = new HashSet();
View Full Code Here

            hostName = InetAddress.getLocalHost().getHostName();
        } catch  (UnknownHostException ue) {
            hostName = "localhost";
        }

        context = new DefaultContext();
        context.put("HostName", hostName);
        getLogger().info("Local host is: " + hostName);

        // Get the domains and hosts served by this instance
        serverNames = new HashSet();
View Full Code Here

TOP

Related Classes of org.apache.avalon.framework.context.DefaultContext

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.