Examples of CallFrame


Examples of org.apache.cocoon.callstack.CallFrame

    /** Key for the environment {@link ServletContext} in the call frame. */
    public final static String CONTEXT_OBJECT  = "context";

    public static final void setEnvironment(HttpServletRequest request, HttpServletResponse response, ServletContext context) {
        CallFrame frame = CallStack.getCurrentFrame();
        frame.setAttribute(REQUEST_OBJECT, request);
        frame.setAttribute(RESPONSE_OBJECT, response);
        frame.setAttribute(CONTEXT_OBJECT, context);
    }
View Full Code Here

Examples of org.apache.cocoon.callstack.CallFrame

        frame.setAttribute(RESPONSE_OBJECT, response);
        frame.setAttribute(CONTEXT_OBJECT, context);
    }

    public static final HttpServletRequest getRequest() {
        CallFrame currentCallFrame = CallStack.getCurrentFrame();
       
        if(currentCallFrame == null) {
            return null;
        }
       
        return (HttpServletRequest) currentCallFrame.getAttribute(REQUEST_OBJECT);
    }
View Full Code Here

Examples of org.apache.cocoon.callstack.CallFrame

    public static final void setRequest(HttpServletRequest request) {
        CallStack.getCurrentFrame().setAttribute(REQUEST_OBJECT, request);
    }

    public static final HttpServletResponse getResponse() {
        CallFrame currentCallFrame = CallStack.getCurrentFrame();
       
        if(currentCallFrame == null) {
            return null;
        }
       
        return (HttpServletResponse) currentCallFrame.getAttribute(RESPONSE_OBJECT);
    }
View Full Code Here

Examples of org.apache.cocoon.callstack.CallFrame

    public static final void setResponse(HttpServletResponse response) {
        CallStack.getCurrentFrame().setAttribute(RESPONSE_OBJECT, response);
    }

    public static final ServletContext getContext() {
        CallFrame currentCallFrame = CallStack.getCurrentFrame();
       
        if(currentCallFrame == null) {
            return null;
        }       
       
        return (ServletContext) currentCallFrame.getAttribute(CONTEXT_OBJECT);
    }
View Full Code Here

Examples of org.apache.cocoon.callstack.CallFrame

     *
     * @return a servlet context
     */
    public static ServletContext getBaseServletContext() {
        for (int i = CallStack.size() - 1; i >= 0; i--) {
            CallFrame frame = CallStack.frameAt(i);
            if (frame.hasAttribute(SUPER_CALL) && !((Boolean) frame.getAttribute(SUPER_CALL)).booleanValue()) {
                return (ServletContext) frame.getAttribute(CallFrameHelper.CONTEXT_OBJECT);
            }
        }

        return null;
    }
View Full Code Here

Examples of org.chromium.sdk.CallFrame

      // Do not block dispatcher thread.
      stateManager.setDefaultReceiver(IGNORE_SCRIPTS_VISITOR);

      List<? extends CallFrame> callFrames = context.getCallFrames();
      CallFrame topFrame = callFrames.get(0);

      JsScope localScope;
      findScope: {
        for (JsScope scope : topFrame.getVariableScopes()) {
          if (scope.getType() == JsScope.Type.LOCAL) {
            localScope = scope;
            break findScope;
          }
        }
View Full Code Here

Examples of org.chromium.sdk.CallFrame

      // Do not block dispatcher thread.
      stateManager.setDefaultReceiver(IGNORE_SCRIPTS_VISITOR);

      List<? extends CallFrame> callFrames = context.getCallFrames();
      CallFrame topFrame = callFrames.get(0);

      JsScope localScope;
      findScope: {
        for (JsScope scope : topFrame.getVariableScopes()) {
          if (scope.getType() == JsScope.Type.LOCAL) {
            localScope = scope;
            break findScope;
          }
        }
View Full Code Here

Examples of org.formulacompiler.compiler.CallFrame


  private CallFrame mapDynamicParams( CallFrame _frame ) throws CompilerException
  {
    if (null == _frame) return null;
    CallFrame prev = mapDynamicParams( _frame.getPrev() );
    final Object[] args = _frame.getArgs();
    boolean changed = false;
    if (null != args) {
      for (int i = 0; i < args.length; i++) {
        if (args[ i ] instanceof CellIndex) {
          CellIndex cell = (CellIndex) args[ i ];
          CellModel model = getOrCreateCellModel( cell );
          args[ i ] = model;
          changed = true;
        }
      }
    }
    if (null != prev) {
      return prev.chain( _frame.getMethod(), args );
    }
    else if (changed) {
      return FormulaCompiler.newCallFrame( _frame.getMethod(), args );
    }
    return _frame;
View Full Code Here

Examples of org.formulacompiler.compiler.CallFrame

    public Section defineRepeatingSection( Range _range, Orientation _orientation,
        Method _inputMethodReturningIterable, Class _inputClass, Method _outputMethodReturningIterableToImplement,
        Class _outputClass ) throws CompilerException
    {
      final CallFrame inputCall = SpreadsheetCompiler.newCallFrame( _inputMethodReturningIterable );
      final CallFrame outputCall = (_outputMethodReturningIterableToImplement == null) ? null : SpreadsheetCompiler
          .newCallFrame( _outputMethodReturningIterableToImplement );
      return defineRepeatingSection( _range, _orientation, inputCall, _inputClass, outputCall, _outputClass );
    }
View Full Code Here

Examples of org.formulacompiler.compiler.CallFrame

  protected void compileBody() throws CompilerException
  {
    final SubSectionCompiler sub = this.sub;
    final GeneratorAdapter mv = mv();

    final CallFrame outputCall = this.callToImplement;
    final Class outputContainerClass = outputCall.getMethod().getReturnType();

    // get$Sect0()
    mv.loadThis();
    mv.visitMethodInsn( Opcodes.INVOKEVIRTUAL, section().classInternalName(), sub.getterName(), sub
        .getterDescriptor() );

    if (outputContainerClass.isArray()) {
      mv.visitInsn( Opcodes.ARETURN );
    }
    else {
      // Detail[] arr = get$Sect0();
      final int l_arr = mv.newLocal( sub.arrayType() );
      mv.storeLocal( l_arr );

      final int l_len = mv.newLocal( Type.INT_TYPE );
      mv.loadLocal( l_arr );
      mv.arrayLength();
      mv.storeLocal( l_len );

      // List lst = new ArrayList( arr.length );
      final int l_lst = mv.newLocal( ARRAYLIST_CLASS );
      mv.newInstance( ARRAYLIST_CLASS );
      mv.dup();
      mv.loadLocal( l_len );
      mv.visitMethodInsn( Opcodes.INVOKESPECIAL, ARRAYLIST_CLASS.getInternalName(), "<init>", "(I)V" );
      mv.storeLocal( l_lst );

      // for (int i = 0; i < len; i++) {
      final int l_i = mv.newLocal( Type.INT_TYPE );
      mv.push( 0 );
      mv.storeLocal( l_i );
      final Label test = mv.newLabel();
      mv.goTo( test );
      final Label again = mv.mark();

      // lst.add( arr[ i ] );
      mv.loadLocal( l_lst );
      mv.loadLocal( l_arr );
      mv.loadLocal( l_i );
      mv.arrayLoad( sub.classType() );
      mv.visitMethodInsn( Opcodes.INVOKEVIRTUAL, ARRAYLIST_CLASS.getInternalName(), "add", "(Ljava/lang/Object;)Z" );
      mv.pop();

      // } // for
      mv.iinc( l_i, 1 );
      mv.mark( test );
      mv.loadLocal( l_i );
      mv.loadLocal( l_len );
      mv.ifCmp( Type.INT_TYPE, mv.LT, again );

      mv.loadLocal( l_lst );
      if (outputContainerClass.isAssignableFrom( List.class )) {
        // return lst;
        mv.visitInsn( Opcodes.ARETURN );
      }
      else if (outputContainerClass.isAssignableFrom( Iterator.class )) {
        // return lst.iterator();
        mv.visitMethodInsn( Opcodes.INVOKEVIRTUAL, ARRAYLIST_CLASS.getInternalName(), "iterator", "()"
            + ITERATOR_INTF.getDescriptor() );
        mv.visitInsn( Opcodes.ARETURN );
      }
      else {
        throw new CompilerException.UnsupportedDataType( "The return type of '"
            + outputCall.getMethod() + "' is not supported as input to a repeating section." );
      }
    }
  }
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.