Package de.tuclausthal.informatik.winf.mobileagents.container

Examples of de.tuclausthal.informatik.winf.mobileagents.container.AgentInfo


   */
  protected int deliverAgent(byte[] data, Node from)
  {
    // unpackage
    Packager p = PackagingManager.getInstance().getPackager("StateOnly");
    AgentInfo info = p.unpackageAgent(data);
    if (info == null)
    {
      return SimpleP2P.REPLY_ERROR;
    }


    // update AgentInfo
    info.setNodeReceivedFrom(from);
    info.setAgentName(info.getAgent().getName());
    info.setPackager(p);

    // put to run
    try
    {
      Container c = ContainerManager.getInstance().getContainer();
View Full Code Here


      }
    });

    container.setNodeName("TESTHOST");
    container.start();
    AgentInfo agentInfo = container.createAgentInfo();
    agentInfo.setPackager(new NullPackager());
    agentInfo.setAgentName("TestAgent");
    agentInfo.setSecurityPolicy(new EverythingAllowedPolicy());
    agentInfo.setAgent(new AgentBase(agentInfo.getAgentName())
    {

      public void start(AgentServices as)
      {
        System.out.println(new Date().toString());
View Full Code Here

     * @return value at the given row/column.
     * @see javax.swing.table.TableModel#getValueAt(int, int)
     */
    public Object getValueAt(int row, int col)
    {
      AgentInfo info = this.agentInfos[row];

      switch (col)
      {
        case 0 :
          return info.getAgentName();
        case 1 :
          return new Integer(info.getAgentState());
        default :
          return null;
      }
    }
View Full Code Here

  public AgentInfo unpackageAgent(byte[] packageFile)
  {
    try
    {
      // get AgentInfo
      AgentInfo agentInfo =
        ContainerManager.getInstance().getContainer().createAgentInfo();

      // deserialize Agent
      agentInfo.setAgent(
        this.deseralizeAgent(packageFile, this.getClass().getClassLoader()));
       
      // set security-policy
      SecurityPolicyManager.getInstance().assignSecurityPolicy(agentInfo);
     
View Full Code Here

   * @see #REPLY_OK
   */
  protected int deliverAgent(byte[] data, Node from) {
    // unpackage
    Packager p = PackagingManager.getInstance().getPackager("StateOnly");
    AgentInfo info = p.unpackageAgent(data);
    if (info == null) {
      return this.REPLY_ERROR;
    }

    // update AgentInfo
    info.setNodeReceivedFrom(from);
    info.setAgentName(info.getAgent().getName());
    info.setPackager(p);

    // put to run
    try {
      Container c = ContainerManager.getInstance().getContainer();

View Full Code Here

TOP

Related Classes of de.tuclausthal.informatik.winf.mobileagents.container.AgentInfo

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.