Package org.activeio

Examples of org.activeio.AsynchChannel


     * @param channel
     * @return
     * @throws IOException
     */
    protected AsynchChannel createAsynchChannel(SocketChannel socketChannel) throws IOException {
        AsynchChannel channel = new NIOAsynchChannel(socketChannel, useDirectBuffers);
        if( createWriteBufferedChannels ) {
            channel = new WriteBufferedAsynchChannel(channel, ByteBufferPacket.createDefaultBuffer(useDirectBuffers), false);
        }
        return channel;
    }
View Full Code Here


     */
    final private class OnePortAcceptListener implements AcceptListener {
       
        public void onAccept(Channel channel) {
            try {
                AsynchChannel asynchChannel = SynchToAsynchChannelAdapter.adapt(channel);
                ProtocolInspectingAsynchChannel inspector = new ProtocolInspectingAsynchChannel(asynchChannel);
                inspector.start();               
            } catch (IOException e) {
                onAcceptError(e);
            }               
View Full Code Here

    }
   
    public void onAccept(Channel channel) {
        try {
           
            AsynchChannel asynchChannel = SynchToAsynchChannelAdapter.adapt(channel);
            asynchChannel.setAsynchChannelListener(new ServerConnectionHandler(asynchChannel));
            asynchChannel.start();
           
        } catch (IOException e) {
            onAcceptError(e);
        }
    }
View Full Code Here

          else if (timeout == SynchChannelServer.NO_WAIT_TIMEOUT)
              setSoTimeout(1);
          else
              setSoTimeout((int) timeout);
 
            AsynchChannel channel = new AIOAsynchChannel(serverSocket.accept());
            channel = new WriteBufferedAsynchChannel(channel, ByteBufferPacket.createDefaultBuffer(true), false);
            return channel;
         
        } catch (SocketTimeoutException ignore) {
        }
View Full Code Here

     * @param channel
     * @return
     * @throws IOException
     */
    protected AsynchChannel createAsynchChannel(AsyncSocketChannel socketChannel) throws IOException {
        AsynchChannel channel = new AIOAsynchChannel(socketChannel);
        channel = new WriteBufferedAsynchChannel(channel, ByteBufferPacket.createDefaultBuffer(true), false);
        return channel;
    }
View Full Code Here

        this.createWriteBufferedChannels = createWriteBufferedChannels;
    this.useDirectBuffers = useDirectBuffers;
    }
   
    protected Channel createChannel(Socket socket) throws IOException {
        AsynchChannel channel = new NIOAsynchChannel(socket.getChannel(), useDirectBuffers);
        if( createWriteBufferedChannels ) {
            channel = new WriteBufferedAsynchChannel(channel, ByteBufferPacket.createDefaultBuffer(useDirectBuffers), false);
        }
        return channel;
    }
View Full Code Here

        if (closed.get()) {
            c.dispose();
            return;
        }

        AsynchChannel channel = SynchToAsynchChannelAdapter.adapt(c);
        // If the channel is not allready buffered.. lets buffer it.
        //if (channel.narrow(WriteBufferedAsynchChannel.class) == null
        //        && channel.narrow(WriteBufferedSynchChannel.class) == null) {
        //   channel = new WriteBufferedAsynchChannel(channel);
        //}
View Full Code Here

     * @param remoteLocation
     * @return the TransportChannel bound to the remote node
     * @throws JMSException
     */
    public TransportChannel create(WireFormat wireFormat, URI remoteLocation) throws JMSException {
        AsynchChannel asynchChannel = createAsynchChannel(remoteLocation);
        ActiveIOTransportChannel channel = new ActiveIOTransportChannel(wireFormat, asynchChannel);
        return populateProperties(channel, remoteLocation);
    }
View Full Code Here

     *                       e.g. local InetAddress and local port
     * @return the TransportChannel bound to the remote node
     * @throws JMSException
     */
    public TransportChannel create(WireFormat wireFormat, URI remoteLocation, URI localLocation) throws JMSException {
        AsynchChannel asynchChannel = createAsynchChannel(remoteLocation);
        ActiveIOTransportChannel channel = new ActiveIOTransportChannel(wireFormat, asynchChannel);
        return populateProperties(channel, remoteLocation);
    }
View Full Code Here

     * @throws JMSException
     */
    private AsynchChannel createAsynchChannel(URI remoteLocation) throws JMSException {
        try {
            remoteLocation = URIConverter.convert(remoteLocation);
            AsynchChannel channel = new ChannelFactory().openAsynchChannel(remoteLocation);
            // If the channel is not allready buffered.. lets buffer it.
            //if( channel.narrow(WriteBufferedAsynchChannel.class)==null && channel.narrow(WriteBufferedSynchChannel.class)==null ) {
            //    channel = new WriteBufferedAsynchChannel(channel);
            //}
            return channel;
View Full Code Here

TOP

Related Classes of org.activeio.AsynchChannel

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.