Package de.tuclausthal.informatik.winf.mobileagents.agent

Examples of de.tuclausthal.informatik.winf.mobileagents.agent.Agent


      String agentClassName =
        agentManifest.getMainAttributes().getValue(
          Attributes.Name.MAIN_CLASS);
      Class agentClass = agentLoader.loadClass(agentClassName);
      Agent agent = (Agent) agentClass.newInstance();
      agentInfo.setAgent(agent);
    } else
    {
      // state supplied
      Agent agent = this.deseralizeAgent(data, agentLoader);
      agentInfo.setAgent(agent);
    }
  }
View Full Code Here


   * @param agent <code>Agent</code> to serialize
   * @return <code>null</code> if <code>Agent</code> could not be serialized, otherwise the serialized <code>Agent</code>
   */
  protected byte[] serializeAgent(Agent agent)
  {
    Agent temp = null;
    try
    {
      ByteArrayOutputStream outbyte = new ByteArrayOutputStream();
      ObjectOutputStream out = new ObjectOutputStream(outbyte);
      //out.useProtocolVersion(out.PROTOCOL_VERSION_2);
View Full Code Here

   * @param classloader <code>ClassLoader</code> to use
   * @return instance of the <code>Agent</code>
   */
  protected Agent deseralizeAgent(byte[] data, ClassLoader classloader)
  {
    Agent retval = null;
    try
    {
      ObjectInputStream in = new ClassLoaderObjectInputStream(this.getClass().getClassLoader(), new ByteArrayInputStream(data));
      //ObjectInputStream in = new ClassLoaderObjectInputStream(classloader, new ByteArrayInputStream(data));
//      byte c;
View Full Code Here

TOP

Related Classes of de.tuclausthal.informatik.winf.mobileagents.agent.Agent

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.