agentfactory.java
来自「javaP2P技术内幕课程第22课的源代码」· Java 代码 · 共 31 行
JAVA
31 行
package server;
import net.jxta.endpoint.Message;
import net.jxta.endpoint.MessageElement;
import java.util.*;
import java.io.*;
/** * A factory to instantiate Agent objects */
public final class AgentFactory {
private static AgentFactory factory = new AgentFactory();
/** * Get the instance of the AgentFactory */
public static AgentFactory getInstance() {
return factory;
}
/** * Instantiates an Agent based on the course. Currently returns an Agent * object. * * @param course The course requested. */
public Agent getAgent(String course) {
return new Agent();
}
}