Examples of Rpc


Examples of com.google.eclipse.protobuf.protobuf.Rpc

  //
  // service PersonService {
  //   rpc PersonRpc (Person) returns (Type);
  // }
  @Test public void should_return_label_for_rpc() {
    Rpc rpc = xtext.findFirst(Rpc.class);
    Object label = labels.labelFor(rpc);
    assertThat(label, instanceOf(StyledString.class));
    StyledString labelText = (StyledString) label;
    assertThat(labelText.getString(), equalTo("PersonRpc : Person > Type"));
  }
View Full Code Here

Examples of com.google.eclipse.protobuf.protobuf.Rpc

  //
  // service PersonService {
  //   rpc PersonRpc (Person) returns (Type);
  // }
  @Test public void should_return_label_for_rpc_with_unresolved_argument_type() {
    Rpc rpc = xtext.findFirst(Rpc.class);
    Object label = labels.labelFor(rpc);
    assertThat(label, instanceOf(StyledString.class));
    StyledString labelText = (StyledString) label;
    assertThat(labelText.getString(), equalTo("PersonRpc : <unresolved> > Type"));
  }
View Full Code Here

Examples of com.google.eclipse.protobuf.protobuf.Rpc

  @Override public void completeMessageLink_Target(EObject model, Assignment assignment, ContentAssistContext context,
      ICompletionProposalAcceptor acceptor) {
    Collection<IEObjectDescription> scope = emptySet();
    if (model instanceof Rpc) {
      Rpc rpc = (Rpc) model;
      scope = scopeProvider().potentialMessagesFor(rpc);
    }
    if (model instanceof Stream) {
      Stream stream = (Stream) model;
      scope = scopeProvider().potentialMessagesFor(stream);
View Full Code Here

Examples of com.google.eclipse.protobuf.protobuf.Rpc

  //
  // service CallServer {
  //   rpc QuickCall (Input) returns (Output);
  // }
  @Test public void should_return_name_of_Rpc() {
    Rpc rpc = xtext.find("QuickCall", Rpc.class);
    String name = resolver.nameOf(rpc);
    assertThat(name, equalTo("QuickCall"));
  }
View Full Code Here

Examples of com.google.eclipse.protobuf.protobuf.Rpc

  //
  // service PersonService {
  //   rpc PersonRpc (Person) returns (Type);
  // }
  @Test public void should_return_label_for_rpc_with_unresolved_return_type() {
    Rpc rpc = xtext.findFirst(Rpc.class);
    Object label = labels.labelFor(rpc);
    assertThat(label, instanceOf(StyledString.class));
    StyledString labelText = (StyledString) label;
    assertThat(labelText.getString(), equalTo("PersonRpc : Person > <unresolved>"));
  }
View Full Code Here

Examples of com.google.eclipse.protobuf.protobuf.Rpc

  //
  // service PersonService {
  //   rpc PersonRpc (Person) returns (Person);
  // }
  @Test public void should_return_image_for_rpc() {
    Rpc rpc = xtext.findFirst(Rpc.class);
    String image = images.imageFor(rpc);
    assertThat(image, equalTo("rpc.gif"));
    assertThat(image, existsInProject());
  }
View Full Code Here

Examples of com.google.eclipse.protobuf.protobuf.Rpc

    if (o instanceof MessageField) {
      MessageField field = (MessageField) o;
      return labelFor(field);
    }
    if (o instanceof Rpc) {
      Rpc rpc = (Rpc) o;
      return labelFor(rpc);
    }
    if (o instanceof Stream) {
      Stream stream = (Stream) o;
      return labelFor(stream);
View Full Code Here

Examples of rocket.beans.rebind.Rpc

      final RpcTag tag = new RpcTag();
      tag.setElement((Element) node);
      tag.setFilename(filename);
      tag.setPlaceHolderResolver(placeHolderResolver);

      final Rpc service = new Rpc();
      service.setId(tag.getId());
      service.setServiceEntryPoint(tag.getServiceEntryPoint());
      service.setServiceInterface(tag.getServiceInterface());

      this.addBean(service);
    }
  }
View Full Code Here

Examples of rocks.xmpp.extensions.rpc.model.Rpc

        xmppSession.addIQListener(new IQListener() {
            @Override
            public void handle(final IQEvent e) {
                final IQ iq = e.getIQ();
                if (e.isIncoming() && isEnabled() && !e.isConsumed() && iq.getType() == IQ.Type.SET) {
                    Rpc rpc = iq.getExtension(Rpc.class);
                    // If there's an incoming RPC
                    if (rpc != null) {
                        synchronized (RpcManager.this) {
                            if (rpcHandler != null) {
                                final Rpc.MethodCall methodCall = rpc.getMethodCall();
                                final List<Value> parameters = new ArrayList<>();
                                for (Value parameter : methodCall.getParameters()) {
                                    parameters.add(parameter);
                                }
                                executorService.execute(new Runnable() {
                                    @Override
                                    public void run() {
                                        try {
                                            Value value = rpcHandler.process(iq.getFrom(), methodCall.getMethodName(), parameters);
                                            IQ result = iq.createResult();
                                            result.setExtension(new Rpc(value));
                                            xmppSession.send(result);
                                        } catch (RpcException e1) {
                                            IQ result = iq.createResult();
                                            result.setExtension(new Rpc(new Rpc.MethodResponse.Fault(e1.getFaultCode(), e1.getFaultString())));
                                            xmppSession.send(result);
                                        } catch (Throwable e1) {
                                            logger.log(Level.WARNING, e1.getMessage(), e1);
                                            xmppSession.send(iq.createError(new StanzaError(new InternalServerError())));
                                        }
View Full Code Here

Examples of rocks.xmpp.extensions.rpc.model.Rpc

     * @throws rocks.xmpp.core.session.NoResponseException  If the entity did not respond.
     * @throws rocks.xmpp.core.stanza.model.StanzaException If the RPC returned with an XMPP stanza error.
     * @throws RpcException                                 If the RPC returned with an application-level error ({@code <fault/>} element).
     */
    public Value call(Jid jid, String methodName, Value... parameters) throws XmppException, RpcException {
        IQ result = xmppSession.query(new IQ(jid, IQ.Type.SET, new Rpc(methodName, parameters)));
        if (result != null) {
            Rpc rpc = result.getExtension(Rpc.class);
            if (rpc != null) {
                Rpc.MethodResponse methodResponse = rpc.getMethodResponse();
                if (methodResponse != null) {
                    if (methodResponse.getFault() != null) {
                        throw new RpcException(methodResponse.getFault().getFaultCode(), methodResponse.getFault().getFaultString());
                    }
                    return methodResponse.getResponse();
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.