public static String getName(Meter.Type type) { switch (type) { case DISTRIBUTION_SUMMARY: return "summary"; case COUNTER: return "counter"; case TIMER: return "timer"; default: throw new RuntimeCamelException("Unsupported meter type " + type); } }
/** * The Server Fully Qualified Domain Name (FQDN). * Used in message ids sent by endpoint. */ public void setServerFqdn(String serverFqdn) { if (clientFqdn == null) { throw new RuntimeCamelException("Parameter 'serverFqdn' can not be null"); } this.serverFqdn = serverFqdn; }
public RestNettyHttpBinding copy() { try { return (RestNettyHttpBinding)this.clone(); } catch (CloneNotSupportedException e) { throw new RuntimeCamelException(e); } }
public KubernetesConfiguration copy() { try { return (KubernetesConfiguration) super.clone(); } catch (CloneNotSupportedException e) { throw new RuntimeCamelException(e); } }
@Override public ConsulClusterConfiguration copy() { try { return (ConsulClusterConfiguration)super.clone(); } catch (CloneNotSupportedException e) { throw new RuntimeCamelException(e); } } }
public AtomixMapConfiguration copy() { try { return (AtomixMapConfiguration) super.clone(); } catch (CloneNotSupportedException e) { throw new RuntimeCamelException(e); } } }
public AtomixSetConfiguration copy() { try { return (AtomixSetConfiguration) super.clone(); } catch (CloneNotSupportedException e) { throw new RuntimeCamelException(e); } } }
public Web3jConfiguration copy() { try { return (Web3jConfiguration)super.clone(); } catch (CloneNotSupportedException e) { throw new RuntimeCamelException(e); } } }
@Override public ZooKeeperServiceRegistryConfiguration copy() { try { return (ZooKeeperServiceRegistryConfiguration)super.clone(); } catch (CloneNotSupportedException e) { throw new RuntimeCamelException(e); } } }
public InfinispanConfiguration copy() { try { return (InfinispanConfiguration)super.clone(); } catch (CloneNotSupportedException e) { throw new RuntimeCamelException(e); } }
private void signalJobFailure(String[] args) { throw new RuntimeCamelException("Execution of Talend job '" + job.getClass().getCanonicalName() + "' with args: " + (args == null ? "none" : Arrays.toString(args)) + "' failed, see stderr for details. "); } }
private byte[] serializeBodyFrom(final Message msg) throws IOException { try (ByteArrayOutputStream b = new ByteArrayOutputStream(); ObjectOutputStream o = new ObjectOutputStream(b)) { o.writeObject(msg.getBody()); return b.toByteArray(); } catch (NotSerializableException nse) { LOG.warn("Cannot send object {} via RabbitMQ because it contains non-serializable objects.", msg.getBody().getClass()); throw new RuntimeCamelException(nse); } } }
public Element set(int index, Element element) { Source s = body.set(index, new DOMSource(element)); try { return StaxUtils.read(s).getDocumentElement(); } catch (XMLStreamException e) { throw new RuntimeCamelException("Problem converting content to Element", e); } }
private void createAS2ClientConnection() { try { as2ClientConnection = AS2ConnectionHelper.createAS2ClientConnection(configuration); } catch (UnknownHostException e) { throw new RuntimeCamelException(String.format("Client HTTP connection failed: Unknown target host '%s'", configuration.getTargetHostname())); } catch (IOException e) { throw new RuntimeCamelException("Client HTTP connection failed", e); } }
public Element get(int index) { Source s = body.get(index); try { Element el = StaxUtils.read(s).getDocumentElement(); addNamespace(el, nsMap); body.set(index, new DOMSource(el)); return el; } catch (Exception ex) { throw new RuntimeCamelException("Problem converting content to Element", ex); } }
private void waitForConfirmation() throws IOException { try { LOG.debug("Waiting for publisher acknowledgements for {}ms", endpoint.getPublisherAcknowledgementsTimeout()); channel.waitForConfirmsOrDie(endpoint.getPublisherAcknowledgementsTimeout()); if (basicReturnReceived) { throw new RuntimeCamelException("Failed to deliver message; basic.return received"); } } catch (InterruptedException | TimeoutException e) { LOG.warn("Acknowledgement error for {}", camelExchange); throw new RuntimeCamelException(e); } }
private void startRoute(String id) { try { camelContext.getRouteController().startRoute(id); } catch (Exception e) { throw new RuntimeCamelException(e); } }
private void resetRoute(String id) { try { ManagedRouteMBean managedRouteMBean = camelContext.getManagedRoute(id, ManagedRouteMBean.class); if (managedRouteMBean != null) { managedRouteMBean.reset(true); } } catch (Exception e) { throw new RuntimeCamelException(e); } }
@Override protected Object createBody() { try { return endpoint.getHttpBinding().parseBody(this); } catch (IOException e) { throw new RuntimeCamelException(e); } }
@Override public void onCanceled() { exchange.setException(new RuntimeCamelException("OData HTTP Request cancelled!")); callback.done(false); } });