Examples of Dispatcher


Examples of com.squareup.okhttp.mockwebserver.Dispatcher

   @Test public void longContentLengthSupported() throws Exception {
      long reallyLongContent = TestUtils.isJava6() ? Integer.MAX_VALUE : Long.MAX_VALUE;

      // Setup a mock server that doesn't attempt to read the request payload.
      MockWebServer server = new MockWebServer();
      server.setDispatcher(new Dispatcher() {
         @Override public MockResponse dispatch(RecordedRequest recordedRequest) {
            return new MockResponse();
         }
      });
      server.play();
View Full Code Here

Examples of com.taobao.zeus.mvc.Dispatcher

      scheduler=new StdSchedulerFactory().getScheduler();
      scheduler.start();
    } catch (SchedulerException e) {
      ScheduleInfoLog.error("schedule start fail", e);
    }
    dispatcher=new Dispatcher();
    handler=new MasterHandler(this);
    server=new MasterServer(handler);
    server.start(port);
    master=new Master(this);
  }
View Full Code Here

Examples of com.volantis.osgi.cm.dispatcher.Dispatcher

                new DelayedReferenceContainer();

        PluginManager pluginManager =
                new PluginManagerImpl(log);

        Dispatcher dispatcher =
                new DispatcherImpl(bundleContext, log, asynchronousDispatcher,
                        delayedReferenceContainer, pluginManager);

        File rootDir = bundleContext.getDataFile("");
        if (rootDir == null) {
View Full Code Here

Examples of de.anomic.yacy.dht.Dispatcher

        this.yc = new yacyCore(this);
        InstantBusyThread.oneTimeJob(this, "loadSeedLists", yacyCore.log, 0);
        //final long startedSeedListAquisition = System.currentTimeMillis();

        // init a DHT transmission dispatcher
        this.dhtDispatcher = (this.peers.sizeConnected() == 0) ? null : new Dispatcher(
                this.indexSegments.segment(Segments.Process.LOCALCRAWLING),
                this.peers,
                true,
                10000);
View Full Code Here

Examples of de.anomic.yacy.dht.Dispatcher

                    networkName,
                    this.log,
                    this.queuesRoot);

            // init a DHT transmission dispatcher
            this.dhtDispatcher = (this.peers.sizeConnected() == 0) ? null : new Dispatcher(
                    this.indexSegments.segment(Segments.Process.LOCALCRAWLING),
                    this.peers,
                    true,
                    10000);
View Full Code Here

Examples of de.odysseus.calyxo.control.Dispatcher

      result = handle(request, response, command.getActionConfig(), e);
    }

    // dispatch request
    if (result != null) {
      Dispatcher dispatcher = pluginContext.getDefaultDispatcher();
      String name = result.getDispatcher();
      if (name == null) {
        name = command.getActionConfig().getDispatcher();
      }
      if (name != null) {
        dispatcher = pluginContext.getDispatcher(name);
        if (dispatcher == null) {
          throw new ServletException("Unknown dispatcher '" + name + "' for action '" + config.toInlineString() + "'");
        }
      }
      dispatcher.dispatch(request, response, result);
    }
  }
View Full Code Here

Examples of de.odysseus.calyxo.control.Dispatcher

    if (param == null) {
      throw new ConfigException("Missing parameter 'config' in " + config.toInlineString());
    }
    service.init(module, param.getValue());

    Dispatcher dispatcher = new PanelsDispatcher(module);
    context.setDispatcher("panels", dispatcher);
   
    param = config.getParamConfig("global");
    if (param != null && "true".equals(param.getValue())) {
      context.setDefaultDispatcher(dispatcher);
View Full Code Here

Examples of de.phleisch.app.itsucks.core.Dispatcher

    ClassPathXmlApplicationContext context =
      new ClassPathXmlApplicationContext(
          ApplicationConstants.CORE_SPRING_CONFIG_FILE);
   
    //load dispatcher from spring
    Dispatcher dispatcher = (Dispatcher) context.getBean("Dispatcher");

    //configure an download job filter
    DownloadJobFilter filter = new DownloadJobFilter();
    filter.setAllowedHostNames(new String[] {".*"});
    filter.setMaxRecursionDepth(1);
    filter.setSaveToDisk(new String[] {
        ".*jpg",
        ".*png",
        ".*gif"});
   
    //add the filter to the dispatcher
    dispatcher.addJobFilter(filter);   
   
    //create an job factory
    DownloadJobFactory jobFactory = (DownloadJobFactory)
      context.getBean("JobFactory");
   
    //create an initial job
    UrlDownloadJob job = jobFactory.createDownloadJob();
    job.setUrl(new URL("http://itsucks.sourceforge.net/"));
    job.setSavePath(new File("/tmp/crawl")); //change this for windows
    job.setIgnoreFilter(true);
    dispatcher.addJob(job);
   
    mLog.info("Start demo dispatcher");
   
    //start the dispatcher
    dispatcher.processJobs();
   
    mLog.info("Demo dispatcher finished");
   
    //dump all found urls
    Collection<Job> content =
      dispatcher.getJobManager().getJobList().getContent();
   
    for (Job finishedJob : content) {
      mLog.info(finishedJob);
    }
   
View Full Code Here

Examples of kalashnikov.dmitry.lab3.Dispatcher

* Created by Tronok on 29.04.14.
*/
public class DispatcherTest {
    @Test
    public void testDispatcherNormal2Threads() throws InterruptedException, ExecutionException, IOException {
        Dispatcher dispatcher = new Dispatcher("multicoreTest.txt", 2);
        Assert.assertArrayEquals(new int[]{1, 2, 2, 3, 5, 5, 6, 8, 9, 34}, dispatcher.sort());
        dispatcher = new Dispatcher("multicoreTest_1_by_1.txt", 2);
        Assert.assertArrayEquals(new int[]{1, 2, 2, 3, 5, 5, 6, 8, 9, 34}, dispatcher.sort());
    }
View Full Code Here

Examples of mephi.cybernetics.dhcn.nodes.dispatcher.Dispatcher

                    thread.start();
                    consoleOutput.setText(consoleOutput.getText() + "\n" + consoleInput.getText());
                }
                if ( "-transport".equals(fragmentCommand[1]))
                {
                    Dispatcher dispatcher = new Dispatcher(Integer.parseInt(fragmentCommand[2]));
                    Thread thread = new Thread(dispatcher);
                    thread.start();
                }
                if ( "-node".equals(fragmentCommand[1]))
                {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.