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

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

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

$Revision: 1.3 $

See Also:
Serialized Form

Field Summary
protected  java.lang.String name
           
protected  KAoSAgentRegistrationHelper reg
           
 
Constructor Summary
WeatherAgentBlockComm(java.lang.String name)
          Uses default LegacyWeatherAgentBlockComm.
WeatherAgentBlockComm(java.lang.String name, LegacyWeatherService ws)
          Demonstrates wrapping a legacy system.
 
Method Summary
 AgentRep getAgentRep()
          Used by the SerializeWeatherAgentBlockComm and TravelingWeatherAgentBlockComm classes.
static void main(java.lang.String[] args)
          Main program.
 void messageAdded(Message msg)
          Implements MessageListener.
 void reexport()
          Used by the SerializeWeatherAgentBlockComm and TravelingWeatherAgentBlockComm classes.
protected  void respondToWeatherQuery(Message msg)
          Composes a reply message which inclues a weather forecast.
 void sendWeatherQueries(AgentRep rep)
          Sends a weather query to an AgentRep.
 void unexport()
          Used by the SerializeWeatherAgentBlockComm and TravelingWeatherAgentBlockComm 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

WeatherAgentBlockComm

public WeatherAgentBlockComm(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

WeatherAgentBlockComm

public WeatherAgentBlockComm(java.lang.String name)
                      throws java.io.IOException,
                             java.lang.ClassNotFoundException
Uses default LegacyWeatherAgentBlockComm.

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

sendWeatherQueries

public void sendWeatherQueries(AgentRep rep)
Sends a weather query to an AgentRep.


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 SerializeWeatherAgentBlockComm and TravelingWeatherAgentBlockComm classes.


reexport

public void reexport()
              throws java.io.IOException
Used by the SerializeWeatherAgentBlockComm and TravelingWeatherAgentBlockComm classes.

Throws:
java.io.IOException

getAgentRep

public AgentRep getAgentRep()
Used by the SerializeWeatherAgentBlockComm and TravelingWeatherAgentBlockComm classes.


main

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

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