User: kimptoc 
  Date: 01/09/01 12:50:33

  Modified:    src/main/org/jboss/util CounterInterceptor.java
                        Scheduler.java
  Log:
  remove deprecated logging import, where possible, otherwise comment as needing 
replacement with log4j.... must find out how it is use.... would be good if the 
deprecation message pointed to an example to use...
  
  Revision  Changes    Path
  1.4       +12 -9     jboss/src/main/org/jboss/util/CounterInterceptor.java
  
  Index: CounterInterceptor.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/util/CounterInterceptor.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- CounterInterceptor.java   2001/08/30 03:50:12     1.3
  +++ CounterInterceptor.java   2001/09/01 19:50:33     1.4
  @@ -7,12 +7,15 @@
   import org.jboss.ejb.MethodInvocation;
   import org.jboss.ejb.Container;
   import org.jboss.ejb.plugins.*;
  +
  +// TODO this needs to be replaced with the log4j logging
   import org.jboss.logging.Logger;
  +
   import org.jboss.util.CounterService;
   
   /**
    * Interceptor that uses the CounterService MBean to record the length of time
  - * spent in 'lower' interceptors (below it in the stack). 
  + * spent in 'lower' interceptors (below it in the stack).
    * <p><b>How to use:</b></p>
    * <p>First, the CounterService MBean must be installed in JBoss. To do this,
    * place the following in your JBoss.jcml file, near the very end.</p>
  @@ -22,8 +25,8 @@
    * <p>This will start up and enable the centralized counter in your JBoss server
    * instance.
    * <p>Next, you need to configure this interceptor into the interceptor stacks
  - * of any beans you wish to monitor. This can be done either globally for a 
  - * container-config in standardjboss.xml, or on a per-bean basis in a jar's 
  + * of any beans you wish to monitor. This can be done either globally for a
  + * container-config in standardjboss.xml, or on a per-bean basis in a jar's
    * jboss.jcml. Just insert the following at the top of the 
&lt;container-interceptors&gt;
    * section. If you're overriding this for a bean in jboss.xml, you'll need to
    * override the entire container-interceptors section.</p>
  @@ -31,7 +34,7 @@
    * &lt;interceptor&gt;org.jboss.util.CounterInterceptor&lt;/interceptor&gt;
    * </code>
    * <p>This can go anywhere in the container-interceptors section, but either
  - * the top or the bottom will probably be best for gathering application 
  + * the top or the bottom will probably be best for gathering application
    * statistics.
    * @author <a href="mailto:[EMAIL PROTECTED]";>Dan Christopherson</href>
    */
  @@ -42,7 +45,7 @@
      boolean loggedNoCounter = false;
      StringBuffer baseCounterName = null;
      int baseNameLength = 0;
  -   
  +
      public CounterInterceptor() {
      }
      public void setContainer(Container container) {
  @@ -53,7 +56,7 @@
      public Container getContainer() {
         return container;
      }
  -   
  +
      public Object invokeHome(MethodInvocation mi) throws Exception {
         long startTime=System.currentTimeMillis();
         try {
  @@ -68,7 +71,7 @@
            }
         }
      }
  -      
  +
      public Object invoke(MethodInvocation mi) throws Exception {
         long startTime=System.currentTimeMillis();
         try {
  @@ -83,12 +86,12 @@
            }
         }
      }
  -   
  +
      public void init() throws java.lang.Exception {
         //get a reference to the CounterService from JNDI
         Logger.debug("CounterInterceptor initializing");
      }
  -   
  +
      private CounterService getCounter() {
         if (counter == null) {
            try {
  
  
  
  1.9       +26 -27    jboss/src/main/org/jboss/util/Scheduler.java
  
  Index: Scheduler.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/util/Scheduler.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- Scheduler.java    2001/08/30 03:50:12     1.8
  +++ Scheduler.java    2001/09/01 19:50:33     1.9
  @@ -32,7 +32,6 @@
   import javax.naming.Reference;
   import javax.naming.StringRefAddr;
   
  -import org.jboss.logging.Log;
   import org.jboss.naming.NonSerializableFactory;
   import org.jboss.system.ServiceMBeanSupport;
   
  @@ -565,50 +564,50 @@
      // Helper methods to bind/unbind the Management class
      // -------------------------------------------------------------------------
   
  -     private void bind( Scheduler pScheduler )
  +    private void bind( Scheduler pScheduler )
         throws
            NamingException
      {
  -             Context lContext = new InitialContext();
  -             String lJNDIName = getJNDIName();
  +        Context lContext = new InitialContext();
  +        String lJNDIName = getJNDIName();
   
  -             // Ah ! JBoss Server isn't serializable, so we use a helper class
  -             NonSerializableFactory.bind( lJNDIName, pScheduler );
  +        // Ah ! JBoss Server isn't serializable, so we use a helper class
  +        NonSerializableFactory.bind( lJNDIName, pScheduler );
   
         //AS Don't ask me what I am doing here
  -             Name lName = lContext.getNameParser("").parse( lJNDIName );
  -             while( lName.size() > 1 ) {
  -                     String lContextName = lName.get( 0 );
  -                     try {
  -                             lContext = (Context) lContext.lookup(lContextName);
  -                     }
  -                     catch( NameNotFoundException e )        {
  -                             lContext = lContext.createSubcontext(lContextName);
  -                     }
  -                     lName = lName.getSuffix( 1 );
  -             }
  -
  -             // The helper class NonSerializableFactory uses address type nns, we 
go on to
  -             // use the helper class to bind the javax.mail.Session object in JNDI
  -             StringRefAddr lAddress = new StringRefAddr( "nns", lJNDIName );
  -             Reference lReference = new Reference(
  +        Name lName = lContext.getNameParser("").parse( lJNDIName );
  +        while( lName.size() > 1 ) {
  +            String lContextName = lName.get( 0 );
  +            try {
  +                lContext = (Context) lContext.lookup(lContextName);
  +            }
  +            catch( NameNotFoundException e )    {
  +                lContext = lContext.createSubcontext(lContextName);
  +            }
  +            lName = lName.getSuffix( 1 );
  +        }
  +
  +        // The helper class NonSerializableFactory uses address type nns, we go on 
to
  +        // use the helper class to bind the javax.mail.Session object in JNDI
  +        StringRefAddr lAddress = new StringRefAddr( "nns", lJNDIName );
  +        Reference lReference = new Reference(
            Scheduler.class.getName(),
            lAddress,
            NonSerializableFactory.class.getName(),
            null
         );
  -             lContext.bind( lName.get( 0 ), lReference );
  +        lContext.bind( lName.get( 0 ), lReference );
   
  -             log.log( "JBoss Scheduler Service '" + getJNDIName() + "' bound to " + 
lJNDIName );
  -     }
  +        log.log( "JBoss Scheduler Service '" + getJNDIName() + "' bound to " + 
lJNDIName );
  +    }
   
  -     private void unbind() throws NamingException {
  +    private void unbind() throws NamingException {
         String lJNDIName = getJNDIName();
   
         new InitialContext().unbind( lJNDIName );
         NonSerializableFactory.unbind( lJNDIName );
         log.log("JBoss Scheduler service '" + lJNDIName + "' removed from JNDI" );
  -     }
  +    }
   
      // -------------------------------------------------------------------------
      // Inner Classes
  
  
  

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

Reply via email to