Examples of TryCatchFinally


Examples of com.amazonaws.services.simpleworkflow.flow.core.TryCatchFinally

    public void execute(final AsyncRunnable cmd) {
        if (currentCommandTryCatchFinally != null) {
            throw new IllegalStateException("Already executing a command");
        }
        command = cmd;
        currentCommandTryCatchFinally = new TryCatchFinally() {

            @Override
            protected void doTry() throws Throwable {
                cmd.run();
            }
View Full Code Here

Examples of com.amazonaws.services.simpleworkflow.flow.core.TryCatchFinally

    public void execute(final AsyncRunnable cmd) {
        if (currentCommandTryCatchFinally != null) {
            throw new IllegalStateException("Already executing a command");
        }
        command = cmd;
        currentCommandTryCatchFinally = new TryCatchFinally() {

            @Override
            protected void doTry() throws Throwable {
                cmd.run();
            }
View Full Code Here

Examples of com.amazonaws.services.simpleworkflow.flow.core.TryCatchFinally

    }

    private void invoke(final int attempt, final long firstAttemptTime, final WorkflowClock clock) {
        final Settable<Throwable> shouldRetry = new Settable<Throwable>();
       
        new TryCatchFinally() {
            Throwable failureToRetry = null;

            @Override
            protected void doTry() throws Throwable {
                retryCallable.call();
View Full Code Here

Examples of com.amazonaws.services.simpleworkflow.flow.core.TryCatchFinally

    @SuppressWarnings("unchecked")
    private void invoke(final Settable<Object> result, final int attempt, final long firstAttemptTime, final WorkflowClock clock) {
        final Settable<Throwable> shouldRetry = new Settable<Throwable>();
       
        new TryCatchFinally() {
            Throwable failureToRetry = null;

            @Override
            protected void doTry() throws Throwable {
                result.chain(retryCallable.call());
View Full Code Here

Examples of com.amazonaws.services.simpleworkflow.flow.core.TryCatchFinally

    public void execute(final AsyncRunnable cmd) {
        if (currentCommandTryCatchFinally != null) {
            throw new IllegalStateException("Already executing a command");
        }
        command = cmd;
        currentCommandTryCatchFinally = new TryCatchFinally() {

            @Override
            protected void doTry() throws Throwable {
                cmd.run();
            }
View Full Code Here

Examples of javax.servlet.jsp.tagext.TryCatchFinally

     */
    public void invoke() throws JspException, IOException
    {
        if (this.tag instanceof TryCatchFinally)
        {
            TryCatchFinally tryCatchFinally = (TryCatchFinally) this.tag;
            try
            {
                invokeInternal();
            }
            catch (Throwable t1)
            {
                try
                {
                    tryCatchFinally.doCatch(t1);
                }
                catch (Throwable t2)
                {
                    throw new JspException(t2.getMessage());
                }
            }
            finally
            {
                tryCatchFinally.doFinally();
            }
        }
        else
        {
            invokeInternal();
View Full Code Here

Examples of javax.servlet.jsp.tagext.TryCatchFinally

     */
    public void invoke() throws JspException, IOException
    {
        if (this.tag instanceof TryCatchFinally)
        {
            TryCatchFinally tryCatchFinally = (TryCatchFinally) this.tag;
            try
            {
                invokeInternal();
            }
            catch (Throwable t1)
            {
                try
                {
                    tryCatchFinally.doCatch(t1);
                }
                catch (Throwable t2)
                {
                    throw new JspException(t2.getMessage());
                }
            }
            finally
            {
                tryCatchFinally.doFinally();
            }
        }
        else
        {
            invokeInternal();
View Full Code Here

Examples of javax.servlet.jsp.tagext.TryCatchFinally

     */
    public void invoke() throws JspException, IOException
    {
        if (this.tag instanceof TryCatchFinally)
        {
            TryCatchFinally tryCatchFinally = (TryCatchFinally) this.tag;
            try
            {
                invokeInternal();
            }
            catch (Throwable t1)
            {
                try
                {
                    tryCatchFinally.doCatch(t1);
                }
                catch (Throwable t2)
                {
                    throw new JspException(t2.getMessage());
                }
            }
            finally
            {
                tryCatchFinally.doFinally();
            }
        }
        else
        {
            invokeInternal();
View Full Code Here

Examples of javax.servlet.jsp.tagext.TryCatchFinally

     */
    public void invoke() throws JspException, IOException
    {
        if (this.tag instanceof TryCatchFinally)
        {
            TryCatchFinally tryCatchFinally = (TryCatchFinally) this.tag;
            try
            {
                invokeInternal();
            }
            catch (Throwable t1)
            {
                try
                {
                    tryCatchFinally.doCatch(t1);
                }
                catch (Throwable t2)
                {
                    throw new JspException(t2.getMessage());
                }
            }
            finally
            {
                tryCatchFinally.doFinally();
            }
        }
        else
        {
            invokeInternal();
View Full Code Here

Examples of railo.transformer.bytecode.statement.TryCatchFinally

    if(!data.cfml.forwardIfCurrent("try",'{') && !data.cfml.forwardIfCurrent("try ") && !data.cfml.forwardIfCurrent("try",'/'))
      return null;
    data.cfml.previous();

    Body body=new BodyBase();
    TryCatchFinally tryCatchFinally=new TryCatchFinally(body,data.cfml.getPosition(),null);
   
    statement(data,body,CTX_TRY);
    comments(data);
   
    // catches
    short catchCount=0;
    while(data.cfml.forwardIfCurrent("catch",'(')) {
      catchCount++;
      comments(data);
     
      // type
      int pos=data.cfml.getPos();
      Position line=data.cfml.getPosition();
      Expression name = null,type = null;
     
      StringBuffer sbType=new StringBuffer();
            String id;
            while(true) {
              id=identifier(data,false);
                if(id==null)break;
                sbType.append(id);
                data.cfml.removeSpace();
                if(!data.cfml.forwardIfCurrent('.'))break;
                sbType.append('.');
                data.cfml.removeSpace();
            }
       
           
      if(sbType.length()==0) {
          type=string(data);
          if(type==null)         
              throw new TemplateException(data.cfml,"a catch statement must begin with the throwing type (query, application ...).");
      }
      else {
        type=LitString.toExprString(sbType.toString());
      }
           
           
      //name = expression();
      comments(data);
     
      // name
      if(!data.cfml.isCurrent(')')) {
        name=expression(data);
      }
      else {
        data.cfml.setPos(pos);
        name=expression(data);
        type = LitString.toExprString( "any" );
      }
      comments(data);

            Body b=new BodyBase();
      try {
        tryCatchFinally.addCatch(type,name,b,line);
      }
      catch (BytecodeException e) {
        throw new TemplateException(data.cfml,e.getMessage());
      }
      comments(data);
     
      if(!data.cfml.forwardIfCurrent(')')) throw new TemplateException(data.cfml,"invalid catch statement, missing closing )");
     
            statement(data,b,CTX_CATCH);
      comments(data)
    }
       
   
// finally
     if(finallyStatement(data,tryCatchFinally)) {
      comments(data);
     }
     else if(catchCount==0)
      throw new TemplateException(data.cfml,"a try statement must have at least one catch statement");
   
        //if(body.isEmpty()) return null;
    tryCatchFinally.setEnd(data.cfml.getPosition());
    return tryCatchFinally;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.