Package org.apache.beehive.netui.util.xml

Examples of org.apache.beehive.netui.util.xml.XmlInputStreamResolver


    public NetUIConfig parse(final XmlInputStreamResolver xmlResolver) {

        NetUIConfig configBean = null;
        InputStream xmlInputStream = null;
        XmlInputStreamResolver theXmlResolver = xmlResolver;
        try {
            /* use the default XmlInputStream */
            if(theXmlResolver == null)
                theXmlResolver = DEFAULT_CONFIG_RESOLVER;

            xmlInputStream = theXmlResolver.getInputStream();

            /* the default XmlInputStream could not provide a valid InputStream; try the default */
            if(xmlInputStream == null) {
                theXmlResolver = DEFAULT_CONFIG_RESOLVER;
                xmlInputStream = theXmlResolver.getInputStream();

                if(LOGGER.isInfoEnabled())
                    LOGGER.info("Loading the default NetUI config file.  The runtime will be configured " +
                        "with a set of minimum parameters.");

                /* todo: should this throw an exception? */
                if(xmlInputStream == null)
                    throw new ConfigInitializationException("The NetUI runtime could not find the default config file.  " +
                            "The webapp may not function properly.");
            }

            if(LOGGER.isInfoEnabled())
                LOGGER.info("NetUIConfigParser -- load config: " + theXmlResolver.getResourcePath());

            configBean = parse(theXmlResolver.getResourcePath(), xmlInputStream);
        }
        finally {
            try {if(xmlInputStream != null) xmlInputStream.close();} catch(IOException ignore) {}
        }

View Full Code Here


        // config (static) isn't the same as the scope for PageFlowActionServlet, which may get created and destroyed
        // within a classloader (which is the case during StrutsTestCase tests).
        //
        if ( ! ConfigUtil.isInit() )
        {
            XmlInputStreamResolver resolver =
                    overrideConfigInput != null ? overrideConfigInput : new NetUIConfigResolver(servletContext);
            try
            {
                ConfigUtil.init(resolver);
            }
            catch ( ConfigInitializationException e )
            {
                _log.fatal( "Could not initialize from " + resolver.getResourcePath(), e );
                throw new IllegalStateException( "Could not initialize from " + resolver.getResourcePath(), e );
            }
        }

        AdapterManager.initServletContext( servletContext );
        LegacySettings.init( servletContext );
View Full Code Here

    public NetUIConfig parse(final XmlInputStreamResolver xmlResolver) {

        NetUIConfig configBean = null;
        InputStream xmlInputStream = null;
        XmlInputStreamResolver theXmlResolver = xmlResolver;
        try {
            /* use the default XmlInputStream */
            if(theXmlResolver == null)
                theXmlResolver = DEFAULT_CONFIG_RESOLVER;

            xmlInputStream = theXmlResolver.getInputStream();

            /* the default XmlInputStream could not provide a valid InputStream; try the default */
            if(xmlInputStream == null) {
                theXmlResolver = DEFAULT_CONFIG_RESOLVER;
                xmlInputStream = theXmlResolver.getInputStream();

                if(LOGGER.isInfoEnabled())
                    LOGGER.info("Loading the default NetUI config file.  The runtime will be configured " +
                        "with a set of minimum parameters.");

                /* todo: should this throw an exception? */
                if(xmlInputStream == null)
                    throw new ConfigInitializationException("The NetUI runtime could not find the default config file.  " +
                            "The webapp may not function properly.");
            }

            if(LOGGER.isInfoEnabled())
                LOGGER.info("NetUIConfigParser -- load config: " + theXmlResolver.getResourcePath());

            configBean = parse(theXmlResolver.getResourcePath(), xmlInputStream);
        }
        finally {
            try {if(xmlInputStream != null) xmlInputStream.close();} catch(IOException ignore) {}
        }

View Full Code Here

        // config (static) isn't the same as the scope for PageFlowActionServlet, which may get created and destroyed
        // within a classloader (which is the case during StrutsTestCase tests).
        //
        if ( ! ConfigUtil.isInit() )
        {
            XmlInputStreamResolver resolver =
                    overrideConfigInput != null ? overrideConfigInput : new NetUIConfigResolver(servletContext);
            try
            {
                ConfigUtil.init(resolver);
            }
            catch ( ConfigInitializationException e )
            {
                _log.fatal( "Could not initialize from " + resolver.getResourcePath(), e );
                throw new IllegalStateException( "Could not initialize from " + resolver.getResourcePath(), e );
            }
        }

        AdapterManager.initServletContext( servletContext );
        LegacySettings.init( servletContext );
View Full Code Here

    public NetUIConfig parse(final XmlInputStreamResolver xmlResolver) {

        NetUIConfig configBean = null;
        InputStream xmlInputStream = null;
        XmlInputStreamResolver theXmlResolver = xmlResolver;
        try {
            /* use the default XmlInputStream */
            if(theXmlResolver == null)
                theXmlResolver = DEFAULT_CONFIG_RESOLVER;

            xmlInputStream = theXmlResolver.getInputStream();

            /* the default XmlInputStream could not provide a valid InputStream; try the default */
            if(xmlInputStream == null) {
                theXmlResolver = DEFAULT_CONFIG_RESOLVER;
                xmlInputStream = theXmlResolver.getInputStream();

                LOGGER.info("Loading the default NetUI config file.  The runtime will be configured " +
                    "with a set of minimum parameters.");

                if(xmlInputStream == null)
                    throw new ConfigInitializationException("The NetUI runtime could not find the default config file.  " +
                            "The webapp may not function properly.");
            }

            if(LOGGER.isInfoEnabled())
                LOGGER.info("NetUIConfigParser -- load config: " + theXmlResolver.getResourcePath());

            configBean = parse(theXmlResolver.getResourcePath(), xmlInputStream);
        }
        finally {
            try {if(xmlInputStream != null) xmlInputStream.close();} catch(IOException ignore) {}
        }

View Full Code Here

TOP

Related Classes of org.apache.beehive.netui.util.xml.XmlInputStreamResolver

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.