Package org.milyn.cdr

Examples of org.milyn.cdr.SmooksConfigurationException


   
    sendInVisitAfter = Boolean.parseBoolean( config.getStringParameter( SEND_IN_VISIT_AFTER , "false" ) );
    sendInVisitBefore = Boolean.parseBoolean( config.getStringParameter( SEND_IN_VISIT_BEFORE , "false" ) );
   
    if ( sendInVisitBefore == false && sendInVisitAfter == false )
      throw new SmooksConfigurationException ("Atleast one of [" + SEND_IN_VISIT_BEFORE + "] and [" + SEND_IN_VISIT_AFTER + "] must be true" );
  }
View Full Code Here


  private ServiceInvoker serviceInvoker;

  public void setConfiguration( SmooksResourceConfiguration config ) throws SmooksConfigurationException
  {
    if ( config == null )
      throw new SmooksConfigurationException( " SmooksResourceConfig was null." );
   
    resourceConfig = config;
   
    serviceCategoryName = resourceConfig.getStringParameter( SERVICE_CATEGORY_NAME_ATTR );
    if ( serviceCategoryName == null )
      throw new SmooksConfigurationException( "[" + SERVICE_CATEGORY_NAME_ATTR + "] must be set.");
   
    serviceName = resourceConfig.getStringParameter( SERVICE_NAME_ATTR );
    if ( serviceName == null )
      throw new SmooksConfigurationException( "[" + SERVICE_NAME_ATTR + "] must be set.");
    try
    {
      serviceInvoker = createServiceInvoker( serviceCategoryName, serviceName );
    }
    catch (MessageDeliverException e)
    {
      log.error( "Could not create a ServiceInvoker", e );
      throw new SmooksConfigurationException ( e );
    }
  }
View Full Code Here

        datasource = (DataSource) lookup(datasourceJndi);

        if(transactionManagerType == TransactionManagerType.JTA) {
          if(transactionJndi == null || transactionJndi.length() == 0) {
            throw new SmooksConfigurationException("The transactionJndi attribute must be set when the JTA transaction manager is set.");
          }

          //On JTA transaction manager then the autoCommit is always false
          autoCommit = false;
        }
View Full Code Here

    Context context = null;
    try {
      context = new InitialContext();
        return context.lookup(jndi);
    } catch (NamingException e) {
        throw new SmooksConfigurationException("JNDI Context lookup failed for '" + jndi + "'.", e);
    } finally {
        if(context != null) {
            try {
                context.close();
            } catch (NamingException e) {
                throw new SmooksConfigurationException("Error closing Naming Context after looking up DataSource JNDI '" + datasourceJndi + "'.", e);
            }
        }
    }
  }
View Full Code Here

        isConfigurable = false;

        try {
            context.getStore().setNamespaces();
        } catch (SAXPathException e) {
            throw new SmooksConfigurationException("Error configuring namespaces", e);
        }
    }
View Full Code Here

        this.autoCloseWriter = autoCloseWriter;
    }

    public File getTempOutDir() {
        if(tempOutDir == null) {
            throw new SmooksConfigurationException("Temp OutDir not set.");
        }
        return tempOutDir;
    }
View Full Code Here

        public static ExpressionEvaluator createInstance(String className, String conditionExpression) {
            try {
                ExpressionEvaluator evaluator = (ExpressionEvaluator) ClassUtil.forName(className, Factory.class).newInstance();

                if(!(evaluator instanceof ExecutionContextExpressionEvaluator)) {
                    throw new SmooksConfigurationException("Unsupported ExpressionEvaluator type '" + className + "'.  Currently only support '" + ExecutionContextExpressionEvaluator.class.getName() + "' implementations.");
                }
                evaluator.setExpression(conditionExpression);

                return evaluator;
            } catch (ClassNotFoundException e) {
                throw new SmooksConfigurationException("Failed to load ExpressionEvaluator Class '" + className + "'.", e);
            } catch (ClassCastException e) {
                throw new SmooksConfigurationException("Class '" + className + "' is not a valid ExpressionEvaluator.  It doesn't implement " + ExpressionEvaluator.class.getName());
            } catch (IllegalAccessException e) {
                throw new SmooksConfigurationException("Failed to load ExpressionEvaluator Class '" + className + "'.", e);
            } catch (InstantiationException e) {
                throw new SmooksConfigurationException("Failed to load ExpressionEvaluator Class '" + className + "'.", e);
            }
        }
View Full Code Here

        String maxFailsConfig = executionContext.getConfigParameter(OnFailResult.MAX_FAILS);
        if(maxFailsConfig != null) {
            try {
                maxFails = Integer.parseInt(maxFailsConfig.trim());
            } catch(NumberFormatException e) {
                throw new SmooksConfigurationException("Invalid config value '" + maxFailsConfig.trim() + "' for global parameter '" + OnFailResult.MAX_FAILS + "'.  Must be a valid Integer value.");
            }
        } else {
            maxFails = Integer.MAX_VALUE;
        }
    }
View Full Code Here

            configurator.getParameters().setProperty("bindBeanId", binding.getBeanId());
            configurator.getParameters().setProperty("bindBeanClass", binding.getBeanClass().getName());
            configurator.getParameters().setProperty("bindingType", binding.getBindingType().toString());
            if(binding.getBindingType() == FixedLengthBindingType.MAP) {
                if(binding.getKeyField() == null) {
                    throw new SmooksConfigurationException("Fixed length 'MAP' Binding must specify a 'keyField' property on the binding configuration.");
                }
                configurator.getParameters().setProperty("bindMapKeyField", binding.getKeyField());
            }
        }
View Full Code Here

                addFieldBindings(bean);

                listBean.addVisitors(visitorMap);
            } else if(bindingType == FixedLengthBindingType.MAP) {
                if(bindMapKeyField == null) {
                    throw new SmooksConfigurationException("FixedLenght 'MAP' Binding must specify a 'keyField' property on the binding configuration.");
                }

                assertValidFieldName(bindMapKeyField);

                Bean mapBean = new Bean(LinkedHashMap.class, bindBeanId, "$document");
View Full Code Here

TOP

Related Classes of org.milyn.cdr.SmooksConfigurationException

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.