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


Java WebServer.addHandler方法代码示例

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


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

示例1: setUp

import org.apache.xmlrpc.WebServer; //导入方法依赖的package包/类
public void setUp() throws Exception {
	super.setUp();
	CURRENT_PORT++;
	fakeServer = new WebServer(CURRENT_PORT);
       handler = context.mock( Handler.class );
       fakeServer.addHandler( "greenpepper1", handler );
       fakeServer.start();

	// keep the current directory
	String origCWD = System.getProperty("user.dir");
	URL resource = getClass().getResource("/remoteagent.properties");
	System.setProperty("user.dir", FileUtils.toFile(resource).getParent());
	Agent.main(new String[0]);
	System.setProperty("user.dir",origCWD);

}
 
开发者ID:strator-dev,项目名称:greenpepper,代码行数:17,代码来源:AgentTest.java

示例2: XmlRpcFileManager

import org.apache.xmlrpc.WebServer; //导入方法依赖的package包/类
/**
 * <p> Creates a new XmlRpcFileManager with the given metadata store factory, and the given data store factory, on the
 * given port. </p>
 *
 * @param port The web server port to run the XML Rpc server on, defaults to 1999.
 */
public XmlRpcFileManager(int port) throws Exception {
  webServerPort = port;

  // start up the web server
  webServer = new WebServer(webServerPort);
  webServer.addHandler("filemgr", this);
  webServer.start();

  List<String> propertiesFiles = new ArrayList<>();

  // set up the configuration, if there is any
  if (System.getProperty("org.apache.oodt.cas.filemgr.properties") != null) {
    propertiesFiles.add(System.getProperty("org.apache.oodt.cas.filemgr.properties"));
  }

  configurationManager = ConfigurationManagerFactory.getConfigurationManager(Component.FILE_MANAGER, propertiesFiles);
  configurationManager.addConfigurationListener(configurationListener);
  this.loadConfiguration();

  LOG.log(Level.INFO, "File Manager started by " + System.getProperty("user.name", "unknown"));
}
 
开发者ID:apache,项目名称:oodt,代码行数:28,代码来源:XmlRpcFileManager.java

示例3: PydevConsoleCommunication

import org.apache.xmlrpc.WebServer; //导入方法依赖的package包/类
/**
 * Initializes the xml-rpc communication.
 *
 * @param port    the port where the communication should happen.
 * @param process this is the process that was spawned (server for the XML-RPC)
 * @throws MalformedURLException
 */
public PydevConsoleCommunication(Project project, int port, Process process, int clientPort) throws Exception {
  super(project);

  //start the server that'll handle input requests
  myWebServer = new WebServer(clientPort, null);
  myWebServer.addHandler("$default", this);
  this.myWebServer.start();

  this.myClient = new PydevXmlRpcClient(process, port);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:PydevConsoleCommunication.java

示例4: startWebServer

import org.apache.xmlrpc.WebServer; //导入方法依赖的package包/类
private void startWebServer()
{
    ws = new WebServer( 9005 );
    handler = new Mock( Handler.class );
    ws.addHandler( "greenpepper1", handler.proxy() );
    ws.start();
}
 
开发者ID:strator-dev,项目名称:greenpepper,代码行数:8,代码来源:SpecificationRunnerMojoTest.java

示例5: setupWebServer

import org.apache.xmlrpc.WebServer; //导入方法依赖的package包/类
public void setupWebServer() throws IOException {
    m_logger.info("XmlrpcAnticipator starting on port number " + m_port);

    m_webServer = new WebServer(m_port);
    m_webServer.addHandler("$default", this);
    m_webServer.start();
    waitForStartup();

    m_logger.info("XmlrpcAnticipator running on port number " + m_port);
}
 
开发者ID:qoswork,项目名称:opennmszh,代码行数:11,代码来源:XmlrpcAnticipator.java

示例6: XmlRpcResourceManager

import org.apache.xmlrpc.WebServer; //导入方法依赖的package包/类
public XmlRpcResourceManager(int port) throws IOException {
    List<String> propertiesFiles = new ArrayList<>();
    // set up the configuration, if there is any
    if (System.getProperty("org.apache.oodt.cas.resource.properties") != null) {
        propertiesFiles.add(System.getProperty("org.apache.oodt.cas.resource.properties"));
    }

    configurationManager = ConfigurationManagerFactory.getConfigurationManager(Component.RESOURCE_MANAGER, propertiesFiles);
    try {
        configurationManager.loadConfiguration();
    } catch (Exception e) {
        LOG.log(Level.SEVERE, "Unable to load configuration", e);
        throw new IOException("Unable to load configuration", e);
    }

    String schedulerClassStr = System.getProperty(
            "resource.scheduler.factory",
            "org.apache.oodt.cas.resource.scheduler.LRUSchedulerFactory");

    scheduler = GenericResourceManagerObjectFactory
            .getSchedulerServiceFromFactory(schedulerClassStr);

    // start up the scheduler
    new Thread(scheduler).start();



    // start up the web server
    webServer = new WebServer(port);
    webServer.addHandler("resourcemgr", this);
    webServer.start();

    LOG.log(Level.INFO, "Resource Manager started by "
            + System.getProperty("user.name", "unknown"));

}
 
开发者ID:apache,项目名称:oodt,代码行数:37,代码来源:XmlRpcResourceManager.java

示例7: XmlRpcBatchStub

import org.apache.xmlrpc.WebServer; //导入方法依赖的package包/类
public XmlRpcBatchStub(int port) {
    webServerPort = port;

    // start up the web server
    webServer = new WebServer(webServerPort);
    webServer.addHandler("batchstub", this);
    webServer.start();

    jobThreadMap = new ConcurrentHashMap();

    LOG.log(Level.INFO, "XmlRpc Batch Stub started by "
                        + System.getProperty("user.name", "unknown"));
}
 
开发者ID:apache,项目名称:oodt,代码行数:14,代码来源:XmlRpcBatchStub.java

示例8: startUp

import org.apache.xmlrpc.WebServer; //导入方法依赖的package包/类
@Override
public boolean startUp() throws Exception {
    webServer = new WebServer(this.port);
    webServer.addHandler("filemgr", this);
    webServer.start();
    this.fileManager = new FileManager();
    this.loadConfiguration();
    return true;
}
 
开发者ID:apache,项目名称:oodt,代码行数:10,代码来源:XmlRpcFileManagerServer.java

示例9: XmlRpcWorkflowManager

import org.apache.xmlrpc.WebServer; //导入方法依赖的package包/类
public XmlRpcWorkflowManager(int port) {
  Preconditions.checkArgument(port > 0, "Must specify a port greater than 0");

  List<String> propertiesFiles = new ArrayList<>();
  String configFile = System.getProperty(PROPERTIES_FILE_PROPERTY);
  if (configFile != null) {
    propertiesFiles.add(configFile);
  }

  configurationManager= ConfigurationManagerFactory.getConfigurationManager(Component.WORKFLOW_MANAGER,propertiesFiles);
  try {
    configurationManager.loadConfiguration();
  } catch (Exception e) {
    LOG.log(Level.SEVERE, "Unable to load configuration", e);
    throw new IllegalStateException("Unable to load configuration", e);
  }

  engine = getWorkflowEngineFromProperty();
  engine.setWorkflowManagerUrl(safeGetUrlFromString("http://"
                                                    + getHostname() + ":" + port));
  repo = getWorkflowRepositoryFromProperty();

  // start up the web server
  webServer = new WebServer(port);
  webServer.addHandler(XML_RPC_HANDLER_NAME, this);
  webServer.start();

  LOG.log(Level.INFO, "Workflow Manager started by "
                      + System.getProperty("user.name", "unknown"));
}
 
开发者ID:apache,项目名称:oodt,代码行数:31,代码来源:XmlRpcWorkflowManager.java

示例10: startCrawling

import org.apache.xmlrpc.WebServer; //导入方法依赖的package包/类
public void startCrawling() {
    // start up the web server
    WebServer server = new WebServer(this.daemonPort);
    server.addHandler("crawldaemon", this);
    server.start();

    LOG.log(Level.INFO, "Crawl Daemon started by "
            + System.getProperty("user.name", "unknown"));

    while (running) {
        // okay, time to crawl
        long timeBefore = System.currentTimeMillis();
        crawler.crawl();
        long timeAfter = System.currentTimeMillis();
        milisCrawling += (timeAfter - timeBefore);
        numCrawls++;

        LOG.log(Level.INFO, "Sleeping for: [" + waitInterval + "] seconds");
        // take a nap
        try {
            Thread.currentThread().sleep(waitInterval * 1000);
        } catch (InterruptedException ignore) {
        }
    }

    LOG.log(Level.INFO, "Crawl Daemon: Shutting down gracefully");
    LOG.log(Level.INFO, "Num Crawls: [" + this.numCrawls + "]");
    LOG.log(Level.INFO, "Total time spent crawling: ["
            + (this.milisCrawling / DOUBLE) + "] seconds");
    LOG.log(Level.INFO, "Average Crawl Time: ["
            + (this.getAverageCrawlTime() / DOUBLE) + "] seconds");
    server.shutdown();
}
 
开发者ID:apache,项目名称:oodt,代码行数:34,代码来源:CrawlDaemon.java

示例11: startWebServer

import org.apache.xmlrpc.WebServer; //导入方法依赖的package包/类
private void startWebServer() {
    ws = new WebServer(19005);
    handler = new Mock(Handler.class);
    ws.addHandler("greenpepper1", handler.proxy());
    ws.start();
}
 
开发者ID:strator-dev,项目名称:greenpepper,代码行数:7,代码来源:SpecificationDownloaderMojoTest.java


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