public static void registerPerRegistryRequestListener(RegistryContext registryContext) { HandlerManager handlerManager = registryContext.getHandlerManager(); PerRegistryRequestListener storeBandwidthHandler = new PerRegistryRequestListener(); URLMatcher anyUrlMatcher = new URLMatcher(); anyUrlMatcher.setPattern(".*"); String[] applyingFilters = new String[] { Filter.PUT, Filter.IMPORT, Filter.GET, Filter.DUMP, Filter.RESTORE, }; handlerManager.addHandlerWithPriority( applyingFilters, anyUrlMatcher, storeBandwidthHandler); } }
public static void registerRegistryUsagePersistingListener(RegistryContext registryContext) throws RegistryException { //If metering is disabled, we do not need to register the handler if(!"true".equals(ServerConfiguration.getInstance().getFirstProperty("EnableMetering"))){ return; } HandlerManager handlerManager = registryContext.getHandlerManager(); RegistryUsageListener handler = new RegistryUsageListener(); URLMatcher anyUrlMatcher = new URLMatcher(); anyUrlMatcher.setPattern(".*"); String[] applyingFilters = new String[]{ Filter.PUT, Filter.IMPORT, Filter.GET, Filter.DUMP, Filter.RESTORE, Filter.DELETE}; handlerManager.addHandlerWithPriority(applyingFilters, anyUrlMatcher, handler, HandlerLifecycleManager.DEFAULT_REPORTING_HANDLER_PHASE); }
RegistryContext registryContext = registry.getRegistryContext(); registryContext.registerNoCachePath(mountPoint); registryContext.getHandlerManager().addHandler(null, urlMatcher, externalContentHandler, HandlerLifecycleManager.TENANT_SPECIFIC_SYSTEM_HANDLER_PHASE);
protected void activate(ComponentContext context) { try { URLMatcher um = new URLMatcher(); um.setAddAssociationPattern(DEFAULT_SHUTTERBUG_HOME + RegistryConstants.PATH_SEPARATOR + VOTE_PATH); um.setRemoveAssociationPattern(DEFAULT_SHUTTERBUG_HOME + RegistryConstants.PATH_SEPARATOR + VOTE_PATH); ShutterbugCollectionHandler sbHandler = new ShutterbugCollectionHandler(); sbHandler.init(); Utils.getRegistryService().getSystemRegistry().getRegistryContext() .getHandlerManager().addHandler(null, um, sbHandler); } catch (Exception e) { log.error("Shutterbug Collection Handler registration failed.", e); } try { Utils.getRegistryService().getSystemRegistry().getRegistryContext() .getHandlerManager().addHandler(null, new MediaTypeMatcher(SHUTTERBUG_MEDIA_TYPE), new ShutterbugImageHandler()); } catch (Exception e) { log.error("Shutterbug Image Handler registration failed.", e); } log.info("Successfully started the Shutterbug Sample."); }
if (registry == null || registry.getRegistryContext() == null || registry.getRegistryContext().getHandlerManager() == null) { String msg = "Error Initializing Registry Profile Handler"; log.error(msg); "/") + ".*" + RegistryConstants.PROFILES_PATH + ".*/profiles"); ProfilesAddHandler handler = new ProfilesAddHandler(); registry.getRegistryContext().getHandlerManager().addHandler(null, filter, handler);
if (registry == null || registry.getRegistryContext() == null || registry.getRegistryContext().getHandlerManager() == null) { String msg = "Error Initializing Registry Eventing Handler"; log.error(msg); filter.setRestorePattern(".*"); RegistryEventingHandler handler = new RegistryEventingHandler(); registry.getRegistryContext().getHandlerManager().addHandler(null, filter, handler, HandlerLifecycleManager.DEFAULT_REPORTING_HANDLER_PHASE); registry.setEventingServiceURL(null, endpoint); SubscriptionManagerHandler erbSubManagerRRHanlder = new EmbeddedRegistryBasedSubscriptionManagerResourceRelocateHandler(); registry.getRegistryContext().getHandlerManager().addHandler(null, erbSubManagerRRFilter, erbSubManagerRRHanlder, HandlerLifecycleManager.DEFAULT_REPORTING_HANDLER_PHASE);
CommonUtil.configureGovernanceArtifacts(registry, CommonUtil.getConfigurationContext().getAxisConfiguration()); HandlerManager handlerManager = registry.getRegistryContext().getHandlerManager(); if (handlerManager != null) { handlerManager.addHandler(null,