public void start() { flushEnabled = true; flushEvents(); flushPendingDataQueues((VmPipeSession) getSession()); }
@Override public IoProcessor<VmPipeSession> getProcessor() { return filterChain.getProcessor(); }
void doFinishSessionInitialization(IoSession session, IoFuture future) { initSession(session, future, null); } }
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 VmPipeSession(VmPipeSession remoteSession, VmPipe entry) { super(entry.getAcceptor()); config = new DefaultVmPipeSessionConfig(); serviceListeners = entry.getListeners(); lock = remoteSession.lock; localAddress = serviceAddress = remoteSession.remoteAddress; remoteAddress = remoteSession.localAddress; filterChain = new VmPipeFilterChain(this); this.remoteSession = remoteSession; receivedMessageQueue = new LinkedBlockingQueue<Object>(); }
public void updateTrafficControl(VmPipeSession session) { if (!session.isReadSuspended()) { List<Object> data = new ArrayList<Object>(); session.receivedMessageQueue.drainTo(data); for (Object aData : data) { VmPipeFilterChain.this.fireMessageReceived(aData); } } if (!session.isWriteSuspended()) { flush(session); } }
/** * {@inheritDoc} */ public void write(VmPipeSession session, WriteRequest writeRequest) { WriteRequestQueue writeRequestQueue = session.getWriteRequestQueue(); writeRequestQueue.offer(session, writeRequest); if (!session.isWriteSuspended()) { this.flush(session); } }
@Override protected Object defaultValue() { return new VmPipeAddress(0); }
/** * Creates a new instance. * * @param executor The executor to use */ public VmPipeConnector(Executor executor) { super(new DefaultVmPipeSessionConfig(), executor); idleChecker = new IdleStatusChecker(); // we schedule the idle status checking task in this service exceutor // it will be woke up every seconds executeWorker(idleChecker.getNotifyingTask(), "idleStatusChecker"); }
/** * Creates a new instance. * * @param executor The executor to use */ public VmPipeAcceptor(Executor executor) { super(new DefaultVmPipeSessionConfig(), executor); idleChecker = new IdleStatusChecker(); // we schedule the idle status checking task in this service exceutor // it will be woke up every seconds executeWorker(idleChecker.getNotifyingTask(), "idleStatusChecker"); }
private void pushEvent(IoEvent e) { pushEvent(e, flushEnabled); }
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 VmPipeSession(VmPipeSession remoteSession, VmPipe entry) { super(entry.getAcceptor()); config = new DefaultVmPipeSessionConfig(); serviceListeners = entry.getListeners(); lock = remoteSession.lock; localAddress = serviceAddress = remoteSession.remoteAddress; remoteAddress = remoteSession.localAddress; filterChain = new VmPipeFilterChain(this); this.remoteSession = remoteSession; receivedMessageQueue = new LinkedBlockingQueue<Object>(); }
public void updateTrafficControl(VmPipeSession session) { if ( ! session.isReadSuspended()) { List<Object> data = new ArrayList<>(); session.receivedMessageQueue.drainTo(data); for (Object aData : data) { VmPipeFilterChain.this.fireMessageReceived(aData); } } if ( ! session.isWriteSuspended()) { flush(session); } }
public void start() { flushEnabled = true; flushEvents(); flushPendingDataQueues((VmPipeSession) getSession()); }
/** * {@inheritDoc} */ public void write(VmPipeSession session, WriteRequest writeRequest) { WriteRequestQueue writeRequestQueue = session.getWriteRequestQueue(); writeRequestQueue.offer(session, writeRequest); if (!session.isWriteSuspended()) { this.flush(session); } }
/** * Creates a new instance. * * @param executor The executor to use */ public VmPipeConnector(Executor executor) { super(new DefaultVmPipeSessionConfig(), executor); idleChecker = new IdleStatusChecker(); // we schedule the idle status checking task in this service exceutor // it will be woke up every seconds executeWorker(idleChecker.getNotifyingTask(), "idleStatusChecker"); }
/** * Creates a new instance. * * @param executor The executor to use */ public VmPipeAcceptor(Executor executor) { super(new DefaultVmPipeSessionConfig(), executor); idleChecker = new IdleStatusChecker(); // we schedule the idle status checking task in this service exceutor // it will be woke up every seconds executeWorker(idleChecker.getNotifyingTask(), "idleStatusChecker"); }
@Override public IoProcessor<VmPipeSession> getProcessor() { return filterChain.getProcessor(); }
public void start() { flushEnabled = true; flushEvents(); flushPendingDataQueues((VmPipeSession) getSession()); }