Package org.eclipse.jetty.xml

Examples of org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration


            return;
        }
        try
        {
            InputStream is = IOUtils.getResourceAsStream(configFile, getClass());
            XmlConfiguration config = new XmlConfiguration(is);

            String appHome =
                muleContext.getRegistry().lookupObject(MuleProperties.APP_HOME_DIRECTORY_PROPERTY);
            if (appHome == null)
            {
                // Mule IDE sets app.home as part of the launch config it creates
                appHome = System.getProperty(MuleProperties.APP_HOME_DIRECTORY_PROPERTY);
            }

            if (appHome != null)
            {
                config.getProperties().put(MuleProperties.APP_HOME_DIRECTORY_PROPERTY, appHome);
            }

            config.configure(httpServer);
        }
        catch (Exception e)
        {
            throw new InitialisationException(e, this);
        }
View Full Code Here


            wah.setTempDirectory(new File("target/work"));

            String jettyConfigFile = System.getProperty("jetty.config.file");
            if (jettyConfigFile != null) {
                log.info("Loading Jetty config from file: " + jettyConfigFile);
                (new XmlConfiguration(new FileInputStream(jettyConfigFile))).configure(jettyServer);
            }

           jettyServer.start();

            // use this to test normal stop behaviour, that is, to check stuff that
View Full Code Here

       
    public static void initIdpServer() {
        if (idpServer == null) {
            try {
                Resource testServerConfig = Resource.newSystemResource("idp-server.xml");
                XmlConfiguration configuration = new XmlConfiguration(testServerConfig.getInputStream());
                idpServer = (Server)configuration.configure();  
               
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
View Full Code Here

   
    public static void initRpServer() {
        if (rpServer == null) {
            try {
                Resource testServerConfig = Resource.newSystemResource("rp-server.xml");
                XmlConfiguration configuration = new XmlConfiguration(testServerConfig.getInputStream());
                rpServer = (Server)configuration.configure();  
               
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
View Full Code Here

       
    public static void initIdpServer() {
        if (idpServer == null) {
            try {
                Resource testServerConfig = Resource.newSystemResource("idp-server.xml");
                XmlConfiguration configuration = new XmlConfiguration(testServerConfig.getInputStream());
                idpServer = (Server)configuration.configure();  
               
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
View Full Code Here

   
    public static void initRpServer() {
        if (rpServer == null) {
            try {
                Resource testServerConfig = Resource.newSystemResource("rp-server.xml");
                XmlConfiguration configuration = new XmlConfiguration(testServerConfig.getInputStream());
                rpServer = (Server)configuration.configure();  
               
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
View Full Code Here

    private static Server configServer(String jettyConfig)
    {
        try {
            serverLog.info("Jetty server config file = "+jettyConfig) ;
            Server server = new Server() ;
            XmlConfiguration configuration = new XmlConfiguration(new FileInputStream(jettyConfig)) ;
            configuration.configure(server) ;
            return server ;
        } catch (Exception ex)
        {
            serverLog.error("SPARQLServer: Failed to configure server: " + ex.getMessage(), ex) ;
            throw new FusekiException("Failed to configure a server using configuration file '"+jettyConfig+"'") ;
View Full Code Here

                };

                try
                {
                    localContextRoot.getRoot().addListener(listener);
                    XmlConfiguration configuration = new XmlConfiguration(jettyEnvXmlUrl);
                    configuration.configure(context);
                }
                finally
                {
                    localContextRoot.getRoot().removeListener(listener);
                    context.setAttribute(JETTY_ENV_BINDINGS,bindings);
View Full Code Here

    public void applyJettyXml() throws Exception
    {
        if (getJettyXmlFiles() == null)
            return;

        XmlConfiguration last = null;
        for ( File xmlFile : getJettyXmlFiles() )
        {
            getLog().info( "Configuring Jetty from xml configuration file = " + xmlFile.getCanonicalPath() );       
            XmlConfiguration xmlConfiguration = new XmlConfiguration(Resource.toURL(xmlFile));
           
            //chain ids from one config file to another
            if (last == null)
                xmlConfiguration.getIdMap().put("Server", this.server);
            else
                xmlConfiguration.getIdMap().putAll(last.getIdMap());
           
            //Set the system properties each time in case the config file set a new one
            Enumeration<?> ensysprop = System.getProperties().propertyNames();
            while (ensysprop.hasMoreElements())
            {
                String name = (String)ensysprop.nextElement();
                xmlConfiguration.getProperties().put(name,System.getProperty(name));
            }
            last = xmlConfiguration;
            xmlConfiguration.configure();
        }
    }
View Full Code Here

        //CAUTION: if you've defined a <webApp> element then the
        //context xml file can OVERRIDE those settings
        if (contextXml != null)
        {
            File file = FileUtils.getFile(contextXml);
            XmlConfiguration xmlConfiguration = new XmlConfiguration(Resource.toURL(file));
            getLog().info("Applying context xml file "+contextXml);
            xmlConfiguration.configure(webApp);  
        }
       
        //If no contextPath was specified, go with default of project artifactid
        String cp = webApp.getContextPath();
        if (cp == null || "".equals(cp))
View Full Code Here

TOP

Related Classes of org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration

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.