• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java EnvConfiguration类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.eclipse.jetty.plus.webapp.EnvConfiguration的典型用法代码示例。如果您正苦于以下问题:Java EnvConfiguration类的具体用法?Java EnvConfiguration怎么用?Java EnvConfiguration使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



EnvConfiguration类属于org.eclipse.jetty.plus.webapp包,在下文中一共展示了EnvConfiguration类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: main

import org.eclipse.jetty.plus.webapp.EnvConfiguration; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
	int port = 8080;
	Server server = new Server(port);
	

	WebAppContext context = new WebAppContext();
       context.setWar("./src/main/webapp");
	context.setConfigurations(new Configuration[] {
			new AnnotationConfiguration(), new WebXmlConfiguration(),
			new WebInfConfiguration(), new TagLibConfiguration(),
			new PlusConfiguration(), new MetaInfConfiguration(),
			new FragmentConfiguration(), new EnvConfiguration() });

	context.setContextPath("/");
	context.setParentLoaderPriority(true);
	server.setHandler(context);
	server.start();
	server.dump(System.err);
	server.join();
}
 
开发者ID:extrema,项目名称:jetty-embedded,代码行数:21,代码来源:EmbedMe.java


示例2: createConfigurations

import org.eclipse.jetty.plus.webapp.EnvConfiguration; //导入依赖的package包/类
private Configuration[] createConfigurations() {
    Configuration[] configurations = {
            new AnnotationConfiguration(),
            new WebInfConfiguration(),
            new WebXmlConfiguration(),
            new MetaInfConfiguration(),
            new FragmentConfiguration(),
            new EnvConfiguration(),
            new PlusConfiguration(),
            new JettyWebXmlConfiguration()
    };

    return configurations;
}
 
开发者ID:otsecbsol,项目名称:linkbinder,代码行数:15,代码来源:Application.java


示例3: createEnvConfiguration

import org.eclipse.jetty.plus.webapp.EnvConfiguration; //导入依赖的package包/类
protected EnvConfiguration createEnvConfiguration() {
    EnvConfiguration envConfiguration = new EnvConfiguration();
    if (jettyEnvPathUrl != null) {
        envConfiguration.setJettyEnvXml(jettyEnvPathUrl);
    }
    return envConfiguration;
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:8,代码来源:CubaJettyServer.java


示例4: JettyConsoleWebappContext

import org.eclipse.jetty.plus.webapp.EnvConfiguration; //导入依赖的package包/类
public JettyConsoleWebappContext(HandlerContainer parent, String webApp, String contextPath) {
    super(parent, webApp, contextPath);
    setConfigurations(new Configuration[]{
            new WebInfConfiguration(),
            new WebXmlConfiguration(),
            new MetaInfConfiguration(),
            new FragmentConfiguration(),
            new EnvConfiguration(),
            new org.eclipse.jetty.plus.webapp.PlusConfiguration(),
            new AnnotationConfiguration(),
            new JettyWebXmlConfiguration()
    });
}
 
开发者ID:eirbjo,项目名称:jetty-console,代码行数:14,代码来源:JettyConsoleWebappContext.java


示例5: createClassList

import org.eclipse.jetty.plus.webapp.EnvConfiguration; //导入依赖的package包/类
private Configuration.ClassList createClassList() {

        Configuration.ClassList classList = new Configuration.ClassList(new String[0]);

        classList.add(AnnotationConfiguration.class.getName());
        classList.add(WebInfConfiguration.class.getName());
        classList.add(WebXmlConfiguration.class.getName());
        classList.add(MetaInfConfiguration.class.getName());
        classList.add(FragmentConfiguration.class.getName());
        classList.add(JettyWebXmlConfiguration.class.getName());
        classList.add(EnvConfiguration.class.getName());
        classList.add(PlusConfiguration.class.getName());

        return classList;
    }
 
开发者ID:kumuluz,项目名称:kumuluzee,代码行数:16,代码来源:JettyFactory.java


示例6: JettyLaucher

import org.eclipse.jetty.plus.webapp.EnvConfiguration; //导入依赖的package包/类
JettyLaucher(final Properties props) {
	String host = props.getProperty("host", "127.0.0.1");
	int port = Integer.parseInt(props.getProperty("port", "8080"));
	int timeout = Integer.parseInt(props.getProperty("timeoutSec", "900"));
	String baseDir  = props.getProperty("baseDir", "webapp");
	logger.info("Try to start server [{}:{}], baseDir={}, connection-timeout={}sec.", host, port, baseDir, timeout);
	System.setProperty(Constants.SYSPROP_DIR_WEBAPP, baseDir);

       // Handler for multiple web apps
       HandlerCollection handlers = new HandlerCollection();
       
       webAppContext = new WebAppContext();
       webAppContext.setContextPath("/");
       webAppContext.setAttribute("org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern", 
               ".*/classes/*");
       webAppContext.setResourceBase(baseDir);
       webAppContext.setConfigurations(new Configuration[] {
       	    new AnnotationConfiguration(), new WebInfConfiguration(),
               new PlusConfiguration(), new MetaInfConfiguration(),
               new FragmentConfiguration(), new EnvConfiguration()
       	});
       handlers.addHandler(webAppContext);
       
	ServerConnector connector = new ServerConnector(server);
	connector.setHost(host);
	connector.setPort(port);
	connector.setIdleTimeout(timeout * 1000);
	server.addConnector(connector);
	 
	server.setHandler(handlers);
}
 
开发者ID:th-schwarz,项目名称:bacoma,代码行数:32,代码来源:JettyLaucher.java


示例7: createWebAppContext

import org.eclipse.jetty.plus.webapp.EnvConfiguration; //导入依赖的package包/类
private WebAppContext createWebAppContext(String path, File war) throws MalformedURLException {
	WebAppContext webAppContext = new WebAppContext();
	webAppContext.setContextPath(path);
	webAppContext.setParentLoaderPriority(false);
	if (war == null) {
		webAppContext.setWar(Main.class.getProtectionDomain().getCodeSource().getLocation().toExternalForm());
	} else {
		webAppContext.setWar(war.toURI().toURL().toExternalForm());
	}
	webAppContext.setConfigurations(new Configuration[] { new AnnotationConfiguration(), new WebInfConfiguration(),
			new WebXmlConfiguration(), new MetaInfConfiguration(), new FragmentConfiguration(),
			new EnvConfiguration(), new PlusConfiguration(), new JettyWebXmlConfiguration() });
	return webAppContext;
}
 
开发者ID:agwlvssainokuni,项目名称:springapp,代码行数:15,代码来源:Main.java


示例8: testCluster

import org.eclipse.jetty.plus.webapp.EnvConfiguration; //导入依赖的package包/类
@Test
public void testCluster() throws Exception {
	
	String projectBaseDirectory = System.getProperty("user.dir");
	
	//
	// Create master node
	//
	Server masterServer = new Server(8080);

	WebAppContext masterContext = new WebAppContext();
	masterContext.setDescriptor(projectBaseDirectory + "/target/vaporware/WEB-INF/web.xml");
	masterContext.setResourceBase(projectBaseDirectory + "/target/vaporware");
	masterContext.setContextPath("/");
	masterContext.setConfigurations(
			new Configuration[] { 
					new WebInfConfiguration(),
					new WebXmlConfiguration(),
					new MetaInfConfiguration(), 
					new FragmentConfiguration(),
					new EnvConfiguration(),
					new PlusConfiguration(),
					new AnnotationConfiguration(), 
					new JettyWebXmlConfiguration(),
					new TagLibConfiguration()
			}
	);
	masterContext.setParentLoaderPriority(true);

	masterServer.setHandler(masterContext);
	masterServer.start();
	//masterServer.join();

	//
	// Create slave node
	//
	Server slaveServer = new Server(8181);

	WebAppContext slaveContext = new WebAppContext();
	slaveContext.setDescriptor(projectBaseDirectory + "/target/vaporware/WEB-INF/web-slave.xml");
	slaveContext.setResourceBase(projectBaseDirectory + "/target/vaporware");
	slaveContext.setContextPath("/");
	slaveContext.setConfigurations(
			new Configuration[] { 
					new WebInfConfiguration(),
					new WebXmlConfiguration(),
					new MetaInfConfiguration(), 
					new FragmentConfiguration(),
					new EnvConfiguration(),
					new PlusConfiguration(),
					new AnnotationConfiguration(), 
					new JettyWebXmlConfiguration(),
					new TagLibConfiguration()
			}
	);
	slaveContext.setParentLoaderPriority(true);

	slaveServer.setHandler(slaveContext);
	slaveServer.start();
	//slaveServer.join();
	
	// Try to let the user terminate the Jetty server instances gracefully.  This won't work in an environment like Eclipse, if 
	// console input can't be received.  However, even in that that case you will be able to kill the Maven process without 
	// a Java process lingering around (as would be the case if you used "Sever.join()" to pause execution of this thread).
	System.out.println("PRESS <ENTER> TO HALT SERVERS (or kill the Maven process)...");
	Scanner scanner = new Scanner(System.in);
	String line = scanner.nextLine();
	System.out.println(line);
	scanner.close();
	masterServer.stop();
	slaveServer.stop();
	System.out.println("Servers halted");
	
}
 
开发者ID:v5developer,项目名称:maven-framework-project,代码行数:75,代码来源:ClusterTest.java



注:本文中的org.eclipse.jetty.plus.webapp.EnvConfiguration类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java BitmapEncoder类代码示例发布时间:2022-05-22
下一篇:
Java MediaBox类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap