Package org.switchyard.transform

Examples of org.switchyard.transform.TransformerRegistry


    @Override
    public void destroy() {
    }

    private void deployTransformers(BeanDeploymentMetaData beanDeploymentMetaData, ServiceDomain domain) {
        TransformerRegistry transformerRegistry = domain.getTransformerRegistry();

        for (CDIBean deploymentBean : beanDeploymentMetaData.getDeploymentBeans()) {
            Class<?> beanClass = deploymentBean.getBean().getBeanClass();

            if (TransformerUtil.isTransformer(beanClass)) {
                List<TransformerTypes> transformers = TransformerUtil.listTransformations(beanClass);
                for (TransformerTypes transformer : transformers) {
                    transformerRegistry.addTransformer(TransformerUtil.newTransformer(beanClass,
                            transformer.getFrom(), transformer.getTo()));
                }
            }
        }
    }
View Full Code Here


     * @param domainName The domain name.
     * @param switchyardConfig The SwitchYard configuration.
     * @return The ServiceDomain instance.
     */
    public ServiceDomain createDomain(QName domainName, SwitchYardModel switchyardConfig) {
        TransformerRegistry transformerRegistry = new BaseTransformerRegistry();
        ValidatorRegistry validatorRegistry = new BaseValidatorRegistry();

        SwitchYardCamelContextImpl camelContext = new SwitchYardCamelContextImpl();
        CamelExchangeBus bus = new CamelExchangeBus(camelContext);

View Full Code Here

        }
        if (type.isInstance(body)) {
            return type.cast(body);
        }

        TransformerRegistry transformerRegistry = getTransformerRegistry();
        if (transformerRegistry == null) {
            throw BusMessages.MESSAGES.cannotConvertNoTransformRegistry(body.getClass().getName(), type.getName());
        }

        QName toType = JavaTypes.toMessageType(type);
        QName fromType = JavaTypes.toMessageType(body.getClass());
        Transformer transformer = transformerRegistry.getTransformer(fromType, toType);
        if (transformer == null) {
            T camelBody = super.getBody(type, body);
            if (camelBody == null) {
                throw BusMessages.MESSAGES.transformerMustBeRegistered(body.getClass().getName(), type.getName(), fromType.toString(), toType.toString());
            }
View Full Code Here

TOP

Related Classes of org.switchyard.transform.TransformerRegistry

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.