User: user57
Date: 02/02/14 22:15:56
Modified: src/main/org/jboss/test/testbean/bean BMTStatefulBean.java
BMTStatelessBean.java EnterpriseEntityBean.java
EntityBMPBean.java EntityPKBean.java
StatefulSessionBean.java StatelessSessionBean.java
TxSessionBean.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.3 +6 -4
jbosstest/src/main/org/jboss/test/testbean/bean/BMTStatefulBean.java
Index: BMTStatefulBean.java
===================================================================
RCS file:
/cvsroot/jboss/jbosstest/src/main/org/jboss/test/testbean/bean/BMTStatefulBean.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- BMTStatefulBean.java 19 Dec 2001 06:49:30 -0000 1.2
+++ BMTStatefulBean.java 15 Feb 2002 06:15:56 -0000 1.3
@@ -15,10 +15,12 @@
import java.sql.SQLException;
public class BMTStatefulBean implements SessionBean {
+ org.apache.log4j.Category log =
org.apache.log4j.Category.getInstance(getClass());
+
private SessionContext sessionContext;
public void ejbCreate() throws RemoteException, CreateException {
- System.out.println("BMTStatefulBean.ejbCreate() called");
+ log.debug("BMTStatefulBean.ejbCreate() called");
}
@@ -27,15 +29,15 @@
public void ejbCreate(String caca, String cacaprout) throws RemoteException,
CreateException{};
public void ejbActivate() throws RemoteException {
- System.out.println("BMTStatefulBean.ejbActivate() called");
+ log.debug("BMTStatefulBean.ejbActivate() called");
}
public void ejbPassivate() throws RemoteException {
- System.out.println("BMTStatefulBean.ejbPassivate() called");
+ log.debug("BMTStatefulBean.ejbPassivate() called");
}
public void ejbRemove() throws RemoteException {
- System.out.println("BMTStatefulBean.ejbRemove() called");
+ log.debug("BMTStatefulBean.ejbRemove() called");
}
public void setSessionContext(SessionContext context) throws RemoteException {
1.2 +6 -4
jbosstest/src/main/org/jboss/test/testbean/bean/BMTStatelessBean.java
Index: BMTStatelessBean.java
===================================================================
RCS file:
/cvsroot/jboss/jbosstest/src/main/org/jboss/test/testbean/bean/BMTStatelessBean.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- BMTStatelessBean.java 27 Sep 2000 00:46:29 -0000 1.1
+++ BMTStatelessBean.java 15 Feb 2002 06:15:56 -0000 1.2
@@ -10,22 +10,24 @@
public class BMTStatelessBean implements SessionBean {
+ org.apache.log4j.Category log =
org.apache.log4j.Category.getInstance(getClass());
+
private SessionContext sessionContext;
public void ejbCreate() throws RemoteException, CreateException {
- System.out.println("BMTStatelessBean.ejbCreate() called");
+ log.debug("BMTStatelessBean.ejbCreate() called");
}
public void ejbActivate() throws RemoteException {
- System.out.println("BMTStatelessBean.ejbActivate() called");
+ log.debug("BMTStatelessBean.ejbActivate() called");
}
public void ejbPassivate() throws RemoteException {
- System.out.println("BMTStatelessBean.ejbPassivate() called");
+ log.debug("BMTStatelessBean.ejbPassivate() called");
}
public void ejbRemove() throws RemoteException {
- System.out.println("BMTStatelessBean.ejbRemove() called");
+ log.debug("BMTStatelessBean.ejbRemove() called");
}
public void setSessionContext(SessionContext context) throws RemoteException {
1.3 +21 -20
jbosstest/src/main/org/jboss/test/testbean/bean/EnterpriseEntityBean.java
Index: EnterpriseEntityBean.java
===================================================================
RCS file:
/cvsroot/jboss/jbosstest/src/main/org/jboss/test/testbean/bean/EnterpriseEntityBean.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- EnterpriseEntityBean.java 29 Sep 2000 20:17:25 -0000 1.2
+++ EnterpriseEntityBean.java 15 Feb 2002 06:15:56 -0000 1.3
@@ -15,6 +15,7 @@
import org.jboss.test.testbean.interfaces.EnterpriseEntity;
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;
@@ -22,64 +23,64 @@
public String ejbCreate(String name) throws RemoteException, CreateException {
- System.out.println("EntityBean.ejbCreate("+name+") called");
+ log.debug("EntityBean.ejbCreate("+name+") called");
this.name = name;
return null;
}
public String ejbFindByPrimaryKey(String name) throws RemoteException,
FinderException {
- System.out.println("EntityBean.ejbFindByPrimaryKey() called");
+ log.debug("EntityBean.ejbFindByPrimaryKey() called");
return name;
}
public void ejbPostCreate(String name) throws RemoteException, CreateException {
- System.out.println("EntityBean.ejbPostCreate("+name+") called");
+ log.debug("EntityBean.ejbPostCreate("+name+") called");
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());
}
}
public void ejbActivate() throws RemoteException {
- System.out.println("EntityBean.ejbActivate() called");
+ log.debug("EntityBean.ejbActivate() called");
}
public void ejbLoad() throws RemoteException {
- System.out.println("EntityBean.ejbLoad() called");
+ log.debug("EntityBean.ejbLoad() called");
}
public void ejbPassivate() throws RemoteException {
- System.out.println("EntityBean.ejbPassivate() called");
+ log.debug("EntityBean.ejbPassivate() called");
}
public void ejbRemove() throws RemoteException, RemoveException {
- System.out.println("EntityBean.ejbRemove() called "+hashCode());
+ log.debug("EntityBean.ejbRemove() called "+hashCode());
}
public void ejbStore() throws RemoteException {
- System.out.println("EntityBean.ejbStore() called "+hashCode());
+ log.debug("EntityBean.ejbStore() called "+hashCode());
}
public String callBusinessMethodA() {
- System.out.println("EntityBean.callBusinessMethodA() called");
+ log.debug("EntityBean.callBusinessMethodA() called");
return "EntityBean.callBusinessMethodA() called, my primaryKey is "+
entityContext.getPrimaryKey().toString();
}
public String callBusinessMethodB() {
- System.out.println("EntityBean.callBusinessMethodB() called");
+ log.debug("EntityBean.callBusinessMethodB() called");
EJBObject ejbObject = entityContext.getEJBObject();
@@ -93,7 +94,7 @@
public String callBusinessMethodB(String words) {
- System.out.println("EntityBean.callBusinessMethodB(String) called");
+ log.debug("EntityBean.callBusinessMethodB(String) called");
EJBObject ejbObject = entityContext.getEJBObject();
@@ -106,25 +107,25 @@
}
public void setOtherField(int value) {
- System.out.println("EntityBean.setOtherField("+value+")");
+ log.debug("EntityBean.setOtherField("+value+")");
otherField = value;
}
public int getOtherField() {
- System.out.println("EntityBean.getOtherField() called");
+ log.debug("EntityBean.getOtherField() called");
return otherField;
}
public EnterpriseEntity createEntity(String newName) throws RemoteException {
- System.out.println("EntityBean.createEntity() called");
+ log.debug("EntityBean.createEntity() called");
EnterpriseEntity newBean;
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);
@@ -140,12 +141,12 @@
}
public void setEntityContext(EntityContext context) throws RemoteException {
- System.out.println("EntityBean.setSessionContext() called");
+ log.debug("EntityBean.setSessionContext() called");
entityContext = context;
}
public void unsetEntityContext() throws RemoteException {
- System.out.println("EntityBean.unsetSessionContext() called");
+ log.debug("EntityBean.unsetSessionContext() called");
entityContext = null;
}
}
1.3 +28 -26
jbosstest/src/main/org/jboss/test/testbean/bean/EntityBMPBean.java
Index: EntityBMPBean.java
===================================================================
RCS file:
/cvsroot/jboss/jbosstest/src/main/org/jboss/test/testbean/bean/EntityBMPBean.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- EntityBMPBean.java 29 Sep 2000 20:17:26 -0000 1.2
+++ EntityBMPBean.java 15 Feb 2002 06:15:56 -0000 1.3
@@ -15,6 +15,8 @@
import java.util.Enumeration;
public class EntityBMPBean implements EntityBean {
+ org.apache.log4j.Category log =
org.apache.log4j.Category.getInstance(getClass());
+
private EntityContext entityContext;
public String name;
private StatelessSession statelessSession;
@@ -23,7 +25,7 @@
public String ejbCreate() throws RemoteException, CreateException {
- System.out.println("EntityBMP.ejbCreate() called");
+ log.debug("EntityBMP.ejbCreate() called");
this.name = "noname";
return name;
@@ -32,7 +34,7 @@
}
public String ejbCreate(String name) throws RemoteException, CreateException {
- System.out.println("EntityBMP.ejbCreate("+name+") called");
+ log.debug("EntityBMP.ejbCreate("+name+") called");
this.name = name;
return name;
@@ -42,7 +44,7 @@
public String ejbFindByPrimaryKey(String name) throws RemoteException,
FinderException {
- System.out.println("EntityBMP.ejbFindByPrimaryKey() called");
+ log.debug("EntityBMP.ejbFindByPrimaryKey() called");
wasFind = true;
@@ -51,7 +53,7 @@
public Collection ejbFindCollectionKeys(int num) throws RemoteException,
FinderException {
- System.out.println("EntityBMP.ejbFindMultipleKeys() called with num "+num);
+ log.debug("EntityBMP.ejbFindMultipleKeys() called with num "+num);
Collection pks = new Vector();
pks.add("primary key number 1");
pks.add("primary key number 2");
@@ -61,7 +63,7 @@
}
public Enumeration ejbFindEnumeratedKeys(int num) throws RemoteException,
FinderException {
- System.out.println("EntityBMP.ejbFindEnumeratedKeys() called with num "+num);
+ log.debug("EntityBMP.ejbFindEnumeratedKeys() called with num "+num);
Collection pks = new Vector();
pks.add("primary key number 1");
pks.add("primary key number 2");
@@ -72,63 +74,63 @@
public void ejbPostCreate() throws RemoteException, CreateException {
- System.out.println("EntityBMP.ejbPostCreate() called");
+ log.debug("EntityBMP.ejbPostCreate() called");
}
public void ejbPostCreate(String name) throws RemoteException, CreateException {
- System.out.println("EntityBMP.ejbPostCreate("+name+") called");
+ log.debug("EntityBMP.ejbPostCreate("+name+") called");
}
public void ejbActivate() throws RemoteException {
- System.out.println("EntityBMP.ejbActivate() called");
+ log.debug("EntityBMP.ejbActivate() called");
}
public void ejbLoad() throws RemoteException {
- System.out.println("EntityBMP.ejbLoad() called");
+ log.debug("EntityBMP.ejbLoad() called");
}
public void ejbPassivate() throws RemoteException {
- System.out.println("Was Find "+wasFind);
- System.out.println("EntityBMP.ejbPassivate() called");
+ log.debug("Was Find "+wasFind);
+ log.debug("EntityBMP.ejbPassivate() called");
}
public void ejbRemove() throws RemoteException, RemoveException {
- System.out.println("EntityBMP.ejbRemove() called");
+ log.debug("EntityBMP.ejbRemove() called");
}
public void ejbStore() throws RemoteException {
- System.out.println("EntityBMP.ejbStore() called");
+ log.debug("EntityBMP.ejbStore() called");
}
public String callBusinessMethodA() throws RemoteException{
- System.out.println("EntityBMP.callBusinessMethodA() called");
+ log.debug("EntityBMP.callBusinessMethodA() called");
return "EntityBMP.callBusinessMethodA() called, my primaryKey is "+
entityContext.getPrimaryKey().toString();
}
public String callBusinessMethodB() throws RemoteException {
- System.out.println("EntityBMP.callBusinessMethodB() called, calling B2B");
+ log.debug("EntityBMP.callBusinessMethodB() called, calling B2B");
String b2bMessage = statelessSession.callBusinessMethodB();
- System.out.println("EntityBMP called stateless Bean and it said "+b2bMessage);
+ log.debug("EntityBMP called stateless Bean and it said "+b2bMessage);
return "EntityBMP.callBusinessMethodB() called, called other bean (B2B) and it
said \""+b2bMessage+"\"";
}
public String callBusinessMethodB(String words) throws RemoteException {
- System.out.println("EntityBMP.callBusinessMethodB(String) called, calling
B2B");
+ log.debug("EntityBMP.callBusinessMethodB(String) called, calling B2B");
String b2bMessage = statelessSession.callBusinessMethodB();
- System.out.println("EntityBMP called stateless Bean and it said "+b2bMessage);
+ log.debug("EntityBMP called stateless Bean and it said "+b2bMessage);
return "EntityBMP.callBusinessMethodB() called, called other bean (B2B) and it
said \""+b2bMessage+"\""+" words "+words;
}
public void setEntityContext(EntityContext context) throws RemoteException {
- System.out.println("EntityBMP.setSessionContext() called");
+ log.debug("EntityBMP.setSessionContext() called");
entityContext = context;
//we use the setEntityContext to lookup the connection and the EJBReference
@@ -140,14 +142,14 @@
Connection connection = ((DataSource)
namingContext.lookup("java:comp/env/jdbc/myDatabase")).getConnection();
connection.close();
- System.out.println("EntityBMP I did get the connection to the database
for BMP");
+ log.debug("EntityBMP I did get the connection to the database for BMP");
}
catch (Exception e) {
e.printStackTrace();
- System.out.println("EntityBMP Could not find the database connection,
check settings");
+ log.debug("EntityBMP Could not find the database connection, check
settings");
throw new RemoteException("EntityBMP Could not find the database
connection");
}
@@ -156,15 +158,15 @@
Context namingContext = new InitialContext();
- System.out.println("EntityBMP Looking up Stateless Home");
+ log.debug("EntityBMP Looking up Stateless Home");
StatelessSessionHome statelessHome = ((StatelessSessionHome)
namingContext.lookup("java:comp/env/ejb/myEJBRef"));
- System.out.println("EntityBMP Calling create on Stateless Home");
+ log.debug("EntityBMP Calling create on Stateless Home");
statelessSession = statelessHome.create();
- System.out.println("EntityBMP Found the EJB Reference in my
java:comp/env/ environment");
+ log.debug("EntityBMP Found the EJB Reference in my java:comp/env/
environment");
}
@@ -173,7 +175,7 @@
e.printStackTrace();
- System.out.println("EntityBMP Could not find the EJB Reference called
myEJBRef, check settings");
+ log.debug("EntityBMP Could not find the EJB Reference called myEJBRef,
check settings");
throw new RemoteException("EntityBean Could not find EJB Reference");
}
@@ -181,7 +183,7 @@
public void unsetEntityContext() throws RemoteException {
- System.out.println("EntityBMP.unsetSessionContext() called");
+ log.debug("EntityBMP.unsetSessionContext() called");
entityContext = null;
}
}
1.3 +10 -9
jbosstest/src/main/org/jboss/test/testbean/bean/EntityPKBean.java
Index: EntityPKBean.java
===================================================================
RCS file:
/cvsroot/jboss/jbosstest/src/main/org/jboss/test/testbean/bean/EntityPKBean.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- EntityPKBean.java 11 Oct 2000 21:26:11 -0000 1.2
+++ EntityPKBean.java 15 Feb 2002 06:15:56 -0000 1.3
@@ -12,6 +12,7 @@
*/
public class EntityPKBean implements EntityBean {
+ org.apache.log4j.Category log =
org.apache.log4j.Category.getInstance(getClass());
public boolean aBoolean;
public int anInt;
public long aLong;
@@ -25,7 +26,7 @@
public AComplexPK ejbCreate(boolean aBoolean, int anInt, long aLong, double
aDouble, String aString) throws RemoteException, CreateException {
- System.out.println("EntityPK.ejbCreate() called");
+ log.debug("EntityPK.ejbCreate() called");
this.aBoolean = aBoolean;
this.anInt = anInt;
@@ -39,44 +40,44 @@
public void ejbPostCreate(boolean aBoolean, int anInt, long aLong, double
aDouble, String aString) throws RemoteException, CreateException {
- System.out.println("EntityPK.ejbPostCreate(pk) called");
+ log.debug("EntityPK.ejbPostCreate(pk) called");
}
public void ejbActivate() throws RemoteException {
- System.out.println("EntityPK.ejbActivate() called");
+ log.debug("EntityPK.ejbActivate() called");
}
public void ejbLoad() throws RemoteException {
- System.out.println("EntityPK.ejbLoad() called");
+ log.debug("EntityPK.ejbLoad() called");
}
public void ejbPassivate() throws RemoteException {
- System.out.println("EntityPK.ejbPassivate() called");
+ log.debug("EntityPK.ejbPassivate() called");
}
public void ejbRemove() throws RemoteException, RemoveException {
- System.out.println("EntityPK.ejbRemove() called");
+ log.debug("EntityPK.ejbRemove() called");
}
public void ejbStore() throws RemoteException {
- System.out.println("EntityPK.ejbStore() called");
+ log.debug("EntityPK.ejbStore() called");
}
public void setEntityContext(EntityContext context) throws RemoteException {
- System.out.println("EntityPK.setSessionContext() called");
+ log.debug("EntityPK.setSessionContext() called");
entityContext = context;
}
public void unsetEntityContext() throws RemoteException {
- System.out.println("EntityBMP.unsetSessionContext() called");
+ log.debug("EntityBMP.unsetSessionContext() called");
entityContext = null;
}
1.2 +11 -10
jbosstest/src/main/org/jboss/test/testbean/bean/StatefulSessionBean.java
Index: StatefulSessionBean.java
===================================================================
RCS file:
/cvsroot/jboss/jbosstest/src/main/org/jboss/test/testbean/bean/StatefulSessionBean.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- StatefulSessionBean.java 27 Sep 2000 00:46:29 -0000 1.1
+++ StatefulSessionBean.java 15 Feb 2002 06:15:56 -0000 1.2
@@ -12,44 +12,45 @@
import javax.ejb.*;
public class StatefulSessionBean implements SessionBean {
+ org.apache.log4j.Category log =
org.apache.log4j.Category.getInstance(getClass());
private SessionContext sessionContext;
public String name;
public void ejbCreate() throws RemoteException, CreateException {
- System.out.println("StatefulSessionBean.ejbCreate() called");
+ log.debug("StatefulSessionBean.ejbCreate() called");
this.name= "noname";
}
public void ejbCreate(String name) throws RemoteException, CreateException {
- System.out.println("StatefulSessionBean.ejbCreate("+name+") called");
+ log.debug("StatefulSessionBean.ejbCreate("+name+") called");
this.name = name;
}
public void ejbCreate(String name, String address) throws RemoteException,
CreateException {
- System.out.println("StatefulSessionBean.ejbCreate("+name+"@"+address+")
called");
+ log.debug("StatefulSessionBean.ejbCreate("+name+"@"+address+") called");
this.name = name;
}
public void ejbActivate() throws RemoteException {
- System.out.println("StatefulSessionBean.ejbActivate() called");
+ log.debug("StatefulSessionBean.ejbActivate() called");
}
public void ejbPassivate() throws RemoteException {
- System.out.println("StatefulSessionBean.ejbPassivate() called");
+ log.debug("StatefulSessionBean.ejbPassivate() called");
}
public void ejbRemove() throws RemoteException {
- System.out.println("StatefulSessionBean.ejbRemove() called");
+ log.debug("StatefulSessionBean.ejbRemove() called");
}
public String callBusinessMethodA() {
- System.out.println("StatefulSessionBean.callBusinessMethodA() called");
+ log.debug("StatefulSessionBean.callBusinessMethodA() called");
return "I was created with Stateful String "+name;
}
public String callBusinessMethodB() {
- System.out.println("StatefulSessionBean.callBusinessMethodB()
called");
+ log.debug("StatefulSessionBean.callBusinessMethodB() called");
// Check that my EJBObject is there
EJBObject ejbObject = sessionContext.getEJBObject();
if (ejbObject == null) {
@@ -64,7 +65,7 @@
public String callBusinessMethodB(String words) {
- System.out.println("StatefulSessionBean.callBusinessMethodB(String) called");
+ log.debug("StatefulSessionBean.callBusinessMethodB(String) called");
// Check that my EJBObject is there
EJBObject ejbObject = sessionContext.getEJBObject();
if (ejbObject == null) {
@@ -80,7 +81,7 @@
public void setSessionContext(SessionContext context) throws RemoteException {
- System.out.println("StatefulSessionBean.setSessionContext("+context+")
called");
+ log.debug("StatefulSessionBean.setSessionContext("+context+") called");
sessionContext = context;
}
}
1.3 +14 -13
jbosstest/src/main/org/jboss/test/testbean/bean/StatelessSessionBean.java
Index: StatelessSessionBean.java
===================================================================
RCS file:
/cvsroot/jboss/jbosstest/src/main/org/jboss/test/testbean/bean/StatelessSessionBean.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- StatelessSessionBean.java 8 Nov 2000 13:00:27 -0000 1.2
+++ StatelessSessionBean.java 15 Feb 2002 06:15:56 -0000 1.3
@@ -15,22 +15,23 @@
import org.jboss.test.testbean.interfaces.BusinessMethodException;
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 {
- System.out.println("StatelessSessionBean.ejbCreate() called");
+ log.debug("StatelessSessionBean.ejbCreate() called");
}
public void ejbActivate() throws RemoteException {
- System.out.println("StatelessSessionBean.ejbActivate() called");
+ log.debug("StatelessSessionBean.ejbActivate() called");
}
public void ejbPassivate() throws RemoteException {
- System.out.println("StatelessSessionBean.ejbPassivate() called");
+ log.debug("StatelessSessionBean.ejbPassivate() called");
}
public void ejbRemove() throws RemoteException {
- System.out.println("StatelessSessionBean.ejbRemove() called");
+ log.debug("StatelessSessionBean.ejbRemove() called");
}
public void setSessionContext(SessionContext context) throws RemoteException {
@@ -45,16 +46,16 @@
try {
Object tx = ((javax.transaction.TransactionManager) new
InitialContext().lookup("java:/TransactionManager")).getTransaction();
if (tx == null)
- System.out.println("I don't see a transaction");
+ log.debug("I don't see a transaction");
else
- System.out.println("I see a transaction "+tx.hashCode());
+ log.debug("I see a transaction "+tx.hashCode());
}
catch (Exception e) {e.printStackTrace();}
- System.out.println("StatelessSessionBean.callBusinessMethodA() called");
+ log.debug("StatelessSessionBean.callBusinessMethodA() called");
}
public String callBusinessMethodB() {
- System.out.println("StatelessSessionBean.callBusinessMethodB() called");
+ log.debug("StatelessSessionBean.callBusinessMethodB() called");
try {
Context context = new InitialContext();
@@ -66,7 +67,7 @@
public String callBusinessMethodB(String words) {
// test if overloaded methods are properly called
- System.out.println("StatelessSessionBean.callBusinessMethodB(String)
called");
+ log.debug("StatelessSessionBean.callBusinessMethodB(String) called");
// Check that my EJBObject is there
EJBObject ejbObject = sessionContext.getEJBObject();
if (ejbObject == null) {
@@ -81,7 +82,7 @@
}
public String callBusinessMethodC() {
- System.out.println("StatelessSessionBean.callBusinessMethodC() called");
+ log.debug("StatelessSessionBean.callBusinessMethodC() called");
try {
Context context = new InitialContext();
@@ -92,12 +93,12 @@
}
public void callBusinessMethodD() throws BusinessMethodException {
- System.out.println("StatelessSessionBean.callBusinessMethodD() called");
+ log.debug("StatelessSessionBean.callBusinessMethodD() called");
throw new BusinessMethodException();
}
public String callBusinessMethodE() {
- System.out.println("StatelessSessionBean.callBusinessMethodE() called");
+ log.debug("StatelessSessionBean.callBusinessMethodE() called");
// Check that my EJBObject is there
EJBObject ejbObject = sessionContext.getEJBObject();
if (ejbObject == null) {
@@ -109,7 +110,7 @@
}
public void testClassLoading() throws BusinessMethodException {
- System.out.println("StatelessSessionBean.testClassLoading() called");
+ log.debug("StatelessSessionBean.testClassLoading() called");
try{
Class.forName("org.somepackage.SomeClass");
1.3 +14 -13
jbosstest/src/main/org/jboss/test/testbean/bean/TxSessionBean.java
Index: TxSessionBean.java
===================================================================
RCS file:
/cvsroot/jboss/jbosstest/src/main/org/jboss/test/testbean/bean/TxSessionBean.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- TxSessionBean.java 8 Nov 2000 13:00:27 -0000 1.2
+++ TxSessionBean.java 15 Feb 2002 06:15:56 -0000 1.3
@@ -14,22 +14,23 @@
public class TxSessionBean implements SessionBean {
+ org.apache.log4j.Category log =
org.apache.log4j.Category.getInstance(getClass());
private SessionContext sessionContext;
public void ejbCreate() throws RemoteException, CreateException {
- System.out.println("TxSessionBean.ejbCreate() called");
+ log.debug("TxSessionBean.ejbCreate() called");
}
public void ejbActivate() throws RemoteException {
- System.out.println("TxSessionBean.ejbActivate() called");
+ log.debug("TxSessionBean.ejbActivate() called");
}
public void ejbPassivate() throws RemoteException {
- System.out.println("TxSessionBean.ejbPassivate() called");
+ log.debug("TxSessionBean.ejbPassivate() called");
}
public void ejbRemove() throws RemoteException {
- System.out.println("TxSessionBean.ejbRemove() called");
+ log.debug("TxSessionBean.ejbRemove() called");
}
public void setSessionContext(SessionContext context) throws RemoteException {
@@ -43,7 +44,7 @@
*/
public String txRequired() {
- System.out.println("TxSessionBean.txRequired() called");
+ log.debug("TxSessionBean.txRequired() called");
try {
Object tx =getDaTransaction();
@@ -61,7 +62,7 @@
*/
public String txRequiresNew() {
- System.out.println("TxSessionBean.txRequiresNew() called");
+ log.debug("TxSessionBean.txRequiresNew() called");
try {
Object tx =getDaTransaction();
@@ -79,7 +80,7 @@
public String txSupports() {
- System.out.println("TxSessionBean.txSupports() called");
+ log.debug("TxSessionBean.txSupports() called");
try {
@@ -99,7 +100,7 @@
*/
public String txMandatory() {
- System.out.println("TxSessionBean.txMandatory() called");
+ log.debug("TxSessionBean.txMandatory() called");
try {
Object tx =getDaTransaction();
@@ -116,7 +117,7 @@
*/
public String txNever() {
- System.out.println("TxSessionBean.txNever() called");
+ log.debug("TxSessionBean.txNever() called");
try {
Object tx =getDaTransaction();
@@ -133,7 +134,7 @@
public String txNotSupported() {
- System.out.println("TxSessionBean.txNotSupported() called");
+ log.debug("TxSessionBean.txNotSupported() called");
try {
Object tx =getDaTransaction();
@@ -150,7 +151,7 @@
*/
public String requiredToSupports() throws RemoteException {
- System.out.println("TxSessionBean.requiredToSupports() called");
+ log.debug("TxSessionBean.requiredToSupports() called");
String message;
Object tx =getDaTransaction();
@@ -175,7 +176,7 @@
*/
public String requiredToNotSupported() throws RemoteException {
- System.out.println("TxSessionBean.requiredToNotSupported() called");
+ log.debug("TxSessionBean.requiredToNotSupported() called");
String message;
Object tx =getDaTransaction();
@@ -197,7 +198,7 @@
public String requiredToRequiresNew() throws RemoteException{
- System.out.println("TxSessionBean.requiredToRequiresNew() called");
+ log.debug("TxSessionBean.requiredToRequiresNew() called");
String message;
Object tx =getDaTransaction();
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development