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

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


   * @throws AgentInfoException see <code>Container</code>
   */
  public void loadAgent(AgentInfo agentInfo) throws AgentInfoException
  {
    if(! (agentInfo instanceof BasicAgentInfo))
      throw new AgentInfoException(AgentInfoException.WRONG_AGENTINFO);
   
    BasicAgentInfo info = (BasicAgentInfo)agentInfo;
   
    // Checks for AgentInfo
    if(this.agentInfos.containsKey(info.getAgentName()))
      throw new AgentInfoException(AgentInfoException.NAME_NOT_UNIQUE);
    if(info.getAgentName() == null)
      throw new AgentInfoException(AgentInfoException.NO_AGENT_NAME);
    if(info.getAgentName().equals(""))
      throw new AgentInfoException(AgentInfoException.NO_AGENT_NAME);
    if(info.getAgentName().equals(HOST_ADDRESS))
    throw new AgentInfoException(AgentInfoException.NAME_NOT_UNIQUE);
    if(info.getAgent() == null)
      throw new AgentInfoException(AgentInfoException.NO_AGENT);
    if(info.getPackager() == null)
      throw new AgentInfoException(AgentInfoException.NO_PACKAGER);
    if(info.getSecurityPolicy() == null)
      throw new AgentInfoException(AgentInfoException.NO_SECURITYPOLICY);
   
    // set preconditions
    info.setAgentState(AgentInfo.STATE_PREPARED);
   
    this.agentInfos.put(info.getAgentName(), info);
View Full Code Here


  public void runAgent(AgentInfo agent) throws AgentInfoException,AgentAlreadyRunningException
  {
    // Checks for AgentInfo
    if(this.agentInfos.containsKey(agent.getAgentName()) &&
       this.agentInfos.get(agent.getAgentName())!= agent)
      throw new AgentInfoException(AgentInfoException.AGENT_NOT_LOADED);
   
    if((agent.getAgentState() != AgentInfo.STATE_PREPARED)
       && (agent.getAgentState() != AgentInfo.STATE_STOPPED))
    {
      throw new AgentAlreadyRunningException();
View Full Code Here

   */
  void removeAgentInfo(BasicAgentInfo agentInfo) throws AgentInfoException
  {
    //  Checks
    if(!this.agentInfos.containsKey(agentInfo.getAgentName()))
      throw new AgentInfoException(AgentInfoException.AGENT_NOT_LOADED);
    if(this.agentInfos.get(agentInfo.getAgentName()) != agentInfo)
      throw new AgentInfoException(AgentInfoException.AGENT_NOT_LOADED);
 
    // clear all resources
    agentInfo.destroy();
    this.agentInfos.remove(agentInfo.getAgentName());
    this.notifyAgentDead(agentInfo);
View Full Code Here

TOP

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

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.