/** * Initializes this <code>Gateway</code>'s <code>GatewayEventProcessor</code> */ private GatewayEventProcessor initializeEventProcessor() { GatewayEventProcessor ev = new GatewayEventProcessor(this); this._eventProcessor = ev; if (this.getLogger().fineEnabled()) { this.getLogger().fine(this + ": Created event processor " + ev); } return ev; }
public void pause() { synchronized (this.controlLock) { if (!this._isRunning) { return; } this._eventProcessor.pauseDispatching(); getLogger().info(LocalizedStrings.GatewayImpl_PAUSED__0, this); } }
/** * Become the primary <code>Gateway</code>. This method is invoked by the * <code>GatewayHub</code> when it becomes primary. * * @see GatewayHubImpl#launchLockObtainingThread */ @Override protected void becomePrimary() { this.getLogger().info(LocalizedStrings.GatewayImpl_0__BECOMING_PRIMARY_GATEWAY, this); synchronized (this._primaryLock) { setPrimary(true); this._primaryLock.notify(); } }
protected void waitForFailoverCompletion() { synchronized (this.failoverCompletedLock) { if (this.failoverCompleted) { return; } this.getLogger().info(LocalizedStrings.GatewayImpl_0__WAITING_FOR_FAILOVER_COMPLETION, this); try { while (!this.failoverCompleted) { this.failoverCompletedLock.wait(); } } catch (InterruptedException ex) { Thread.currentThread().interrupt(); this._cache.getCancelCriterion().checkCancelInProgress(ex); this.getLogger().info(LocalizedStrings.GatewayImpl_0_DID_NOT_WAIT_FOR_FAILOVER_COMPLETION_DUE_TO_INTERRUPTION, this); } } }
public void setSocketReadTimeout(int socketReadTimeout) { synchronized (this.controlLock) { checkRunning(); getLogger().warning(LocalizedStrings.GatewayImpl_GATEWAY_SOCKET_READ_TIMEOUT_DISABLED); // do nothing on purpose... // setSocketReadTimeout is now optional and this impl ignores it // setSocketReadTimeout was causing too many problems because customers // kept using too small of a value } }
public void resume() { synchronized (this.controlLock) { if (!this._isRunning) { return; } this._eventProcessor.resumeDispatching(); getLogger().info(LocalizedStrings.GatewayImpl_RESUMED__0, this); } }
/** * Wait to be told to become the primary <code>Gateway</code>. This method * is invoked by the <code>Gateway</code>'s<code>EventDispatcher</code> * to wait until it is primary before processing the queue. */ protected void waitToBecomePrimary() throws InterruptedException { if (getPrimary()) { return; } synchronized (this._primaryLock) { while (!getPrimary()) { this.getLogger().info(LocalizedStrings.GatewayImpl_0__WAITING_TO_BECOME_PRIMARY_GATEWAY, this); this._primaryLock.wait(); } } // synchronized }
/** * Constructor. * * @param gateway * The <code>Gateway</code> on behalf of whom this dispatcher * dispatches events. */ protected GatewayEventProcessor(GatewayImpl gateway) { super(LogWriterImpl.createThreadGroup("Gateway Event Processor from " + gateway.getGatewayHubId() + " to " + gateway.getId(), gateway .getLogger()), "Gateway Event Processor from " + gateway.getGatewayHubId() + " to " + gateway.getId()); this._gateway = gateway; this.unprocessedEvents = new LinkedHashMap(); this.unprocessedTokens = new LinkedHashMap(); // Create the event conflator //this._eventConflator = new BridgeEventConflator(this._logger); this._eventQueue = this.initializeMessageQueue(); this._eventDispatcher = this.initializeEventDispatcher(); setDaemon(true); }
this.getLogger().info(LocalizedStrings.GatewayImpl_STOPPED__0, this);
this.getLogger().info(LocalizedStrings.SerialGatewaySenderImpl_STARTED__0, this);
this.getLogger().severe( LocalizedStrings.GatewayImpl_0_AN_EXCEPTION_OCCURRED_WHILE_QUEUEING_1_TO_PERFORM_OPERATION_2_FOR_3, new Object[] {this, getId(), operation, event}, e); if (this.getLogger().fineEnabled()) { this.getLogger().fine(this + ": About to queue operation " + operation + " for "+ getId() + ": " + event); this.getLogger().severe( LocalizedStrings.GatewayImpl_0_AN_EXCEPTION_OCCURRED_WHILE_QUEUEING_1_TO_PERFORM_OPERATION_2_FOR_3, new Object[] {this, getId(), operation, event}, e);