public ResponseValidatorException(String message, MuleEvent event) { super(CoreMessages.createStaticMessage(message), event); } }
public KeyedPoolMessageDispatcherFactoryAdapter(MessageDispatcherFactory factory) { super(); if (factory == null) { throw new IllegalArgumentException(CoreMessages.objectIsNull("factory").toString()); } this.factory = factory; }
private void handleException(MuleEvent event, Throwable e) throws MuleException { throw new MessagingException(CoreMessages.failedToInvoke(this.operationName), 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); } }
protected EndpointBuilder createEndpointBuilder(Object[] constructorParams) throws TransportFactoryException { logger.debug("Loading endpoint builder: " + endpointBuilder); try { return (EndpointBuilder) ClassUtils.instanciateClass(endpointBuilder, constructorParams, classLoader); } catch (Exception e) { throw new TransportFactoryException(CoreMessages.failedToLoad("Endpoint Builder: " + endpointBuilder), e); } }
public void initialise() throws InitialisationException { if (algorithm == null) { throw new InitialisationException(CoreMessages.objectIsNull("Algorithm"), this); } else { logger.debug("Using encryption algorithm: " + algorithm); } keySpec = createKeySpec(); try { secretKey = getSecretKey(); createAndInitCiphers(); } catch (Exception e) { throw new InitialisationException(CoreMessages.failedToCreate("encryption ciphers"), e, this); } }
protected ServerNotification createNotification(MuleContext context, String action) { try { return (ServerNotification)ctor.newInstance(context, action); } catch (Exception e) { throw new MuleRuntimeException(CoreMessages.failedToCreate("Notification:" + action) ,e); } } }
@Override protected void doStart() throws MuleException { try { quartzScheduler.start(); } catch (Exception e) { throw new ConnectorException(CoreMessages.failedToStart("Quartz provider"), this, e); } }
@Override public void initialise() throws InitialisationException { Logger log = LoggerFactory.getLogger(ServiceNowConnectorLifecycleAdapter.class); MuleVersion connectorVersion = new MuleVersion("3.5"); MuleVersion muleVersion = new MuleVersion(MuleManifest.getProductVersion()); if (!muleVersion.atLeastBase(connectorVersion)) { throw new InitialisationException(CoreMessages.minMuleVersionNotMet(this.getMinMuleVersion()), this); } }
throw new InitialisationException(CoreMessages.propertiesNotSet("jndiName"), this); throw new InitialisationException(CoreMessages.failedToCreate("Jndi context"), e, this);
/** * Returns the StreamSource corresponding to xslt (which should have been loaded * in {@link #initialise()}). * * @return The StreamSource */ protected StreamSource getStreamSource() throws InitialisationException { if (xslt == null) { throw new InitialisationException(CoreMessages.propertiesNotSet("xsl-file or xsl-text"), this); } else { return new StreamSource(new StringReader(xslt)); } }
/** * 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); } }
private KeyStore createTrustStore() throws CreateException { trustStorePassword = null == trustStorePassword ? "" : trustStorePassword; KeyStore trustStore; try { trustStore = KeyStore.getInstance(trustStoreType); InputStream is = IOUtils.getResourceAsStream(trustStoreName, getClass()); if (null == is) { throw new FileNotFoundException( "Failed to load truststore from classpath or local file: " + trustStoreName); } trustStore.load(is, trustStorePassword.toCharArray()); } catch (Exception e) { throw new CreateException( failedToLoad("TrustStore: " + trustStoreName), e, this); } return trustStore; }
protected synchronized void createStoreDirectory(File directory) { // To support concurrency we need to check if directory exists again inside // synchronized method if (!directory.exists() && !directory.mkdirs()) { Message message = CoreMessages.failedToCreate("object store directory " + directory.getAbsolutePath()); throw new MuleRuntimeException(message); } }
@Override public void start() throws MuleException { try { mBeanServer.invoke(adaptorName, "start", null, null); } catch (InstanceNotFoundException e) { throw new JmxManagementException( CoreMessages.failedToStart("Jdmk agent"), adaptorName, e); } catch (MBeanException e) { throw new JmxManagementException( CoreMessages.failedToStart("Jdmk agent"), adaptorName, e); } catch (ReflectionException e) { // ignore } }
@Override public void initialise() throws InitialisationException { Logger log = LoggerFactory.getLogger(LDAPConnectorLifecycleAdapter.class); MuleVersion connectorVersion = new MuleVersion("3.5"); MuleVersion muleVersion = new MuleVersion(MuleManifest.getProductVersion()); if (!muleVersion.atLeastBase(connectorVersion)) { throw new InitialisationException(CoreMessages.minMuleVersionNotMet(this.getMinMuleVersion()), this); } }
@Override public void initialise() throws InitialisationException { super.initialise(); if(getReturnClass().equals(Object.class)) { throw new InitialisationException(CoreMessages.propertiesNotSet("returnClass"), this); } }
public InvalidExpressionException(String expression, String message) { super(CoreMessages.createStaticMessage(message + ". Offending expression string is: " + expression)); this.expression = expression; this.message = message; }
@Override protected void doStore(Serializable key, T value) throws ObjectStoreException { if (value == null) { throw new ObjectStoreException(CoreMessages.objectIsNull("value")); } map.put(key, value); }
/** * 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); } }