return reqistry;
}
public static NHttpRequestHandlerResolver initNRegistry(final IBeeEventListener listener) {
final Map<String, Object> confighandlers = HttpConfiguration.getInstance().getHandlers();
final NHttpRequestHandlerRegistry reqistry = new NHttpRequestHandlerRegistry(); //new NHttpRequestHandlerRegistry();
if (!CollectionUtils.isEmpty(confighandlers)) {
final Set<String> keys = confighandlers.keySet();
final Map<String, Class<? extends AbstractHttpHandler>> classes = HandlerFactory.getHandlers();
if (!CollectionUtils.isEmpty(classes)) {
for (final String key : keys) {
final Object objval = confighandlers.get(key);
final List<String> values = new LinkedList<String>();
if (objval instanceof List) {
values.addAll((List<String>) objval);
} else {
values.add(objval.toString());
}
for (final String value : values) {
final String[] tokens = CollectionUtils.delimitedListToStringArray(
value, ":");
if (tokens.length == 2 && "true".equalsIgnoreCase(tokens[0])) {
final String pattern = getRegistryPattern(tokens[1]);
final NHttpRequestHandler handler = getNHandler(
listener, classes.get(key), pattern);
if (null != handler) {
reqistry.register(pattern, handler);
logHandler(pattern, handler.getClass());
}
}
}
}