Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: belaban/JGroups
base: f99a19b
...
head fork: belaban/JGroups
compare: 50b5bf0
  • 2 commits
  • 18 files changed
  • 0 commit comments
  • 1 contributor
View
6 src/org/jgroups/JChannel.java
@@ -786,9 +786,6 @@ protected Object invokeCallback(int type, Object arg) {
}
protected final void init(ProtocolStackConfigurator configurator) throws Exception {
- if(log.isInfoEnabled())
- log.info("JGroups version: " + Version.description);
-
List<ProtocolConfiguration> configs=configurator.getProtocolStack();
for(ProtocolConfiguration config: configs)
config.substituteVariables(); // replace vars with system props
@@ -802,9 +799,6 @@ protected final void init(ProtocolStackConfigurator configurator) throws Excepti
protected final void init(JChannel ch) throws Exception {
if(ch == null)
throw new IllegalArgumentException("channel is null");
- if(log.isInfoEnabled())
- log.info("JGroups version: " + Version.description);
-
synchronized(JChannel.class) {
prot_stack=new ProtocolStack(this);
prot_stack.setup(ch.getProtocolStack()); // Setup protocol stack (creates protocol, calls init() on them)
View
13 src/org/jgroups/auth/FixedMembershipToken.java
@@ -21,19 +21,18 @@
*/
package org.jgroups.auth;
-import java.io.DataInput;
-import java.io.DataOutput;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.StringTokenizer;
-
import org.jgroups.Event;
import org.jgroups.Message;
import org.jgroups.PhysicalAddress;
import org.jgroups.annotations.Property;
import org.jgroups.util.Util;
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.StringTokenizer;
+
/**
* <p>
* The FixedMemberShipToken object predefines a list of IP addresses and ports that can join the
View
12 src/org/jgroups/auth/X509Token.java
@@ -105,8 +105,8 @@ public String getName() {
public boolean authenticate(AuthToken token, Message msg) {
if (!this.valueSet) {
- if (log.isFatalEnabled()) {
- log.fatal("X509Token not setup correctly - check token attrs");
+ if (log.isErrorEnabled()) {
+ log.error("X509Token not setup correctly - check token attrs");
}
return false;
}
@@ -115,8 +115,8 @@ public boolean authenticate(AuthToken token, Message msg) {
// got a valid X509 token object
X509Token serverToken = (X509Token) token;
if (!serverToken.valueSet) {
- if (log.isFatalEnabled()) {
- log.fatal("X509Token - recieved token not valid");
+ if (log.isErrorEnabled()) {
+ log.error("X509Token - recieved token not valid");
}
return false;
}
@@ -134,8 +134,8 @@ public boolean authenticate(AuthToken token, Message msg) {
return true;
}
} catch (Exception e) {
- if (log.isFatalEnabled()) {
- log.fatal(e.toString());
+ if (log.isErrorEnabled()) {
+ log.error(e.toString());
}
}
}
View
2  src/org/jgroups/blocks/AbstractConnectionMap.java
@@ -232,7 +232,7 @@ public void run() {
Entry<Address,V> entry=it.next();
V c=entry.getValue();
if(c.isExpired(System.currentTimeMillis())) {
- log.info("Connection " + c.toString() + " reaped");
+ log.debug("Connection " + c.toString() + " reaped");
Util.close(c);
it.remove();
}
View
4 src/org/jgroups/blocks/ReplCache.java
@@ -576,8 +576,8 @@ public void viewAccepted(final View new_view) {
final List<Address> old_nodes=this.view != null? new ArrayList<Address>(this.view.getMembers()) : null;
this.view=new_view;
- if(log.isInfoEnabled())
- log.info("new view: " + new_view);
+ if(log.isDebugEnabled())
+ log.debug("new view: " + new_view);
if(hash_function != null)
hash_function.installNodes(new_view.getMembers());
View
9 src/org/jgroups/conf/XmlConfigurator.java
@@ -156,12 +156,10 @@ public void warning(SAXParseException exception) throws SAXException {
}
public void fatalError(SAXParseException exception) throws SAXException {
- log.fatal("Error during parse", exception);
exceptionRef.set(exception);
}
public void error(SAXParseException exception) throws SAXException {
- log.error("Error during parse", exception);
exceptionRef.set(exception);
}
});
@@ -207,11 +205,8 @@ protected static XmlConfigurator parse(Element root_element) throws java.io.IOEx
*/
try {
String root_name=root_element.getNodeName();
- if(!"config".equals(root_name.trim().toLowerCase())) {
- log.fatal("XML protocol stack configuration does not start with a '<config>' element; " + "maybe the XML configuration needs to be converted to the new format ?\n"
- + "use 'java org.jgroups.conf.XmlConfigurator <old XML file> -new_format' to do so");
- throw new IOException("invalid XML configuration");
- }
+ if(!"config".equals(root_name.trim().toLowerCase()))
+ throw new IOException("the configuration does not start with a <config> element");
NodeList prots=root_element.getChildNodes();
for(int i=0;i < prots.getLength();i++) {
View
8 src/org/jgroups/logging/JDKLogImpl.java
@@ -72,10 +72,6 @@ public void fatal(String msg) {
logger.log(Level.SEVERE, msg);
}
- public void trace(Object msg, Throwable t) {
- logger.log(Level.FINER, msg.toString(), t);
- }
-
public void trace(String msg, Throwable t) {
logger.log(Level.FINER, msg, t);
}
@@ -84,10 +80,6 @@ public void debug(String msg, Throwable t) {
logger.log(Level.FINE, msg, t);
}
- public void info(String msg, Throwable t) {
- logger.log(Level.INFO, msg, t);
- }
-
public void warn(String msg, Throwable t) {
logger.log(Level.WARNING, msg, t);
}
View
17 src/org/jgroups/logging/Log.java
@@ -15,20 +15,21 @@
boolean isDebugEnabled();
boolean isTraceEnabled();
- void debug(String msg);
- void debug(String msg, Throwable throwable);
- void error(String msg);
- void error(String msg, Throwable throwable);
+
+
void fatal(String msg);
void fatal(String msg, Throwable throwable);
+ void error(String msg);
+ void error(String msg, Throwable throwable);
+ void warn(String msg);
+ void warn(String msg, Throwable throwable);
void info(String msg);
- void info(String msg, Throwable throwable);
+ void debug(String msg);
+ void debug(String msg, Throwable throwable);
void trace(Object msg);
- void trace(Object msg, Throwable throwable);
void trace(String msg);
void trace(String msg, Throwable throwable);
- void warn(String msg);
- void warn(String msg, Throwable throwable);
+
// Advanced methods
View
8 src/org/jgroups/logging/Log4JLogImpl.java
@@ -76,18 +76,10 @@ public void info(String msg) {
logger.log(FQCN, Level.INFO, msg, null);
}
- public void info(String msg, Throwable throwable) {
- logger.log(FQCN, Level.INFO, msg, throwable);
- }
-
public void trace(Object msg) {
logger.log(FQCN, Level.TRACE, msg, null);
}
- public void trace(Object msg, Throwable throwable) {
- logger.log(FQCN, Level.TRACE, msg, throwable);
- }
-
public void trace(String msg) {
logger.log(FQCN, Level.TRACE, msg, null);
}
View
2  src/org/jgroups/protocols/BSH.java
@@ -50,7 +50,7 @@ public int getCurrentPort() {
public void start() throws Exception {
srv_sock=Util.createServerSocket(getSocketFactory(), Global.BSH_SRV_SOCK, null, bind_port);
- log.info("Server socket listening at " + srv_sock.getLocalSocketAddress());
+ log.debug("Server socket listening at " + srv_sock.getLocalSocketAddress());
acceptor=new Thread(this);
acceptor.start();
}
View
4 src/org/jgroups/protocols/DELAY.java
@@ -46,7 +46,7 @@ public Object up(Event evt) {
switch(evt.getType()) {
case Event.MSG: // Only delay messages, not other events !
- if(log.isInfoEnabled()) log.info("delaying incoming message for " + delay + " milliseconds");
+ if(log.isTraceEnabled()) log.trace("delaying incoming message for " + delay + " milliseconds");
Util.sleep(delay);
break;
}
@@ -62,7 +62,7 @@ public Object down(Event evt) {
case Event.MSG: // Only delay messages, not other events !
- if(log.isInfoEnabled()) log.info("delaying outgoing message for " + delay + " milliseconds");
+ if(log.isTraceEnabled()) log.trace("delaying outgoing message for " + delay + " milliseconds");
Util.sleep(delay);
break;
}
View
54 src/org/jgroups/protocols/ENCRYPT.java
@@ -222,8 +222,8 @@ public void init() throws Exception {
if(keyPassword == null && storePassword != null) {
keyPassword=storePassword;
- if(log.isInfoEnabled())
- log.info("key_password used is same as store_password");
+ if(log.isDebugEnabled())
+ log.debug("key_password used is same as store_password");
}
if(keyStoreName == null) {
initSymKey();
@@ -326,8 +326,8 @@ public void initSymKey() throws Exception {
setSecretKey(secretKey);
- if(log.isInfoEnabled())
- log.info(" Symmetric key generated ");
+ if(log.isDebugEnabled())
+ log.debug(" Symmetric key generated ");
}
/**
@@ -340,8 +340,8 @@ public void initSymKey() throws Exception {
*/
private void initSymCiphers(String algorithm, SecretKey secret) throws Exception {
- if(log.isInfoEnabled())
- log.info(" Initializing symmetric ciphers");
+ if(log.isDebugEnabled())
+ log.debug(" Initializing symmetric ciphers");
if(symProvider != null && symProvider.trim().length() > 0) {
symEncodingCipher=Cipher.getInstance(algorithm, symProvider);
@@ -361,8 +361,8 @@ private void initSymCiphers(String algorithm, SecretKey secret) throws Exception
digest.update(secret.getEncoded());
symVersion=new String(digest.digest(), "UTF-8");
- if(log.isInfoEnabled()) {
- log.info(" Initialized symmetric ciphers with secret key (" + symVersion.length() + " bytes)");
+ if(log.isDebugEnabled()) {
+ log.debug(" Initialized symmetric ciphers with secret key (" + symVersion.length() + " bytes)");
/*
StringBuilder sb=new StringBuilder(" Initialized symmetric ciphers with secret key (" + symVersion.length()
+ " bytes) ");
@@ -371,7 +371,7 @@ private void initSymCiphers(String algorithm, SecretKey secret) throws Exception
char c=arr[i];
sb.append((int)c);
}
- log.info(sb.toString());
+ log.debug(sb.toString());
*/
}
}
@@ -404,8 +404,8 @@ public void initKeyPair() throws Exception {
asymCipher.init(Cipher.DECRYPT_MODE, Kpair.getPrivate());
- if(log.isInfoEnabled())
- log.info(" asym algo initialized");
+ if(log.isDebugEnabled())
+ log.debug(" asym algo initialized");
}
/** Just remove if you don't need to reset any state */
@@ -418,8 +418,8 @@ public Object up(Event evt) {
switch(evt.getType()) {
case Event.VIEW_CHANGE:
View view=(View)evt.getArg();
- if(log.isInfoEnabled())
- log.info("new view: " + view);
+ if(log.isDebugEnabled())
+ log.debug("new view: " + view);
if(!suppliedKey) {
handleViewChange(view, false);
}
@@ -488,8 +488,8 @@ else if(keyServerAddr == null || (!tmpKeyServer.equals(keyServerAddr)) || (keySe
private void becomeKeyServer(Address tmpKeyServer, boolean forced) {
keyServerAddr=tmpKeyServer;
keyServer=true;
- if(log.isInfoEnabled() && !forced)
- log.info("[" + local_addr + "] I have become the new key server ");
+ if(log.isDebugEnabled() && !forced)
+ log.debug("[" + local_addr + "] I have become the new key server ");
queue_down=false;
queue_up=false;
}
@@ -509,8 +509,8 @@ private void handleNewKeyServer(Address newKeyServer) {
// set new keyserver address
keyServerAddr=newKeyServer;
keyServer=false;
- if(log.isInfoEnabled())
- log.info("[" + local_addr + "] " + keyServerAddr + " has become the new key server, sending key request to it");
+ if(log.isDebugEnabled())
+ log.debug("[" + local_addr + "] " + keyServerAddr + " has become the new key server, sending key request to it");
// create a key request message
sendKeyRequest();
@@ -599,8 +599,8 @@ private void handleUpMessage(Event evt) throws Exception {
switch(hdr.getType()) {
// if a key request
case EncryptHeader.KEY_REQUEST:
- if(log.isInfoEnabled()) {
- log.info("received a key request from peer");
+ if(log.isDebugEnabled()) {
+ log.debug("received a key request from peer");
}
//if a key request send response key back
@@ -615,8 +615,8 @@ private void handleUpMessage(Event evt) throws Exception {
}
break;
case EncryptHeader.SECRETKEY:
- if(log.isInfoEnabled()) {
- log.info("received a secretkey response from keyserver");
+ if(log.isDebugEnabled()) {
+ log.debug("received a secretkey response from keyserver");
}
try {
@@ -630,8 +630,8 @@ private void handleUpMessage(Event evt) throws Exception {
// otherwise lets set the reurned key
// as the shared key
setKeys(tmp, hdr.getVersion());
- if(log.isInfoEnabled()) {
- log.info("Decoded secretkey response");
+ if(log.isDebugEnabled()) {
+ log.debug("Decoded secretkey response");
}
}
}
@@ -693,7 +693,7 @@ private void setKeys(SecretKey key, String version) throws Exception {
setSymVersion(version);
// drain the up queue
- log.info("setting queue up to false in setKeys");
+ log.debug("setting queue up to false in setKeys");
queue_up=false;
drainUpQueue();
@@ -844,8 +844,8 @@ public Object down(Event evt) {
case Event.VIEW_CHANGE:
View view=(View)evt.getArg();
- if(log.isInfoEnabled())
- log.info("new view: " + view);
+ if(log.isDebugEnabled())
+ log.debug("new view: " + view);
if(!suppliedKey) {
handleViewChange(view, false);
}
@@ -970,7 +970,7 @@ private SecretKeySpec decodeKey(byte[] encodedKey) throws Exception {
temp.init(Cipher.SECRET_KEY, keySpec);
}
catch(Exception e) {
- log.fatal(e.toString());
+ log.error(e.toString());
keySpec=null;
}
return keySpec;
View
16 src/org/jgroups/protocols/FD_SIMPLE.java
@@ -90,7 +90,7 @@ public Object up(Event evt) {
return null; // don't pass up further
case FdHeader.I_AM_ALIVE:
- if(log.isInfoEnabled()) log.info("received I_AM_ALIVE response from " + sender);
+ if(log.isTraceEnabled()) log.trace("received I_AM_ALIVE response from " + sender);
heartbeat_lock.lock();
try {
if(task != null)
@@ -132,7 +132,7 @@ public Object down(Event evt) {
try {
if(heartbeat_future == null || heartbeat_future.isDone()) {
task=new HeartbeatTask();
- if(log.isInfoEnabled()) log.info("starting heartbeat task");
+ if(log.isTraceEnabled()) log.trace("starting heartbeat task");
heartbeat_future=timer.scheduleWithFixedDelay(task, interval, interval, TimeUnit.MILLISECONDS);
}
}
@@ -144,7 +144,7 @@ public Object down(Event evt) {
heartbeat_lock.lock();
try {
if(heartbeat_future != null) {
- if(log.isInfoEnabled()) log.info("stopping heartbeat task");
+ if(log.isTraceEnabled()) log.trace("stopping heartbeat task");
heartbeat_future.cancel(true);
heartbeat_future=null;
task=null;
@@ -160,7 +160,7 @@ public Object down(Event evt) {
for(Iterator<Address> it=counters.keySet().iterator(); it.hasNext();) {
key=it.next();
if(!members.contains(key)) {
- if(log.isInfoEnabled()) log.info("removing " + key + " from counters");
+ if(log.isTraceEnabled()) log.trace("removing " + key + " from counters");
it.remove();
}
}
@@ -306,8 +306,8 @@ public void run() {
return;
}
- if(log.isInfoEnabled())
- log.info("sending ARE_YOU_ALIVE message to " + dest + ", counters are\n" + printCounters());
+ if(log.isTraceEnabled())
+ log.trace("sending ARE_YOU_ALIVE message to " + dest + ", counters are\n" + printCounters());
promise.reset();
msg=new Message(dest);
@@ -317,8 +317,8 @@ public void run() {
promise.getResult(timeout);
num_missed_hbs=incrementCounter(dest);
if(num_missed_hbs >= max_missed_hbs) {
- if(log.isInfoEnabled())
- log.info("missed " + num_missed_hbs + " from " + dest + ", suspecting member");
+ if(log.isTraceEnabled())
+ log.trace("missed " + num_missed_hbs + " from " + dest + ", suspecting member");
up_prot.up(new Event(Event.SUSPECT, dest));
}
}
View
6 src/org/jgroups/protocols/JDBC_PING.java
@@ -106,7 +106,7 @@ public void stop() {
protected void attemptSchemaInitialization() {
if (stringIsEmpty(initialize_sql)) {
- log.info("Table creation step skipped: initialize_sql property is missing");
+ log.debug("Table creation step skipped: initialize_sql property is missing");
return;
}
Connection connection = getConnection();
@@ -116,14 +116,14 @@ protected void attemptSchemaInitialization() {
PreparedStatement preparedStatement =
connection.prepareStatement(initialize_sql);
preparedStatement.execute();
- log.info("Table created for JDBC_PING Discovery Protocol");
+ log.debug("Table created for JDBC_PING Discovery Protocol");
} catch (SQLException e) {
if (log.isDebugEnabled()) {
log.debug("Could not execute initialize_sql statement; not necessarily an error.", e);
}
else {
//avoid printing out the stacktrace
- log.info("Could not execute initialize_sql statement; not necessarily an error. Set to debug logging level for details.");
+ log.debug("Could not execute initialize_sql statement; not necessarily an error. Set to debug logging level for details.");
}
}
} finally {
View
2  src/org/jgroups/protocols/pbcast/GMS.java
@@ -919,7 +919,7 @@ public Object down(Event evt) {
}
down_prot.down(evt);
if(local_addr == null)
- if(log.isFatalEnabled()) log.fatal("[CONNECT] local_addr is null");
+ throw new IllegalStateException("local_addr is null");
try {
if(state_transfer)
impl.joinWithStateTransfer(local_addr, use_flush);
View
15 tests/junit/org/jgroups/tests/ChannelConcurrencyTest.java
@@ -3,6 +3,7 @@
import static java.util.concurrent.TimeUnit.SECONDS;
import java.net.InetAddress;
+import java.sql.SQLOutput;
import java.util.Properties;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutorService;
@@ -68,7 +69,6 @@ protected void testhelper(boolean useDispatcher) throws Throwable {
// Wait for all channels to finish connecting
successConnecting=latch.await(timeoutToConverge, TimeUnit.SECONDS);
if(successConnecting) {
- log.info("All connected. Converging...");
for(Task t:tasks) {
Throwable ex=t.getException();
if(ex != null)
@@ -87,14 +87,12 @@ protected void testhelper(boolean useDispatcher) throws Throwable {
}
final long duration=System.currentTimeMillis() - start;
- log.info("Converged to a single group after " + duration
- + " ms; group is:\n");
for(int i=0;i < channels.length;i++) {
- log.info("#" + (i + 1)
- + ": "
- + channels[i].getAddress()
- + ": "
- + channels[i].getView());
+ System.out.println("#" + (i + 1)
+ + ": "
+ + channels[i].getAddress()
+ + ": "
+ + channels[i].getView());
}
}
@@ -106,7 +104,6 @@ protected void testhelper(boolean useDispatcher) throws Throwable {
finally {
Util.sleep(2500);
executor.shutdownNow();
- log.info("closing channels: ");
for(JChannel ch:channels) {
ch.close();
//there are sometimes big delays until entire cluster shuts down
View
2  tests/junit/org/jgroups/tests/ChannelTestBase.java
@@ -384,7 +384,7 @@ public void unblock() {
public void viewAccepted(View new_view) {
events.append('v');
- log.info(getLocalAddress() + ": view=" + new_view);
+ System.out.println(getLocalAddress() + ": view=" + new_view);
}
}
View
2  tests/junit/org/jgroups/tests/FlushCloseOpenTest.java
@@ -97,7 +97,7 @@ private void assertCount(ReceiverImpl srv1, long srv1Count, ReceiverImpl srv2, l
+ srv1.receiveCount;
assert srv2Count == srv2.receiveCount.get() : "expected " + srv2Count + " but got "
+ srv2.receiveCount;
- log.info("assert OK in " + (System.currentTimeMillis() - start) + "ms");
+ System.out.println("assert OK in " + (System.currentTimeMillis() - start) + "ms");
}
private class ReceiverImpl extends ReceiverAdapter {

No commit comments for this range

Something went wrong with that request. Please try again.