Package org.milyn

Examples of org.milyn.SmooksException


                producerTemplate.send(toEndpoint, processor);
            }else {
                producerTemplate.sendBodyAndHeaders(toEndpoint, bean, execContext.getBeanContext().getBeanMap());
            }
        }  catch (final Exception e) {
            throw new SmooksException("Exception routing beanId '" + beanId + "' to endpoint '" + toEndpoint + "'.", e);
        }
    }
View Full Code Here


    }
   
    private Object getBeanFromExecutionContext(final ExecutionContext execContext, final String beanId) {
        final Object bean = execContext.getBeanContext().getBean(beanId);
        if (bean == null) {
            throw new SmooksException("Exception routing beanId '" + beanId
                    + "'. The bean was not found in the Smooks ExceutionContext.");
        }

        return bean;
    }
View Full Code Here

    @Uninitialize
    public void uninitialize() {
        try {
            producerTemplate.stop();
        catch (final Exception e) {
            throw new SmooksException(e.getMessage(), e);
        }
    }
View Full Code Here

        String correlationId = correlationIdTemplate.apply(beanMap);

        try {
            message.setJMSCorrelationID(correlationId);
        } catch (JMSException e) {
            throw new SmooksException("Failed to set CorrelationID '" + correlationId + "' on message.", e);
        }
    }
View Full Code Here

          @SuppressWarnings("unchecked")
          Map<String, Object> castParams = (Map<String, Object>) beanContext.getBean(beanId);

          params = castParams;
        } catch(ClassCastException e) {
            throw new SmooksException("Illegal use of reserved beanId '" + STATVAR + "'.  Must be a Map.  Is a " + params.getClass().getName(), e);
        }

        if(params == null) {
            params = new HashMap<String, Object>();
            beanContext.addBean(beanId, params, source);
View Full Code Here

    private void intialize(List<Properties> descriptors, EntityResolver schemaResolver, EntityResolver bindingResolver) throws SAXException, IOException {

        if(schemaResolver instanceof AbstractResolver) {
            if(((AbstractResolver)schemaResolver).getClassLoader() != classloader) {
                throw new SmooksException("Schema EntityResolver '" + schemaResolver.getClass().getName() + "' not using the same ClassLoader as this Descriptor instance.");
            }
        }
        if(bindingResolver instanceof AbstractResolver) {
            if(((AbstractResolver)bindingResolver).getClassLoader() != classloader) {
                throw new SmooksException("Binding EntityResolver '" + bindingResolver.getClass().getName() + "' not using the same ClassLoader as this Descriptor instance.");
            }
        }

        if(schemaResolver != null) {
            this.schema = newSchemaInstance(descriptors, schemaResolver);
View Full Code Here

        for(Node node : toSerializeNodes) {
            try {
                serialize(node, serializeWriter);
            } catch (IOException e) {
                throw new SmooksException("Unexpected pre-text node serialization exception.", e);
            }
        }

        // Get rid of leading and space characters (only spaces - not all whitespace).
        // This helps eliminate ugly indentation issues in the serialized XML...
        String xml;
        try {
            xml = normalizeLines(serializeWriter.toString());
        } catch (IOException e) {
            throw new SmooksException("Unexpected pre-text node serialization exception while attempting to remove excess whitespace.", e);
        }
        StringBuilder trimEnd = new StringBuilder(xml);
        while(trimEnd.length() > 0 && trimEnd.charAt(0) == ' ') {
            trimEnd.deleteCharAt(0);
        }
View Full Code Here

        AssertArgument.isNotNull(context, "context");

        Map<String, RuleProvider> providers = getRuleProviders(context);
        if ( providers == null || providers.isEmpty())
        {
            throw new SmooksException("No RuleProviders were found. Have you configured a rules section in your Smooks configuration?");
        }

        final RuleProvider provider = providers.get(ruleProviderName);
        if (provider == null)
        {
            throw new SmooksException("Not provider with name '" + ruleProviderName  + "' was found in the execution context. Have you configured the rules section properly?");
        }

        return provider;
    }
View Full Code Here

        return compositeRuleName.substring(0, lastIndexOfDot);
    }

    private static void throwInvalidCompositeRuleName(final String compositRuleName)
    {
        throw new SmooksException("A rule must be specified in the format <ruleProviderName>.<ruleName>." +
                " Please check you configuration and make sure that you are referencing the rule in a correct manner.");
    }
View Full Code Here

        {
            return providerClass.newInstance();
        }
        catch (final InstantiationException e)
        {
            throw new SmooksException(e.getMessage(), e);
        }
        catch (final IllegalAccessException e)
        {
            throw new SmooksException(e.getMessage(), e);
        }
    }
View Full Code Here

TOP

Related Classes of org.milyn.SmooksException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.