Package com.almende.eve.rpc

Examples of com.almende.eve.rpc.RequestParams


          // TODO: handle response
        } else if (isRequest(json)) {
          // this is a request
         
          // append the sender to the request parameters
          RequestParams params = new RequestParams();
          params.put(Sender.class, from.getId());
         
          // TODO: cleanup logger info
          logger.info("request agentUrl =" + agentUrl + ", agentId="
              + agentId + " request=" + json + ", sender="
              + from.getId());
View Full Code Here


      throws Exception {
    String agentId = getAgentId(receiverUrl);
    if (agentId != null) {
      // local agent, invoke locally
      // TODO: provide Sender in requestParams
      RequestParams requestParams = new RequestParams();
      requestParams.put(Sender.class, null);
      JSONResponse response = invoke(agentId, request, requestParams);
      return response;
    }
    else {
      TransportService service = null;
View Full Code Here

        @Override
        public void run() {
          JSONResponse response;
          try {
            // TODO: provide Sender in requestParams
            RequestParams requestParams = new RequestParams();
            requestParams.put(Sender.class, null);
            response = invoke(receiverId, request, requestParams);
            callback.onSuccess(response);
          } catch (Exception e) {
            callback.onFailure(e);
          }
View Full Code Here

      taskId = createTaskId();
      future = scheduler.schedule(new Runnable() {
        @Override
        public void run() {
          try {
            RequestParams params = new RequestParams();
            params.put(Sender.class, null); // TODO: provide itself

            agentFactory.invoke(agentId, request, params);
          } catch (Exception e) {
            e.printStackTrace();
          } finally {
View Full Code Here

  public void runTask(final TaskEntry task) {
    myClock.runInPool(new Runnable() {
      @Override
      public void run() {
        try {
          RequestParams params = new RequestParams();
          params.put(Sender.class, null); // TODO: provide itself

          myAgent.getAgentFactory().invoke(myAgent.getId(),
              task.request, params);
        } catch (Exception e) {
          e.printStackTrace();
View Full Code Here

      // retrieve the agent url and the request body
      body = StringUtil.streamToString(req.getInputStream());
      jsonRequest = new JSONRequest(body);

      // TODO: append authorized sender url to the request parameters
      RequestParams requestParams =  new RequestParams();
      requestParams.put(Sender.class, null);

      // invoke the agent
      agentUrl = req.getRequestURI();
      agentId = httpTransport.getAgentId(agentUrl);
      if (agentId == null || agentId.isEmpty()) {
View Full Code Here

        String param = params.nextElement();
        request.putParam(param, req.getParameter(param));
      }

      // TODO: provide authorized sender url
      RequestParams requestParams = new RequestParams();
      requestParams.put(Sender.class, null);
     
      // invoke the agent
      JSONResponse response = factory.invoke(agentId, request, requestParams);

      // return response
View Full Code Here

      // retrieve the request body
      String body = StringUtil.streamToString(req.getInputStream());
      jsonRequest = new JSONRequest(body);
     
      // TODO: append authorized sender url to the request parameters
      RequestParams requestParams = new RequestParams();
      requestParams.put(Sender.class, null);

      // invoke the agent
      jsonResponse = agentFactory.invoke(agentId, jsonRequest, requestParams);
    } catch (Exception err) {
      // generate JSON error response
View Full Code Here

        @Override
        public void run() {
          JSONResponse response;
          try {
            // append the sender to the request parameters
            RequestParams params = new RequestParams();
            params.put(Sender.class, senderUrl);

            // invoke the agent
            response = agentFactory.invoke(agentId, request, params);
          } catch (Exception err) {
            // generate JSON error response
View Full Code Here

            }
            if (interval > 0 && !sequential) {
              start(interval);
            }
           
            RequestParams params = new RequestParams();
            String senderUrl = "local://" + agentId;
            params.put(Sender.class, senderUrl);
            // TODO: provide itself
           
            JSONResponse resp = host.receive(agentId, request,
                params);
           
View Full Code Here

TOP

Related Classes of com.almende.eve.rpc.RequestParams

Copyright © 2018 www.massapicom. 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.