Examples of NHttpRequestHandlerRegistry


Examples of org.apache.http.nio.protocol.NHttpRequestHandlerRegistry

        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());
                            }
                        }
                    }
                }
View Full Code Here

Examples of org.apache.http.nio.protocol.NHttpRequestHandlerRegistry

                httpproc,
                new DefaultHttpResponseFactory(),
                new DefaultConnectionReuseStrategy(),
                params);

        NHttpRequestHandlerRegistry reqistry = new NHttpRequestHandlerRegistry();
        reqistry.register("/rnd", new NRandomDataHandler());
        handler.setHandlerResolver(reqistry);

        ListeningIOReactor ioreactor = new DefaultListeningIOReactor(2, params);
        IOEventDispatch ioEventDispatch = new DefaultServerIOEventDispatch(handler, params);
        this.listener = new NHttpListener(ioreactor, ioEventDispatch);
View Full Code Here

Examples of org.apache.http.nio.protocol.NHttpRequestHandlerRegistry

                httpproc,
                new DefaultHttpResponseFactory(),
                new DefaultConnectionReuseStrategy(),
                params);

        NHttpRequestHandlerRegistry reqistry = new NHttpRequestHandlerRegistry();
        reqistry.register("/rnd", new NRandomDataHandler());
        handler.setHandlerResolver(reqistry);

        ListeningIOReactor ioreactor = new DefaultListeningIOReactor(2, params);
        IOEventDispatch ioEventDispatch = new DefaultServerIOEventDispatch(handler, params);
        this.listener = new NHttpListener(ioreactor, ioEventDispatch);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.