User: user57
Date: 02/02/14 22:15:52
Modified: src/main/org/jboss/test/deadlock/bean
EnterpriseEntityBean.java StatelessSessionBean.java
Log:
o replaced most System.out usage with Log4j. should really introduce
some base classes to make this mess more maintainable...
Revision Changes Path
1.2 +6 -4
jbosstest/src/main/org/jboss/test/deadlock/bean/EnterpriseEntityBean.java
Index: EnterpriseEntityBean.java
===================================================================
RCS file:
/cvsroot/jboss/jbosstest/src/main/org/jboss/test/deadlock/bean/EnterpriseEntityBean.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- EnterpriseEntityBean.java 12 Jan 2002 20:29:52 -0000 1.1
+++ EnterpriseEntityBean.java 15 Feb 2002 06:15:51 -0000 1.2
@@ -16,6 +16,8 @@
public class EnterpriseEntityBean implements EntityBean
{
+ org.apache.log4j.Category log =
org.apache.log4j.Category.getInstance(getClass());
+
private EntityContext entityContext;
public String name;
public int otherField = 0;
@@ -33,10 +35,10 @@
EJBObject ejbObject = entityContext.getEJBObject();
if (ejbObject == null) {
- System.out.println("******************************* NULL EJBOBJECT
in ejbPostCreate");
+ log.debug("******************************* NULL EJBOBJECT in
ejbPostCreate");
}
else {
- System.out.println("&&&&&&&&&&&&&&&& EJBObject found in
ejbPostCreate id is "+ejbObject.getPrimaryKey());
+ log.debug("&&&&&&&&&&&&&&&& EJBObject found in ejbPostCreate
id is "+ejbObject.getPrimaryKey());
}
}
@@ -104,9 +106,9 @@
try{
EJBObject ejbObject = entityContext.getEJBObject();
if (ejbObject == null)
- System.out.println("************************** NULL EJBOBJECT");
+ log.debug("************************** NULL EJBOBJECT");
else
- System.out.println("************************** OK EJBOBJECT");
+ log.debug("************************** OK EJBOBJECT");
EnterpriseEntityHome home =
(EnterpriseEntityHome)entityContext.getEJBObject().getEJBHome();
newBean = (EnterpriseEntity)home.create(newName);
1.2 +10 -8
jbosstest/src/main/org/jboss/test/deadlock/bean/StatelessSessionBean.java
Index: StatelessSessionBean.java
===================================================================
RCS file:
/cvsroot/jboss/jbosstest/src/main/org/jboss/test/deadlock/bean/StatelessSessionBean.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- StatelessSessionBean.java 12 Jan 2002 20:29:52 -0000 1.1
+++ StatelessSessionBean.java 15 Feb 2002 06:15:51 -0000 1.2
@@ -16,6 +16,8 @@
public class StatelessSessionBean implements SessionBean
{
+ org.apache.log4j.Category log =
org.apache.log4j.Category.getInstance(getClass());
+
private SessionContext sessionContext;
public void ejbCreate() throws RemoteException, CreateException
@@ -42,16 +44,16 @@
{
try
{
- System.out.println("callAB start");
+ log.debug("callAB start");
EnterpriseEntityHome home = (EnterpriseEntityHome)new
InitialContext().lookup("nextgen.EnterpriseEntity");
EnterpriseEntity A = home.findByPrimaryKey("A");
EnterpriseEntity B = home.findByPrimaryKey("B");
A.getOtherField();
- System.out.println("callAB is sleeping");
+ log.debug("callAB is sleeping");
Thread.sleep(10000);
- System.out.println("callAB woke up");
+ log.debug("callAB woke up");
B.getOtherField();
- System.out.println("callAB end");
+ log.debug("callAB end");
}
catch (Exception ex)
{
@@ -64,16 +66,16 @@
{
try
{
- System.out.println("callBA start");
+ log.debug("callBA start");
EnterpriseEntityHome home = (EnterpriseEntityHome)new
InitialContext().lookup("nextgen.EnterpriseEntity");
EnterpriseEntity B = home.findByPrimaryKey("B");
EnterpriseEntity A = home.findByPrimaryKey("A");
B.getOtherField();
- System.out.println("callBA is sleeping");
+ log.debug("callBA is sleeping");
Thread.sleep(10000);
- System.out.println("callBA woke up");
+ log.debug("callBA woke up");
A.getOtherField();
- System.out.println("callBA end");
+ log.debug("callBA end");
}
catch (Exception ex)
{
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development