Package org.milyn

Examples of org.milyn.SmooksException


        case JTA:
          return new JtaTransactionManager(connection, (UserTransaction)lookup(transactionJndi), setAutoCommitAllowed);
        case EXTERNAL:
          return new ExternalTransactionManager(connection, isAutoCommit(), setAutoCommitAllowed);
        default:
          throw new SmooksException("The TransactionManager type '" + transactionManagerType + "' is unknown. This is probably a bug!");
      }
    }
View Full Code Here


                }
            } else {
                processFinishEvent();
            }
        } catch (IOException e) {
            throw new SmooksException("Failed to write report.", e);
        }
    }
View Full Code Here

        {
            return ClassUtil.forName(type, Exports.class);
        }
        catch (ClassNotFoundException e)
        {
            throw new SmooksException("Could not load class for type [" + type + "].");
        }
    }
View Full Code Here

        {
            return (Result) resultTypeClass.newInstance();
        }
        catch (InstantiationException e)
        {
            throw new SmooksException("Could not instantiate instance for result type ["
                        + resultTypeClass.getName() + "]", e);
        }
        catch (IllegalAccessException e)
        {
            throw new SmooksException("Could not create instance for result type ["
                        + resultTypeClass.getName() + "]", e);
        }
    }
View Full Code Here

            return;
        }

        ruleProvider = RuleProviderAccessor.get(appContext, ruleProviderName);
        if(ruleProvider == null) {
            throw new SmooksException("Unknown rule provider '" + ruleProviderName + "'.");
        }

        // Configure the base bundle name for validation failure messages...
        setMessageBundleBaseName();
View Full Code Here

    } else {

      Object result = startExpression.getValue(beanContext.getBeanMap());

      if(!(result instanceof Long || result instanceof Integer)) {
        throw new SmooksException("The start expression must result in a Integer or a Long");
      }

      return new Long(result.toString());

    }
View Full Code Here

    } else {

      Object result = amountExpression.getValue(beanContext.getBeanMap());

      if(result instanceof Integer == false) {
        throw new SmooksException("The amount expression must result in a Integer");
      }

      return (Integer) result;
    }
  }
View Full Code Here

            template.process(model, writer);
            writer.flush();
            templatingResult = writer.toString();
        } catch (TemplateException e) {
            throw new SmooksException("Failed to apply FreeMarker template to fragment '" + DomUtils.getXPath(element) + "'.  Resource: " + config, e);
        } catch (IOException e) {
            throw new SmooksException("Failed to apply FreeMarker template to fragment '" + DomUtils.getXPath(element) + "'.  Resource: " + config, e);
        }

        // Create the replacement DOM text node containing the applied template...
        Node resultNode = TextSerializationUnit.createTextElement(element, templatingResult);
View Full Code Here

        try {
            Map<String, Object> model = FreeMarkerUtils.getMergedModel(executionContext);
            template.process(model, writer);
            writer.flush();
        } catch (TemplateException e) {
            throw new SmooksException("Failed to apply FreeMarker template to fragment '" + SAXUtil.getXPath(element) + "'.  Resource: " + config, e);
        } catch (IOException e) {
            throw new SmooksException("Failed to apply FreeMarker template to fragment '" + SAXUtil.getXPath(element) + "'.  Resource: " + config, e);
        }
    }
View Full Code Here

  private void write( final ExecutionContext executionContext )
  {
    Object bean = executionContext.getBeanContext().getBean( beanId );
        if ( bean == null )
        {
          throw new SmooksException( "A bean with id [" + beanId + "] was not found in the executionContext");
        }

        OutputStream out = AbstractOutputStreamResource.getOutputStream( resourceName, executionContext );
    try
    {
      if ( bean instanceof String )
      {
            out.write( ( (String)bean).getBytes(encoding ) );
      }
      else if ( bean instanceof byte[] )
      {
            out.write( new String( (byte[]) bean, encoding ).getBytes() ) ;
      }
      else
      {
            out = new ObjectOutputStream( out );
            ((ObjectOutputStream)out).writeObject( bean );
      }

      out.flush();

    }
    catch (IOException e)
    {
        final String errorMsg = "IOException while trying to append to file";
        throw new SmooksException( errorMsg, 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.