import java.io.*;
import java.net.*;

public class AgentServer extends ObjectServer {
   public void processRequest(ObjectInputStream in, ObjectOutputStream out) 
   throws Exception {
      ObjectRequest request = (ObjectRequest)in.readObject();

      Task task = request.getTask();

      task.run();

      ObjectResponse response = task.getResponse();

      out.writeObject(response);

      out.flush();

      out.close();
   }
}
