2011-02-15 19:37:35 +00:00
|
|
|
package zutil.net.nio.service;
|
2008-11-14 16:38:36 +00:00
|
|
|
|
|
|
|
|
import java.nio.channels.SocketChannel;
|
|
|
|
|
|
2011-02-15 19:37:35 +00:00
|
|
|
import zutil.net.nio.NioNetwork;
|
|
|
|
|
import zutil.net.nio.message.Message;
|
2008-11-14 16:38:36 +00:00
|
|
|
|
|
|
|
|
public abstract class NetworkService {
|
|
|
|
|
protected static NetworkService instance;
|
|
|
|
|
protected NioNetwork nio;
|
|
|
|
|
|
|
|
|
|
public NetworkService(NioNetwork nio){
|
|
|
|
|
instance = this;
|
|
|
|
|
this.nio = nio;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public abstract void handleMessage(Message message, SocketChannel socket);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return A instance of this class
|
|
|
|
|
*/
|
|
|
|
|
public static NetworkService getInstance(){
|
|
|
|
|
return instance;
|
|
|
|
|
}
|
|
|
|
|
}
|