connectorConfig.getFilterChain().addLast("serialization",
new ProtocolCodecFilter(new ObjectSerializationCodecFactory()));
LOCAL_ADDRESS = new InetSocketAddress("localhost", remotePort);
String processors = getProperty("pastrybroker.maxprocessors", "5");
SocketConnector clientConnector = new SocketConnector(Integer
.parseInt(processors), Executors.newCachedThreadPool());
log.info("Connecting to local broker...");
ConnectFuture connectFuture = clientConnector.connect(LOCAL_ADDRESS,
new IoHandlerAdapter() {
public void messageReceived(IoSession session, Object msg) {
context = (PastryContext) msg;
log.info("Pastry context retrieved");
}