public void remove(VmPipeSession session) { try { session.getLock().lock(); if (!session.getCloseFuture().isClosed()) { session.getServiceListeners().fireSessionDestroyed(session); session.getRemoteSession().closeNow(); } } finally { session.getLock().unlock(); } }
private static void flushPendingDataQueues(VmPipeSession s) { s.getProcessor().updateTrafficControl(s); s.getRemoteSession().getProcessor().updateTrafficControl(s); }
public void remove(VmPipeSession session) { try { session.getLock().lock(); if (!session.getCloseFuture().isClosed()) { session.getServiceListeners().fireSessionDestroyed(session); session.getRemoteSession().close(true); } } finally { session.getLock().unlock(); } }
public void flush(VmPipeSession session) { WriteRequestQueue queue = session.getWriteRequestQueue0(); if (!session.isClosing()) { session.getLock().lock(); try { if (queue.isEmpty(session)) { Object m = req.getMessage(); pushEvent(new IoEvent(IoEventType.MESSAGE_SENT, session, req), false); session.getRemoteSession().getFilterChain().fireMessageReceived(getMessageCopy(m)); if (m instanceof IoBuffer) { session.increaseWrittenBytes0(((IoBuffer) m).remaining(), currentTime); flushEvents(); session.getLock().unlock(); r.getFuture().setException(cause); session.getFilterChain().fireExceptionCaught(cause);
VmPipeSession localSession = new VmPipeSession(this, getListeners(), actualLocalAddress, getHandler(), entry); localSession.getCloseFuture().addListener(LOCAL_ADDRESS_RECLAIMER); IoFilterChain filterChain = localSession.getFilterChain(); this.getFilterChainBuilder().buildFilterChain(filterChain); VmPipeSession remoteSession = localSession.getRemoteSession(); ((VmPipeAcceptor) remoteSession.getService()).doFinishSessionInitialization(remoteSession, null); try { IoFilterChain filterChain = remoteSession.getFilterChain(); entry.getAcceptor().getFilterChainBuilder().buildFilterChain(filterChain); } catch (Exception e) { ExceptionMonitor.getInstance().exceptionCaught(e); remoteSession.closeNow(); ((VmPipeFilterChain) localSession.getFilterChain()).start(); ((VmPipeFilterChain) remoteSession.getFilterChain()).start();
VmPipeSession localSession = new VmPipeSession(this, getListeners(), actualLocalAddress, getHandler(), entry); localSession.getCloseFuture().addListener(LOCAL_ADDRESS_RECLAIMER); IoFilterChain filterChain = localSession.getFilterChain(); this.getFilterChainBuilder().buildFilterChain(filterChain); VmPipeSession remoteSession = localSession.getRemoteSession(); ((VmPipeAcceptor) remoteSession.getService()).doFinishSessionInitialization(remoteSession, null); try { IoFilterChain filterChain = remoteSession.getFilterChain(); entry.getAcceptor().getFilterChainBuilder().buildFilterChain( filterChain); } catch (Throwable t) { ExceptionMonitor.getInstance().exceptionCaught(t); remoteSession.close(true); ((VmPipeFilterChain) localSession.getFilterChain()).start(); ((VmPipeFilterChain) remoteSession.getFilterChain()).start();
if (sessionOpened && (!session.isReadSuspended()) && session.getLock().tryLock()) { try { if (session.isReadSuspended()) { session.receivedMessageQueue.add(data); } else { session.getLock().unlock(); sessionOpened = true; } else if (type == IoEventType.SESSION_CREATED) { session.getLock().lock(); try { super.fireSessionCreated(); } finally { session.getLock().unlock();
VmPipeSession(IoService service, IoServiceListenerSupport serviceListeners, VmPipeAddress localAddress, IoHandler handler, VmPipe remoteEntry) { this.service = service; this.serviceListeners = serviceListeners; lock = new ReentrantLock(); this.localAddress = localAddress; remoteAddress = serviceAddress = remoteEntry.getAddress(); this.handler = handler; filterChain = new VmPipeFilterChain(this); receivedMessageQueue = new LinkedBlockingQueue<>(); remoteSession = new VmPipeSession(this, remoteEntry); }
public void flush(VmPipeSession session) { WriteRequestQueue queue = session.getWriteRequestQueue0(); if (!session.isClosing()) { session.getLock().lock(); try { if (queue.isEmpty(session)) { Object m = req.getMessage(); pushEvent(new IoEvent(IoEventType.MESSAGE_SENT, session, req), false); session.getRemoteSession().getFilterChain().fireMessageReceived( getMessageCopy(m)); if (m instanceof IoBuffer) { session.increaseWrittenBytes0( ((IoBuffer) m).remaining(), currentTime); flushEvents(); session.getLock().unlock(); r.getFuture().setException(cause); session.getFilterChain().fireExceptionCaught(cause);
VmPipeSession localSession = new VmPipeSession(this, getListeners(), actualLocalAddress, getHandler(), entry); localSession.getCloseFuture().addListener(LOCAL_ADDRESS_RECLAIMER); IoFilterChain filterChain = localSession.getFilterChain(); this.getFilterChainBuilder().buildFilterChain(filterChain); VmPipeSession remoteSession = localSession.getRemoteSession(); ((VmPipeAcceptor) remoteSession.getService()).doFinishSessionInitialization(remoteSession, null); try { IoFilterChain filterChain = remoteSession.getFilterChain(); entry.getAcceptor().getFilterChainBuilder().buildFilterChain(filterChain); } catch (Exception e) { ExceptionMonitor.getInstance().exceptionCaught(e); remoteSession.closeNow(); ((VmPipeFilterChain) localSession.getFilterChain()).start(); ((VmPipeFilterChain) remoteSession.getFilterChain()).start();
if (sessionOpened && (! session.isReadSuspended() ) && session.getLock().tryLock()) { try { if (session.isReadSuspended()) { session.receivedMessageQueue.add(data); } else { session.getLock().unlock(); sessionOpened = true; } else if (type == IoEventType.SESSION_CREATED) { session.getLock().lock(); try { super.fireSessionCreated(); } finally { session.getLock().unlock();
VmPipeSession(IoService service, IoServiceListenerSupport serviceListeners, VmPipeAddress localAddress, IoHandler handler, VmPipe remoteEntry) { super(service); config = new DefaultVmPipeSessionConfig(); this.serviceListeners = serviceListeners; lock = new ReentrantLock(); this.localAddress = localAddress; remoteAddress = serviceAddress = remoteEntry.getAddress(); filterChain = new VmPipeFilterChain(this); receivedMessageQueue = new LinkedBlockingQueue<Object>(); remoteSession = new VmPipeSession(this, remoteEntry); }
public void flush(VmPipeSession session) { WriteRequestQueue queue = session.getWriteRequestQueue0(); if (!session.isClosing()) { session.getLock().lock(); try { if (queue.isEmpty(session)) { Object m = req.getMessage(); pushEvent(new IoEvent(IoEventType.MESSAGE_SENT, session, req), false); session.getRemoteSession().getFilterChain().fireMessageReceived(getMessageCopy(m)); if (m instanceof IoBuffer) { session.increaseWrittenBytes0(((IoBuffer) m).remaining(), currentTime); flushEvents(); session.getLock().unlock(); r.getFuture().setException(cause); session.getFilterChain().fireExceptionCaught(cause);
public void remove(VmPipeSession session) { try { session.getLock().lock(); if (!session.getCloseFuture().isClosed()) { session.getServiceListeners().fireSessionDestroyed(session); session.getRemoteSession().closeNow(); } } finally { session.getLock().unlock(); } }
private static void flushPendingDataQueues(VmPipeSession s) { s.getProcessor().updateTrafficControl(s); s.getRemoteSession().getProcessor().updateTrafficControl(s); }
if (sessionOpened && (!session.isReadSuspended()) && session.getLock().tryLock()) { try { if (session.isReadSuspended()) { session.receivedMessageQueue.add(data); } else { session.getLock().unlock(); sessionOpened = true; } else if (type == IoEventType.SESSION_CREATED) { session.getLock().lock(); try { super.fireSessionCreated(); } finally { session.getLock().unlock();
VmPipeSession(IoService service, IoServiceListenerSupport serviceListeners, VmPipeAddress localAddress, IoHandler handler, VmPipe remoteEntry) { super(service); config = new DefaultVmPipeSessionConfig(); this.serviceListeners = serviceListeners; lock = new ReentrantLock(); this.localAddress = localAddress; remoteAddress = serviceAddress = remoteEntry.getAddress(); filterChain = new VmPipeFilterChain(this); receivedMessageQueue = new LinkedBlockingQueue<Object>(); remoteSession = new VmPipeSession(this, remoteEntry); }
private static void flushPendingDataQueues(VmPipeSession s) { s.getProcessor().updateTrafficControl(s); s.getRemoteSession().getProcessor().updateTrafficControl(s); }