Package com.almende.eve.transport

Examples of com.almende.eve.transport.TransportService


       
        // TODO: getting an arbitrary http service which knows this agent
        //       is not safe
        //       -> Scheduler should be configured with the servlet_url
        //          that it should use specified?
        TransportService service = null;
        for (TransportService s : agentFactory.getTransportServices("http")) {
          if (s.getAgentUrl(agentId) != null) {
            service = s;
            break;
          }
        }
        String url = null;
        if (service != null) {
          url = service.getAgentUrl(agentId);
        }
       
        URL uri = new URL(url);
        String path = uri.getPath();   
        Queue queue = QueueFactory.getDefaultQueue();
View Full Code Here


      if (sender != null) {
        senderUri = getSenderUrl(sender.getId(), receiverUrl);
      }
      receive(receiverId, message, senderUri, tag);
    } else {
      TransportService service = null;
      URI senderUri = null;
      if (sender != null) {
        senderUri = getSenderUrl(sender.getId(), receiverUrl);
      }
      service = getTransportService(protocol);
      if (service != null) {
        // TODO: message should already be a String?
        service.sendAsync(senderUri, receiverUrl, message.toString(),
            tag);
      } else {
        throw new ProtocolException(
            "No transport service configured for protocol '"
                + protocol + "'.");
View Full Code Here

                      + " must implement "
                      + TransportService.class.getName());
            }
           
            // initialize the transport service
            final TransportService transport = (TransportService) transportClass
                .getConstructor(AgentHost.class, Map.class)
                .newInstance(this, transportParams);
           
            // register the service with the agent factory
            addTransportService(transport);
View Full Code Here

      requestParams.put(Sender.class, null);
      JSONResponse response = invoke(agentId, request, requestParams);
      return response;
    }
    else {
      TransportService service = null;
      String protocol = null;
      int separator = receiverUrl.indexOf(":");
      if (separator != -1) {
        protocol = receiverUrl.substring(0, separator);
        service = getTransportService(protocol);
      }
      if (service != null) {
        JSONResponse response = service.send(senderId, receiverUrl, request);
        return response;
      }
      else {
        throw new ProtocolException(
          "No transport service configured for protocol '" + protocol + "'.");
View Full Code Here

          }
        }
      }).start();
    }
    else {
      TransportService service = null;
      String protocol = null;
      int separator = receiverUrl.indexOf(":");
      if (separator != -1) {
        protocol = receiverUrl.substring(0, separator);
        service = getTransportService(protocol);
      }
      if (service != null) {
        service.sendAsync(senderId, receiverUrl, request, callback);
      }
      else {
        throw new ProtocolException(
          "No transport service configured for protocol '" + protocol + "'.");
      }
View Full Code Here

                "TransportService class " + transportClass.getName() +
                " must implement " + TransportService.class.getName());
          }
         
          // initialize the transport service
          TransportService transport = (TransportService) transportClass
              .getConstructor(AgentFactory.class, Map.class)
              .newInstance(this, transportParams);

          // register the service with the agent factory
          addTransportService(transport);
View Full Code Here

      if (sender != null) {
        senderUri = getSenderUrl(sender.getId(), receiverUrl);
      }
      receive(receiverId, message, senderUri, tag);
    } else {
      TransportService service = null;
      URI senderUri = null;
      if (sender != null) {
        senderUri = getSenderUrl(sender.getId(), receiverUrl);
      }
      service = getTransportService(protocol);
      if (service != null) {
        // TODO: message should already be a String?
        service.sendAsync(senderUri, receiverUrl, message.toString(),
            tag);
      } else {
        throw new ProtocolException(
            "No transport service configured for protocol '"
                + protocol + "'.");
View Full Code Here

                      + " must implement "
                      + TransportService.class.getName());
            }
           
            // initialize the transport service
            final TransportService transport = (TransportService) transportClass
                .getConstructor(AgentHost.class, Map.class)
                .newInstance(this, transportParams);
           
            // register the service with the agent factory
            addTransportService(transport);
View Full Code Here

      try {
        // TODO: getting an arbitrary http service which knows this agent
        //       is not safe
        //       -> Scheduler should be configured with the servlet_url
        //          that it should use specified?
        TransportService service = null;
        for (TransportService s : agentFactory.getTransportServices("http")) {
          if (s.getAgentUrl(agentId) != null) {
            service = s;
            break;
          }
        }
        String url = null;
        if (service != null) {
          url = service.getAgentUrl(agentId);
        }
       
        URL uri = new URL(url);
        String path = uri.getPath();   
        Queue queue = QueueFactory.getDefaultQueue();
View Full Code Here

      onDestroy();
    } else if (AgentSignal.SETSCHEDULERFACTORY.equals(event.getEvent())) {
      // init scheduler tasks
      scheduler = host.getScheduler(this);
    } else if (AgentSignal.ADDTRANSPORTSERVICE.equals(event.getEvent())) {
      final TransportService service = (TransportService) event.getData();
      try {
        service.reconnect(getId());
      } catch (final IOException e) {
        LOG.log(Level.WARNING,
            "Failed to reconnect agent on new transport.", e);
      }
    }
View Full Code Here

TOP

Related Classes of com.almende.eve.transport.TransportService

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.