/** * Returns the shared instance of HandlersMap. This method is * also responsible for initializing the handler map if this is * the first time it has been requested since the class was * loaded. */ private static synchronized Map getHandlersMap() { if (handlersMap != null) return handlersMap; handlersMap = new HashMap(); registerHandler(new ParsedURLDataProtocolHandler()); registerHandler(new ParsedURLJarProtocolHandler()); Iterator iter = Service.providers(ParsedURLProtocolHandler.class); while (iter.hasNext()) { ParsedURLProtocolHandler handler; handler = (ParsedURLProtocolHandler)iter.next(); // System.out.println("Handler: " + handler); registerHandler(handler); } return handlersMap; }
/** * Returns the shared instance of HandlersMap. This method is * also responsible for initializing the handler map if this is * the first time it has been requested since the class was * loaded. */ private static synchronized Map getHandlersMap() { if (handlersMap != null) return handlersMap; handlersMap = new HashMap(); registerHandler(new ParsedURLDataProtocolHandler()); registerHandler(new ParsedURLJarProtocolHandler()); Iterator iter = Service.providers(ParsedURLProtocolHandler.class); while (iter.hasNext()) { ParsedURLProtocolHandler handler; handler = (ParsedURLProtocolHandler)iter.next(); // System.out.println("Handler: " + handler); registerHandler(handler); } return handlersMap; }
/** * Returns the shared instance of HandlersMap. This method is * also responsible for initializing the handler map if this is * the first time it has been requested since the class was * loaded. */ private static synchronized Map getHandlersMap() { if (handlersMap != null) return handlersMap; handlersMap = new HashMap(); registerHandler(new ParsedURLDataProtocolHandler()); registerHandler(new ParsedURLJarProtocolHandler()); Iterator iter = Service.providers(ParsedURLProtocolHandler.class); while (iter.hasNext()) { ParsedURLProtocolHandler handler; handler = (ParsedURLProtocolHandler)iter.next(); // System.out.println("Handler: " + handler); registerHandler(handler); } return handlersMap; }
/** * Get the context */ public void contextualize(Context context) throws ContextException { ParsedContextURLProtocolHandler.setContext( (org.apache.cocoon.environment.Context)context.get(Constants.CONTEXT_ENVIRONMENT_CONTEXT)); ParsedURL.registerHandler(new ParsedContextURLProtocolHandler()); ParsedURL.registerHandler(new ParsedResourceURLProtocolHandler()); }