/** * Send request message(s) immediately. * @see com.cosylab.epics.caj.impl.Transport#submit(com.cosylab.epics.caj.impl.Request) */ public void submit(Request requestMessage) { send(requestMessage.getRequestMessage()); }
/** * Update beacon period and do analitical checks (server restared, routing problems, etc.) * @param remoteTransportRevision * @param timestamp * @param sequentalID */ public void beaconNotify(short remoteTransportRevision, long timestamp, long sequentalID) { boolean networkChanged = updateBeaconPeriod(remoteTransportRevision, timestamp, sequentalID); if (networkChanged) changedTransport(); }
/** * @param context */ public CAResponseHandler(CAJContext context) { this.context = context; intializeHandlerTable(); }
/** * Notify transport about beacon arrival. */ private void beaconArrivalNotify() { Transport[] transports = context.getTransportRegistry().get(responseFrom); if (transports == null) return; // notify all for (int i = 0; i < transports.length; i++) ((CATransport)transports[i]).beaconArrivalNotify(); }
/** * Process output (write) IO event. */ protected void processWrite() { flushInternal(); }
/** * Called each time beacon anomaly is detected. */ public void beaconAnomalyNotify() { if (channelSearchManager != null) channelSearchManager.beaconAnomalyNotify(); }
/** * Search response received notification. * @param channel found channel. * @param responseSequenceNumber sequence number of search frame which contained search request. * @param isSequenceNumberValid valid flag of <code>responseSequenceNumber</code>. * @param responseTime time of search response. */ public void searchResponse(CAJChannel channel, int responseSequenceNumber, boolean isSequenceNumberValid, long responseTime) { unregisterChannel(channel); // TODO we could destroy timer thread when there is no channel to search }
/** * Beacon arrival. */ public void beaconArrivalNotify() { if (!probeResponsePending) rescheduleTimer(connectionTimeout); }
/** * Submit request to the corresponding transport. * @see com.cosylab.epics.caj.impl.Request#submit() */ public void submit() throws IOException { transport.submit(this); }
/** * @see com.cosylab.epics.caj.impl.handlers.AbstractCAJResponseHandler#internalHandleResponse(java.net.InetSocketAddress, com.cosylab.epics.caj.impl.Transport, java.nio.ByteBuffer[]) */ protected void internalHandleResponse( InetSocketAddress responseFrom, Transport transport, ByteBuffer[] response) { ((CATransport)transport).echoNotify(); }
/** * Boost searching of a channel. * @param channel channel to boost searching. * @param timerIndex to what timer-index to boost */ private void boostSearching(CAJChannel channel, int timerIndex) { timers[timerIndex].installChannel(channel); }
/** * Cancel. */ public synchronized void cancel() { if (canceled) return; canceled = true; if (timers != null) for (int i = 0; i < timers.length; i++) timers[i].shutdown(); }
/** * Beacon anomaly detected. * Boost searching of all channels. */ public void beaconAnomalyNotify() { //System.out.println("[*] beaconAnomaly"); for (int i = beaconAnomalyTimerIndex + 1; i < timers.length; i++) timers[i].moveChannels(timers[beaconAnomalyTimerIndex]); }
/** * Send a request message through the transport. * @param requestMessage message to send. * @param address send address. * @throws IOException */ public void send(Request requestMessage, InetSocketAddress address) throws IOException { send(requestMessage.getRequestMessage(), address); }
/** * Update beacon period and do analitical checks (server restared, routing problems, etc.) * @param remoteTransportRevision * @param timestamp * @param sequentalID */ public void beaconNotify(short remoteTransportRevision, long timestamp, long sequentalID) { boolean networkChanged = updateBeaconPeriod(remoteTransportRevision, timestamp, sequentalID); if (networkChanged) changedTransport(); }
/** * @param context */ public CAResponseHandler(CAJContext context) { this.context = context; intializeHandlerTable(); }
/** * Process output (write) IO event. */ protected void processWrite() { flushInternal(); }
/** * Called each time beacon anomaly is detected. */ public void beaconAnomalyNotify() { if (channelSearchManager != null) channelSearchManager.beaconAnomalyNotify(); }
/** * Send a request message through the transport. * @param requestMessage message to send. * @param address send address. * @throws IOException */ public void send(Request requestMessage, InetSocketAddress address) throws IOException { send(requestMessage.getRequestMessage(), address); }
/** * Send request message(s) immediately. * @see com.cosylab.epics.caj.impl.Transport#submit(com.cosylab.epics.caj.impl.Request) */ public void submit(Request requestMessage) { send(requestMessage.getRequestMessage()); }