use of java.util.logging.Level in project hazelcast by hazelcast.
the class ClusterListenerSupport method connect.
private boolean connect(Set<InetSocketAddress> triedAddresses) throws Exception {
final Collection<InetSocketAddress> socketAddresses = getSocketAddresses();
for (InetSocketAddress inetSocketAddress : socketAddresses) {
if (!client.getLifecycleService().isRunning()) {
if (logger.isFinestEnabled()) {
logger.finest("Giving up on retrying to connect to cluster since client is shutdown");
}
break;
}
Connection connection = null;
try {
triedAddresses.add(inetSocketAddress);
Address address = new Address(inetSocketAddress);
logger.info("Trying to connect to " + address + " as owner member");
connection = connectionManager.getOrConnect(address, true);
clientMembershipListener.listenMembershipEvents(ownerConnectionAddress);
fireConnectionEvent(LifecycleEvent.LifecycleState.CLIENT_CONNECTED);
return true;
} catch (Exception e) {
Level level = e instanceof AuthenticationException ? Level.WARNING : Level.FINEST;
logger.log(level, "Exception during initial connection to " + inetSocketAddress, e);
if (null != connection) {
connection.close("Could not connect to " + inetSocketAddress + " as owner", e);
}
}
}
return false;
}
use of java.util.logging.Level in project hazelcast by hazelcast.
the class ReplicaSyncResponse method logException.
private void logException(Operation op, Throwable e) {
ILogger logger = getLogger();
NodeEngine nodeEngine = getNodeEngine();
Level level = nodeEngine.isRunning() ? Level.WARNING : Level.FINEST;
if (logger.isLoggable(level)) {
logger.log(level, "While executing " + op, e);
}
}
use of java.util.logging.Level in project hazelcast by hazelcast.
the class LoggingScheduledExecutor method afterExecute.
@Override
protected void afterExecute(Runnable runnable, Throwable throwable) {
super.afterExecute(runnable, throwable);
Level level = FINE;
if (throwable == null && runnable instanceof ScheduledFuture && ((ScheduledFuture) runnable).isDone()) {
try {
((Future) runnable).get();
} catch (CancellationException ce) {
throwable = ce;
} catch (ExecutionException ee) {
level = SEVERE;
throwable = ee.getCause();
} catch (InterruptedException ie) {
throwable = ie;
currentThread().interrupt();
}
}
if (throwable != null) {
logger.log(level, "Failed to execute " + runnable, throwable);
}
}
use of java.util.logging.Level in project j2objc by google.
the class LevelTest method testParse_UndefinedNumber.
/*
* Test method parse, with an undefined valid number strings.
*/
public void testParse_UndefinedNumber() {
Level l = Level.parse("0");
assertEquals(0, l.intValue());
assertEquals("0", l.getName());
assertNull(l.getResourceBundleName());
}
use of java.util.logging.Level in project j2objc by google.
the class LevelTest method testParse_NegativeNumber.
public void testParse_NegativeNumber() {
Level l = Level.parse("-4");
assertEquals(-4, l.intValue());
assertEquals("-4", l.getName());
assertNull(l.getResourceBundleName());
}
Aggregations