當前位置: 首頁>>代碼示例>>Java>>正文


Java ContextHandlerCollection.addHandler方法代碼示例

本文整理匯總了Java中org.mortbay.jetty.handler.ContextHandlerCollection.addHandler方法的典型用法代碼示例。如果您正苦於以下問題:Java ContextHandlerCollection.addHandler方法的具體用法?Java ContextHandlerCollection.addHandler怎麽用?Java ContextHandlerCollection.addHandler使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.mortbay.jetty.handler.ContextHandlerCollection的用法示例。


在下文中一共展示了ContextHandlerCollection.addHandler方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: configureHandlers

import org.mortbay.jetty.handler.ContextHandlerCollection; //導入方法依賴的package包/類
private void configureHandlers(ContextHandlerCollection contexts)
{
    // adding extra context handlers
    Iterator handlersIterator = contextHandlers.iterator();
    while (handlersIterator.hasNext())
    {
        ContextHandler contextHandler = (ContextHandler) handlersIterator.next();
        contexts.addHandler(contextHandler);
    }
}
 
開發者ID:iMartinezMateu,項目名稱:openbravo-pos,代碼行數:11,代碼來源:WebApplicationProxyImpl.java

示例2: doInitialize

import org.mortbay.jetty.handler.ContextHandlerCollection; //導入方法依賴的package包/類
protected void doInitialize()
{
   super.doInitialize();
   
   try
   {
      if( this.server == null) this.server = new Server();
      
      HandlerCollection handlers = new HandlerCollection();
      ContextHandlerCollection contexts = new ContextHandlerCollection();
      handlers.setHandlers(new Handler[]{contexts,new DefaultHandler()});
      server.setHandler(handlers);
      
      this.adminCustomContext = new WebAppContext();
      this.adminCustomContext.setWar(this.customAdministrationWar.stringValue());
      this.adminCustomContext.setContextPath("/adminCustom");
      this.adminCustomContext.setParentLoaderPriority(true);
      contexts.addHandler(this.adminCustomContext);
      if (this.adminCustomContext.isStarted()) this.adminCustomContext.start();

      if( !this.server.isStarted() ) this.server.start();
   }
   catch (Exception e) 
   {
      super.logError("Error creating AdministrationWebAppHandler!", e);
      throw new StatusTransitionException("Error creating AdministrationWebAppHandler!", e);
   } 
}
 
開發者ID:tolo,項目名稱:JServer,代碼行數:29,代碼來源:CustomAdministrationWebAppHandler.java

示例3: HttpServer

import org.mortbay.jetty.handler.ContextHandlerCollection; //導入方法依賴的package包/類
public HttpServer(String name, String bindAddress, int port,
    boolean findPort, Connector connector, Configuration conf,
    String[] pathSpecs) throws IOException {
  this.webServer = new Server();
  this.findPort = findPort;

  if (connector == null) {
    listenerStartedExternally = false;
    listener = createBaseListener(conf);
    listener.setHost(bindAddress);
    listener.setPort(port);

  } else {
    listenerStartedExternally = true;
    listener = connector;
  }
  webServer.addConnector(listener);

  SessionIdManager sessionIdManager = new HashSessionIdManager(new Random(System.currentTimeMillis()));
  webServer.setSessionIdManager(sessionIdManager);

  int maxThreads = conf.getInt("tajo.http.maxthreads", -1);
  // If HTTP_MAX_THREADS is not configured, QueueThreadPool() will use the
  // default value (currently 250).
  QueuedThreadPool threadPool = maxThreads == -1 ? new QueuedThreadPool()
      : new QueuedThreadPool(maxThreads);
  webServer.setThreadPool(threadPool);

  final String appDir = getWebAppsPath(name);
  ContextHandlerCollection contexts = new ContextHandlerCollection();

  webAppContext = new WebAppContext();
  webAppContext.setDisplayName(name);
  webAppContext.setContextPath("/");
  webAppContext.setResourceBase(appDir + "/" + name);
  webAppContext.setDescriptor(appDir + "/" + name + "/WEB-INF/web.xml");

  contexts.addHandler(webAppContext);
  webServer.setHandler(contexts);

  addDefaultApps(contexts, appDir, conf);
}
 
開發者ID:apache,項目名稱:tajo,代碼行數:43,代碼來源:HttpServer.java


注:本文中的org.mortbay.jetty.handler.ContextHandlerCollection.addHandler方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。