use of com.hazelcast.logging.LoggingService in project hazelcast by hazelcast.
the class SelectNow_NioNetworkingFactory method create.
@Override
public NioNetworking create(final MockServerContext serverContext, MetricsRegistry metricsRegistry) {
LoggingService loggingService = serverContext.loggingService;
HazelcastProperties properties = serverContext.properties();
return new NioNetworking(new NioNetworking.Context().loggingService(loggingService).metricsRegistry(metricsRegistry).threadNamePrefix(serverContext.getHazelcastName()).errorHandler(new TcpServerConnectionChannelErrorHandler(loggingService.getLogger(TcpServerConnectionChannelErrorHandler.class))).inputThreadCount(properties.getInteger(IO_INPUT_THREAD_COUNT)).outputThreadCount(properties.getInteger(IO_OUTPUT_THREAD_COUNT)).balancerIntervalSeconds(properties.getInteger(IO_BALANCER_INTERVAL_SECONDS)).selectorMode(SelectorMode.SELECT_NOW));
}
use of com.hazelcast.logging.LoggingService in project hazelcast by hazelcast.
the class Select_NioNetworkingFactory method create.
@Override
public NioNetworking create(final MockServerContext serverContext, MetricsRegistry metricsRegistry) {
HazelcastProperties properties = serverContext.properties();
LoggingService loggingService = serverContext.loggingService;
return new NioNetworking(new NioNetworking.Context().loggingService(loggingService).metricsRegistry(metricsRegistry).threadNamePrefix(serverContext.getHazelcastName()).errorHandler(new TcpServerConnectionChannelErrorHandler(loggingService.getLogger(TcpServerConnectionChannelErrorHandler.class))).inputThreadCount(properties.getInteger(IO_INPUT_THREAD_COUNT)).outputThreadCount(properties.getInteger(IO_OUTPUT_THREAD_COUNT)).balancerIntervalSeconds(properties.getInteger(IO_BALANCER_INTERVAL_SECONDS)).selectorMode(SelectorMode.SELECT));
}
use of com.hazelcast.logging.LoggingService in project hazelcast by hazelcast.
the class DiagnosticsTest method mockLoggingService.
private LoggingService mockLoggingService() {
LoggingService mock = mock(LoggingService.class);
when(mock.getLogger(Diagnostics.class)).thenReturn(getLogger(Diagnostics.class));
return mock;
}
use of com.hazelcast.logging.LoggingService in project hazelcast by hazelcast.
the class HazelcastOSGiInstanceTest method getLoggingServiceCalledSuccessfullyOverOSGiInstance.
@Test
public void getLoggingServiceCalledSuccessfullyOverOSGiInstance() {
LoggingService mockLoggingService = mock(LoggingService.class);
HazelcastInstance mockHazelcastInstance = mock(HazelcastInstance.class);
HazelcastOSGiInstance hazelcastOSGiInstance = createHazelcastOSGiInstance(mockHazelcastInstance);
when(mockHazelcastInstance.getLoggingService()).thenReturn(mockLoggingService);
assertEquals(mockLoggingService, hazelcastOSGiInstance.getLoggingService());
verify(mockHazelcastInstance).getLoggingService();
}
use of com.hazelcast.logging.LoggingService in project hazelcast by hazelcast.
the class DefaultClientConnectionManagerFactory method createConnectionManager.
@Override
public ClientConnectionManager createConnectionManager(ClientConfig config, HazelcastClientInstanceImpl client, DiscoveryService discoveryService) {
LoggingService loggingService = client.getLoggingService();
ILogger logger = loggingService.getLogger(HazelcastClient.class);
ClientAwsConfig awsConfig = config.getNetworkConfig().getAwsConfig();
AddressTranslator addressTranslator;
if (awsConfig != null && awsConfig.isEnabled()) {
try {
addressTranslator = new AwsAddressTranslator(awsConfig, loggingService);
} catch (NoClassDefFoundError e) {
logger.warning("hazelcast-aws.jar might be missing!");
throw e;
}
} else if (discoveryService != null) {
addressTranslator = new DiscoveryAddressTranslator(discoveryService, client.getProperties().getBoolean(ClientProperty.DISCOVERY_SPI_PUBLIC_IP_ENABLED));
} else {
addressTranslator = new DefaultAddressTranslator();
}
return new ClientConnectionManagerImpl(client, addressTranslator);
}
Aggregations