@Test public void createUnderDifferentNamespaces() { String[] namespaces = {null, "foo", "bar"}; for (String ns: namespaces) { ServiceLogManager em; String nsLoggerName = (ns == null ? "" : ns) + loggerName; OperationKey ns1Key = new OperationKey(op1Key, ns); OperationKey ns2Key = new OperationKey(op2Key, ns); em = factory.create(ns1Key.getNamespace(), ns1Key.getServiceName(), ns1Key.getVersion()); assertNotNull(em); assertEquals(nsLoggerName, em.getLoggerName()); em = factory.create(ns2Key.getNamespace(), ns2Key.getServiceName(), ns2Key.getVersion()); assertNotNull(em); assertEquals(nsLoggerName, em.getLoggerName()); em = factory.create(ns, serviceName, serviceVersion); assertNotNull(em); assertEquals(nsLoggerName, em.getLoggerName()); } }
@Override public ServiceLogManager create(String namespace, String serviceName, ServiceVersion version) { String loggerName = eventLoggingRegistry.registerConcreteLogger(namespace, serviceName); return new DefaultServiceLogManager(loggerName); }
DefaultServiceLogManagerFactory implements ServiceLogManagerFactory { @Override public ServiceLogManager create(String namespace, String serviceName, ServiceVersion version) { String loggerName = eventLoggingRegistry.registerConcreteLogger(namespace, serviceName); return new DefaultServiceLogManager(loggerName); } }
DefaultServiceLogManagerFactory implements ServiceLogManagerFactory { @Override public ServiceLogManager create(String namespace, String serviceName, ServiceVersion version) { String loggerName = eventLoggingRegistry.registerConcreteLogger(namespace, serviceName); return new DefaultServiceLogManager(loggerName); } DefaultServiceLogManagerFactory(EventLoggingRegistry eventLoggingRegistry); }
DefaultServiceLogManagerFactory implements ServiceLogManagerFactory { @Override public ServiceLogManager create(String namespace, String serviceName, ServiceVersion version) { String loggerName = eventLoggingRegistry.registerConcreteLogger(namespace, serviceName); return new DefaultServiceLogManager(loggerName); } DefaultServiceLogManagerFactory(EventLoggingRegistry eventLoggingRegistry); @Override ServiceLogManager create(String namespace, String serviceName, ServiceVersion version); }
DefaultServiceLogManagerFactory implements ServiceLogManagerFactory { @Override public ServiceLogManager create(String namespace, String serviceName, ServiceVersion version) { String loggerName = eventLoggingRegistry.registerConcreteLogger(namespace, serviceName); return new DefaultServiceLogManager(loggerName); } DefaultServiceLogManagerFactory(EventLoggingRegistry eventLoggingRegistry); @Override ServiceLogManager create(String namespace, String serviceName, ServiceVersion version);  }