本文整理匯總了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);
}
}