private void waitForRunningStatus() { for (SerialGatewaySenderEventProcessor serialProcessor : this.processors) { synchronized (serialProcessor.runningStateLock) { while (serialProcessor.getException() == null && serialProcessor.isStopped()) { try { serialProcessor.runningStateLock.wait(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } } Exception ex = serialProcessor.getException(); if (ex != null) { throw new GatewaySenderException( String.format("Could not start a gateway sender %s because of exception %s", new Object[] {this.sender.getId(), ex.getMessage()}), ex.getCause()); } } } }
Throwable cause = e.getCause(); if (cause instanceof IOException || e instanceof GatewaySenderConfigurationException || cause instanceof ConnectionDestroyedException) {
this.processor.getSender().getId(), gse.getCause().getMessage()); this.processor.checkIfPdxNeedsResend(this.connection.getQueueStatus().getPdxSize()); } catch (ConnectionDestroyedException e) { throw new GatewaySenderException( String.format("%s : Could not connect due to: %s", this.processor.getSender().getId(), e.getMessage()),
protected void waitForRunningStatus() { synchronized (this.eventProcessor.runningStateLock) { while (this.eventProcessor.getException() == null && this.eventProcessor.isStopped()) { try { this.eventProcessor.runningStateLock.wait(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } } Exception ex = this.eventProcessor.getException(); if (ex != null) { throw new GatewaySenderException( String.format("Could not start a gateway sender %s because of exception %s", new Object[] {this.getId(), ex.getMessage()}), ex.getCause()); } } }
Throwable t = ge.getCause(); if (this.sender.getProxy() == null || this.sender.getProxy().isDestroyed()) {
/** * Sends a batch of messages to the registered <code>AsyncEventListener</code>s. * * @param events The <code>List</code> of events to send * */ protected boolean dispatchBatch(List events) throws GatewaySenderException { if (events.isEmpty()) { return true; } int batchId = this.eventProcessor.getBatchId(); boolean successAll = true; try { for (AsyncEventListener listener : this.eventListeners) { boolean successOne = listener.processEvents(events); if (!successOne) { successAll = false; } } } catch (Exception e) { final String alias = "%s: Exception during processing batch %s"; final Object[] aliasArgs = new Object[] {this, Integer.valueOf(batchId)}; String exMsg = String.format(alias, aliasArgs); GatewaySenderException ge = new GatewaySenderException(exMsg, e); logger.warn(exMsg, ge); throw ge; } return successAll; }
private void waitForRunningStatus() { for (ParallelGatewaySenderEventProcessor parallelProcessor : this.processors) { synchronized (parallelProcessor.runningStateLock) { while (parallelProcessor.getException() == null && parallelProcessor.isStopped()) { try { parallelProcessor.runningStateLock.wait(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } } Exception ex = parallelProcessor.getException(); if (ex != null) { throw new GatewaySenderException( String.format("Could not start a gateway sender %s because of exception %s", new Object[] {this.sender.getId(), ex.getMessage()}), ex.getCause()); } } } }
GatewaySenderException gse = null; if (e.getCause() instanceof GemFireSecurityException) { gse = new GatewaySenderException(e.getCause()); } else { List<ServerLocation> servers = this.sender.getProxy().getCurrentServers(); gse = new GatewaySenderException( String.format("%s : Could not connect due to: %s", new Object[] {this.processor.getSender().getId(), ex.getMessage()}),
throw new GatewaySenderException( String.format("%s : Exception during processing batch %s on connection %s", new Object[] {this, Integer.valueOf(currentBatchId), connection}), throw new GatewaySenderException( String.format("%s : Exception during processing batch %s on connection %s", new Object[] {this, Integer.valueOf(currentBatchId), connection}), ex); } catch (IllegalStateException e) { this.processor.setException(new GatewaySenderException(e)); throw new GatewaySenderException( String.format("%s : Exception during processing batch %s on connection %s", new Object[] {this, Integer.valueOf(currentBatchId), connection}), throw new GatewaySenderException( String.format("%s : Exception during processing batch %s on connection %s", new Object[] {this, Integer.valueOf(currentBatchId), connection}),
throw new GatewaySenderException( String.format( "The GatewaySender %s could not be destroyed as it is still used by region(s).",
.getDistributedSystemId(); if (remoteDSId == myDSId) { throw new GatewaySenderException( String.format( "GatewaySender %s cannot be created with remote DS Id equal to this DS Id. ", throw new GatewaySenderException( String.format("GatewaySender %s cannot be created with remote DS Id less than 0. ", id)); throw new GatewaySenderException( String.format("GatewaySender %s can not be created with dispatcher threads less than 1", id)); if ((this.attrs.getOrderPolicy() != null) && this.attrs.getOrderPolicy().equals(OrderPolicy.THREAD)) { throw new GatewaySenderException( String.format("Parallel Gateway Sender %s can not be created with OrderPolicy %s", id, this.attrs.getOrderPolicy())); throw new GatewaySenderException( String.format( "SerialGatewaySener %s cannot define a remote site because at least AsyncEventListener is already added. Both listeners and remote site cannot be defined for the same gateway sender.",
throw new GatewaySenderException(exception);
throw new GatewaySenderException( String.format( "Non persistent gateway sender %s can not be attached to persistent region %s",