Package org.atmosphere.util.uri

Examples of org.atmosphere.util.uri.UriTemplate


        U handler = handlers.get(path);

        if (handler == null) {
            final Map<String, String> m = new HashMap<String, String>();
            for (Map.Entry<String, U> e : handlers.entrySet()) {
                UriTemplate t = null;
                try {
                    t = new UriTemplate(e.getKey());
                    logger.trace("Trying to map {} to {}", t, path);
                    if (t.match(path, m)) {
                        handler = e.getValue();
                        logger.trace("Mapped {} to {}", t, e.getValue());
                        break;
                    }
                } finally {
                    if (t != null) t.destroy();
                }
            }
        }
        return handler;
    }
View Full Code Here


            Collection<Broadcaster> c = config.getBroadcasterFactory().lookupAll();

            final Map<String, String> m = new HashMap<String, String>();
            List<Broadcaster> l = new ArrayList<Broadcaster>();
            logger.trace("Map {}", path);
            UriTemplate t = null;
            try {
                t = new UriTemplate(path);
                for (Broadcaster b : c) {
                    logger.trace("Trying to map {} to {}", t, b.getID());
                    if (t.match(b.getID(), m)) {
                        l.add(b);
                    }
                    m.clear();
                }
            } finally {
                if (t != null) t.destroy();
            }

            if (l.isEmpty() && cacheMessage) {
                if (NoCache.class.isAssignableFrom(cache.getClass())) {
                    logger.warn("No Broadcaster matches {}. Message {} WILL BE LOST. " +
View Full Code Here

TOP

Related Classes of org.atmosphere.util.uri.UriTemplate

Copyright © 2018 www.massapicom. 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.