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


Java Context.setMaxFormContentSize方法代碼示例

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


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

示例1: AzkabanExecutorServer

import org.mortbay.jetty.servlet.Context; //導入方法依賴的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

示例2: AzkabanExecutorServer

import org.mortbay.jetty.servlet.Context; //導入方法依賴的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);

	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.setAttribute(AzkabanServletContextListener.AZKABAN_SERVLET_CONTEXT_KEY, this);
	
	
	executionLoader = createExecLoader(props);
	projectLoader = createProjectLoader(props);
	runnerManager = new FlowRunnerManager(props, executionLoader, projectLoader, this.getClass().getClassLoader());
	
	String globalPropsPath = props.getString("executor.global.properties", null);
	if (globalPropsPath == null) {
		executorGlobalProps = new Props();
	}
	else {
		executorGlobalProps = new Props(null, globalPropsPath);
	}
	runnerManager.setGlobalProps(executorGlobalProps);
	
	configureMBeanServer();

	try {
		server.start();
	} 
	catch (Exception e) {
		logger.warn(e);
		Utils.croak(e.getMessage(), 1);
	}
	
	logger.info("Azkaban Executor Server started on port " + portNumber);
}
 
開發者ID:zhizhounq,項目名稱:azkaban-customization,代碼行數:49,代碼來源:AzkabanExecutorServer.java


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