protected synchronized void removeProtocols(final ProtocolManagerFactory<?> factory) { final Set<String> protocols = new HashSet<>(Arrays.asList(factory.getProtocols())); for (final String protocol : protocols) { logger.info("Removing protocol - {} -> {}", protocol, factory); this.protocols.remove(protocol, factory); } if (this.listener != null) { this.listener.protocolsRemoved(protocols); } }
protected synchronized void addProtocols(final ProtocolManagerFactory<?> factory) { final Set<String> protocols = new HashSet<>(Arrays.asList(factory.getProtocols())); for (final String protocol : protocols) { logger.info("Adding protocol - {} -> {}", protocol, factory); this.protocols.put(protocol, factory); } if (this.listener != null) { this.listener.protocolsAdded(protocols); } }
@Override public ProtocolManagerFactory addingService(ServiceReference<ProtocolManagerFactory<Interceptor>> reference) { ProtocolManagerFactory<Interceptor> pmf = context.getService(reference); callback.addFactory(pmf); for (String protocol : pmf.getProtocols()) { protocolAdded(protocol); } return pmf; }
@Override public void removedService(ServiceReference<ProtocolManagerFactory<Interceptor>> reference, ProtocolManagerFactory<Interceptor> pmf) { for (String protocol : pmf.getProtocols()) { protocolRemoved(protocol); } callback.removeFactory(pmf); }
/** * Loads the protocols found into a map. * * @param protocolManagerFactoryCollection */ private void loadProtocolManagerFactories(Iterable<ProtocolManagerFactory> protocolManagerFactoryCollection) { for (ProtocolManagerFactory next : protocolManagerFactoryCollection) { MessagePersister.registerProtocol(next); String[] protocols = next.getProtocols(); for (String protocol : protocols) { ActiveMQServerLogger.LOGGER.addingProtocolSupport(protocol, next.getModuleName()); protocolMap.put(protocol, next); } } }