User: fleury
Date: 00/08/17 20:20:58
Modified: src/main/org/jboss/ejb/plugins AbstractInstancePool.java
BMPPersistenceManager.java
CMPFilePersistenceManager.java
CMPPersistenceManager.java
EntityInstanceInterceptor.java
EntitySynchronizationInterceptor.java
LogInterceptor.java
NoPassivationEntityInstanceCache.java
NoPassivationStatefulSessionInstanceCache.java
RandomEntityInstanceCache.java
SingletonStatelessSessionInstancePool.java
StatefulSessionFilePersistenceManager.java
TxInterceptor.java
Log:
Logger messages and clean up for binary
Revision Changes Path
1.3 +6 -4 jboss/src/main/org/jboss/ejb/plugins/AbstractInstancePool.java
Index: AbstractInstancePool.java
===================================================================
RCS file:
/products/cvs/ejboss/jboss/src/main/org/jboss/ejb/plugins/AbstractInstancePool.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- AbstractInstancePool.java 2000/08/12 00:40:46 1.2
+++ AbstractInstancePool.java 2000/08/18 03:20:56 1.3
@@ -22,14 +22,16 @@
import org.jboss.ejb.DeploymentException;
import org.jboss.metadata.MetaData;
import org.jboss.metadata.XmlLoadable;
+import org.jboss.logging.Logger;
+
/**
* <description>
*
* @see <related>
* @author Rickard �berg ([EMAIL PROTECTED])
- * @version $Revision: 1.2 $
+ * @version $Revision: 1.3 $
*/
public abstract class AbstractInstancePool
implements InstancePool, XmlLoadable
@@ -92,7 +94,7 @@
public synchronized EnterpriseContext get()
throws RemoteException
{
-// System.out.println("Get instance "+this);
+// Logger.log("Get instance "+this);
if (!pool.empty())
{
@@ -124,7 +126,7 @@
public synchronized void free(EnterpriseContext ctx)
{
// Pool it
-// System.out.println("Free instance:"+ctx.getId()+"#"+ctx.getTransaction());
+// Logger.log("Free instance:"+ctx.getId()+"#"+ctx.getTransaction());
if (pool.size() < maxSize)
{
@@ -143,7 +145,7 @@
ctx.discard();
} catch (RemoteException e)
{
- e.printStackTrace();
+ // DEBUG Logger.exception(e);
}
}
1.5 +6 -4 jboss/src/main/org/jboss/ejb/plugins/BMPPersistenceManager.java
Index: BMPPersistenceManager.java
===================================================================
RCS file:
/products/cvs/ejboss/jboss/src/main/org/jboss/ejb/plugins/BMPPersistenceManager.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- BMPPersistenceManager.java 2000/08/17 20:13:13 1.4
+++ BMPPersistenceManager.java 2000/08/18 03:20:56 1.5
@@ -22,14 +22,16 @@
import org.jboss.ejb.EntityContainer;
import org.jboss.ejb.EntityPersistenceManager;
import org.jboss.ejb.EntityEnterpriseContext;
+import org.jboss.logging.Logger;
+
/**
* <description>
*
* @see <related>
* @author Rickard �berg ([EMAIL PROTECTED])
* @author <a href="mailto:[EMAIL PROTECTED]">Marc Fleury</a>
- * @version $Revision: 1.4 $
+ * @version $Revision: 1.5 $
*/
public class BMPPersistenceManager
implements EntityPersistenceManager
@@ -209,7 +211,7 @@
public void storeEntity(EntityEnterpriseContext ctx)
throws RemoteException
{
-// System.out.println("Store entity");
+// Logger.log("Store entity");
try
{
ejbStore.invoke(ctx.getInstance(), new Object[0]);
@@ -256,7 +258,7 @@
callMethod = getFinderMethod(con.getBeanClass(), finderMethod, args);
} catch (NoSuchMethodException me) {
// debug
- me.printStackTrace();
+ //Logger.exception(me);
throw new RemoteException("couldn't find finder method in bean class. " +
me.toString());
}
@@ -266,7 +268,7 @@
result = callMethod.invoke(ctx.getInstance(), args);
} catch (Exception e) {
// debug
- e.printStackTrace();
+ // DEBUG Logger.exception(e);
throw new RemoteException("exception occured while invoking finder method:"
+ e.toString());
}
1.4 +6 -6
jboss/src/main/org/jboss/ejb/plugins/CMPFilePersistenceManager.java
Index: CMPFilePersistenceManager.java
===================================================================
RCS file:
/products/cvs/ejboss/jboss/src/main/org/jboss/ejb/plugins/CMPFilePersistenceManager.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- CMPFilePersistenceManager.java 2000/08/12 00:40:46 1.3
+++ CMPFilePersistenceManager.java 2000/08/18 03:20:56 1.4
@@ -42,7 +42,7 @@
* @see <related>
* @author Rickard �berg ([EMAIL PROTECTED])
* @author <a href="mailto:[EMAIL PROTECTED]">Marc Fleury</a>
- * @version $Revision: 1.3 $
+ * @version $Revision: 1.4 $
*/
public class CMPFilePersistenceManager
implements EntityPersistenceStore
@@ -142,18 +142,18 @@
{
if (finderMethod.getName().equals("findAll"))
{
- // System.out.println("Find all entities");
+ // Logger.log("Find all entities");
String[] files = dir.list();
ArrayList result = new ArrayList();
for (int i = 0; i < files.length; i++)
if (files[i].endsWith(".ser"))
{
-// System.out.println("Found entity");
+// Logger.log("Found entity");
result.add(files[i].substring(0,files[i].length()-4));
}
-// System.out.println("Find all entities done");
+// Logger.log("Find all entities done");
return result;
} else
{
@@ -215,7 +215,7 @@
public void storeEntity(EntityEnterpriseContext ctx)
throws RemoteException
{
-// System.out.println("Store entity");
+// Logger.log("Store entity");
storeEntity(ctx.getId(), ctx.getInstance());
}
@@ -233,7 +233,7 @@
// Remove file
if (!getFile(ctx.getId()).delete())
throw new RemoveException("Could not remove file:"+getFile(ctx.getId()));
-// System.out.println("Removed file for"+ctx.getId());
+// Logger.log("Removed file for"+ctx.getId());
}
// Z implementation ----------------------------------------------
1.4 +2 -2 jboss/src/main/org/jboss/ejb/plugins/CMPPersistenceManager.java
Index: CMPPersistenceManager.java
===================================================================
RCS file:
/products/cvs/ejboss/jboss/src/main/org/jboss/ejb/plugins/CMPPersistenceManager.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- CMPPersistenceManager.java 2000/08/17 20:13:14 1.3
+++ CMPPersistenceManager.java 2000/08/18 03:20:56 1.4
@@ -33,7 +33,7 @@
*
* @see <related>
* @author <a href="mailto:[EMAIL PROTECTED]">Marc Fleury</a>
-* @version $Revision: 1.3 $
+* @version $Revision: 1.4 $
*/
public class CMPPersistenceManager
implements EntityPersistenceManager {
@@ -196,7 +196,7 @@
public void storeEntity(EntityEnterpriseContext ctx)
throws RemoteException {
- // System.out.println("Store entity");
+ // Logger.log("Store entity");
try {
// Prepare the instance for storage
1.6 +3 -3
jboss/src/main/org/jboss/ejb/plugins/EntityInstanceInterceptor.java
Index: EntityInstanceInterceptor.java
===================================================================
RCS file:
/products/cvs/ejboss/jboss/src/main/org/jboss/ejb/plugins/EntityInstanceInterceptor.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- EntityInstanceInterceptor.java 2000/08/17 20:13:14 1.5
+++ EntityInstanceInterceptor.java 2000/08/18 03:20:56 1.6
@@ -40,7 +40,7 @@
*
* @see <related>
* @author Rickard �berg ([EMAIL PROTECTED])
- * @version $Revision: 1.5 $
+ * @version $Revision: 1.6 $
*/
public class EntityInstanceInterceptor
extends AbstractInterceptor
@@ -84,7 +84,7 @@
container.getInstancePool().free(mi.getEnterpriseContext());
} else
{
-// System.out.println("Entity was created; not returned to pool");
+// Logger.log("Entity was created; not returned to pool");
((EntityContainer)getContainer()).getInstanceCache().release(mi.getEnterpriseContext());
}
}
@@ -126,7 +126,7 @@
throw e;
} finally
{
-// System.out.println("Release instance for "+id);
+// Logger.log("Release instance for "+id);
EnterpriseContext ctx = mi.getEnterpriseContext();
if (ctx != null)
{
1.11 +2 -2
jboss/src/main/org/jboss/ejb/plugins/EntitySynchronizationInterceptor.java
Index: EntitySynchronizationInterceptor.java
===================================================================
RCS file:
/products/cvs/ejboss/jboss/src/main/org/jboss/ejb/plugins/EntitySynchronizationInterceptor.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- EntitySynchronizationInterceptor.java 2000/08/17 20:13:14 1.10
+++ EntitySynchronizationInterceptor.java 2000/08/18 03:20:56 1.11
@@ -48,7 +48,7 @@
* @see <related>
* @author Rickard �berg ([EMAIL PROTECTED])
* @author <a href="mailto:[EMAIL PROTECTED]">Marc Fleury</a>
-* @version $Revision: 1.10 $
+* @version $Revision: 1.11 $
*/
public class EntitySynchronizationInterceptor
extends AbstractInterceptor
@@ -280,7 +280,7 @@
tx.setRollbackOnly();
} catch (SystemException ex)
{
- ex.printStackTrace();
+ // DEBUG ex.printStackTrace();
}
}
}
1.7 +7 -3 jboss/src/main/org/jboss/ejb/plugins/LogInterceptor.java
Index: LogInterceptor.java
===================================================================
RCS file:
/products/cvs/ejboss/jboss/src/main/org/jboss/ejb/plugins/LogInterceptor.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- LogInterceptor.java 2000/08/12 00:40:46 1.6
+++ LogInterceptor.java 2000/08/18 03:20:56 1.7
@@ -25,13 +25,15 @@
import org.jboss.ejb.MethodInvocation;
import org.jboss.logging.Log;
+import org.jboss.logging.Logger;
+
/**
* <description>
*
* @see <related>
* @author Rickard �berg ([EMAIL PROTECTED])
- * @version $Revision: 1.6 $
+ * @version $Revision: 1.7 $
*/
public class LogInterceptor
extends AbstractInterceptor
@@ -105,7 +107,7 @@
if (e instanceof RemoteException ||
e instanceof RuntimeException)
{
- e.printStackTrace();
+ Logger.log(e.getMessage());
}
throw e;
@@ -154,7 +156,9 @@
return getNext().invoke(mi);
} catch (Exception e)
{
- log.exception(e);
+ //DEBUG log.exception(e);
+ if (e.getMessage() != null)
+ log.log(e.getMessage());
throw e;
} finally
{
1.8 +4 -4
jboss/src/main/org/jboss/ejb/plugins/NoPassivationEntityInstanceCache.java
Index: NoPassivationEntityInstanceCache.java
===================================================================
RCS file:
/products/cvs/ejboss/jboss/src/main/org/jboss/ejb/plugins/NoPassivationEntityInstanceCache.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- NoPassivationEntityInstanceCache.java 2000/08/17 20:13:14 1.7
+++ NoPassivationEntityInstanceCache.java 2000/08/18 03:20:56 1.8
@@ -35,7 +35,7 @@
* @see <related>
* @author Rickard �berg ([EMAIL PROTECTED])
* @author <a href="mailto:[EMAIL PROTECTED]">Marc Fleury</a>
-* @version $Revision: 1.7 $
+* @version $Revision: 1.8 $
*/
public class NoPassivationEntityInstanceCache
implements InstanceCache
@@ -132,7 +132,7 @@
info = (InstanceInfo)ctx.getCacheContext();
if (!info.isLocked())
break;
- //DEBUG System.out.println("Cache is waiting for
"+id+"("+info.isLocked()+","+ctx.getTransaction()+")");
+ //DEBUG Logger.log("Cache is waiting for
"+id+"("+info.isLocked()+","+ctx.getTransaction()+")");
// Check if same tx; reentrant call
try
@@ -235,7 +235,7 @@
}
// At this point we own the instance with the given identity
- // System.out.println("Got entity:"+ctx.getId());
+ // Logger.log("Got entity:"+ctx.getId());
return ctx;
}
@@ -256,7 +256,7 @@
synchronized(ctx)
{
((InstanceInfo)((EntityEnterpriseContext)ctx).getCacheContext()).unlock();
- // System.out.println("Release entity:"+ctx.getId());
+ // Logger.log("Release entity:"+ctx.getId());
if
(!((InstanceInfo)((EntityEnterpriseContext)ctx).getCacheContext()).isLocked())
ctx.notifyAll();
}
1.8 +3 -2
jboss/src/main/org/jboss/ejb/plugins/NoPassivationStatefulSessionInstanceCache.java
Index: NoPassivationStatefulSessionInstanceCache.java
===================================================================
RCS file:
/products/cvs/ejboss/jboss/src/main/org/jboss/ejb/plugins/NoPassivationStatefulSessionInstanceCache.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- NoPassivationStatefulSessionInstanceCache.java 2000/08/14 15:04:10 1.7
+++ NoPassivationStatefulSessionInstanceCache.java 2000/08/18 03:20:56 1.8
@@ -23,6 +23,7 @@
import org.jboss.ejb.StatefulSessionPersistenceManager;
import org.jboss.ejb.EnterpriseContext;
import org.jboss.ejb.StatefulSessionEnterpriseContext;
+import org.jboss.logging.Logger;
/**
@@ -31,7 +32,7 @@
* @see <related>
* @author Rickard �berg ([EMAIL PROTECTED])
* @author <a href="[EMAIL PROTECTED]">Marc Fleury</a>
-* @version $Revision: 1.7 $
+* @version $Revision: 1.8 $
*/
public class NoPassivationStatefulSessionInstanceCache
implements InstanceCache
@@ -83,7 +84,7 @@
{
InstanceInfo info = null;
- System.out.println("I AM LOOKING FOR THE ID "+id);
+ Logger.log("I AM LOOKING FOR THE ID "+id);
// Do we have the context in cache?
StatefulSessionEnterpriseContext ctx =
(StatefulSessionEnterpriseContext)active.get(id);
1.4 +3 -3
jboss/src/main/org/jboss/ejb/plugins/RandomEntityInstanceCache.java
Index: RandomEntityInstanceCache.java
===================================================================
RCS file:
/products/cvs/ejboss/jboss/src/main/org/jboss/ejb/plugins/RandomEntityInstanceCache.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- RandomEntityInstanceCache.java 2000/08/17 20:13:14 1.3
+++ RandomEntityInstanceCache.java 2000/08/18 03:20:57 1.4
@@ -29,7 +29,7 @@
* @see <related>
* @author Rickard �berg ([EMAIL PROTECTED])
* @author <a href="mailto:[EMAIL PROTECTED]">Marc Fleury</a>
-* @version $Revision: 1.3 $
+* @version $Revision: 1.4 $
*/
public class RandomEntityInstanceCache
extends NoPassivationEntityInstanceCache
@@ -80,7 +80,7 @@
// Passivation loop
while(running)
{
- // System.out.println("Clearing cache");
+ // Logger.log("Clearing cache");
// Passivate old. Lock cache first
synchronized(RandomEntityInstanceCache.this)
{
@@ -141,7 +141,7 @@
}
- // System.out.println("Passivation done");
+ // Logger.log("Passivation done");
// Sleep
try
{
1.4 +4 -2
jboss/src/main/org/jboss/ejb/plugins/SingletonStatelessSessionInstancePool.java
Index: SingletonStatelessSessionInstancePool.java
===================================================================
RCS file:
/products/cvs/ejboss/jboss/src/main/org/jboss/ejb/plugins/SingletonStatelessSessionInstancePool.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- SingletonStatelessSessionInstancePool.java 2000/08/12 00:40:46 1.3
+++ SingletonStatelessSessionInstancePool.java 2000/08/18 03:20:57 1.4
@@ -20,14 +20,16 @@
import org.jboss.metadata.XmlLoadable;
import org.jboss.metadata.MetaData;
import org.w3c.dom.Element;
+import org.jboss.logging.Logger;
+
/**
* Singleton pool for session beans. This lets you have
* singletons in EJB!
*
* @see <related>
* @author Rickard �berg ([EMAIL PROTECTED])
- * @version $Revision: 1.3 $
+ * @version $Revision: 1.4 $
*/
public class SingletonStatelessSessionInstancePool
implements InstancePool, XmlLoadable
@@ -135,7 +137,7 @@
ctx.discard();
} catch (RemoteException e)
{
- e.printStackTrace();
+ // DEBUG Logger.exception(e);
}
// Notify waiters
1.6 +5 -3
jboss/src/main/org/jboss/ejb/plugins/StatefulSessionFilePersistenceManager.java
Index: StatefulSessionFilePersistenceManager.java
===================================================================
RCS file:
/products/cvs/ejboss/jboss/src/main/org/jboss/ejb/plugins/StatefulSessionFilePersistenceManager.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- StatefulSessionFilePersistenceManager.java 2000/08/14 15:02:20 1.5
+++ StatefulSessionFilePersistenceManager.java 2000/08/18 03:20:57 1.6
@@ -48,7 +48,9 @@
import org.jboss.ejb.StatefulSessionContainer;
import org.jboss.ejb.StatefulSessionPersistenceManager;
import org.jboss.ejb.StatefulSessionEnterpriseContext;
+import org.jboss.logging.Logger;
+
/**
* StatefulSessionFilePersistenceManager
*
@@ -58,7 +60,7 @@
* @see <related>
* @author Rickard �berg ([EMAIL PROTECTED])
* @author <a href="[EMAIL PROTECTED]">Marc Fleury</a>
- * @version $Revision: 1.5 $
+ * @version $Revision: 1.6 $
*/
public class StatefulSessionFilePersistenceManager
implements StatefulSessionPersistenceManager
@@ -104,7 +106,7 @@
dir.mkdirs();
- System.out.println("Storing sessions for "+ejbName+" in:"+dir);
+ Logger.log("Storing sessions for "+ejbName+" in:"+dir);
// Clear dir of old files
File[] sessions = dir.listFiles();
@@ -112,7 +114,7 @@
{
sessions[i].delete();
}
- System.out.println(sessions.length + " old sessions removed");
+ Logger.log(sessions.length + " old sessions removed");
}
public void start()
1.13 +4 -4 jboss/src/main/org/jboss/ejb/plugins/TxInterceptor.java
Index: TxInterceptor.java
===================================================================
RCS file:
/products/cvs/ejboss/jboss/src/main/org/jboss/ejb/plugins/TxInterceptor.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- TxInterceptor.java 2000/08/16 18:30:47 1.12
+++ TxInterceptor.java 2000/08/18 03:20:57 1.13
@@ -38,7 +38,7 @@
* @see <related>
* @author Rickard �berg ([EMAIL PROTECTED])
* @author <a href="mailto:[EMAIL PROTECTED]">Marc Fleury</a>
-* @version $Revision: 1.12 $
+* @version $Revision: 1.13 $
*/
public class TxInterceptor
extends AbstractInterceptor
@@ -139,8 +139,8 @@
// New transaction is the new transaction this might start
Transaction newTransaction = null;
-// System.out.println("Current transaction in MI is "+mi.getTransaction());
-// System.out.println("Current method "+mi.getMethod());
+// Logger.log("Current transaction in MI is "+mi.getTransaction());
+// Logger.log("Current method "+mi.getMethod());
byte transType = getTransactionMethod(mi.getMethod(), remoteInvocation);
// DEBUG printMethod(mi.getMethod(), transType);
@@ -373,7 +373,7 @@
if(b != null) return b.byteValue();
BeanMetaData bmd = container.getBeanMetaData();
- System.out.println("Found metadata for bean '"+bmd.getEjbName()+"'"+" method
is "+m.getName());
+ Logger.log("Found metadata for bean '"+bmd.getEjbName()+"'"+" method is
"+m.getName());
byte result = bmd.getMethodTransactionType(m.getName(),
m.getParameterTypes(), remoteInvocation);
// provide default if method is not found in descriptor