Package org.mortbay.xml

Examples of org.mortbay.xml.XmlConfiguration


            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


        // the webapp being deployed.
        Resource resource = Resource.newResource(filename);       
        if (!resource.exists())
            return null;

        XmlConfiguration xmlConfiguration=new XmlConfiguration(resource.getURL());
        HashMap properties = new HashMap();
        properties.put("Server", _contexts.getServer());
        if (_configMgr!=null)
            properties.putAll(_configMgr.getProperties());
          
        xmlConfiguration.setProperties(properties);
        ContextHandler context=(ContextHandler)xmlConfiguration.configure();
        return context;
    }
View Full Code Here

    }
  }
 
  public void run() {
    server = new Server();
    XmlConfiguration configuration;
    try {
      configuration = new XmlConfiguration(serverConf);
      configuration.configure(server);
      server.start();
    } catch (Exception e) {
      log.error(ExceptionUtil.getStackTrace(e));
    }    
  }
View Full Code Here

     */
    public void start( DirectoryService dirService ) throws Exception
    {
        this.dirService = dirService;
       
        XmlConfiguration jettyConf = null;

        if ( confFile != null )
        {
            jettyConf = new XmlConfiguration( new FileInputStream( confFile ) );

            LOG.info( "configuring jetty http server from the configuration file {}", confFile );

            try
            {
                jetty = new Server();
                jettyConf.configure( jetty );
                configured = true;
            }
            catch ( Exception e )
            {
                LOG.error( I18n.err( I18n.ERR_120 ) );
View Full Code Here

            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

      configurationClasses.add("org.mortbay.jetty.plus.webapp.EnvConfiguration");
      configurationClasses.addAll(Arrays.asList(bb.getConfigurationClasses()));
      bb.setConfigurationClasses(configurationClasses.toArray(new String[0]));
     
      Resource jettyEnvXml = Resource.newResource("src/main/webapp/WEB-INF/jetty-env.xml");
      XmlConfiguration config = new XmlConfiguration(jettyEnvXml.getURL());
      config.configure(bb);
     
      server.addHandler(bb);

      try
      {
View Full Code Here

        {
            LOG.warn( "Neither configuration file nor web apps were configured for the http server, skipping initialization." );
            return;
        }

        XmlConfiguration jettyConf = null;

        if ( confFile != null )
        {
            jettyConf = new XmlConfiguration( new FileInputStream( confFile ) );

            LOG.info( "configuring jetty http server from the configuration file {}", confFile );

            try
            {
                jetty = new Server();
                jettyConf.configure( jetty );
                configured = true;
            }
            catch ( Exception e )
            {
                LOG.error( "Failed to configure the jetty http server" );
View Full Code Here

        configFile = new File(persvrHome + sep + "etc" + sep + "jetty.xml");
        if (!configFile.exists())
          throw new RuntimeException("Couldn't find a valid jetty.xml config in your instance, or in the Persevere installation.");
      }

      XmlConfiguration xmlconfig = new XmlConfiguration(new FileInputStream(configFile));
      Map props = xmlconfig.getProperties();
      props.put("port", port);
      xmlconfig.configure(server);

      WebAppContext webapp = new WebAppContext();
      webapp.setResourceBase(instancePath);

      Resource resource = InheritingFileResource.newResource(instancePath, persvrHome);
View Full Code Here


    if(configs.getJettyXML() != null && !"".equals(configs.getJettyXML().trim())){
      System.err.println("Loading Jetty.xml:"+configs.getJettyXML());
      try{
        XmlConfiguration configuration = new XmlConfiguration(
            new File(configs.getJettyXML()).toURI().toURL());
        configuration.configure(server);
      }catch(Exception ex){
        System.err.println("Exception happened when loading Jetty.xml:");
        ex.printStackTrace();
      }
    }
View Full Code Here

        for(int i=0; i<this.configurationLocations.length; i++)
        {
            String currConfigurationLocation = this.configurationLocations[i];
            this.getLogger().info("Loading the Jetty serviceConfiguration file : " + currConfigurationLocation);
            InputStream is = this.locate(this.serviceApplicationDir, currConfigurationLocation);
            XmlConfiguration configuration = new XmlConfiguration(is);
            configuration.configure(currServer);
            is.close();
        }

        this.server = currServer;
    }
View Full Code Here

TOP

Related Classes of org.mortbay.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.