David,

Could you please remove this file from the CVS immediately (and any other with the SENSOVA copyright)
Please do not check in java files with copyrights to your company into the Apache CVS


Thanks,

David

Begin forwarded message:

From: [EMAIL PROTECTED]
Date: Thu Feb 12, 2004 6:52:07 AM US/Pacific
To: [EMAIL PROTECTED]
Subject: cvs commit: jakarta-jetspeed-2/services/security/src/aop/org/apache/jetspeed/trace PerformanceTrace.java
Reply-To: "Jetspeed Developers List" <[EMAIL PROTECTED]>


dlestrat 2004/02/12 06:52:07

Added: services/security/src/aop/org/apache/jetspeed/trace
PerformanceTrace.java
Log:
Aspect used for security service method execution performance tracing.


Revision Changes Path
1.1 jakarta-jetspeed-2/services/security/src/aop/org/apache/jetspeed/ trace/PerformanceTrace.java


  Index: PerformanceTrace.java
  ===================================================================
  /* <SENSOVA-COPYRIGHT>
   * Copyright (C) 2004 Sensova, LLC.
   * All Rights Reserved. No use, copying or distribution
   * of this work may be made except with a valid agreement
   * from Sensova, LLC.
   * This notice must be included on all copies,
   * modifications and derivatives of this work.
   * </SENSOVA-COPYRIGHT>
   *
   * File Created: org.apache.jetspeed.trace.Trace.java
   * Creation Date: Feb 2, 2004
   *
   */
  package org.apache.jetspeed.trace;

import java.util.logging.*;

  /**
   * @author <a href="">David Le Strat</a>
   *
   */
  public aspect PerformanceTrace {

pointcut publicMethodCall() : call(public * org.apache.jetspeed.security..*(..));

/**
* <p>This is the advice code on the defined set of pointcuts in
* publicMethodCall() - definition.</p>
* <p>Wrap the method call(s) so we can log that it is about to be run,
* the parameters it will run with and the result we get from it.
* "around" is instead of the method call, alternatives are
* "before" or "after".</p>
*/
Object around() : publicMethodCall()
{
long startTime = System.currentTimeMillis();


          // Execute the wrapped method and catch the result
          Object result = proceed();

long endTime = System.currentTimeMillis();
long diff = endTime - startTime;
if (diff > 100)
{
System.out.println("[INFO] " + thisJoinPoint);
System.out.println("[INFO] Execution time: " + diff);
System.out.println("[INFO] Arguments: " + thisJoinPoint.getArgs());
if (result != null)
{
System.out.println("[INFO] Result: " + thisJoinPoint + ": " + result.toString());
}
}


          return result;
      }

}




--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



-- David Sean Taylor Bluesunrise Software [EMAIL PROTECTED] [office] +01 707 773-4646 [mobile] +01 707 529 9194



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to