⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ubiqossystemagentpacket.java

📁 一个agent 工具包,可以开发移动设备应用,考虑了安全措施
💻 JAVA
字号:
package SOMA.agent.mobility;

import SOMA.agent.Agent;
import SOMA.Environment;
import SOMA.naming.AgentID;
import java.io.*;

/**
 * Title:        	ubiQoS
 * Copyright:    	Copyright (c) 2002
 * Date:		12/04/2002
 * Description:		Multimedia middleware based in part on precedent versions implemented by Antonio D'Errico and Francesco Baschieri
 * @author 		Luca Foschini
 * @version 		1.0
 *
 */

/**
 * A packetizer for the UbiQoS system agents. This class implements a packetizer for the
 * system agents used in the ubiQoS package. In particular this packetizer moves only the
 * fields of the class and assumes that all the needed code, both for the agent and for 
 * the fields is present in the target location. There is no code mobility in this case,
 * but only mobility of the state of the agent.
 *
 */
public class UbiQoSSystemAgentPacket implements AgentPacket
{
  private final byte[] packet;
  private final AgentID agentID;
  private final String className;

  public UbiQoSSystemAgentPacket( Agent agent )
  {
    agentID = agent.getID();
    className = agent.getClass().getName();

    byte[] thePacket = null;
    try
    {
      ByteArrayOutputStream baos = new ByteArrayOutputStream();
      ObjectOutputStream oos = new ObjectOutputStream( baos );
      oos.writeObject( agent );
      //AgentOutputStream aos = new AgentOutputStream( baos, agent );
      //aos.writeObject( agent );
      thePacket = baos.toByteArray();
    }
    catch( Exception e )
    {
      e.printStackTrace();
    }

    packet = thePacket;
       // packet 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -