User: starksm 
  Date: 01/09/11 11:35:00

  Modified:    src/main/org/jboss/ejb/plugins AbstractInstanceCache.java
                        AbstractInterceptor.java AbstractTxInterceptor.java
                        AbstractTxInterceptorBMT.java
                        EnterpriseContextCachePolicy.java
                        EntityInstanceInterceptor.java
                        EntityLockInterceptor.java
                        EntityMultiInstanceInterceptor.java
                        EntityMultiInstanceSynchronizationInterceptor.java
                        EntitySynchronizationInterceptor.java
                        LRUEnterpriseContextCachePolicy.java
                        LogInterceptor.java SecurityInterceptor.java
                        StatefulSessionFilePersistenceManager.java
                        StatefulSessionInstanceCache.java
                        TxInterceptorCMT.java
  Log:
  Convert all logging to org.jboss.logging.Logger which is a subclass of
  org.apache.log4j.Category.
  
  Revision  Changes    Path
  1.21      +15 -16    jboss/src/main/org/jboss/ejb/plugins/AbstractInstanceCache.java
  
  Index: AbstractInstanceCache.java
  ===================================================================
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/AbstractInstanceCache.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- AbstractInstanceCache.java        2001/09/01 19:50:30     1.20
  +++ AbstractInstanceCache.java        2001/09/11 18:34:59     1.21
  @@ -43,8 +43,6 @@
   import org.jboss.ejb.BeanLockManager;
   import org.jboss.metadata.MetaData;
   import org.jboss.metadata.XmlLoadable;
  -
  -// TODO this needs to be replaced with the log4j logging
   import org.jboss.logging.Logger;
   
   import org.jboss.monitor.Monitorable;
  @@ -66,7 +64,7 @@
    * @author <a href="[EMAIL PROTECTED]">Bill Burke</a>
    * @author <a href="[EMAIL PROTECTED]">Marc Fleury</a>
    *
  - * @version $Revision: 1.20 $
  + * @version $Revision: 1.21 $
    *
    *   <p><b>Revisions:</b>
    *
  @@ -96,6 +94,7 @@
      // Constants -----------------------------------------------------
   
      // Attributes ----------------------------------------------------
  +   protected static Logger log = Logger.create(AbstractInstanceCache.class);
      /* The object that is delegated to implement the desired caching policy */
      private CachePolicy m_cache;
      /* The worker queue that passivates beans in another thread */
  @@ -155,7 +154,7 @@
         }
         catch (JMSException x)
         {
  -         Logger.exception(x);
  +         log.error("sendMessage failed", x);
         }
      }
      public Message createMessage(Object id)
  @@ -173,7 +172,7 @@
         }
         catch (JMSException x)
         {
  -         Logger.exception(x);
  +         log.error("createMessage failed", x);
         }
         return message;
      }
  @@ -433,7 +432,7 @@
         m_buffer.append(getContainer().getBeanMetaData().getEjbName());
         m_buffer.append(" with id = ");
         m_buffer.append(id);
  -      Logger.debug(m_buffer.toString());
  +      log.debug(m_buffer.toString());
   
         if (isJMSMonitoringEnabled())
         {
  @@ -445,7 +444,7 @@
            }
            catch (JMSException x)
            {
  -            Logger.exception(x);
  +            log.error("createMessage failed", x);
            }
   
            // Send JMS Message
  @@ -460,7 +459,7 @@
         m_buffer.append(getContainer().getBeanMetaData().getEjbName());
         m_buffer.append(" with id = ");
         m_buffer.append(id);
  -      Logger.debug(m_buffer.toString());
  +      log.debug(m_buffer.toString());
   
         if (isJMSMonitoringEnabled())
         {
  @@ -473,7 +472,7 @@
            }
            catch (JMSException x)
            {
  -            Logger.exception(x);
  +            log.error("createMessage failed", x);
            }
   
            // Send JMS Message
  @@ -488,7 +487,7 @@
         m_buffer.append(getContainer().getBeanMetaData().getEjbName());
         m_buffer.append(" with id = ");
         m_buffer.append(id);
  -      Logger.debug(m_buffer.toString());
  +      log.debug(m_buffer.toString());
   
         if (isJMSMonitoringEnabled())
         {
  @@ -501,7 +500,7 @@
            }
            catch (JMSException x)
            {
  -            Logger.exception(x);
  +            log.error("createMessage failed", x);
            }
   
            // Send JMS Message
  @@ -516,7 +515,7 @@
         m_buffer.append(getContainer().getBeanMetaData().getEjbName());
         m_buffer.append(" with id = ");
         m_buffer.append(id);
  -      Logger.debug(m_buffer.toString());
  +      log.debug(m_buffer.toString());
   
         if (isJMSMonitoringEnabled())
         {
  @@ -529,7 +528,7 @@
            }
            catch (JMSException x)
            {
  -            Logger.exception(x);
  +            log.error("createMessage failed", x);
            }
   
            // Send JMS Message
  @@ -869,6 +868,7 @@
   
   class PassivatorQueue extends WorkerQueue
   {
  +   protected static Logger log = Logger.create(PassivatorQueue.class);
      /**
       * Used for debug purposes, holds the scheduled passivation jobs
       */
  @@ -939,14 +939,13 @@
         // Log system exceptions
         if (x instanceof EJBException)
         {
  -         Logger.error("BEAN EXCEPTION:"+x.getMessage());
            Exception nestedX = ((EJBException)x).getCausedByException();
            if (nestedX != null)
            {
  -            Logger.exception(nestedX);
  +            log.error("BEAN EXCEPTION", x);
            }
         } else {
  -         Logger.exception(x);
  +         log.error("EXCEPTION", x);
         }
      }
   }
  
  
  
  1.8       +4 -1      jboss/src/main/org/jboss/ejb/plugins/AbstractInterceptor.java
  
  Index: AbstractInterceptor.java
  ===================================================================
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/AbstractInterceptor.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- AbstractInterceptor.java  2001/08/03 17:15:44     1.7
  +++ AbstractInterceptor.java  2001/09/11 18:34:59     1.8
  @@ -11,13 +11,14 @@
   import org.jboss.ejb.Container;
   import org.jboss.ejb.Interceptor;
   import org.jboss.ejb.MethodInvocation;
  +import org.jboss.logging.Logger;
   
   /**
    * An abstract base class for container interceptors.
    *      
    * @author <a href="mailto:[EMAIL PROTECTED]";>Rickard �berg</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>Jason Dillon</a>
  - * @version $Revision: 1.7 $
  + * @version $Revision: 1.8 $
    */
   public abstract class AbstractInterceptor
      implements Interceptor
  @@ -28,6 +29,8 @@
   
      /** The next interceptor in the chain. */
      protected Interceptor nextInterceptor;
  +   /** Use a JBoss custom log4j category for trace level logging */
  +   protected Logger log = Logger.create(this.getClass());
   
      // Static --------------------------------------------------------
   
  
  
  
  1.6       +6 -7      jboss/src/main/org/jboss/ejb/plugins/AbstractTxInterceptor.java
  
  Index: AbstractTxInterceptor.java
  ===================================================================
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/AbstractTxInterceptor.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- AbstractTxInterceptor.java        2001/09/01 19:50:30     1.5
  +++ AbstractTxInterceptor.java        2001/09/11 18:34:59     1.6
  @@ -19,21 +19,20 @@
   
   import org.jboss.ejb.Container;
   import org.jboss.ejb.MethodInvocation;
  -
  -// TODO this needs to be replaced with the log4j logging
   import org.jboss.logging.Logger;
   
   /**
    *  A common superclass for the transaction interceptors.
    *
    *  @author <a href="mailto:[EMAIL PROTECTED]";>Ole Husgaard</a>
  - *  @version $Revision: 1.5 $
  + *  @version $Revision: 1.6 $
    */
   abstract class AbstractTxInterceptor
      extends AbstractInterceptor
   {
   
       // Attributes ----------------------------------------------------
  +   protected Logger log = Logger.create(this.getClass());
   
       /** Local reference to the container's TransactionManager. */
       protected TransactionManager tm;
  @@ -105,9 +104,9 @@
                       mi.getTransaction().setRollbackOnly();
                   }
               } catch (SystemException ex) {
  -                Logger.exception(ex);
  +                log.error("invokeNext", ex);
               } catch (IllegalStateException ex) {
  -                Logger.exception(ex);
  +                log.error("invokeNext", ex);
               }
               RemoteException ex;
               if (newTx) {
  @@ -131,9 +130,9 @@
                 try {
                    mi.getTransaction().setRollbackOnly();
                 } catch (SystemException ex) {
  -                 Logger.exception(ex);
  +                log.error("invokeNext", ex);
                 } catch (IllegalStateException ex) {
  -                 Logger.exception(ex);
  +                log.error("invokeNext", ex);
                 }
                 RemoteException ex;
                 if (newTx) {
  
  
  
  1.4       +4 -7      
jboss/src/main/org/jboss/ejb/plugins/AbstractTxInterceptorBMT.java
  
  Index: AbstractTxInterceptorBMT.java
  ===================================================================
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/AbstractTxInterceptorBMT.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- AbstractTxInterceptorBMT.java     2001/09/01 19:50:30     1.3
  +++ AbstractTxInterceptorBMT.java     2001/09/11 18:34:59     1.4
  @@ -23,8 +23,6 @@
   
   import org.jboss.ejb.EnterpriseContext;
   import org.jboss.ejb.MethodInvocation;
  -
  -// TODO this needs to be replaced with the log4j logging
   import org.jboss.logging.Logger;
   
   
  @@ -32,12 +30,11 @@
    *  A common superclass for the BMT transaction interceptors.
    *
    *  @author <a href="mailto:[EMAIL PROTECTED]";>Ole Husgaard</a>
  - *  @version $Revision: 1.3 $
  + *  @version $Revision: 1.4 $
    */
   abstract class AbstractTxInterceptorBMT
      extends AbstractTxInterceptor
   {
  -
      // Attributes ----------------------------------------------------
   
      /**
  @@ -175,7 +172,7 @@
         try {
            status = tm.getStatus();
         } catch (SystemException ex) {
  -         Logger.exception(ex);
  +         log.error("Failed to get status", ex);
         }
   
         switch (status) {
  @@ -187,7 +184,7 @@
               try {
                  tm.rollback();
               } catch (Exception ex) {
  -               Logger.exception(ex);
  +               log.error("Failed to rollback", ex);
               }
               // fall through...
            case Status.STATUS_PREPARED:
  @@ -195,7 +192,7 @@
                            container.getBeanMetaData().getEjbName() +
                            " should complete transactions before" +
                            " returning (ejb1.1 spec, 11.6.1)";
  -            Logger.error(msg);
  +            log.error(msg);
   
               // the instance interceptor will discard the instance
               throw new RemoteException(msg);
  
  
  
  1.8       +4 -4      
jboss/src/main/org/jboss/ejb/plugins/EnterpriseContextCachePolicy.java
  
  Index: EnterpriseContextCachePolicy.java
  ===================================================================
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/EnterpriseContextCachePolicy.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- EnterpriseContextCachePolicy.java 2001/08/03 17:15:44     1.7
  +++ EnterpriseContextCachePolicy.java 2001/09/11 18:34:59     1.8
  @@ -6,7 +6,7 @@
    */
   package org.jboss.ejb.plugins;
   
  -import org.jboss.logging.Log;
  +import org.jboss.logging.Logger;
   import org.jboss.util.TimerQueue;
   import org.jboss.util.TimerTask;
   import org.jboss.util.CachePolicy;
  @@ -18,14 +18,14 @@
    * 
    * @see AbstractInstanceCache
    * @author <a href="mailto:[EMAIL PROTECTED]";>Simone Bordet</a>
  - * @version $Revision: 1.7 $
  + * @version $Revision: 1.8 $
    */
   public interface EnterpriseContextCachePolicy extends CachePolicy
   {
        // Constants -----------------------------------------------------
   
        // Static --------------------------------------------------------
  -     public static Log log = Log.createLog("org.jboss.ejb.plugins.BeanCache");
  +     public static Logger log = Logger.create(EnterpriseContextCachePolicy.class);
        public static Scheduler scheduler = new Scheduler();
        
        // Public --------------------------------------------------------
  @@ -54,7 +54,7 @@
                static
                {
                        m_scheduler.start();
  -                     log.log("Cache policy scheduler started");
  +                     log.info("Cache policy scheduler started");
                }
                public final void schedule(TimerTask t) 
                {
  
  
  
  1.44      +2 -7      
jboss/src/main/org/jboss/ejb/plugins/EntityInstanceInterceptor.java
  
  Index: EntityInstanceInterceptor.java
  ===================================================================
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/EntityInstanceInterceptor.java,v
  retrieving revision 1.43
  retrieving revision 1.44
  diff -u -r1.43 -r1.44
  --- EntityInstanceInterceptor.java    2001/08/08 22:00:46     1.43
  +++ EntityInstanceInterceptor.java    2001/09/11 18:34:59     1.44
  @@ -36,7 +36,6 @@
   import org.jboss.ejb.InstancePool;
   import org.jboss.ejb.MethodInvocation;
   import org.jboss.ejb.CacheKey;
  -import org.jboss.logging.log4j.JBossCategory;
   import org.jboss.metadata.EntityMetaData;
   import org.jboss.tm.TxManager;
   
  @@ -61,7 +60,7 @@
   * @author <a href="mailto:[EMAIL PROTECTED]";>Marc Fleury</a>
   * @author <a href="mailto:[EMAIL PROTECTED]";>Scott Stark</a>
   * @author <a href="mailto:[EMAIL PROTECTED]";>Bill Burke</a>
  -* @version $Revision: 1.43 $
  +* @version $Revision: 1.44 $
   *
   * <p><b>Revisions:</b><br>
   * <p><b>2001/06/28: marcf</b>
  @@ -115,11 +114,7 @@
        
      protected EntityContainer container;
        
  -   // Static --------------------------------------------------------
  -     
  -     /** Use a JBoss custom log4j category for trace level logging */
  -   static JBossCategory log = (JBossCategory) 
JBossCategory.getInstance(EntityInstanceInterceptor.class);
  -     
  +   // Static --------------------------------------------------------        
      // Constructors --------------------------------------------------
        
        // Public --------------------------------------------------------
  
  
  
  1.6       +158 -162  jboss/src/main/org/jboss/ejb/plugins/EntityLockInterceptor.java
  
  Index: EntityLockInterceptor.java
  ===================================================================
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/EntityLockInterceptor.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- EntityLockInterceptor.java        2001/08/08 22:00:46     1.5
  +++ EntityLockInterceptor.java        2001/09/11 18:34:59     1.6
  @@ -1,162 +1,158 @@
  -/*
  -* JBoss, the OpenSource J2EE webOS
  -*
  -* Distributable under LGPL license.
  -* See terms of license at gnu.org.
  -*/
  -package org.jboss.ejb.plugins;
  -
  -import java.lang.reflect.Method;
  -import java.rmi.RemoteException;
  -import java.util.Map;
  -import java.util.HashMap;
  -import java.util.ArrayList;
  -
  -import javax.ejb.EJBObject;
  -import javax.ejb.CreateException;
  -import javax.ejb.EJBException;
  -import javax.ejb.NoSuchEntityException;
  -import javax.ejb.RemoveException;
  -import javax.ejb.EntityBean;
  -import javax.transaction.Status;
  -import javax.transaction.Synchronization;
  -import javax.transaction.Transaction;
  -import javax.transaction.TransactionManager;
  -import javax.transaction.RollbackException;
  -import javax.transaction.SystemException;
  -
  -import org.jboss.ejb.Container;
  -import org.jboss.ejb.BeanLock;
  -import org.jboss.ejb.BeanLockManager;
  -import org.jboss.ejb.EntityContainer;
  -import org.jboss.ejb.EntityPersistenceManager;
  -import org.jboss.ejb.EntityEnterpriseContext;
  -import org.jboss.ejb.EnterpriseContext;
  -import org.jboss.ejb.InstanceCache;
  -import org.jboss.ejb.InstancePool;
  -import org.jboss.ejb.MethodInvocation;
  -import org.jboss.ejb.CacheKey;
  -import org.jboss.logging.log4j.JBossCategory;
  -import org.jboss.metadata.EntityMetaData;
  -import org.jboss.tm.TxManager;
  -
  -/**
  - * The lock interceptors role is to schedule thread wanting to invoke method on a 
target bean
  - *
  -* <p>The policies for implementing scheduling (pessimistic locking etc) is 
implemented by pluggable
  -*    locks
  -*
  -* <p>We also implement serialization of calls in here (this is a spec
  -*    requirement). This is a fine grained notify, notifyAll mechanism. We
  -*    notify on ctx serialization locks and notifyAll on global transactional
  -*    locks.
  -*   
  -* <p><b>WARNING: critical code</b>, get approval from senior developers
  -*    before changing.
  -*    
  -* @author <a href="mailto:[EMAIL PROTECTED]";>Marc Fleury</a>
  -* @author <a href="mailto:[EMAIL PROTECTED]";>Bill Burke</a>
  -* @version $Revision: 1.5 $
  -*
  -* <p><b>Revisions:</b><br>
  -* <p><b>2001/07/30: marcf</b>
  -* <ol>
  -*   <li>Initial revision
  -*   <li>Factorization of the lock out of the context in cache
  -*   <li>The new locking is implement as "scheduling" in the lock which allows for 
pluggable locks
  -* </ol>
  -* <p><b>2001/08/07: billb</b>
  -* <ol>
  -*   <li>Removed while loop and moved it to SimplePessimisticEJBLock where it 
belongs.
  -* </ol>
  -*/
  -public class EntityLockInterceptor
  -   extends AbstractInterceptor
  -{
  -   // Constants -----------------------------------------------------
  - 
  -   // Attributes ----------------------------------------------------
  - 
  -   protected EntityContainer container;
  - 
  -   // Static --------------------------------------------------------
  - 
  -   /** Use a JBoss custom log4j category for trace level logging */
  -   static JBossCategory log = (JBossCategory) 
JBossCategory.getInstance(EntityLockInterceptor.class);
  - 
  -   // Constructors --------------------------------------------------
  - 
  -   // Public --------------------------------------------------------
  - 
  -   public void setContainer(Container container)
  -   {
  -      this.container = (EntityContainer)container;
  - 
  -   }
  - 
  -   public Container getContainer()
  -   {
  -      return container;
  -   }
  - 
  -   // Interceptor implementation --------------------------------------
  - 
  -   public Object invokeHome(MethodInvocation mi)
  -      throws Exception
  -   {  
  -      // Invoke through interceptors
  -      return getNext().invokeHome(mi);
  -  
  -   }
  - 
  -   public Object invoke(MethodInvocation mi)
  -      throws Exception
  -   {
  -  
  -      // The key.
  -      Object key = (CacheKey) mi.getId();
  -  
  -      // The lock.
  -      BeanLock lock ;
  -  
  -      boolean threadIsScheduled = false;
  -      boolean trace = log.isTraceEnabled();
  -  
  -      if( trace ) log.trace("Begin invoke, key="+key);
  -   
  -  
  -      try 
  -      {
  -         lock = (BeanLock)container.getLockManager().getLock(key);
  -   
  -         lock.schedule(mi);
  -   
  -         try {
  -    
  -            return getNext().invoke(mi); 
  -         }
  -   
  -         finally 
  -         {
  -    
  -            // we are done with the method, decrease the count, if it reaches 0 it 
will wake up 
  -            // the next thread 
  -            lock.sync();
  -            lock.releaseMethodLock();
  -            lock.releaseSync(); 
  -         }
  -      }
  -      finally
  -      {
  -   
  -         // We are done with the lock in general
  -         container.getLockManager().removeLockRef(key);
  -   
  -         if( trace ) log.trace("End invoke, key="+key);
  -      }
  -   }
  -}
  -
  -
  -
  -
  +/*
  +* JBoss, the OpenSource J2EE webOS
  +*
  +* Distributable under LGPL license.
  +* See terms of license at gnu.org.
  +*/
  +package org.jboss.ejb.plugins;
  +
  +import java.lang.reflect.Method;
  +import java.rmi.RemoteException;
  +import java.util.Map;
  +import java.util.HashMap;
  +import java.util.ArrayList;
  +
  +import javax.ejb.EJBObject;
  +import javax.ejb.CreateException;
  +import javax.ejb.EJBException;
  +import javax.ejb.NoSuchEntityException;
  +import javax.ejb.RemoveException;
  +import javax.ejb.EntityBean;
  +import javax.transaction.Status;
  +import javax.transaction.Synchronization;
  +import javax.transaction.Transaction;
  +import javax.transaction.TransactionManager;
  +import javax.transaction.RollbackException;
  +import javax.transaction.SystemException;
  +
  +import org.jboss.ejb.Container;
  +import org.jboss.ejb.BeanLock;
  +import org.jboss.ejb.BeanLockManager;
  +import org.jboss.ejb.EntityContainer;
  +import org.jboss.ejb.EntityPersistenceManager;
  +import org.jboss.ejb.EntityEnterpriseContext;
  +import org.jboss.ejb.EnterpriseContext;
  +import org.jboss.ejb.InstanceCache;
  +import org.jboss.ejb.InstancePool;
  +import org.jboss.ejb.MethodInvocation;
  +import org.jboss.ejb.CacheKey;
  +import org.jboss.metadata.EntityMetaData;
  +import org.jboss.tm.TxManager;
  +
  +/**
  + * The lock interceptors role is to schedule thread wanting to invoke method on a 
target bean
  + *
  +* <p>The policies for implementing scheduling (pessimistic locking etc) is 
implemented by pluggable
  +*    locks
  +*
  +* <p>We also implement serialization of calls in here (this is a spec
  +*    requirement). This is a fine grained notify, notifyAll mechanism. We
  +*    notify on ctx serialization locks and notifyAll on global transactional
  +*    locks.
  +*   
  +* <p><b>WARNING: critical code</b>, get approval from senior developers
  +*    before changing.
  +*    
  +* @author <a href="mailto:[EMAIL PROTECTED]";>Marc Fleury</a>
  +* @author <a href="mailto:[EMAIL PROTECTED]";>Bill Burke</a>
  +* @version $Revision: 1.6 $
  +*
  +* <p><b>Revisions:</b><br>
  +* <p><b>2001/07/30: marcf</b>
  +* <ol>
  +*   <li>Initial revision
  +*   <li>Factorization of the lock out of the context in cache
  +*   <li>The new locking is implement as "scheduling" in the lock which allows for 
pluggable locks
  +* </ol>
  +* <p><b>2001/08/07: billb</b>
  +* <ol>
  +*   <li>Removed while loop and moved it to SimplePessimisticEJBLock where it 
belongs.
  +* </ol>
  +*/
  +public class EntityLockInterceptor
  +   extends AbstractInterceptor
  +{
  +   // Constants -----------------------------------------------------
  + 
  +   // Attributes ----------------------------------------------------
  + 
  +   protected EntityContainer container;
  + 
  +   // Static --------------------------------------------------------
  +
  +   // Constructors --------------------------------------------------
  + 
  +   // Public --------------------------------------------------------
  + 
  +   public void setContainer(Container container)
  +   {
  +      this.container = (EntityContainer)container;
  + 
  +   }
  + 
  +   public Container getContainer()
  +   {
  +      return container;
  +   }
  + 
  +   // Interceptor implementation --------------------------------------
  + 
  +   public Object invokeHome(MethodInvocation mi)
  +      throws Exception
  +   {  
  +      // Invoke through interceptors
  +      return getNext().invokeHome(mi);
  +  
  +   }
  + 
  +   public Object invoke(MethodInvocation mi)
  +      throws Exception
  +   {
  +  
  +      // The key.
  +      Object key = (CacheKey) mi.getId();
  +  
  +      // The lock.
  +      BeanLock lock ;
  +  
  +      boolean threadIsScheduled = false;
  +      boolean trace = log.isTraceEnabled();
  +  
  +      if( trace ) log.trace("Begin invoke, key="+key);
  +   
  +  
  +      try 
  +      {
  +         lock = (BeanLock)container.getLockManager().getLock(key);
  +   
  +         lock.schedule(mi);
  +   
  +         try {
  +    
  +            return getNext().invoke(mi); 
  +         }
  +   
  +         finally 
  +         {
  +    
  +            // we are done with the method, decrease the count, if it reaches 0 it 
will wake up 
  +            // the next thread 
  +            lock.sync();
  +            lock.releaseMethodLock();
  +            lock.releaseSync(); 
  +         }
  +      }
  +      finally
  +      {
  +   
  +         // We are done with the lock in general
  +         container.getLockManager().removeLockRef(key);
  +   
  +         if( trace ) log.trace("End invoke, key="+key);
  +      }
  +   }
  +}
  +
  +
  +
  +
  
  
  
  1.2       +2 -6      
jboss/src/main/org/jboss/ejb/plugins/EntityMultiInstanceInterceptor.java
  
  Index: EntityMultiInstanceInterceptor.java
  ===================================================================
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/EntityMultiInstanceInterceptor.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- EntityMultiInstanceInterceptor.java       2001/08/09 20:28:56     1.1
  +++ EntityMultiInstanceInterceptor.java       2001/09/11 18:34:59     1.2
  @@ -36,7 +36,6 @@
   import org.jboss.ejb.InstancePool;
   import org.jboss.ejb.MethodInvocation;
   import org.jboss.ejb.CacheKey;
  -import org.jboss.logging.log4j.JBossCategory;
   import org.jboss.metadata.EntityMetaData;
   import org.jboss.tm.TxManager;
   
  @@ -46,7 +45,7 @@
    *
    *    
    * @author <a href="mailto:[EMAIL PROTECTED]";>Bill Burke</a>
  - * @version $Revision: 1.1 $
  + * @version $Revision: 1.2 $
    *
    * <p><b>Revisions:</b><br>
    * <p><b>2001/08/08: billb</b>
  @@ -64,10 +63,7 @@
      protected EntityContainer container;
        
      // Static --------------------------------------------------------
  -     
  -     /** Use a JBoss custom log4j category for trace level logging */
  -   static JBossCategory log = (JBossCategory) 
JBossCategory.getInstance(EntityMultiInstanceInterceptor.class);
  -     
  +
      // Constructors --------------------------------------------------
        
        // Public --------------------------------------------------------
  
  
  
  1.2       +1 -2      
jboss/src/main/org/jboss/ejb/plugins/EntityMultiInstanceSynchronizationInterceptor.java
  
  Index: EntityMultiInstanceSynchronizationInterceptor.java
  ===================================================================
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/EntityMultiInstanceSynchronizationInterceptor.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- EntityMultiInstanceSynchronizationInterceptor.java        2001/08/09 20:28:56    
 1.1
  +++ EntityMultiInstanceSynchronizationInterceptor.java        2001/09/11 18:34:59    
 1.2
  @@ -38,7 +38,6 @@
   import org.jboss.ejb.InstancePool;
   import org.jboss.ejb.MethodInvocation;
   import org.jboss.metadata.ConfigurationMetaData;
  -import org.jboss.logging.log4j.JBossCategory;
   import org.jboss.util.Sync;
   
   /**
  @@ -55,7 +54,7 @@
    *    before changing.
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Bill Burke</a>
  - * @version $Revision: 1.1 $
  + * @version $Revision: 1.2 $
    *
    * <p><b>Revisions:</b><br>
    * <p><b>2001/08/08: billb</b>
  
  
  
  1.53      +1 -4      
jboss/src/main/org/jboss/ejb/plugins/EntitySynchronizationInterceptor.java
  
  Index: EntitySynchronizationInterceptor.java
  ===================================================================
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/EntitySynchronizationInterceptor.java,v
  retrieving revision 1.52
  retrieving revision 1.53
  diff -u -r1.52 -r1.53
  --- EntitySynchronizationInterceptor.java     2001/08/09 20:27:21     1.52
  +++ EntitySynchronizationInterceptor.java     2001/09/11 18:34:59     1.53
  @@ -38,7 +38,6 @@
   import org.jboss.ejb.InstancePool;
   import org.jboss.ejb.MethodInvocation;
   import org.jboss.metadata.ConfigurationMetaData;
  -import org.jboss.logging.log4j.JBossCategory;
   import org.jboss.util.Sync;
   
   /**
  @@ -57,7 +56,7 @@
    * @author <a href="mailto:[EMAIL PROTECTED]";>Marc Fleury</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>Scott Stark</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>Bill Burke</a>
  - * @version $Revision: 1.52 $
  + * @version $Revision: 1.53 $
    *
    * <p><b>Revisions:</b><br>
    * <p><b>2001/06/28: marcf</b>
  @@ -106,8 +105,6 @@
      // Constants -----------------------------------------------------
    
      // Attributes ----------------------------------------------------
  -   /** Use a JBoss custom log4j category for trace level logging */
  -   static JBossCategory log = (JBossCategory) 
JBossCategory.getInstance(EntitySynchronizationInterceptor.class);
    
      /**
       *  The current commit option.
  
  
  
  1.13      +8 -8      
jboss/src/main/org/jboss/ejb/plugins/LRUEnterpriseContextCachePolicy.java
  
  Index: LRUEnterpriseContextCachePolicy.java
  ===================================================================
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/LRUEnterpriseContextCachePolicy.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- LRUEnterpriseContextCachePolicy.java      2001/08/03 17:15:44     1.12
  +++ LRUEnterpriseContextCachePolicy.java      2001/09/11 18:34:59     1.13
  @@ -27,7 +27,7 @@
    *
    * @see AbstractInstanceCache
    * @author <a href="mailto:[EMAIL PROTECTED]";>Simone Bordet</a>
  - * @version $Revision: 1.12 $
  + * @version $Revision: 1.13 $
    */
   public class LRUEnterpriseContextCachePolicy
      extends LRUCachePolicy
  @@ -258,7 +258,7 @@
            }
            catch (JMSException x) 
            {
  -            log.exception(x);
  +            log.error("createMessage failed", x);
            }
                        
            // Send JMS Message
  @@ -289,7 +289,7 @@
            }
            catch (JMSException x) 
            {
  -            log.exception(x);
  +            log.error("createMessage failed", x);
            }
                        
            // Send JMS Message
  @@ -384,7 +384,7 @@
               }
               catch (JMSException x) 
               {
  -               log.exception(x);
  +               log.error("createMessage failed", x);
               }
                        
               // Send JMS Message
  @@ -463,7 +463,7 @@
               }
               catch (JMSException x) 
               {
  -               log.exception(x);
  +               log.error("createMessage failed", x);
               }
                        
               // Send JMS Message
  @@ -508,7 +508,7 @@
               }
               catch (JMSException x) 
               {
  -               log.exception(x);
  +               log.error("createMessage failed", x);
               }
                        
               // Send JMS Message
  @@ -531,7 +531,7 @@
               }
               catch (JMSException x) 
               {
  -               log.exception(x);
  +               log.error("createMessage failed", x);
               }
                        
               // Send JMS Message
  @@ -555,7 +555,7 @@
               }
               catch (JMSException x) 
               {
  -               log.exception(x);
  +               log.error("createMessage failed", x);
               }
                        
               // Send JMS Message
  
  
  
  1.20      +1 -3      jboss/src/main/org/jboss/ejb/plugins/LogInterceptor.java
  
  Index: LogInterceptor.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/LogInterceptor.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- LogInterceptor.java       2001/08/15 18:14:21     1.19
  +++ LogInterceptor.java       2001/09/11 18:34:59     1.20
  @@ -32,7 +32,6 @@
   import org.jboss.ejb.EnterpriseContext;
   import org.jboss.ejb.Interceptor;
   import org.jboss.ejb.MethodInvocation;
  -import org.jboss.logging.log4j.JBossCategory;
   import org.jboss.metadata.BeanMetaData;
   
   /** An interceptor used to log call invocations. It also handles any
  @@ -40,13 +39,12 @@
    *
    *   @author <a href="mailto:[EMAIL PROTECTED]";>Rickard �berg</a>
    *   @author <a href="mailto:[EMAIL PROTECTED]";>Scott Stark</a>
  - *   @version $Revision: 1.19 $
  + *   @version $Revision: 1.20 $
    */
   public class LogInterceptor
      extends AbstractInterceptor
   {
      // Static --------------------------------------------------------
  -   private static JBossCategory log = (JBossCategory) 
JBossCategory.getInstance(LogInterceptor.class);
      
      // Attributes ----------------------------------------------------
      protected String ejbName;
  
  
  
  1.23      +7 -8      jboss/src/main/org/jboss/ejb/plugins/SecurityInterceptor.java
  
  Index: SecurityInterceptor.java
  ===================================================================
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/SecurityInterceptor.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- SecurityInterceptor.java  2001/09/01 19:50:30     1.22
  +++ SecurityInterceptor.java  2001/09/11 18:34:59     1.23
  @@ -16,10 +16,7 @@
   
   import org.jboss.ejb.Container;
   import org.jboss.ejb.MethodInvocation;
  -
  -// TODO this needs to be replaced with the log4j logging
   import org.jboss.logging.Logger;
  -
   import org.jboss.metadata.BeanMetaData;
   import org.jboss.metadata.SecurityIdentityMetaData;
   import org.jboss.security.AnybodyPrincipal;
  @@ -33,10 +30,11 @@
   
   @author <a href="[EMAIL PROTECTED]">Oleg Nitz</a>
   @author <a href="mailto:[EMAIL PROTECTED]";>Scott Stark</a>.
  -@version $Revision: 1.22 $
  +@version $Revision: 1.23 $
   */
   public class SecurityInterceptor extends AbstractInterceptor
   {
  +    protected static Logger log = Logger.create(SecurityInterceptor.class);
       /**
        * @clientCardinality 0..1
        * @supplierCardinality 1
  @@ -77,6 +75,7 @@
           }
           securityManager = container.getSecurityManager();
           realmMapping = container.getRealmMapping();
  +        
       }
   
       public Container getContainer()
  @@ -168,7 +167,7 @@
           if( securityManager.isValid(principal, credential) == false )
           {
               String msg = "Authentication exception, principal="+principal;
  -            Logger.error(msg);
  +            log.error(msg);
               SecurityException e = new SecurityException(msg);
               throw new RemoteException("checkSecurityAssociation", e);
           }
  @@ -183,7 +182,7 @@
           {
               String method = mi.getMethod().getName();
               String msg = "No method permissions assigned to method="+method;
  -            Logger.error(msg);
  +            log.error(msg);
               SecurityException e = new SecurityException(msg);
               throw new RemoteException("checkSecurityAssociation", e);
           }
  @@ -203,7 +202,7 @@
                   String method = mi.getMethod().getName();
                   String msg = "Insufficient method permissions, 
runAsRole="+threadRunAsRole
                       + ", method="+method+", requiredRoles="+methodRoles;
  -                Logger.error(msg);
  +                log.error(msg);
                   SecurityException e = new SecurityException(msg);
                   throw new RemoteException("checkSecurityAssociation", e);
               }
  @@ -216,7 +215,7 @@
               String method = mi.getMethod().getName();
               String msg = "Insufficient method permissions, principal="+principal
                   + ", method="+method+", requiredRoles="+methodRoles;
  -            Logger.error(msg);
  +            log.error(msg);
               SecurityException e = new SecurityException(msg);
               throw new RemoteException("checkSecurityAssociation", e);
           }
  
  
  
  1.24      +4 -5      
jboss/src/main/org/jboss/ejb/plugins/StatefulSessionFilePersistenceManager.java
  
  Index: StatefulSessionFilePersistenceManager.java
  ===================================================================
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/StatefulSessionFilePersistenceManager.java,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- StatefulSessionFilePersistenceManager.java        2001/09/01 19:50:30     1.23
  +++ StatefulSessionFilePersistenceManager.java        2001/09/11 18:34:59     1.24
  @@ -50,8 +50,6 @@
   import org.jboss.ejb.StatefulSessionContainer;
   import org.jboss.ejb.StatefulSessionPersistenceManager;
   import org.jboss.ejb.StatefulSessionEnterpriseContext;
  -
  -// TODO this needs to be replaced with the log4j logging
   import org.jboss.logging.Logger;
   
   
  @@ -65,7 +63,7 @@
   *  @author <a href="mailto:[EMAIL PROTECTED]";>Rickard �berg</a>
   *  @author <a href="mailto:[EMAIL PROTECTED]";>Marc Fleury</a>
   *  @author <a href="mailto:[EMAIL PROTECTED]";>Sebastien Alborini</a>
  -*  @version $Revision: 1.23 $
  +*  @version $Revision: 1.24 $
   */
   public class StatefulSessionFilePersistenceManager
   implements StatefulSessionPersistenceManager
  @@ -73,6 +71,7 @@
       // Constants -----------------------------------------------------
       
       // Attributes ----------------------------------------------------
  +   private static Logger log = 
Logger.create(StatefulSessionFilePersistenceManager.class);
       private StatefulSessionContainer con;
       
       private Method ejbActivate;
  @@ -117,7 +116,7 @@
           
           dir.mkdirs();
           
  -        Logger.debug("Storing sessions for "+ejbName+" in:"+dir);
  +        log.debug("Storing sessions for "+ejbName+" in:"+dir);
           
           // Clear dir of old files
           File[] sessions = dir.listFiles();
  @@ -125,7 +124,7 @@
           {
               sessions[i].delete();
           }
  -        Logger.debug(sessions.length + " old sessions removed");
  +        log.debug(sessions.length + " old sessions removed");
           
           // Get fields of class
           Class beanClass = con.getBeanClass();
  
  
  
  1.12      +4 -5      
jboss/src/main/org/jboss/ejb/plugins/StatefulSessionInstanceCache.java
  
  Index: StatefulSessionInstanceCache.java
  ===================================================================
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/StatefulSessionInstanceCache.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- StatefulSessionInstanceCache.java 2001/09/01 19:50:30     1.11
  +++ StatefulSessionInstanceCache.java 2001/09/11 18:34:59     1.12
  @@ -25,8 +25,6 @@
   import org.jboss.ejb.EnterpriseContext;
   import org.jboss.ejb.StatefulSessionEnterpriseContext;
   import org.jboss.ejb.StatefulSessionPersistenceManager;
  -
  -// TODO this needs to be replaced with the log4j logging
   import org.jboss.logging.Logger;
   
   /**
  @@ -34,7 +32,7 @@
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Simone Bordet</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>Sebastien Alborini</a>
  - * @version $Revision: 1.11 $
  + * @version $Revision: 1.12 $
    */
   public class StatefulSessionInstanceCache
       extends AbstractInstanceCache
  @@ -42,6 +40,7 @@
       // Constants -----------------------------------------------------
   
       // Attributes ----------------------------------------------------
  +   protected Logger log = Logger.create(StatefulSessionInstanceCache.class);
       /* The container */
       private StatefulSessionContainer m_container;
       /* The map that holds passivated beans that will be removed */
  @@ -148,7 +147,7 @@
           m_buffer.append(m_container.getBeanMetaData().getEjbName());
           m_buffer.append("' with id = ");
           m_buffer.append(key);
  -        Logger.debug(m_buffer.toString());
  +        log.debug(m_buffer.toString());
   
           if (isJMSMonitoringEnabled())
           {
  @@ -160,7 +159,7 @@
               }
               catch (JMSException x)
               {
  -                Logger.exception(x);
  +                log.error("createMessage failed", x);
               }
   
               // Send JMS Message
  
  
  
  1.17      +2 -2      jboss/src/main/org/jboss/ejb/plugins/TxInterceptorCMT.java
  
  Index: TxInterceptorCMT.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/TxInterceptorCMT.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- TxInterceptorCMT.java     2001/09/01 19:50:30     1.16
  +++ TxInterceptorCMT.java     2001/09/11 18:34:59     1.17
  @@ -31,7 +31,7 @@
    *  @author <a href="mailto:[EMAIL PROTECTED]";>Sebastien Alborini</a>
    *  @author <a href="mailto:[EMAIL PROTECTED]";>Anatoly Akkerman</a>
    *  @author <a href="mailto:[EMAIL PROTECTED]";>Ole Husgaard</a>
  - *  @version $Revision: 1.16 $
  + *  @version $Revision: 1.17 $
    */
   public class TxInterceptorCMT
       extends AbstractTxInterceptor
  @@ -91,7 +91,7 @@
               default:
                   name = "TX_UNKNOWN";
           }
  -        Logger.debug(name+" for "+m.getName());
  +        log.debug(name+" for "+m.getName());
       }
   
       /*
  
  
  

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to