Examples of Ready


Examples of com.davfx.ninio.common.Ready

        if (oldRecyclers == null) {
          final Recycler newRecycler = new Recycler();
          newRecycler.reader = reader;
          newRecycler.handler = handler;
          newRecycler.closeDate = null;
          Ready ready;
          if (request.isSecure()) {
            ready = secureReadyFactory.create(queue, new OnceByteBufferAllocator());
          } else {
            ready = readyFactory.create(queue, new OnceByteBufferAllocator());
          }
          ready.connect(request.getAddress(), new ReadyConnection() {
            private HttpResponseReader.RecyclingHandler recyclingHandler;
            @Override
            public void handle(Address address, ByteBuffer buffer) {
              if (newRecycler.reader == null) {
                return;
View Full Code Here

Examples of com.davfx.ninio.common.Ready

    q.post(new Runnable() {
      @Override
      public void run() {
        ByteBufferAllocator allocator = new OnceByteBufferAllocator();
        Ready ready = readyFactory.create(q, allocator);
        ready.connect(a, new ReadyConnection() {
          private TelnetResponseReader reader = null;
          @Override
          public void handle(Address address, ByteBuffer buffer) {
            reader.handle(address, buffer);
          }
View Full Code Here

Examples of com.davfx.ninio.common.Ready

    executorService.shutdown();
  }
 
  @Override
  public Ready create(Queue queue, ByteBufferAllocator allocator) {
    return new Ready() {
      @Override
      public void connect(Address address, ReadyConnection connection) {
        connection.connected(new CloseableByteBufferHandler() {
          private volatile boolean closed = false;
          @Override
View Full Code Here

Examples of com.davfx.ninio.common.Ready

   
    q.post(new Runnable() {
      @Override
      public void run() {
        ByteBufferAllocator allocator = new OnceByteBufferAllocator();
        Ready ready = readyFactory.create(q, allocator);
        ready.connect(a, new ReadyConnection() {
          private FtpResponseReader reader = null;
          @Override
          public void handle(Address address, ByteBuffer buffer) {
            reader.handle(address, buffer);
          }
View Full Code Here

Examples of com.davfx.ninio.common.Ready

                          }
                        }
                      } else if (len == 0) {
                        Address address = new Address(in.readUTF(), in.readInt());
                        ReadyFactory factory = proxyUtils.read(in);
                        Ready r = factory.create(queue, new OnceByteBufferAllocator());
                        MutablePair<Address, CloseableByteBufferHandler> connection = new MutablePair<Address, CloseableByteBufferHandler>(address, null);
                        connections.put(connectionId, connection);
                       
                        Lock lock = new Lock();
                       
                        r.connect(address, new ReadyConnection() {
                          @Override
                          public void failed(IOException e) {
                            lock.signal();
                            try {
                              out.writeInt(connectionId);
View Full Code Here

Examples of com.davfx.ninio.common.Ready

    proxyUtils.override(type, configurator);
    return this;
  }

  public Ready get(Queue queue, String connecterType) {
    return new Ready() {
      @Override
      public void connect(Address address, ReadyConnection connection) {
        final DataOutputStream out;
        final Map<Integer, Pair<Address, ReadyConnection>> connections;
   
View Full Code Here

Examples of com.davfx.ninio.common.Ready

    q.post(new Runnable() {
      @Override
      public void run() {
        ByteBufferAllocator allocator = new OnceByteBufferAllocator();
        Ready ready = rf.create(q, allocator);
       
        ready.connect(a, new ReadyConnection() {
          private final InstanceMapper instanceMapper = new InstanceMapper();

          @Override
          public void handle(Address address, ByteBuffer buffer) {
            ByteBuffer bb = buffer.duplicate();
View Full Code Here

Examples of com.opengamma.engine.calcnode.msg.Ready

  private static final FudgeContext s_fudgeContext = OpenGammaFudgeContext.getInstance();
  private static final long TIMEOUT = Timeout.standardTimeoutMillis();

  public void simpleInvocation() {
    final JobDispatcher jobDispatcher = new JobDispatcher();
    final Ready initialMessage = new Ready(1, "Test");
    final DirectFudgeConnection conduit = new DirectFudgeConnection(s_fudgeContext);
    final RemoteNodeJobInvoker jobInvoker = new RemoteNodeJobInvoker(Executors.newCachedThreadPool(), initialMessage, conduit.getEnd1(), new InMemoryIdentifierMap(), new FunctionCosts(),
        new DummyFunctionBlacklistQuery(), new DummyFunctionBlacklistMaintainer());
    jobDispatcher.registerJobInvoker(jobInvoker);
    final TestJobResultReceiver resultReceiver = new TestJobResultReceiver();
View Full Code Here

Examples of com.opengamma.engine.calcnode.msg.Ready

    assertNotNull(resultReceiver.waitForResult(TIMEOUT));
  }

  public void saturate() {
    final JobDispatcher jobDispatcher = new JobDispatcher();
    final Ready initialMessage = new Ready(3, "Test");
    final DirectFudgeConnection conduit = new DirectFudgeConnection(s_fudgeContext);
    final RemoteNodeJobInvoker jobInvoker = new RemoteNodeJobInvoker(Executors.newCachedThreadPool(), initialMessage, conduit.getEnd1(), new InMemoryIdentifierMap(), new FunctionCosts(),
        new DummyFunctionBlacklistQuery(), new DummyFunctionBlacklistMaintainer());
    jobDispatcher.registerJobInvoker(jobInvoker);
    final FudgeConnection remoteNode = conduit.getEnd2();
View Full Code Here

Examples of com.opengamma.engine.calcnode.msg.Ready

    s_logger.debug("Sending message ({} fields) to {}", msg.getNumFields(), _connection);
    sender.send(msg);
  }

  protected void sendCapabilities() {
    final Ready ready = new Ready(getTotalNodeCount(), getHostId());
    // TODO any other capabilities to add
    sendMessage(ready);
  }
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.