Package org.apache.commons.jelly

Examples of org.apache.commons.jelly.JellyException


        try {
            return new JexlExpression(
                org.apache.commons.jexl.ExpressionFactory.createExpression(text)
            );
        } catch (Exception e) {
            throw new JellyException("Unable to create expression: " + text, e);
        }
    }
View Full Code Here


        {
            expression = new JexlExpression( org.apache.commons.jexl.ExpressionFactory.createExpression( text ) );
        }
        catch ( Exception anException )
        {
            throw new JellyException( "error evaluating expression", anException );
        }

        final Expression jexlExpression = expression;

        if ( isSupportAntVariables() && isValidAntVariableName( text ) )
View Full Code Here

        if ( rootCause != null )
        {
            if ( rootCause instanceof JellyException )
            {
                returnCode = RC_JELLY_FAILED;
                JellyException jellyEx = (JellyException) rootCause;

                fileName = jellyEx.getFileName();
                elementName = jellyEx.getElementName();

                lineNumber = jellyEx.getLineNumber();
                column = jellyEx.getColumnNumber();

                rootCause = jellyEx.getCause();

                if ( rootCause == null )
                {
                    msg = jellyEx.getReason();
                }
                else
                {
                    if ( getCli().hasOption( DISPLAY_STACKTRACE ) )
                    {
View Full Code Here

    // Tag interface
    //-------------------------------------------------------------------------
    public void doTag(XMLOutput output) throws Exception {
        if ( value == null ) {
            throw new JellyException( "No value is supplied!" );
        }
        getBroker().store( value );
    }
View Full Code Here

        if ( name == null ) {
            throw new MissingAttributeException("name");
        }
        MapMessageTag tag = (MapMessageTag) findAncestorWithClass( MapMessageTag.class );
        if ( tag == null ) {
            throw new JellyException("<jms:mapEntry> tag must be within a <jms:mapMessage> tag");
        }
        if (value != null) {
            tag.addEntry( name, value );
        }
        else {
View Full Code Here

    // Implementation methods
    //-------------------------------------------------------------------------                           
    protected Messenger findConnection() throws JellyException, JMSException {
        ConnectionContext messengerTag = (ConnectionContext) findAncestorWithClass( ConnectionContext.class );
        if ( messengerTag == null ) {
            throw new JellyException("This tag must be within a <jms:connection> tag or the 'connection' attribute should be specified");
        }
        return messengerTag.getConnection();
    }
View Full Code Here

    public void doTag(XMLOutput output) throws Exception {               
        if ( var == null ) {
            // expose message to parent message consumer
            SendTag tag = (SendTag) findAncestorWithClass( SendTag.class );
            if ( tag == null ) {
                throw new JellyException("<jms:message> tags must either have the 'var' attribute specified or be used inside a <jms:send> tag");
            }
            tag.setMessage( getMessage() );           
        }
        else {
            context.setVariable( var, getMessage() );
View Full Code Here

    // Implementation methods
    //-------------------------------------------------------------------------                           
    protected Messenger findConnection() throws Exception {
        ConnectionContext messengerTag = (ConnectionContext) findAncestorWithClass( ConnectionContext.class );
        if ( messengerTag == null ) {
            throw new JellyException("This tag must be within a <jms:connection> tag or the 'connection' attribute should be specified");
        }
        return messengerTag.getConnection();
    }
View Full Code Here

        if ( name == null ) {
            throw new MissingAttributeException("name");
        }
        MessageTag tag = (MessageTag) findAncestorWithClass( MessageTag.class );
        if ( tag == null ) {
            throw new JellyException("<jms:property> tag must be within a <jms:message> tag");
        }
       
        if ( value != null ) {
            tag.addProperty(name, value);
        }
View Full Code Here

    // Tag interface
    //-------------------------------------------------------------------------                   
    public void doTag(XMLOutput output) throws Exception {       
        ConnectionContext messengerTag = (ConnectionContext) findAncestorWithClass( ConnectionContext.class );
        if ( messengerTag == null ) {
            throw new JellyException("<jms:destination> tag must be within a <jms:connection> or <jms:send> or <jms:receive> tag");
        }
        Messenger messenger = messengerTag.getConnection();
        String subject = (name != null) ? name : getBodyText();
        Destination destination = messenger.getDestination( subject );
        if ( var != null ) {
            context.setVariable( var, destination );
        }
        else {
            MessageOperationTag tag = (MessageOperationTag) findAncestorWithClass( MessageOperationTag.class );
            if ( tag == null ) {
                throw new JellyException("<jms:destination> tag must be within a <jms:send> or <jms:receive> tag or the 'var' attribute should be specified");
            }
            tag.setDestination( destination );
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.commons.jelly.JellyException

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.