User: juha    
  Date: 00/12/29 14:28:27

  Modified:    src/main/org/jboss/ejb/plugins MetricsInterceptor.java
  Log:
  Something was taking up alot of cycles in here..
  
  Revision  Changes    Path
  1.4       +3 -18     jboss/src/main/org/jboss/ejb/plugins/MetricsInterceptor.java
  
  Index: MetricsInterceptor.java
  ===================================================================
  RCS file: 
/products/cvs/ejboss/jboss/src/main/org/jboss/ejb/plugins/MetricsInterceptor.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- MetricsInterceptor.java   2000/12/17 20:31:10     1.3
  +++ MetricsInterceptor.java   2000/12/29 22:28:27     1.4
  @@ -128,9 +128,6 @@
   
       private void sendMessage(long time, Message msg) {        
   
  -        if ((metricsPub == null) || (msg == null))
  -            return;
  -            
           try {
               msg.setStringProperty("TIME",  String.valueOf(time));
               metricsPub.publish(metricsTopic, msg);
  @@ -143,30 +140,18 @@
       
       private Message createMessage(MethodInvocation mi, String checkpoint) {
           
  -        if (metricsSession == null)
  -            return null;
  -
           try {            
               Message  msg    =  metricsSession.createMessage();
               Transaction tx  =  mi.getTransaction();
               Principal principal = mi.getPrincipal();
               
               msg.setStringProperty("CHECKPOINT",  checkpoint);
  -            msg.setStringProperty("APPLICATION", applicationName);
  +            //msg.setStringProperty("APPLICATION", applicationName);
               msg.setStringProperty("BEAN",   beanName);
  -            msg.setObjectProperty("METHOD", mi.getMethod().toString());    
  +            msg.setObjectProperty("METHOD", mi.getMethod().getName());    
               
  -            if (tx == null) {
  -                // This is a workaround for SpyMessage throwing NPE if
  -                // getIntProperty(..) is called on a non-existant key.
  -                // javax.jms.MessageFormatException would seem more
  -                // appropriate (it's checked exception)
  -                msg.setIntProperty("STATUS", Status.STATUS_UNKNOWN);
  -            }
  -            else {
  +            if (tx != null) 
                   msg.setStringProperty("ID",  String.valueOf(tx.hashCode()));
  -                msg.setIntProperty("STATUS", tx.getStatus());
  -            }
                           
               if (principal != null)
                   msg.setStringProperty("PRINCIPAL", principal.getName());
  
  
  

Reply via email to