コード例 #1
0
ファイル: VMContext.java プロジェクト: tpso-src/thirdparty
  /**
   * Used to put VMProxyArgs into this context. It separates the VMProxyArgs into constant and
   * non-constant types pulling out the value of the constant types so they can be modified w/o
   * damaging the VMProxyArg, and leaving the dynamic ones, as they modify context rather than their
   * own state
   *
   * @param vmpa VMProxyArg to add
   */
  public void addVMProxyArg(VMProxyArg vmpa) {
    /*
     *  ask if it's a constant : if so, get the value and put into the
     *  local context, otherwise, put the vmpa in our vmproxyhash
     */

    String key = vmpa.getContextReference();

    if (vmpa.isConstant()) {
      localcontext.put(key, vmpa.getObject(wrappedContext));
    } else {
      vmproxyhash.put(key, vmpa);
    }
  }
コード例 #2
0
ファイル: VMContext.java プロジェクト: tpso-src/thirdparty
  /**
   * Impl of the Context.gut() method.
   *
   * @param key name of item to get
   * @return stored object or null
   */
  public Object get(String key) {
    /*
     * first, see if it's a VMPA
     */

    Object o = null;

    VMProxyArg vmpa = (VMProxyArg) vmproxyhash.get(key);

    if (vmpa != null) {
      o = vmpa.getObject(wrappedContext);
    } else {
      if (localcontextscope) {
        /*
         * if we have localcontextscope mode, then just
         * put in the local context
         */

        o = localcontext.get(key);
      } else {
        /*
         *  try the local context
         */

        o = localcontext.get(key);

        if (o == null) {
          /*
           * last chance
           */

          o = innerContext.get(key);
        }
      }
    }

    return o;
  }