Examples of MethodType


Examples of java.lang.invoke.MethodType

  protected abstract void resetCache();

  private MethodHandle getFallbackMethod() {
    try {
      final MethodType fallbackType = MethodType.genericMethodType(
          type.parameterCount()).insertParameterTypes(0,
          BaseCallSite.class);
      final MethodHandle fallbackHandle = MethodHandles.insertArguments(
          MethodHandles.lookup().findStatic(BaseCallSite.class,
              "invocationFallback", fallbackType), 0, this);
View Full Code Here

Examples of java.lang.invoke.MethodType

    CompiledClass current = jvmClasses.get(key);

    Object[] astConstants = jvmClass.astConstants();
    if (astConstants.length == 0)
      return this;
    MethodType type = MethodType.genericMethodType(astConstants.length)
        .changeReturnType(void.class);
    MethodHandle findStatic;
    try {
      findStatic = MethodHandles.lookup().findStatic(current.javaClass,
          "_astinit", type);
View Full Code Here

Examples of java.lang.invoke.MethodType

  public static void timeMH(IndyDemo indyDemo) throws Throwable {
    long start = System.currentTimeMillis();
    int REFLECTION_TIMES = 10000;
    MethodHandles.Lookup lookup = MethodHandles.lookup();
    MethodType type = MethodType.methodType(Integer.TYPE);
    for (int i = 0; i < REFLECTION_TIMES; i++) {
      MethodHandle someMethod = lookup.findVirtual(IndyDemo.class, "someMethod", type);
      int result = (int) someMethod.invokeExact(indyDemo);
    }
    System.out.println("methodhandle: " + (TIMES/ REFLECTION_TIMES)*(System.currentTimeMillis() - start));
View Full Code Here

Examples of java.lang.invoke.MethodType

  }

  public static void timeMHCached(IndyDemo indyDemo) throws Throwable {
    long start = System.currentTimeMillis();
    MethodHandles.Lookup lookup = MethodHandles.lookup();
    MethodType type = MethodType.methodType(Integer.TYPE);
    MethodHandle someMethod = lookup.findVirtual(IndyDemo.class, "someMethod", type);
    for (int i = 0; i < TIMES; i++) {
      int result = (int) someMethod.invokeExact(indyDemo);
    }
    System.out.println("methodhandle cached: " + (System.currentTimeMillis() - start));
View Full Code Here

Examples of net.opengis.wps10.MethodType

                //this is a reference
                InputReferenceType ref = input.getReference();
               
                //grab the location and method
                String href = ref.getHref();
                MethodType meth = ref.getMethod() != null ? ref.getMethod() : MethodType.GET_LITERAL;
               
                //handle get vs post
                if ( meth == MethodType.POST_LITERAL ) {
                    //post, handle the body
                }
View Full Code Here

Examples of org.apache.airavata.schemas.gfac.MethodType

            int rdint = rand.nextInt(1000000);
            wsdlQName = new QName(nameSpaceURI, serviceName + "_" + date + "_" + rdint);
        }

        PortTypeType portType = serviceDesc.getPortType();
        MethodType method = portType.getMethod();
        QName portTypeName = serviceQName;

        String portName = portTypeName.getLocalPart();

        try {
View Full Code Here

Examples of org.apache.geronimo.xbeans.j2ee.MethodType

        for (int i = 0; i < methodPermissions.length; i++) {
            MethodPermissionType methodPermission = methodPermissions[i];
            MethodType[] methods = methodPermission.getMethodArray();

            for (int j = 0; j < methods.length; j++) {
                MethodType method = methods[j];
                EJBMethodPermission permission = new EJBMethodPermission(method.getEjbName().getStringValue(),
                        method.getMethodName().getStringValue(),
                        method.getMethodIntf().getStringValue(),
                        toStringArray(method.getMethodParams().getMethodParamArray()));

                try {
                    if (methodPermission.getUnchecked() != null) {
                        configuration.addToUncheckedPolicy(permission);
                    } else {
View Full Code Here

Examples of org.apache.xalan.xsltc.compiler.util.MethodType

    /**
     * Add primops and base functions to the symbol table.
     */
    private void initSymbolTable() {
  MethodType I_V  = new MethodType(Type.Int, Type.Void);
  MethodType I_R  = new MethodType(Type.Int, Type.Real);
  MethodType I_S  = new MethodType(Type.Int, Type.String);
  MethodType I_D  = new MethodType(Type.Int, Type.NodeSet);
  MethodType R_I  = new MethodType(Type.Real, Type.Int);
  MethodType R_V  = new MethodType(Type.Real, Type.Void);
  MethodType R_R  = new MethodType(Type.Real, Type.Real);
  MethodType R_D  = new MethodType(Type.Real, Type.NodeSet);
  MethodType R_O  = new MethodType(Type.Real, Type.Reference);
  MethodType I_I  = new MethodType(Type.Int, Type.Int);
   MethodType D_O  = new MethodType(Type.NodeSet, Type.Reference);
  MethodType D_V  = new MethodType(Type.NodeSet, Type.Void);
  MethodType D_S  = new MethodType(Type.NodeSet, Type.String);
  MethodType D_D  = new MethodType(Type.NodeSet, Type.NodeSet);
  MethodType A_V  = new MethodType(Type.Node, Type.Void);
  MethodType S_V  = new MethodType(Type.String, Type.Void);
  MethodType S_S  = new MethodType(Type.String, Type.String);
  MethodType S_A  = new MethodType(Type.String, Type.Node);
  MethodType S_D  = new MethodType(Type.String, Type.NodeSet);
  MethodType S_O  = new MethodType(Type.String, Type.Reference);
  MethodType B_O  = new MethodType(Type.Boolean, Type.Reference);
  MethodType B_V  = new MethodType(Type.Boolean, Type.Void);
  MethodType B_B  = new MethodType(Type.Boolean, Type.Boolean);
  MethodType B_S  = new MethodType(Type.Boolean, Type.String);
  MethodType D_X  = new MethodType(Type.NodeSet, Type.Object);
  MethodType R_RR = new MethodType(Type.Real, Type.Real, Type.Real);
  MethodType I_II = new MethodType(Type.Int, Type.Int, Type.Int);
  MethodType B_RR = new MethodType(Type.Boolean, Type.Real, Type.Real);
  MethodType B_II = new MethodType(Type.Boolean, Type.Int, Type.Int);
  MethodType S_SS = new MethodType(Type.String, Type.String, Type.String);
  MethodType S_DS = new MethodType(Type.String, Type.Real, Type.String);
  MethodType S_SR = new MethodType(Type.String, Type.String, Type.Real);
  MethodType O_SO = new MethodType(Type.Reference, Type.String, Type.Reference);

  MethodType D_SS =
      new MethodType(Type.NodeSet, Type.String, Type.String);
  MethodType D_SD =
      new MethodType(Type.NodeSet, Type.String, Type.NodeSet);
  MethodType B_BB =
      new MethodType(Type.Boolean, Type.Boolean, Type.Boolean);
  MethodType B_SS =
      new MethodType(Type.Boolean, Type.String, Type.String);
  MethodType S_SD =
      new MethodType(Type.String, Type.String, Type.NodeSet);
  MethodType S_DSS =
      new MethodType(Type.String, Type.Real, Type.String, Type.String);
  MethodType S_SRR =
      new MethodType(Type.String, Type.String, Type.Real, Type.Real);
  MethodType S_SSS =
      new MethodType(Type.String, Type.String, Type.String, Type.String);

  /*
   * Standard functions: implemented but not in this table concat().
   * When adding a new function make sure to uncomment
   * the corresponding line in <tt>FunctionAvailableCall</tt>.
View Full Code Here

Examples of org.apache.xalan.xsltc.compiler.util.MethodType

    /**
     * Add primops and base functions to the symbol table.
     */
    private void initSymbolTable() {
  MethodType I_V  = new MethodType(Type.Int, Type.Void);
  MethodType I_R  = new MethodType(Type.Int, Type.Real);
  MethodType I_S  = new MethodType(Type.Int, Type.String);
  MethodType I_D  = new MethodType(Type.Int, Type.NodeSet);
  MethodType R_I  = new MethodType(Type.Real, Type.Int);
  MethodType R_V  = new MethodType(Type.Real, Type.Void);
  MethodType R_R  = new MethodType(Type.Real, Type.Real);
  MethodType R_D  = new MethodType(Type.Real, Type.NodeSet);
  MethodType R_O  = new MethodType(Type.Real, Type.Reference);
  MethodType I_I  = new MethodType(Type.Int, Type.Int);
   MethodType D_O  = new MethodType(Type.NodeSet, Type.Reference);
  MethodType D_V  = new MethodType(Type.NodeSet, Type.Void);
  MethodType D_S  = new MethodType(Type.NodeSet, Type.String);
  MethodType D_D  = new MethodType(Type.NodeSet, Type.NodeSet);
  MethodType A_V  = new MethodType(Type.Node, Type.Void);
  MethodType S_V  = new MethodType(Type.String, Type.Void);
  MethodType S_S  = new MethodType(Type.String, Type.String);
  MethodType S_A  = new MethodType(Type.String, Type.Node);
  MethodType S_D  = new MethodType(Type.String, Type.NodeSet);
  MethodType S_O  = new MethodType(Type.String, Type.Reference);
  MethodType B_O  = new MethodType(Type.Boolean, Type.Reference);
  MethodType B_V  = new MethodType(Type.Boolean, Type.Void);
  MethodType B_B  = new MethodType(Type.Boolean, Type.Boolean);
  MethodType B_S  = new MethodType(Type.Boolean, Type.String);
  MethodType D_X  = new MethodType(Type.NodeSet, Type.Object);
  MethodType R_RR = new MethodType(Type.Real, Type.Real, Type.Real);
  MethodType I_II = new MethodType(Type.Int, Type.Int, Type.Int);
  MethodType B_RR = new MethodType(Type.Boolean, Type.Real, Type.Real);
  MethodType B_II = new MethodType(Type.Boolean, Type.Int, Type.Int);
  MethodType S_SS = new MethodType(Type.String, Type.String, Type.String);
  MethodType S_DS = new MethodType(Type.String, Type.Real, Type.String);
  MethodType S_SR = new MethodType(Type.String, Type.String, Type.Real);

  MethodType D_SS =
      new MethodType(Type.NodeSet, Type.String, Type.String);
  MethodType D_SD =
      new MethodType(Type.NodeSet, Type.String, Type.NodeSet);
  MethodType B_BB =
      new MethodType(Type.Boolean, Type.Boolean, Type.Boolean);
  MethodType B_SS =
      new MethodType(Type.Boolean, Type.String, Type.String);
  MethodType S_SD =
      new MethodType(Type.String, Type.String, Type.NodeSet);
  MethodType S_DSS =
      new MethodType(Type.String, Type.Real, Type.String, Type.String);
  MethodType S_SRR =
      new MethodType(Type.String, Type.String, Type.Real, Type.Real);
  MethodType S_SSS =
      new MethodType(Type.String, Type.String, Type.String, Type.String);

  /*
   * Standard functions: implemented but not in this table concat().
   * When adding a new function make sure to uncomment
   * the corresponding line in <tt>FunctionAvailableCall</tt>.
View Full Code Here

Examples of org.apache.xalan.xsltc.compiler.util.MethodType

  // Get the left and right operand types
  Type tleft = _left.typeCheck(stable);
  Type tright = _right.typeCheck(stable);

  // Check if the operator supports the two operand types
  MethodType wantType = new MethodType(Type.Void, tleft, tright);
  MethodType haveType = lookupPrimop(stable, Ops[_op], wantType);

  // Yes, the operation is supported
  if (haveType != null) {
      // Check if left-hand side operand must be type casted
      Type arg1 = (Type)haveType.argsType().elementAt(0);
      if (!arg1.identicalTo(tleft))
    _left = new CastExpr(_left, arg1);
      // Check if right-hand side operand must be type casted
      Type arg2 = (Type) haveType.argsType().elementAt(1);
      if (!arg2.identicalTo(tright))
    _right = new CastExpr(_right, arg1);
      // Return the result type for the operator we will use
      return _type = haveType.resultType();
  }
  throw new TypeCheckError(this);
    }
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.