Jadex 0.941

jadex.adapter
Interface IAgentAdapter


public interface IAgentAdapter

The adapter for a specific platform agent (e.g. a Jade agent). These are the methods a Jadex agents needs to call on its host agent.


Method Summary
 BasicAgentIdentifier getAgentIdentifier()
          Return the native agent-identifier that allows to send messages to this agent.
 IMessageEventTransport[] getMessageEventTransports()
          Get all avaiable transports available on the native platform.
 String getPlatformType()
          Used to determine the platform type.
 void idleStateChanged()
          Called by the agent when it probably awoke from an idle state.
 boolean isAgentThread(Thread thread)
          Test if the current thread is the agent thread.
 void killAgent()
          This is called, after the agent has decided to kill itself.
 void notifyIn(long millis)
          Notify the agent in a time interval.
 

Method Detail

idleStateChanged

public void idleStateChanged()
Called by the agent when it probably awoke from an idle state. The platform has to make sure that the agent will be executed again from now on. Note, this method can be called also from external threads (e.g. property changes). Therefore, on the calling thread no agent related actions must be executed (use some kind of wake-up mechanism). Also proper synchronization has to be made sure, as this method can be called called concurrently from different threads.


notifyIn

public void notifyIn(long millis)
Notify the agent in a time interval. This method is called by the jadex agent to realize internal timing issues. The platform only has to consider the last call of this method, and may forget about earlier notification requests. The method should return immediately, after saving the notification request. When the notification is due, the platform has to call the IJadexAgent.notifyDue() method.

Parameters:
millis - The relative time in millis.

isAgentThread

public boolean isAgentThread(Thread thread)
Test if the current thread is the agent thread. To ensure synchronization and to avoid deadlocks Jadex performs some checks from which thread its methods are called. Therefore it needs to distingiush between the agent's own thread(s) and other external (e.g. GUI) threads.

Parameters:
thread - The thread to test.
Returns:
True, if thread is the agent thread (i.e. the thread currently executing the agent).

killAgent

public void killAgent()
This is called, after the agent has decided to kill itself. All platform-specific resources/entries regarding the agent should now be removed.


getPlatformType

public String getPlatformType()
Used to determine the platform type. Each adapter implementation should provide the value of a constant defined somewhere. Using the platform type, e.g. plan context conditions can check if plans are applicable in current context.


getAgentIdentifier

public BasicAgentIdentifier getAgentIdentifier()
Return the native agent-identifier that allows to send messages to this agent.


getMessageEventTransports

public IMessageEventTransport[] getMessageEventTransports()
Get all avaiable transports available on the native platform.

Returns:
All transports.

Jadex 0.941

Submit a bug or feature
For further API reference and developer documentation, see the Jadex User Guide and the Jadex Tutorial. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, and working code examples.

Copyright (C) 2002-2005 Lars Braubach, Alexander Pokahr, Andrzej Walczak - University of Hamburg. Use is subject to license terms.