Package com.maverick.util

Examples of com.maverick.util.ByteArrayWriter.toByteArray()


          response.writeInt(filteredResources.size());
          for (Resource resource : filteredResources) {
            response.writeInt(resource.getResourceId());
            response.writeString(resource.getResourceDisplayName());
          }
          request.setRequestData(response.toByteArray());
          return true;
        }
      } catch (Exception e) {
        log.error("Failed to get resources.", e);
      }
View Full Code Here


        msg.writeString(message.getContent());

        DefaultAgentManager agentManager = DefaultAgentManager.getInstance();
        if (agentManager.hasActiveAgent(info) && info.getUser().getPrincipalName().equals(recipient.getRecipientAlias())) {
            try {
                Request request = new Request("agentMessage", msg.toByteArray());
                AgentTunnel tunnel = agentManager.getAgentBySession(info);
                if (tunnel != null) {
                    tunnel.sendRequest(request, false, 0);
                    return true;
                }
View Full Code Here

        new Properties(),
        shortcut.getParameters(),
        shortcut.getApplication()));
    }
   
    return new Request("launchApplication", msg.toByteArray());
  }

  /* (non-Javadoc)
   * @see com.adito.agent.AgentService#createChannel(com.maverick.multiplex.MultiplexedConnection, java.lang.String)
   */
 
View Full Code Here

      try {
        notifyAll();
        ByteArrayWriter baw = new ByteArrayWriter();
        try {
          baw.writeString(VersionInfo.getVersion().toString());
          request.setRequestData(baw.toByteArray());
          return true;
        } catch (IOException e) {
          log.error("Failed to send back server version.");
          return false;
        }
View Full Code Here

            return false;
          }
        }
       
       
        request.setRequestData(baw.toByteArray());
        return true;
     
      } catch(Exception ex) {
        log.error(ex);
        return false;
View Full Code Here

              for(AgentTunnel agent : agents) {
                ByteArrayWriter baw = new ByteArrayWriter();
                try {
                  baw.writeInt(resourceType.getResourceTypeId());
                  synchronized(agent) {
                    agent.sendRequest(new Request(AgentTunnel.UPDATE_RESOURCES_REQUEST, baw.toByteArray()), false);
                  }
                }
                catch(IOException ioe) {
                  log.warn("Failed to send resource update request to agent " + agent.getId() + ".", ioe);
                }
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.