Author: mwebb
Date: Mon Jul 16 04:23:23 2007
New Revision: 556591
URL: http://svn.apache.org/viewvc?view=rev&rev=556591
Log:
cleaned up this class some more. No need to return the ProfilerTimerUnit
object anymore in a getter.
Modified:
mina/trunk/core/src/main/java/org/apache/mina/filter/ProfilerTimerFilter.java
Modified:
mina/trunk/core/src/main/java/org/apache/mina/filter/ProfilerTimerFilter.java
URL:
http://svn.apache.org/viewvc/mina/trunk/core/src/main/java/org/apache/mina/filter/ProfilerTimerFilter.java?view=diff&rev=556591&r1=556590&r2=556591
==============================================================================
---
mina/trunk/core/src/main/java/org/apache/mina/filter/ProfilerTimerFilter.java
(original)
+++
mina/trunk/core/src/main/java/org/apache/mina/filter/ProfilerTimerFilter.java
Mon Jul 16 04:23:23 2007
@@ -37,13 +37,11 @@
* method in the [EMAIL PROTECTED] IoFilterAdapter} class to execute. The
basic
* premise of the logic in this class is to get the current time
* at the beginning of the method, call method on nextFilter, and
- * then get the current time again. The result will then be sent to
- * the <tt>SessionLog.debug()</tt> method. An example of how to use
+ * then get the current time again. An example of how to use
* the filter is:
*
* <pre>
* ProfilerTimerFilter profiler = new ProfilerTimerFilter(
ProfilerTimerFilter.MSG_RCV, ProfilerTimerUnit.MILLISECOND );
- * profiler.setLogLevel( 6 );
* chain.addFirst( "Profiler", profiler);
* </pre>
*
@@ -88,15 +86,7 @@
{
this.eventsToProfile = eventsToProfile;
- if( unit == TimeUnit.MILLISECONDS ){
- this.timeUnit = ProfilerTimerUnit.MILLISECONDS;
- } else if( unit == TimeUnit.NANOSECONDS ){
- this.timeUnit = ProfilerTimerUnit.NANOSECONDS;
- } else if( unit == TimeUnit.SECONDS ){
- this.timeUnit = ProfilerTimerUnit.SECONDS;
- } else {
- throw new IllegalArgumentException( "Invalid Time specified" );
- }
+ setTimeUnit( unit );
timerManager = new HashMap<IoEventType,TimerWorker>();
@@ -107,26 +97,22 @@
/**
- * Returns the [EMAIL PROTECTED] ProfilerTimerUnit} being used.
- *
- * @return
- * The [EMAIL PROTECTED] ProfilerTimerUnit} being used.
- */
- public ProfilerTimerUnit getTimeUnit()
- {
- return timeUnit;
- }
-
-
- /**
* Sets the [EMAIL PROTECTED] ProfilerTimerUnit} being used.
*
* @param timeUnit
* Sets the new [EMAIL PROTECTED] ProfilerTimerUnit} to be used.
*/
- public void setTimeUnit( ProfilerTimerUnit timeUnit )
+ public void setTimeUnit( TimeUnit unit )
{
- this.timeUnit = timeUnit;
+ if( unit == TimeUnit.MILLISECONDS ){
+ this.timeUnit = ProfilerTimerUnit.MILLISECONDS;
+ } else if( unit == TimeUnit.NANOSECONDS ){
+ this.timeUnit = ProfilerTimerUnit.NANOSECONDS;
+ } else if( unit == TimeUnit.SECONDS ){
+ this.timeUnit = ProfilerTimerUnit.SECONDS;
+ } else {
+ throw new IllegalArgumentException( "Invalid Time specified" );
+ }
}
/**