Package org.apache.mina.core.future

Examples of org.apache.mina.core.future.ConnectFuture.await()


                if (q != null) {
                    connFuture = q.poll();
                }
                if (connFuture == null) {
                    connFuture = connector.connect(isa);
                    connFuture.await();
                    ((DatagramSessionConfig)connFuture.getSession().getConfig()).setSendBufferSize(64 * 1024);
                    ((DatagramSessionConfig)connFuture.getSession().getConfig()).setReceiveBufferSize(64 * 1024);
                }
                connFuture.getSession().setAttribute(CXF_MESSAGE_ATTR, message);
                message.setContent(OutputStream.class, new UDPConduitOutputStream(connector, connFuture, message));
View Full Code Here


        ConnectFuture connectionFuture = connector.connect( address );

        // Wait until it's established
        try
        {
            connectionFuture.await( timeout );
        }
        catch( InterruptedException e )
        {
            connector = null;
            LOG.debug( "Interrupted while waiting for connection to establish with server {}:{}", config.getLdapHost(), config.getLdapPort(), e );
View Full Code Here

                        }
                    });

                    ConnectFuture c2Future = c2.connect(address);

                    c2Future.await();

                    latch.await();

                    c2Future.getSession().write("please don't deadlock via c2");
                } else {
View Full Code Here

            }
        });

        ConnectFuture future = connector.connect(address);

        future.await();

        c1.set(future.getSession());
        c1.get().write("start");

        ThreadMXBean threadMXBean = ManagementFactory.getThreadMXBean();
View Full Code Here

        }
    ConnectFuture future = connector.connect(
      new InetSocketAddress( address, port ),
      new VMIDSlotInitializer<ConnectFuture>( args, reconnect_token, container,
        attachment, original_vmid ) );
    if ( !future.await( timeout_ns, TimeUnit.NANOSECONDS ) ) {
      future.cancel();

      // TODO: better way to do this??
      // HACK ALERT: In situations where the connection times out, there can be a
      //             file descriptor leak because MINA doesn't seem to close the
View Full Code Here

        ConnectFuture connectionFuture = connector.connect( address );

        // Wait until it's established
        try
        {
            connectionFuture.await( timeout );
        }
        catch ( InterruptedException e )
        {
            connector = null;
            LOG.debug( "Interrupted while waiting for connection to establish with server {}:{}", config.getLdapHost(),
View Full Code Here

                        }
                    });

                    ConnectFuture c2Future = c2.connect(address);

                    c2Future.await();

                    latch.await();

                    c2Future.getSession().write("please don't deadlock via c2");
                } else {
View Full Code Here

            }
        });

        ConnectFuture future = connector.connect(address);

        future.await();

        c1.set(future.getSession());
        c1.get().write("start");

        ThreadMXBean threadMXBean = ManagementFactory.getThreadMXBean();
View Full Code Here

                if (q != null) {
                    connFuture = q.poll();
                }
                if (connFuture == null) {
                    connFuture = connector.connect(isa);
                    connFuture.await();
                    ((DatagramSessionConfig)connFuture.getSession().getConfig()).setSendBufferSize(64 * 1024);
                    ((DatagramSessionConfig)connFuture.getSession().getConfig()).setReceiveBufferSize(64 * 1024);
                }
                connFuture.getSession().setAttribute(CXF_MESSAGE_ATTR, message);
                message.setContent(OutputStream.class, new UDPConduitOutputStream(connector, connFuture, message));
View Full Code Here

    if (!connector.isActive()) init();

    ConnectFuture cf = connector.connect(new InetSocketAddress(getHost(), getPort()));

    cf.await(2000);
    if (connector.isActive()) {
      log.info("Stampy MINA ClientMinaMessageGateway connected to {}:{}", host, getPort());
    } else {
      log.error("Could not connect to {}:{}", host, getPort());
    }
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.