edu.uwf.kaos.coabsgrid.test.kgh
Class WeatherAgentMany

java.lang.Object
  extended by edu.uwf.kaos.coabsgrid.test.kgh.WeatherAgentMany
All Implemented Interfaces:
java.io.Serializable

public class WeatherAgentMany
extends java.lang.Object
implements java.io.Serializable

A simple weather forecast agent. Receives weather queries in its messageQueue, and responds by sending weather forecast messages back. Send bug reports to coabsgrid-bugs@globalinfotek.com

See Also:
Serialized Form

Field Summary
protected  java.lang.String name
           
protected  KAoSAgentRegistrationHelper reg
           
 
Constructor Summary
WeatherAgentMany(java.lang.String name)
          Uses default LegacyWeatherAgent.
WeatherAgentMany(java.lang.String name, LegacyWeatherService ws)
          Demonstrates wrapping a legacy system.
 
Method Summary
 AgentRep getAgentRep()
          Used by the SerializeWeatherAgent and TravelingWeatherAgent classes.
static void main(java.lang.String[] args)
          Main program.
 void messageAdded(Message msg)
          Implements MessageListener.
 void reexport()
          Used by the SerializeWeatherAgent and TravelingWeatherAgent classes.
protected  void respondToWeatherQuery(Message msg)
          Composes a reply message which inclues a weather forecast.
 void unexport()
          Used by the SerializeWeatherAgent and TravelingWeatherAgent classes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

protected java.lang.String name

reg

protected KAoSAgentRegistrationHelper reg
Constructor Detail

WeatherAgentMany

public WeatherAgentMany(java.lang.String name,
                        LegacyWeatherService ws)
                 throws java.io.IOException,
                        java.lang.ClassNotFoundException
Demonstrates wrapping a legacy system.

Throws:
java.io.IOException
java.lang.ClassNotFoundException

WeatherAgentMany

public WeatherAgentMany(java.lang.String name)
                 throws java.io.IOException,
                        java.lang.ClassNotFoundException
Uses default LegacyWeatherAgent.

Throws:
java.io.IOException
java.lang.ClassNotFoundException
Method Detail

messageAdded

public void messageAdded(Message msg)
Implements MessageListener. Processes incoming messages. Assumes that the incoming message has the Sender field filled in with the sender's DefaultAgentRep - otherwise does not bother to reply.


respondToWeatherQuery

protected void respondToWeatherQuery(Message msg)
Composes a reply message which inclues a weather forecast.


unexport

public void unexport()
Used by the SerializeWeatherAgent and TravelingWeatherAgent classes.


reexport

public void reexport()
              throws java.io.IOException
Used by the SerializeWeatherAgent and TravelingWeatherAgent classes.

Throws:
java.io.IOException

getAgentRep

public AgentRep getAgentRep()
Used by the SerializeWeatherAgent and TravelingWeatherAgent classes.


main

public static void main(java.lang.String[] args)
                 throws java.io.IOException,
                        java.lang.ClassNotFoundException
Main program. Instantiates a WeatherAgent.

Throws:
java.io.IOException
java.lang.ClassNotFoundException