Map<String, CommunicationsProtocol> protocols =
new ScalableHashMap<String, CommunicationsProtocol>();
AppContext.getDataManager().setBinding(BINDING_NAME, protocols);
// find all annotated protocols and install them
ScannedClassLoader scl = ScannedClassLoader.getSystemScannedClassLoader();
Iterator<CommunicationsProtocol> pi = scl.getAll(Protocol.class,
CommunicationsProtocol.class);
while (pi.hasNext()) {
CommunicationsProtocol cp = pi.next();
protocols.put(cp.getName(), cp);
}
// find all annotated client handlers and install them
Iterator<ClientConnectionHandler> ci = scl.getAll(ClientHandler.class,
ClientConnectionHandler.class);
while (ci.hasNext()) {
WonderlandSessionListener.registerClientHandler(ci.next());
}
}