Package org.apache.mina.transport.socket.nio

Examples of org.apache.mina.transport.socket.nio.NioSocketConnector


        thread.start();
        Thread.sleep( 500 );
       
        client = new MinaTaskClient( "client 1",
                                     new TaskClientHandler(SystemEventListenerFactory.getSystemEventListener()) );
        NioSocketConnector connector = new NioSocketConnector();
        SocketAddress address = new InetSocketAddress( "127.0.0.1",
                                                       9123 );
        client.connect( connector,
                        address );
    }
View Full Code Here


            throw new IllegalArgumentException( "Address cannot be null" );
        }
        
        if ( this.connector == null ) {
            // Allow users to pass their own configured SocketConnector
            this.connector = new NioSocketConnector();
            this.connector.getFilterChain().addLast( "codec",
                                                     new ProtocolCodecFilter(new ObjectSerializationCodecFactory() ) );
        }

        //        this.handler = new MessageHandler() {
View Full Code Here

        thread.start();
        Thread.sleep( 500 );

        client = new MinaTaskClient( "client 1",
                                     new TaskClientHandler(SystemEventListenerFactory.getSystemEventListener()) );
        NioSocketConnector connector = new NioSocketConnector();
        SocketAddress address = new InetSocketAddress( "127.0.0.1",
                                                       9123 );
        client.connect( connector,
                        address );
    }
View Full Code Here

        server = new MinaTaskServer(taskService);
        Thread thread = new Thread(server);
        thread.start();
        Thread.sleep(500);
        client = new MinaTaskClient("client 1", new TaskClientHandler(SystemEventListenerFactory.getSystemEventListener()));
        NioSocketConnector connector = new NioSocketConnector();
        SocketAddress address = new InetSocketAddress("127.0.0.1", 9123);
        client.connect(connector, address);
        handler = new WSHumanTaskHandler();
    }
View Full Code Here

        thread.start();
        Thread.sleep( 500 );
       
        client = new MinaTaskClient( "client 1",
                                     new TaskClientHandler(SystemEventListenerFactory.getSystemEventListener()) );
        NioSocketConnector connector = new NioSocketConnector();
        SocketAddress address = new InetSocketAddress( "127.0.0.1",
                                                       9123 );
        client.connect( connector,
                        address );
       
View Full Code Here

        thread.start();
        Thread.sleep( 500 );

        client = new MinaTaskClient( "client 1",
                                     new TaskClientHandler(SystemEventListenerFactory.getSystemEventListener()) );
        NioSocketConnector connector = new NioSocketConnector();
        SocketAddress address = new InetSocketAddress( "127.0.0.1",
                                                       9123 );
        client.connect( connector,
                        address );
    }
View Full Code Here

 
  public void connect() {
    if (client == null) {
      client = new MinaTaskClient(
        "org.drools.process.workitem.wsht.WSHumanTaskHandler", new TaskClientHandler());
      NioSocketConnector connector = new NioSocketConnector();
      SocketAddress address = new InetSocketAddress(ipAddress, port);
      boolean connected = client.connect(connector, address);
      if (!connected) {
        throw new IllegalArgumentException(
          "Could not connect task client");
View Full Code Here

        this.connector.setHandler( this.handler );
        return connect();
    }

  public boolean connect(String address, int port) {
    this.connector = new NioSocketConnector();
        this.address = new InetSocketAddress( address, port );
        this.connector.setHandler( this.handler );
        return connect();
  }
View Full Code Here

            throw new IllegalStateException(
                    "Already connected. Disconnect first.");
        }

        if (this.connector==null) {
          this.connector = new NioSocketConnector();
        }
       
        if (this.address==null) {
          this.address = new InetSocketAddress( "127.0.0.1", 9123);
        }
View Full Code Here

            System.out.println(Main.class.getName() + " <hostname> <port>");
            return;
        }

        // Create TCP/IP connector.
        NioSocketConnector connector = new NioSocketConnector();

        // Set connect timeout.
        connector.setConnectTimeout(30);

        // Start communication.
        connector.setHandler(new NetCatProtocolHandler());
        ConnectFuture cf = connector.connect(
                new InetSocketAddress(args[0], Integer.parseInt(args[1])));

        // Wait for the connection attempt to be finished.
        cf.awaitUninterruptibly();
        cf.getSession().getCloseFuture().awaitUninterruptibly();
       
        connector.dispose();
    }
View Full Code Here

TOP

Related Classes of org.apache.mina.transport.socket.nio.NioSocketConnector

Copyright © 2018 www.massapicom. 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.