当前位置: 首页>>代码示例>>Java>>正文


Java Server.getConnectors方法代码示例

本文整理汇总了Java中org.mortbay.jetty.Server.getConnectors方法的典型用法代码示例。如果您正苦于以下问题:Java Server.getConnectors方法的具体用法?Java Server.getConnectors怎么用?Java Server.getConnectors使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.mortbay.jetty.Server的用法示例。


在下文中一共展示了Server.getConnectors方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getRedirectUri

import org.mortbay.jetty.Server; //导入方法依赖的package包/类
@Override
public String getRedirectUri() throws IOException {
  if (port == -1) {
    port = getUnusedPort();
  }
  server = new Server(port);
  for (Connector c : server.getConnectors()) {
    c.setHost(host);
  }
  server.addHandler(new CallbackHandler());
  try {
    server.start();
  } catch (Exception e) {
    Throwables.propagateIfPossible(e);
    throw new IOException(e);
  }
  return "http://" + host + ":" + port + CALLBACK_PATH;
}
 
开发者ID:cchabanois,项目名称:mesfavoris,代码行数:19,代码来源:LocalServerReceiver.java

示例2: GigaServerConfiguration

import org.mortbay.jetty.Server; //导入方法依赖的package包/类
public GigaServerConfiguration( ClusterInfo info, Server server )
{
	_instanceId = info.getInstanceId();
	if ( info.getBackupId() != null )
	{
		_backupId = info.getBackupId();
	}
	_schema =info.getSchema();
	
	if ( server.getConnectors() != null )
	{
		_serverPort = server.getConnectors()[0].getPort();
	}
}
 
开发者ID:iMartinezMateu,项目名称:openbravo-pos,代码行数:15,代码来源:GigaServerConfiguration.java

示例3: JmxJettyServer

import org.mortbay.jetty.Server; //导入方法依赖的package包/类
public JmxJettyServer(Server server) {
  this.server = server;
  this.connector = server.getConnectors()[0];
}
 
开发者ID:JasonBian,项目名称:azkaban,代码行数:5,代码来源:JmxJettyServer.java

示例4: AzkabanExecutorServer

import org.mortbay.jetty.Server; //导入方法依赖的package包/类
/**
 * Constructor
 *
 * @throws Exception
 */
public AzkabanExecutorServer(Props props) throws Exception {
  this.props = props;

  int portNumber = props.getInt("executor.port", DEFAULT_PORT_NUMBER);
  int maxThreads = props.getInt("executor.maxThreads", DEFAULT_THREAD_NUMBER);

  server = new Server(portNumber);
  QueuedThreadPool httpThreadPool = new QueuedThreadPool(maxThreads);
  server.setThreadPool(httpThreadPool);

  boolean isStatsOn = props.getBoolean("executor.connector.stats", true);
  logger.info("Setting up connector with stats on: " + isStatsOn);

  for (Connector connector : server.getConnectors()) {
    connector.setStatsOn(isStatsOn);
    logger.info(String.format(
        "Jetty connector name: %s, default header buffer size: %d",
        connector.getName(), connector.getHeaderBufferSize()));
    connector.setHeaderBufferSize(props.getInt("jetty.headerBufferSize",
        DEFAULT_HEADER_BUFFER_SIZE));
    logger.info(String.format(
        "Jetty connector name: %s, (if) new header buffer size: %d",
        connector.getName(), connector.getHeaderBufferSize()));
  }

  Context root = new Context(server, "/", Context.SESSIONS);
  root.setMaxFormContentSize(MAX_FORM_CONTENT_SIZE);

  root.addServlet(new ServletHolder(new ExecutorServlet()), "/executor");
  root.addServlet(new ServletHolder(new JMXHttpServlet()), "/jmx");
  root.addServlet(new ServletHolder(new StatsServlet()), "/stats");
  root.addServlet(new ServletHolder(new ServerStatisticsServlet()), "/serverStatistics");

  root.setAttribute(ServerConstants.AZKABAN_SERVLET_CONTEXT_KEY, this);

  executionLoader = createExecLoader(props);
  projectLoader = createProjectLoader(props);
  runnerManager =
      new FlowRunnerManager(props, executionLoader, projectLoader, this
          .getClass().getClassLoader());

  JmxJobMBeanManager.getInstance().initialize(props);

  // make sure this happens before
  configureJobCallback(props);

  configureMBeanServer();
  configureMetricReports();

  SystemMemoryInfo.init(props.getInt("executor.memCheck.interval", 30));

  loadCustomJMXAttributeProcessor(props);

  try {
    server.start();
  } catch (Exception e) {
    logger.warn(e);
    Utils.croak(e.getMessage(), 1);
  }

  logger.info("Azkaban Executor Server started on port " + portNumber);
}
 
开发者ID:JasonBian,项目名称:azkaban,代码行数:68,代码来源:AzkabanExecutorServer.java


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