Examples of MethodDescriptor


Examples of cc.catalysts.cdoclet.generator.velocity.MethodDescriptor

  }

 
  public void beginMethod(Type classType, Type methodType, int modifier, Type returnType, String methodName, boolean asnyc, boolean override) {
    if (typeDescriptor != null) {
      methodDescriptor = new MethodDescriptor(modifier, returnType, methodType, methodName, asnyc);
      methodDescriptor.setOverride(override);
      typeDescriptor.addMethodDescriptor(methodDescriptor);
    }
    if (proxyTypeDescriptor != null) {
      proxyMethodDescriptor = new MethodDescriptor(modifier, returnType, methodType, methodName, asnyc);
      proxyTypeDescriptor.addMethodDescriptor(proxyMethodDescriptor);
    }
  }
View Full Code Here

Examples of com.buschmais.jqassistant.plugin.java.api.model.MethodDescriptor

        return new FieldVisitor(fieldDescriptor, visitorHelper);
    }

    @Override
    public MethodVisitor visitMethod(final int access, final String name, final String desc, final String signature, final String[] exceptions) {
        MethodDescriptor methodDescriptor = visitorHelper.getMethodDescriptor(typeDescriptor, SignatureHelper.getMethodSignature(name, desc));
        typeDescriptor.addDeclaredMethod(methodDescriptor);
        methodDescriptor.setName(name);
        setModifiers(access, methodDescriptor);
        if (hasFlag(access, Opcodes.ACC_ABSTRACT)) {
            methodDescriptor.setAbstract(Boolean.TRUE);
        }
        if (hasFlag(access, Opcodes.ACC_NATIVE)) {
            methodDescriptor.setNative(Boolean.TRUE);
        }
        if (signature == null) {
            String returnType = SignatureHelper.getType(Type.getReturnType(desc));
            methodDescriptor.setReturns(visitorHelper.getTypeDescriptor(returnType));
            org.objectweb.asm.Type[] types = org.objectweb.asm.Type.getArgumentTypes(desc);
            for (int i = 0; i < types.length; i++) {
                ParameterDescriptor parameterDescriptor = visitorHelper.addParameterDescriptor(methodDescriptor, i);
                String parameterType = SignatureHelper.getType(types[i]);
                parameterDescriptor.setType(visitorHelper.getTypeDescriptor(parameterType));
            }
        } else {
            new SignatureReader(signature).accept(new MethodSignatureVisitor(methodDescriptor, visitorHelper));
        }
        for (int i = 0; exceptions != null && i < exceptions.length; i++) {
            TypeDescriptor exception = visitorHelper.getTypeDescriptor(SignatureHelper.getObjectType(exceptions[i]));
            methodDescriptor.getDeclaredThrowables().add(exception);
        }
        return new MethodVisitor(methodDescriptor, visitorHelper);
    }
View Full Code Here

Examples of com.google.gwt.core.ext.soyc.coderef.MethodDescriptor

      } else if (symbol.isField()) {
        assertTrue(classDescriptor.getField(symbol.getMemberName()).getObfuscatedNames()
            .contains(symbol.getSymbolName()));
      } else {
        // method
        MethodDescriptor mth = classDescriptor.getMethod(
            unSynthMethodSignature(symbol.getJsniIdent().split("::")[1]));
        assertTrue(mth.getObfuscatedNames().contains(symbol.getSymbolName()));
      }
    }
  }
View Full Code Here

Examples of com.google.protobuf.Descriptors.MethodDescriptor

    };
    TestRpcServer rpcServer = new TestRpcServer();
    try {
      rpcServer.start();
      InetSocketAddress address = rpcServer.getListenerAddress();
      MethodDescriptor md = SERVICE.getDescriptorForType().findMethodByName("echo");
      final String message = "hello";
      EchoRequestProto param = EchoRequestProto.newBuilder().setMessage(message).build();
      Pair<Message, CellScanner> r = client.call(md, param, null,
        md.getOutputType().toProto(), User.getCurrent(), address, 0);
      assertTrue(r.getSecond() == null);
      // Silly assertion that the message is in the returned pb.
      assertTrue(r.getFirst().toString().contains(message));
    } finally {
      client.stop();
View Full Code Here

Examples of com.google.protobuf.Descriptors.MethodDescriptor

    int count = 3;
    for (int i = 0; i < count; i++) cells.add(CELL);
    try {
      rpcServer.start();
      InetSocketAddress address = rpcServer.getListenerAddress();
      MethodDescriptor md = SERVICE.getDescriptorForType().findMethodByName("echo");
      EchoRequestProto param = EchoRequestProto.newBuilder().setMessage("hello").build();
      Pair<Message, CellScanner> r = client.call(md, param, CellUtil.createCellScanner(cells),
        md.getOutputType().toProto(), User.getCurrent(), address, 0);
      int index = 0;
      while (r.getSecond().advance()) {
        assertTrue(CELL.equals(r.getSecond().current()));
        index++;
      }
View Full Code Here

Examples of com.google.protobuf.Descriptors.MethodDescriptor

    TestRpcServer rpcServer = new TestRpcServer();
    RpcClient client = new RpcClient(conf, HConstants.CLUSTER_ID_DEFAULT, spyFactory);
    try {
      rpcServer.start();
      InetSocketAddress address = rpcServer.getListenerAddress();
      MethodDescriptor md = SERVICE.getDescriptorForType().findMethodByName("echo");
      EchoRequestProto param = EchoRequestProto.newBuilder().setMessage("hello").build();
      client.call(md, param, null, null, User.getCurrent(), address, 0);
      fail("Expected an exception to have been thrown!");
    } catch (Exception e) {
      LOG.info("Caught expected exception: " + e.toString());
View Full Code Here

Examples of com.google.protobuf.Descriptors.MethodDescriptor

        setupResponse(responseBuffer, callTooBig, new CallQueueTooBigException(),
          "Call queue is full, is ipc.server.max.callqueue.size too small?");
        responder.doRespond(callTooBig);
        return;
      }
      MethodDescriptor md = null;
      Message param = null;
      CellScanner cellScanner = null;
      try {
        if (header.hasRequestParam() && header.getRequestParam()) {
          md = this.service.getDescriptorForType().findMethodByName(header.getMethodName());
View Full Code Here

Examples of com.google.protobuf.Descriptors.MethodDescriptor

    public void messageReceived(ChannelHandlerContext ctx, MessageEvent e)
        throws Exception {
      final RpcRequest request = (RpcRequest) e.getMessage();

      String methodName = request.getMethodName();
      MethodDescriptor methodDescriptor =
          service.getDescriptorForType().findMethodByName(methodName);

      if (methodDescriptor == null) {
        throw new RemoteCallException(request.getId(),
            new NoSuchMethodException(methodName));
View Full Code Here

Examples of com.google.protobuf.Descriptors.MethodDescriptor

        throws Exception {

      final RpcRequest request = (RpcRequest) e.getMessage();

      String methodName = request.getMethodName();
      MethodDescriptor methodDescriptor = service.getDescriptorForType().
          findMethodByName(methodName);

      if (methodDescriptor == null) {
        throw new RemoteCallException(request.getId(),
            new NoSuchMethodException(methodName));
View Full Code Here

Examples of com.google.protobuf.Descriptors.MethodDescriptor

    assertEquals("protobuf_unittest.TestService", service.getFullName());
    assertEquals(UnittestProto.getDescriptor(), service.getFile());

    assertEquals(2, service.getMethods().size());

    MethodDescriptor fooMethod = service.getMethods().get(0);
    assertEquals("Foo", fooMethod.getName());
    assertEquals(UnittestProto.FooRequest.getDescriptor(),
                 fooMethod.getInputType());
    assertEquals(UnittestProto.FooResponse.getDescriptor(),
                 fooMethod.getOutputType());
    assertEquals(fooMethod, service.findMethodByName("Foo"));

    MethodDescriptor barMethod = service.getMethods().get(1);
    assertEquals("Bar", barMethod.getName());
    assertEquals(UnittestProto.BarRequest.getDescriptor(),
                 barMethod.getInputType());
    assertEquals(UnittestProto.BarResponse.getDescriptor(),
                 barMethod.getOutputType());
    assertEquals(barMethod, service.findMethodByName("Bar"));

    assertNull(service.findMethodByName("NoSuchMethod"));

    for (int i = 0; i < service.getMethods().size(); i++) {
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.