Examples of VmPipe


Examples of org.apache.mina.transport.vmpipe.support.VmPipe

        if (config == null) {
            config = getDefaultConfig();
        }

        VmPipe entry = VmPipeAcceptor.boundHandlers.get(address);
        if (entry == null) {
            return DefaultConnectFuture.newFailedFuture(new IOException(
                    "Endpoint unavailable: " + address));
        }

        DefaultConnectFuture future = new DefaultConnectFuture();
        VmPipeSessionImpl localSession = new VmPipeSessionImpl(this,
                                                               config,getListeners(),
                                                               new AnonymousSocketAddress(),
                                                               handler,
                                                               entry);

        // initialize connector session
        try {
            IoFilterChain filterChain = localSession.getFilterChain();
            this.getFilterChainBuilder().buildFilterChain(filterChain);
            config.getFilterChainBuilder().buildFilterChain(filterChain);
            config.getThreadModel().buildFilterChain(filterChain);

            // The following sentences don't throw any exceptions.
            localSession.setAttribute(AbstractIoFilterChain.CONNECT_FUTURE, future);
            getListeners().fireSessionCreated(localSession);
            VmPipeIdleStatusChecker.getInstance().addSession(localSession);
        } catch (Throwable t) {
            future.setException(t);
            return future;
        }

        // initialize acceptor session
        VmPipeSessionImpl remoteSession = localSession.getRemoteSession();
        try {
            IoFilterChain filterChain = remoteSession.getFilterChain();
            entry.getAcceptor().getFilterChainBuilder().buildFilterChain(
                    filterChain);
            entry.getConfig().getFilterChainBuilder().buildFilterChain(
                    filterChain);
            entry.getConfig().getThreadModel().buildFilterChain(filterChain);

            // The following sentences don't throw any exceptions.
            entry.getListeners().fireSessionCreated(remoteSession);
            VmPipeIdleStatusChecker.getInstance().addSession(remoteSession);
        } catch (Throwable t) {
            ExceptionMonitor.getInstance().exceptionCaught(t);
            remoteSession.close();
        }
View Full Code Here

Examples of org.apache.mina.transport.vmpipe.support.VmPipe

            {
                throw new IOException( "Address already bound: " + address );
            }

            boundHandlers.put( address,
                               new VmPipe( this,
                                          ( VmPipeAddress ) address,
                                          handler, config ) );
        }
    }
View Full Code Here

Examples of org.apache.mina.transport.vmpipe.support.VmPipe

    public Set getManagedSessions( SocketAddress address )
    {
        if( address == null )
            throw new NullPointerException( "address" );
       
        VmPipe pipe = null;
        synchronized( boundHandlers )
        {
            pipe = ( VmPipe ) boundHandlers.get( address );
            if( pipe == null )
            {
                throw new IllegalArgumentException( "Address not bound: " + address );
            }
        }
       
        Set managedSessions = pipe.getManagedServerSessions();
        return Collections.unmodifiableSet(
                new IdentityHashSet( Arrays.asList( managedSessions.toArray() ) ) );
    }
View Full Code Here

Examples of org.apache.mina.transport.vmpipe.support.VmPipe

    public void unbind( SocketAddress address )
    {
        if( address == null )
            throw new NullPointerException( "address" );

        VmPipe pipe = null;
        synchronized( boundHandlers )
        {
            if( !boundHandlers.containsKey( address ) )
            {
                throw new IllegalArgumentException( "Address not bound: " + address );
            }
           
            pipe = ( VmPipe ) boundHandlers.remove( address );
        }
       
        Set managedSessions = pipe.getManagedServerSessions();
       
        IoServiceConfig cfg = pipe.getConfig();
        boolean disconnectOnUnbind;
        if( cfg instanceof IoAcceptorConfig )
        {
            disconnectOnUnbind = ( ( IoAcceptorConfig ) cfg ).isDisconnectOnUnbind();
        }
View Full Code Here

Examples of org.apache.mina.transport.vmpipe.support.VmPipe

        if( config == null )
        {
            config = getDefaultConfig();
        }

        VmPipe entry = ( VmPipe ) VmPipeAcceptor.boundHandlers.get( address );
        if( entry == null )
        {
            return ConnectFuture.newFailedFuture(
                    new IOException( "Endpoint unavailable: " + address ) );
        }
View Full Code Here

Examples of org.apache.mina.transport.vmpipe.support.VmPipe

            {
                throw new IOException( "Address already bound: " + address );
            }

            boundHandlers.put( address,
                               new VmPipe( this,
                                          ( VmPipeAddress ) address,
                                          handler, config ) );
        }
    }
View Full Code Here

Examples of org.apache.mina.transport.vmpipe.support.VmPipe

    public Set getManagedSessions( SocketAddress address )
    {
        if( address == null )
            throw new NullPointerException( "address" );
       
        VmPipe pipe = null;
        synchronized( boundHandlers )
        {
            pipe = ( VmPipe ) boundHandlers.get( address );
            if( pipe == null )
            {
                throw new IllegalArgumentException( "Address not bound: " + address );
            }
        }
       
        Set managedSessions = pipe.getManagedServerSessions();
        return Collections.unmodifiableSet(
                new IdentityHashSet( Arrays.asList( managedSessions.toArray() ) ) );
    }
View Full Code Here

Examples of org.apache.mina.transport.vmpipe.support.VmPipe

    public void unbind( SocketAddress address )
    {
        if( address == null )
            throw new NullPointerException( "address" );

        VmPipe pipe = null;
        synchronized( boundHandlers )
        {
            if( !boundHandlers.containsKey( address ) )
            {
                throw new IllegalArgumentException( "Address not bound: " + address );
            }
           
            pipe = ( VmPipe ) boundHandlers.remove( address );
        }
       
        Set managedSessions = pipe.getManagedServerSessions();
       
        IoServiceConfig cfg = pipe.getConfig();
        boolean disconnectOnUnbind;
        if( cfg instanceof IoAcceptorConfig )
        {
            disconnectOnUnbind = ( ( IoAcceptorConfig ) cfg ).isDisconnectOnUnbind();
        }
View Full Code Here

Examples of org.apache.mina.transport.vmpipe.support.VmPipe

        if( config == null )
        {
            config = getDefaultConfig();
        }

        VmPipe entry = ( VmPipe ) VmPipeAcceptor.boundHandlers.get( address );
        if( entry == null )
        {
            return ConnectFuture.newFailedFuture(
                    new IOException( "Endpoint unavailable: " + address ) );
        }
View Full Code Here

Examples of org.apache.mina.transport.vmpipe.support.VmPipe

                }
            } else if (boundHandlers.containsKey(address)) {
                throw new IOException("Address already bound: " + address);
            }

            boundHandlers.put(address, new VmPipe(this,
                    (VmPipeAddress) address, handler, config, getListeners()));
        }

        getListeners().fireServiceActivated(this, address, handler, config);
    }
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.