org.mortbay.jetty.Server.addHandler()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(6.5k)|赞(0)|评价(0)|浏览(136)

本文整理了Java中org.mortbay.jetty.Server.addHandler()方法的一些代码示例,展示了Server.addHandler()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Server.addHandler()方法的具体详情如下:
包路径:org.mortbay.jetty.Server
类名称:Server
方法名:addHandler

Server.addHandler介绍

暂无

代码示例

代码示例来源:origin: pentaho/pentaho-kettle

public String getRedirectUri() throws IOException {
 if ( this.port == -1 ) {
  this.port = getUnusedPort();
 }
 this.server = new Server( this.port );
 Connector[] arr$ = this.server.getConnectors();
 int len$ = arr$.length;
 for ( int i$ = 0; i$ < len$; ++i$ ) {
  Connector c = arr$[i$];
  c.setHost( this.host );
 }
 this.server.addHandler( new CustomLocalServerReceiver.CallbackHandler() );
 try {
  this.server.start();
 } catch ( Exception var5 ) {
  Throwables.propagateIfPossible( var5 );
  throw new IOException( var5 );
 }
 return "http://" + this.host + ":" + this.port + "/Callback/success.html";
}

代码示例来源:origin: Netflix/eureka

public MockRemoteEurekaServer(int port, Map<String, Application> applicationMap,
               Map<String, Application> applicationDeltaMap) {
  this.applicationMap = applicationMap;
  this.applicationDeltaMap = applicationDeltaMap;
  ServletHandler handler = new AppsResourceHandler();
  EurekaServerConfig serverConfig = new DefaultEurekaServerConfig();
  EurekaServerContext serverContext = mock(EurekaServerContext.class);
  when(serverContext.getServerConfig()).thenReturn(serverConfig);
  handler.addFilterWithMapping(ServerRequestAuthFilter.class, "/*", 1).setFilter(new ServerRequestAuthFilter(serverContext));
  handler.addFilterWithMapping(RateLimitingFilter.class, "/*", 1).setFilter(new RateLimitingFilter(serverContext));
  server = new Server(port);
  server.addHandler(handler);
  System.out.println(String.format(
      "Created eureka server mock with applications map %s and applications delta map %s",
      stringifyAppMap(applicationMap), stringifyAppMap(applicationDeltaMap)));
}

代码示例来源:origin: testcontainers/testcontainers-java

@Before
public void setupLocalServer() throws Exception {
  // Set up a local Jetty HTTP server
  Server server = new Server();
  server.addConnector(new SocketConnector());
  ResourceHandler resourceHandler = new ResourceHandler();
  resourceHandler.setResourceBase("src/test/resources/server");
  server.addHandler(resourceHandler);
  server.start();
  // The server will have a random port assigned, so capture that
  localPort = server.getConnectors()[0].getLocalPort();
}

代码示例来源:origin: apache/tajo

public void addContext(Context ctxt, boolean isFiltered)
  throws IOException {
 webServer.addHandler(ctxt);
 defaultContexts.put(ctxt, isFiltered);
}

代码示例来源:origin: org.apache.tajo/tajo-core

public void addContext(Context ctxt, boolean isFiltered)
  throws IOException {
 webServer.addHandler(ctxt);
 defaultContexts.put(ctxt, isFiltered);
}

代码示例来源:origin: io.fabric8/fabric-hadoop

public void addContext(Context ctxt, boolean isFiltered)
  throws IOException {
 webServer.addHandler(ctxt);
 defaultContexts.put(ctxt, isFiltered);
}

代码示例来源:origin: org.apache.hama/hama-core

public void addContext(Context ctxt, boolean isFiltered) throws IOException {
 webServer.addHandler(ctxt);
 defaultContexts.put(ctxt, isFiltered);
}

代码示例来源:origin: com.facebook.hadoop/hadoop-core

public void addContext(Context ctxt, boolean isFiltered)
  throws IOException {
 webServer.addHandler(ctxt);
 defaultContexts.put(ctxt, isFiltered);
}

代码示例来源:origin: ch.cern.hadoop/hadoop-common

public void addContext(Context ctxt, boolean isFiltered) {
 webServer.addHandler(ctxt);
 addNoCacheFilter(webAppContext);
 defaultContexts.put(ctxt, isFiltered);
}

代码示例来源:origin: io.hops/hadoop-common

public void addContext(Context ctxt, boolean isFiltered)
  throws IOException {
 webServer.addHandler(ctxt);
 addNoCacheFilter(webAppContext);
 defaultContexts.put(ctxt, isFiltered);
}

代码示例来源:origin: com.github.jiayuhan-it/hadoop-common

public void addContext(Context ctxt, boolean isFiltered)
  throws IOException {
 webServer.addHandler(ctxt);
 addNoCacheFilter(webAppContext);
 defaultContexts.put(ctxt, isFiltered);
}

代码示例来源:origin: com.github.jiayuhan-it/hadoop-common

public void addContext(Context ctxt, boolean isFiltered) {
 webServer.addHandler(ctxt);
 addNoCacheFilter(webAppContext);
 defaultContexts.put(ctxt, isFiltered);
}

代码示例来源:origin: io.hops/hadoop-common

public void addContext(Context ctxt, boolean isFiltered)
  throws IOException {
 webServer.addHandler(ctxt);
 addNoCacheFilter(webAppContext);
 defaultContexts.put(ctxt, isFiltered);
}

代码示例来源:origin: io.hops/hadoop-common

public void addContext(Context ctxt, boolean isFiltered) {
 webServer.addHandler(ctxt);
 addNoCacheFilter(webAppContext);
 defaultContexts.put(ctxt, isFiltered);
}

代码示例来源:origin: ch.cern.hadoop/hadoop-common

public void addContext(Context ctxt, boolean isFiltered)
  throws IOException {
 webServer.addHandler(ctxt);
 addNoCacheFilter(webAppContext);
 defaultContexts.put(ctxt, isFiltered);
}

代码示例来源:origin: jpotts/alfresco-api-java-examples

@Override
public String getRedirectUri() throws Exception {
 server = new Server(PORT);
 for (Connector c : server.getConnectors()) {
  c.setHost(LOCALHOST);
 }
 server.addHandler(new CallbackHandler());
 server.start();
 return "http://" + LOCALHOST + ":" + PORT + CALLBACK_PATH;
}

代码示例来源:origin: net.disy.legato/legato-testing

public void addServletWithMapping(
  final String contextPath,
  final String servletClassName,
  final String servletMapping) {
 final ContextHandler contextHandler = new ContextHandler();
 contextHandler.setContextPath(contextPath);
 final ServletHandler servletHandler = new ServletHandler();
 servletHandler.addServletWithMapping(servletClassName, contextPath + servletMapping);
 contextHandler.setHandler(servletHandler);
 server.addHandler(servletHandler);
}

代码示例来源:origin: org.xworker/xworker_core

public static void createWebAppContext(ActionContext actionContext){
  Thing self = (Thing) actionContext.get("self");
  String contextPath = (String) self.doAction("getContextPath", actionContext);
  String webApp = (String) self.doAction("getWebApp", actionContext);
  
  Server server = (Server) actionContext.get("server");
  WebAppContext context = new WebAppContext(webApp, contextPath);
  server.addHandler(context);
}

代码示例来源:origin: jpotts/alfresco-api-java-examples

@Override
public String getRedirectUri() throws Exception {
 server = new Server(PORT);
 for (Connector c : server.getConnectors()) {
  c.setHost(LOCALHOST);
 }
 server.addHandler(new CallbackHandler());
 server.start();
 return "http://" + LOCALHOST + ":" + PORT + CALLBACK_PATH;
}

代码示例来源:origin: info.aduna.commons/aduna-commons-net-http-server-embedded

public EmbeddedServer(String host, int port, String contextPath, String warPath) {
  System.clearProperty("DEBUG");
  jetty = new Server();
  Connector conn = new BlockingChannelConnector();
  conn.setHost(host);
  conn.setPort(port);
  jetty.addConnector(conn);
  WebAppContext webapp = new WebAppContext();
  webapp.setContextPath(contextPath);
  webapp.setWar(warPath);
  jetty.addHandler(webapp);
}

相关文章