User: chirino
Date: 01/07/15 19:51:45
Modified: src/main/org/jbossmq/il/oil OILClientIL.java
OILClientILService.java OILServerIL.java
OILServerILService.java
OILServerILServiceMBean.java
Log:
Moved the rest of JBossMQ over to log4j logging.
- The jbossmq-client.jar now includes a log4j.properties which sets up the logging
subsystems on the client side. To chanage the logging levels, just place your
log4j.properties in the classpath betfore the jbossmq-client.jar
Revision Changes Path
1.2 +3 -4 jbossmq/src/main/org/jbossmq/il/oil/OILClientIL.java
Index: OILClientIL.java
===================================================================
RCS file: /cvsroot/jboss/jbossmq/src/main/org/jbossmq/il/oil/OILClientIL.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- OILClientIL.java 2001/07/11 02:28:34 1.1
+++ OILClientIL.java 2001/07/16 02:51:45 1.2
@@ -18,7 +18,6 @@
import java.io.ObjectInputStream;
import java.rmi.RemoteException;
import java.io.BufferedOutputStream;
-import org.jbossmq.Log;
import java.io.ObjectOutputStream;
import java.io.BufferedInputStream;
import java.net.InetAddress;
@@ -30,7 +29,7 @@
* @author Norbert Lataille ([EMAIL PROTECTED])
* @author Hiram Chirino ([EMAIL PROTECTED])
*
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
*/
public class OILClientIL implements ClientIL, java.io.Serializable {
@@ -65,7 +64,7 @@
}
private InetAddress addr;
- final static org.apache.log4j.Category cat =
org.apache.log4j.Category.getInstance(OILClientIL.class);
+ static org.apache.log4j.Category cat =
org.apache.log4j.Category.getInstance(OILClientIL.class);
private transient ObjectInputStream in;
static final int m_close = 2;
static final int m_deleteTemporaryDestination = 1;
@@ -86,13 +85,13 @@
protected void createConnection() throws RemoteException
{
try {
- Log.notice("ConnectionReceiverOILClient is connecting to:
"+addr.getHostAddress()+":"+port);
+ cat.info("ConnectionReceiverOILClient is connecting to:
"+addr.getHostAddress()+":"+port);
socket=new Socket(addr,port);
out=new ObjectOutputStream(new
BufferedOutputStream(socket.getOutputStream()));
out.flush();
in=new ObjectInputStream(new
BufferedInputStream(socket.getInputStream()));
} catch (Exception e) {
- Log.error(e);
+ cat.debug(e);
throw new RemoteException("Cannot connect to the
ConnectionReceiver/Server");
}
}
1.2 +5 -6 jbossmq/src/main/org/jbossmq/il/oil/OILClientILService.java
Index: OILClientILService.java
===================================================================
RCS file:
/cvsroot/jboss/jbossmq/src/main/org/jbossmq/il/oil/OILClientILService.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- OILClientILService.java 2001/07/11 02:28:34 1.1
+++ OILClientILService.java 2001/07/16 02:51:45 1.2
@@ -18,7 +18,6 @@
import java.net.Socket;
import java.io.ObjectInputStream;
import java.rmi.RemoteException;
-import org.jbossmq.Log;
import java.io.BufferedOutputStream;
import java.io.ObjectOutputStream;
import java.io.BufferedInputStream;
@@ -31,10 +30,9 @@
* @author Norbert Lataille ([EMAIL PROTECTED])
* @author Hiram Chirino ([EMAIL PROTECTED])
*
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
*/
public class OILClientILService implements org.jbossmq.il.ClientILService, Runnable
{
-
//the client IL
OILClientIL clientIL;
@@ -74,6 +72,7 @@
worker.interrupt();
}
+ static org.apache.log4j.Category cat =
org.apache.log4j.Category.getInstance(OILClientILService.class);
//A link on my connection
private Connection connection;
// Attributes ----------------------------------------------------
@@ -94,7 +93,7 @@
ObjectInputStream in = null;
try {
- Log.log("Waiting for the server to connect to me");
+ cat.debug("Waiting for the server to connect to me");
// We may close() before we get a connection so we need to
// periodicaly check to see if we were !running.
serverSocket.setSoTimeout(1000);
@@ -120,7 +119,7 @@
while (running) {
try {
- Log.log("Waiting for a messgage from the server");
+ cat.debug("Waiting for a messgage from the server");
code = in.readByte();
} catch (java.io.InterruptedIOException e) {
continue;
@@ -165,7 +164,7 @@
break;
try {
- Log.error(e);
+ cat.error(e);
out.writeByte(1);
out.writeObject(e);
out.reset();
@@ -180,7 +179,7 @@
}
try {
- Log.log("Closing receiver connections.");
+ cat.debug("Closing receiver connections.");
out.close();
in.close();
} catch (IOException e) {
1.2 +0 -0 jbossmq/src/main/org/jbossmq/il/oil/OILServerIL.java
Index: OILServerIL.java
===================================================================
RCS file: /cvsroot/jboss/jbossmq/src/main/org/jbossmq/il/oil/OILServerIL.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- OILServerIL.java 2001/07/11 02:28:34 1.1
+++ OILServerIL.java 2001/07/16 02:51:45 1.2
@@ -36,7 +36,7 @@
* @author Hiram Chirino ([EMAIL PROTECTED])
* @author Norbert Lataille ([EMAIL PROTECTED])
*
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
*/
public class OILServerIL implements ServerIL, java.io.Serializable, Cloneable {
1.2 +7 -8 jbossmq/src/main/org/jbossmq/il/oil/OILServerILService.java
Index: OILServerILService.java
===================================================================
RCS file:
/cvsroot/jboss/jbossmq/src/main/org/jbossmq/il/oil/OILServerILService.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- OILServerILService.java 2001/07/11 02:28:34 1.1
+++ OILServerILService.java 2001/07/16 02:51:45 1.2
@@ -45,7 +45,7 @@
* manage the JVM IL.
*
* @author Hiram Chirino ([EMAIL PROTECTED])
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
*/
public class OILServerILService extends ServerILJMXService implements
OILServerILServiceMBean, Runnable {
@@ -77,7 +77,7 @@
serverSocket = new ServerSocket(serverBindPort);
serverSocket.setSoTimeout(SO_TIMEOUT);
- cat.info("JBossMQ OIL service available at :
"+InetAddress.getLocalHost().getHostAddress()+ ":"+ serverSocket.getLocalPort());
+ category.info("JBossMQ OIL service available at :
"+InetAddress.getLocalHost().getHostAddress()+ ":"+ serverSocket.getLocalPort());
worker = new Thread(server.threadGroup, this,"OIL Worker");
worker.start();
@@ -110,7 +110,6 @@
return rc;
}
- org.apache.log4j.Category cat =
org.apache.log4j.Category.getInstance(OILServerILService.class);
static final int m_acknowledge = 1;
static final int m_addMessage = 2;
static final int m_browse = 3;
@@ -163,7 +162,7 @@
in = new ObjectInputStream(new
BufferedInputStream(socket.getInputStream()));
} catch (IOException e) {
- cat.warn("Could not initialize the OILServerIL Service.", e);
+ category.warn("Could not initialize the OILServerIL Service.",
e);
running = false;
return;
}
@@ -183,7 +182,7 @@
if( closed || !running )
break;
- cat.warn("Connection failure (1).", e);
+ category.warn("Connection failure (1).", e);
break;
}
@@ -195,7 +194,7 @@
{
case m_setSpyDistributedConnection:
connectionToken =
(ConnectionToken)in.readObject();
- cat.debug("The UILClientIL Connection is set
up");
+ category.debug("The UILClientIL Connection is
set up");
break;
case m_acknowledge:
server.acknowledge(connectionToken,
(AcknowledgementRequest)in.readObject());
@@ -271,7 +270,7 @@
if( closed )
break;
- cat.warn("Connection failure (2).", e);
+ category.warn("Connection failure (2).", e);
break;
}
@@ -288,7 +287,7 @@
if( closed )
break;
- cat.warn("Connection failure (3).", e);
+ category.warn("Connection failure (3).", e);
break;
}
}
@@ -303,7 +302,7 @@
}
socket.close();
} catch (IOException e ) {
- cat.warn("Connection failure during connection close.", e);
+ category.warn("Connection failure during connection close.",
e);
}
}
1.2 +0 -1 jbossmq/src/main/org/jbossmq/il/oil/OILServerILServiceMBean.java
Index: OILServerILServiceMBean.java
===================================================================
RCS file:
/cvsroot/jboss/jbossmq/src/main/org/jbossmq/il/oil/OILServerILServiceMBean.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- OILServerILServiceMBean.java 2001/07/11 02:28:34 1.1
+++ OILServerILServiceMBean.java 2001/07/16 02:51:45 1.2
@@ -14,5 +14,4 @@
*/
public interface OILServerILServiceMBean extends
org.jbossmq.il.ServerILJMXServiceMBean
{
- public static final String OBJECT_NAME = "JBossMQ:service=OILServerIL";
}
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development