本文整理汇总了Java中org.eclipse.jetty.server.handler.ContextHandler.start方法的典型用法代码示例。如果您正苦于以下问题:Java ContextHandler.start方法的具体用法?Java ContextHandler.start怎么用?Java ContextHandler.start使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jetty.server.handler.ContextHandler
的用法示例。
在下文中一共展示了ContextHandler.start方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addHandler
import org.eclipse.jetty.server.handler.ContextHandler; //导入方法依赖的package包/类
public void addHandler(final Domain domain) {
ContextHandler handler = domainHandlerFactory.create(domain);
try {
parent.addHandler(handler);
// Do not remove next line, handler should be managed to join group lifecycle when server
// is already in STARTED state
parent.manage(handler);
handler.start();
logger.info("Security domain {} has been been published on path {}", domain.getName(), handler.getContextPath());
} catch (Exception ex) {
logger.error("Unable to add a new handler", ex);
}
}
开发者ID:gravitee-io,项目名称:graviteeio-access-management,代码行数:16,代码来源:SecurityDomainHandlerCollection.java
示例2: doStart
import org.eclipse.jetty.server.handler.ContextHandler; //导入方法依赖的package包/类
@Override
protected void doStart() throws Exception {
Resource resource = Resource.newResource(webapp);
File file = resource.getFile();
if (!resource.exists())
throw new IllegalStateException("WebApp resouce does not exist "+resource);
String lcName=file.getName().toLowerCase(Locale.ENGLISH);
if (lcName.endsWith(".xml")) {
XmlConfiguration xmlc = new XmlConfiguration(resource.getURI().toURL());
xmlc.getIdMap().put("Server", contexts.getServer());
xmlc.getProperties().put("jetty.home",System.getProperty("jetty.home","."));
xmlc.getProperties().put("jetty.base",System.getProperty("jetty.base","."));
xmlc.getProperties().put("jetty.webapp",file.getCanonicalPath());
xmlc.getProperties().put("jetty.webapps",file.getParentFile().getCanonicalPath());
xmlc.getProperties().putAll(properties);
handler = (ContextHandler)xmlc.configure();
} else {
WebAppContext wac=new WebAppContext();
wac.setWar(webapp);
wac.setContextPath("/");
}
contexts.addHandler(handler);
if (contexts.isRunning())
handler.start();
}
示例3: start
import org.eclipse.jetty.server.handler.ContextHandler; //导入方法依赖的package包/类
private void start(ContextHandler contextHandler) {
try {
contextHandler.start();
} catch (Exception e) {
throw new RuntimeException("Error starting context: " + contextHandler.getDisplayName(), e);
}
}