private void handleException(MuleEvent event, Throwable e) throws MuleException { throw new MessagingException(CoreMessages.failedToInvoke(this.operationName), event, e); }
@Override public MuleEvent process(MuleEvent event) throws MuleException { MuleEvent resultEvent = event; Object[] args = evaluateArguments(event, arguments); if (logger.isDebugEnabled()) { logger.debug(String.format("Invoking '%s' of '%s' with arguments: '%s'", method.getName(), object, args)); } try { Object result = method.invoke(object, args); if (!method.getReturnType().equals(void.class)) { resultEvent = createResultEvent(event, result); } } catch (Exception e) { throw new MessagingException(CoreMessages.failedToInvoke(object.toString()), event, e, this); } return resultEvent; }
/** * Invokes the MessageProcessor. * * @param event MuleEvent to be processed * @throws MuleException */ public MuleEvent process(MuleEvent event) throws MuleException { MuleMessage _muleMessage = event.getMessage(); FTPServerModuleLifecycleAdapter castedModuleObject = null; if (moduleObject instanceof String) { castedModuleObject = ((FTPServerModuleLifecycleAdapter) muleContext.getRegistry().lookupObject(((String) moduleObject))); if (castedModuleObject == null) { throw new MessagingException(CoreMessages.failedToCreate("containsFiles"), event, new RuntimeException("Cannot find the configuration specified by the config-ref attribute.")); } } else { castedModuleObject = ((FTPServerModuleLifecycleAdapter) moduleObject); } try { String transformedFile = ((String) evaluateAndTransform(_muleMessage, ContainsFilesMessageProcessor.class.getDeclaredField("_fileType").getGenericType(), null, file)); String transformedPath = ((String) evaluateAndTransform(_muleMessage, ContainsFilesMessageProcessor.class.getDeclaredField("_pathType").getGenericType(), null, path)); retryCount.getAndIncrement(); castedModuleObject.containsFiles(transformedFile, transformedPath); retryCount.set(0); return event; } catch (Exception e) { throw new MessagingException(CoreMessages.failedToInvoke("containsFiles"), event, e); } }
/** * Invokes the MessageProcessor. * * @param event MuleEvent to be processed * @throws MuleException */ public MuleEvent process(MuleEvent event) throws MuleException { MuleMessage _muleMessage = event.getMessage(); FTPServerModuleLifecycleAdapter castedModuleObject = null; if (moduleObject instanceof String) { castedModuleObject = ((FTPServerModuleLifecycleAdapter) muleContext.getRegistry().lookupObject(((String) moduleObject))); if (castedModuleObject == null) { throw new MessagingException(CoreMessages.failedToCreate("remove"), event, new RuntimeException("Cannot find the configuration specified by the config-ref attribute.")); } } else { castedModuleObject = ((FTPServerModuleLifecycleAdapter) moduleObject); } try { String transformedPath = ((String) evaluateAndTransform(_muleMessage, RemoveMessageProcessor.class.getDeclaredField("_pathType").getGenericType(), null, path)); retryCount.getAndIncrement(); castedModuleObject.remove(transformedPath); retryCount.set(0); return event; } catch (Exception e) { throw new MessagingException(CoreMessages.failedToInvoke("remove"), event, e); } }
/** * Invokes the MessageProcessor. * * @param event MuleEvent to be processed * @throws MuleException */ public MuleEvent process(MuleEvent event) throws MuleException { MuleMessage _muleMessage = event.getMessage(); FTPServerModuleLifecycleAdapter castedModuleObject = null; if (moduleObject instanceof String) { castedModuleObject = ((FTPServerModuleLifecycleAdapter) muleContext.getRegistry().lookupObject(((String) moduleObject))); if (castedModuleObject == null) { throw new MessagingException(CoreMessages.failedToCreate("stopServer"), event, new RuntimeException("Cannot find the configuration specified by the config-ref attribute.")); } } else { castedModuleObject = ((FTPServerModuleLifecycleAdapter) moduleObject); } try { retryCount.getAndIncrement(); castedModuleObject.stopServer(); retryCount.set(0); return event; } catch (Exception e) { throw new MessagingException(CoreMessages.failedToInvoke("stopServer"), event, e); } }
/** * Invokes the MessageProcessor. * * @param event MuleEvent to be processed * @throws MuleException */ public MuleEvent process(MuleEvent event) throws MuleException { MuleMessage _muleMessage = event.getMessage(); FTPServerModuleLifecycleAdapter castedModuleObject = null; if (moduleObject instanceof String) { castedModuleObject = ((FTPServerModuleLifecycleAdapter) muleContext.getRegistry().lookupObject(((String) moduleObject))); if (castedModuleObject == null) { throw new MessagingException(CoreMessages.failedToCreate("startServer"), event, new RuntimeException("Cannot find the configuration specified by the config-ref attribute.")); } } else { castedModuleObject = ((FTPServerModuleLifecycleAdapter) moduleObject); } try { retryCount.getAndIncrement(); castedModuleObject.startServer(); retryCount.set(0); return event; } catch (Exception e) { throw new MessagingException(CoreMessages.failedToInvoke("startServer"), event, e); } }
throw messagingException; } catch (Exception e) { throw new MessagingException(CoreMessages.failedToInvoke("addWorkdayAccount"), event, e);
throw messagingException; } catch (Exception e) { throw new MessagingException(CoreMessages.failedToInvoke("getCertificationIssuers"), event, e);
throw messagingException; } catch (Exception e) { throw new MessagingException(CoreMessages.failedToInvoke("putPeriodSchedulePayrollInterface"), event, e);
throw messagingException; } catch (Exception e) { throw new MessagingException(CoreMessages.failedToInvoke("getQuarterlyWorkerTaxFilingData"), event, e);
throw messagingException; } catch (Exception e) { throw new MessagingException(CoreMessages.failedToInvoke("putEducationalInstitutionType"), event, e);
throw messagingException; } catch (Exception e) { throw new MessagingException(CoreMessages.failedToInvoke("startPerformanceReview"), event, e);
throw messagingException; } catch (Exception e) { throw new MessagingException(CoreMessages.failedToInvoke("putPayrollDeductionRecipient"), event, e);
throw messagingException; } catch (Exception e) { throw new MessagingException(CoreMessages.failedToInvoke("putPayrollHistoryPayment"), event, e);
throw messagingException; } catch (Exception e) { throw new MessagingException(CoreMessages.failedToInvoke("putCompetencyCategory"), event, e);
throw messagingException; } catch (Exception e) { throw new MessagingException(CoreMessages.failedToInvoke("getJobPostings"), event, e);
throw messagingException; } catch (Exception e) { throw new MessagingException(CoreMessages.failedToInvoke("getSkillSourcePrecedences"), event, e);
throw messagingException; } catch (Exception e) { throw new MessagingException(CoreMessages.failedToInvoke("hireEmployee"), event, e);
throw messagingException; } catch (Exception e) { throw new MessagingException(CoreMessages.failedToInvoke("getPeriodSchedulesPayrollInterface"), event, e);
@Override public MuleEvent process(MuleEvent event) throws MessagingException { try { int timeout = event.getMessage().getInboundProperty(CHANNEL.TIMEOUT, event.getMuleContext().getConfiguration().getDefaultResponseTimeout()); if (inboundEndpoint instanceof DynamicRequestEndpoint) { MuleMessage message =((DynamicRequestEndpoint) inboundEndpoint).request(timeout, event); if(message == null) { message = new DefaultMuleMessage(NullPayload.getInstance(), event.getMuleContext()); } return new DefaultMuleEvent(message, event); } else { return new DefaultMuleEvent(inboundEndpoint.request(event.getMuleContext() .getConfiguration() .getDefaultResponseTimeout()), event); } } catch (Exception e) { throw new MessagingException(CoreMessages.failedToInvoke("inboundEndpoint.request()"), event, e, this); } } }