@Override protected void afterConnect() throws Exception { super.afterConnect(); setupNotificationConsumer(); }
@Override public void run() { bridge.connect(); } }
@Override public void run() { resendLive(); schedule(); }
@Override public void run() { if (bridge.isStarted()) executor.execute(new ConnectRunnable(bridge)); } }
public static MessageLoadBalancingType getType(String string) { if (string.equals(OFF.getType())) { return MessageLoadBalancingType.OFF; } else if (string.equals(STRICT.getType())) { return MessageLoadBalancingType.STRICT; } else if (string.equals(ON_DEMAND.getType())) { return MessageLoadBalancingType.ON_DEMAND; } else { return null; } } }
protected void scheduleRetryConnectFixedTimeout(final long milliseconds) { try { cleanUpSessionFactory(csf); } catch (Throwable ignored) { } if (stopping) return; if (logger.isDebugEnabled()) { logger.debug("Scheduling retry for bridge " + this.name + " in " + milliseconds + " milliseconds"); } futureScheduledReconnection = scheduledExecutor.schedule(new FutureConnectRunnable(executor, this), milliseconds, TimeUnit.MILLISECONDS); }
@Override protected void fail(final boolean permanently) { logger.debug("Cluster Bridge " + this.getName() + " failed, permanently=" + permanently); super.fail(permanently); if (permanently) { logger.debug("cluster node for bridge " + this.getName() + " is permanently down"); clusterConnection.removeRecord(targetNodeID); } else { clusterConnection.disconnectRecord(targetNodeID); } } }
@Override public void start() throws Exception { synchronized (this) { if (started) { return; } stopping = false; started = true; activate(); } }
@Override protected void tryScheduleRetryReconnect(final ActiveMQExceptionType type) { if (type != ActiveMQExceptionType.DISCONNECTED) { scheduleRetryConnect(); } }
@Override public void nodeUP(TopologyMember member, boolean last) { BridgeImpl.this.nodeUP(member, last); }
@Override public void reset() throws Exception { resetBindings(); }
@Override public boolean allowRedistribute() { return messageLoadBalancingType.equals(MessageLoadBalancingType.ON_DEMAND); }
@Override public String debug() { return toString(); }
@Override public void connectionFailed(final ActiveMQException me, boolean failedOver) { connectionFailed(me, failedOver, null); }
protected void tryScheduleRetryReconnect(final ActiveMQExceptionType type) { scheduleRetryConnect(); }
public synchronized void close() { boolean ok = flushExecutor(); if (!ok) { throw new IllegalStateException("Timed out waiting for executor to complete"); } active = false; }
private void execPrompter() { count++; // We use >= as the large message redistribution will set count to max_int // so we are use the prompter will get called if (count >= batchSize) { // We continue the next batch on a different thread, so as not to keep the delivery thread busy for a very // long time in the case there are many messages in the queue active = false; executor.execute(new Prompter()); count = 0; } }
@Override public BroadcastEndpoint createBroadcastEndpoint() throws Exception { return new BroadcastEndpointImpl(this); }
private void internalCancelReferences() { cancelRefs(); if (queue != null) { queue.deliverAsync(); } }
@Override public synchronized void cancelRedistributor() throws Exception { if (redistributor != null) { redistributor.consumer.stop(); redistributor = null; } clearRedistributorFuture(); }