Package org.eclipse.jetty.xml

Examples of org.eclipse.jetty.xml.XmlConfiguration


        //the pom to override the context xml file, but as the other mojos all
        //configure a WebAppContext in the pom (the <webApp> element), it is
        //already configured by the time the context xml file is applied.
        if (contextXml != null)
        {
            XmlConfiguration xmlConfiguration = new XmlConfiguration(Resource.toURL(contextXml));
            xmlConfiguration.getIdMap().put("Server",server);
            xmlConfiguration.configure(webApp);
        }

        this.server.addWebApplication(webApp);

        System.err.println("STOP PORT="+stopPort+", STOP KEY="+stopKey);
View Full Code Here


            return;
       
        for ( File xmlFile : jettyXmls )
        {
            LOG.info( "Configuring Jetty from xml configuration file = " + xmlFile.getCanonicalPath() );       
            XmlConfiguration xmlConfiguration = new XmlConfiguration(Resource.toURL(xmlFile));
            xmlConfiguration.configure(this.server);
        }
    }
View Full Code Here

public class JettyEmbedIntegration {

    public static void main(String args[]) throws Exception {
        Resource jetty_xml = Resource.newSystemResource("jetty/jetty.xml");
        XmlConfiguration configuration = new XmlConfiguration(jetty_xml.getInputStream());
        Server server = (Server) configuration.configure();
        int port = 8081;
        Connector[] connectors = server.getConnectors();
        for (Connector connector : connectors) {
            connector.setPort(port);
        }
View Full Code Here

    private String              htdocsDir;
    private ConfigClientService configClientService;

    public void afterPropertiesSet() throws Exception {
        Resource configXml = Resource.newSystemResource(config);
        XmlConfiguration configuration = new XmlConfiguration(configXml.getInputStream());
        server = (Server) configuration.configure();
        Integer port = getPort();
        if (port != null && port > 0) {
            Connector[] connectors = server.getConnectors();
            for (Connector connector : connectors) {
                connector.setPort(port);
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

        portsRange.iterate(new PortsRange.PortCallback() {
            @Override
            public boolean onPortNumber(int portNumber) {
                try {
                    Server server = null;
                    XmlConfiguration lastXmlConfiguration = null;
                    Object[] objs = new Object[jettyConfig.length];
                    Map<String, String> esProperties = jettySettings(bindHost, portNumber);

                    for (int i = 0; i < jettyConfig.length; i++) {
                        String configFile = jettyConfig[i];
                        URL config = environment.resolveConfig(configFile);
                        XmlConfiguration xmlConfiguration = new XmlConfiguration(config);

                        // Make ids of objects created in early configurations available
                        // in the later configurations
                        if (lastXmlConfiguration != null) {
                            xmlConfiguration.getIdMap().putAll(lastXmlConfiguration.getIdMap());
                        } else {
                            xmlConfiguration.getIdMap().put("ESServerTransport", JettyHttpServerTransport.this);
                            xmlConfiguration.getIdMap().put("ESClient", client);
                        }
                        // Inject elasticsearch properties
                        xmlConfiguration.getProperties().putAll(esProperties);

                        objs[i] = xmlConfiguration.configure();
                        lastXmlConfiguration = xmlConfiguration;
                    }
                    // Find jetty Server with id  jettyConfigServerId
                    Object serverObject = lastXmlConfiguration.getIdMap().get(jettyConfigServerId);
                    if (serverObject != null) {
View Full Code Here

    org.apache.log4j.Logger logger = Logger.getLogger("ShuttlServer");
    try {
      Server server = new Server();

      // TODO: Replace paths relative to /bin/
      XmlConfiguration configuration = new XmlConfiguration(new File(
          "../jetty/shuttl.xml").toURI().toURL());
      configuration.configure(server);

      // TODO: Replace paths relative to /bin/
      server.setHandler(new WebAppContext("../webapps/shuttl", "/shuttl"));
      ShuttlServer servermbean = new ShuttlServer();
      Connector connectors[] = server.getConnectors();
View Full Code Here

        this.config = jettyXml;
    }

    public void start() throws Exception {
        Resource configXml = Resource.newSystemResource(config);
        XmlConfiguration configuration = new XmlConfiguration(configXml.getInputStream());
        server = (Server) configuration.configure();

        //        Integer port = getPort();
        //        if (port != null && port > 0) {
        //            Connector[] connectors = server.getConnectors();
        //            for (Connector connector : connectors) {
View Full Code Here

TOP

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

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.