@Override public MuleEvent handleException(Exception exception, MuleEvent event) { event.getMuleContext().getExceptionListener().handleException(exception); return event; } }
public void run() { ClassLoader originalCl = Thread.currentThread().getContextClassLoader(); try { try { Thread.currentThread().setContextClassLoader(classLoader); if (!worker.isRunning()) { workManager.scheduleWork(worker); } } catch (Exception e) { receiver.getEndpoint().getMuleContext().getExceptionListener().handleException(e); } } finally { Thread.currentThread().setContextClassLoader(originalCl); } }
private void doOnConnectException(ConnectException ce) { MuleContext muleContext = ((AbstractConnector) ce.getFailed()).getMuleContext(); muleContext.getExceptionListener().handleException(ce); }
protected void pollMessagesOutsideTransactions() throws Exception { ExecutionTemplate<MuleEvent> pt = createExecutionTemplate(); List messages = getMessages(); if (messages != null && messages.size() > 0) { final CountDownLatch countdown = new CountDownLatch(messages.size()); for (Object message : messages) { try { this.getWorkManager().scheduleWork( new MessageProcessorWorker(pt, countdown, endpoint.getMuleContext().getExceptionListener(), message)); } catch (Exception e) { countdown.countDown(); throw e; } } countdown.await(); } }
protected void doRun() { try { processMessages(); } catch (MessagingException e) { //already managed by TransactionTemplate } catch (Exception e) { endpoint.getMuleContext().getExceptionListener().handleException(e); } }
public void run() { try { generateEvent(endpoint, payload, messageProperties, MessageExchangePattern.ONE_WAY); } catch (Exception e) { getConnector().getMuleContext().getExceptionListener().handleException(e); } }
getMuleContext().getExceptionListener().handleException(e);
@Override public void doRun() { try { Object message; do { message = getNextMessage(resource); messages.add(message); super.doRun(); } while (message != null && hasMoreMessages(message)); } catch (Exception e) { endpoint.getMuleContext().getExceptionListener().handleException(e); } }
getMuleContext().getExceptionListener().handleException(e);
public void poll() { try { Object result = invokeMethod.invoke(remoteObject, getMethodArguments()); if (null != result) { routeMessage(createMuleMessage(result)); } } catch (Exception e) { getEndpoint().getMuleContext().getExceptionListener().handleException(e); } }
muleContext.getExceptionListener().handleException((Exception) e); muleContext.getExceptionListener().handleException( new MuleRuntimeException(CoreMessages.connectorCausedError(this.getName()), e));
/** * Implementation {@link Runnable#run()} that will invoke the method on the pojo that this message source wraps. * */ public void run() { Object moduleObject = null; try { moduleObject = findOrCreate(null, false, null); final ProcessTemplate<Object, Object> processTemplate = ((ProcessAdapter<Object> ) moduleObject).getProcessTemplate(); final SourceCallback sourceCallback = this; final Integer transformedCount = ((Integer) transform(getMuleContext(), ((MuleEvent) null), getClass().getDeclaredField("_countType").getGenericType(), null, count)); processTemplate.execute(new ProcessCallback<Object,Object>() { public List<Class<? extends Exception>> getManagedExceptions() { return null; } public boolean isProtected() { return false; } public Object process(Object object) throws Exception { ((TwitterConnector) object).linkStream(transformedCount, sourceCallback); return null; } } , null, ((MuleEvent) null)); } catch (Exception e) { getMuleContext().getExceptionListener().handleException(e); } }
/** * Implementation {@link Runnable#run()} that will invoke the method on the pojo that this message source wraps. * */ public void run() { Object moduleObject = null; try { moduleObject = findOrCreate(null, false, null); final ProcessTemplate<Object, Object> processTemplate = ((ProcessAdapter<Object> ) moduleObject).getProcessTemplate(); final SourceCallback sourceCallback = this; final Integer transformedCount = ((Integer) transform(getMuleContext(), ((MuleEvent) null), getClass().getDeclaredField("_countType").getGenericType(), null, count)); processTemplate.execute(new ProcessCallback<Object,Object>() { public List<Class<? extends Exception>> getManagedExceptions() { return null; } public boolean isProtected() { return false; } public Object process(Object object) throws Exception { ((TwitterConnector) object).firehoseStream(transformedCount, sourceCallback); return null; } } , null, ((MuleEvent) null)); } catch (Exception e) { getMuleContext().getExceptionListener().handleException(e); } }
/** * Implementation {@link Runnable#run()} that will invoke the method on the pojo that this message source wraps. * */ public void run() { Object moduleObject = null; try { moduleObject = findOrCreate(null, false, null); final ProcessTemplate<Object, Object> processTemplate = ((ProcessAdapter<Object> ) moduleObject).getProcessTemplate(); final SourceCallback sourceCallback = this; final List<String> transformedKeywords = ((List<String> ) transform(getMuleContext(), ((MuleEvent) null), getClass().getDeclaredField("_keywordsType").getGenericType(), null, keywords)); processTemplate.execute(new ProcessCallback<Object,Object>() { public List<Class<? extends Exception>> getManagedExceptions() { return null; } public boolean isProtected() { return false; } public Object process(Object object) throws Exception { ((TwitterConnector) object).userStream(transformedKeywords, sourceCallback); return null; } } , null, ((MuleEvent) null)); } catch (Exception e) { getMuleContext().getExceptionListener().handleException(e); } }
@Override protected void pollMessagesOutsideTransactions() throws Exception { ExecutionTemplate<MuleEvent> pt = createExecutionTemplate(); List messages = getMessages(); if (messages != null && messages.size() > 0) { for (Object message : messages) { try { this.getWorkManager().scheduleWork( new MessageProcessorWorker(pt, endpoint.getMuleContext().getExceptionListener(), message)); } catch (Exception e) { throw e; } } } }
/** * Implementation {@link Runnable#run()} that will invoke the method on the pojo that this message source wraps. * */ public void run() { Object moduleObject = null; try { moduleObject = findOrCreate(null, false, null); final ProcessTemplate<Object, Object> processTemplate = ((ProcessAdapter<Object> ) moduleObject).getProcessTemplate(); final SourceCallback sourceCallback = this; processTemplate.execute(new ProcessCallback<Object,Object>() { public List<Class<? extends Exception>> getManagedExceptions() { return null; } public boolean isProtected() { return false; } public Object process(Object object) throws Exception { ((TwitterConnector) object).sampleStream(sourceCallback); return null; } } , null, ((MuleEvent) null)); } catch (Exception e) { getMuleContext().getExceptionListener().handleException(e); } }
receiver.getEndpoint().getMuleContext().getExceptionListener().handleException(e1); receiver.getEndpoint().getMuleContext().getExceptionListener().handleException(e);
@Override public void poll() throws Exception { // Wait 10% less than the polling frequency. This approach makes sure that we finish // in time before the next poll call comes in try { long frequency = getFrequency(); long tenPercent = (long)(frequency * 0.1); long pollTimeout = frequency - tenPercent; Message xmppMessage = conversation.receive(pollTimeout); if (xmppMessage == null) { return; } processMessage(xmppMessage); } catch (Exception e) { getEndpoint().getMuleContext().getExceptionListener().handleException(e); throw e; } }
getEndpoint().getMuleContext().getExceptionListener().handleException(e);
public void completeProcessingRequest() { try { if (discardMessage) { super.discardMessageOnThrottlingExceeded(); } else if (emptyResponseReceived) { getServletResponseWriter().writeEmptyResponse(getServletResponse(), null); } else if (responseForClient != null) { super.sendResponseToClient(responseForClient); } else { super.sendFailureResponseToClient(failureResponseForClient); } } catch (Exception e) { getMuleContext().getExceptionListener().handleException(e); } }