001 /**
002 * $Id: ProfileMe.java,v 1.2 2010/03/15 09:12:42 oboehm Exp $
003 *
004 * Copyright (c) 2008 by Oliver Boehm
005 *
006 * Licensed under the Apache License, Version 2.0 (the "License");
007 * you may not use this file except in compliance with the License.
008 * You may obtain a copy of the License at
009 *
010 * http://www.apache.org/licenses/LICENSE-2.0
011 *
012 * Unless required by applicable law or agreed to in writing, software
013 * distributed under the License is distributed on an "AS IS" BASIS,
014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express orimplied.
015 * See the License for the specific language governing permissions and
016 * limitations under the License.
017 *
018 * (c)reated 19.12.2008 by oliver (ob@oasd.de)
019 */
020 package patterntesting.runtime.annotation;
021
022 import java.lang.annotation.*;
023
024 /**
025 * You want to measure a method or constructor? Mark it with @ProfileMe.
026 * You want to measure all methods or constructors in a class? Mark the
027 * class with @ProfileMe.
028 * <br/>
029 * You want to find constructors or methods of a class which are never called?
030 * Mark the class with @ProfileMe and look at the constructors and methods
031 * which has a hit of "0". This feature works only if you mark the whole class
032 * with @ProfileMe because in this case the ProfileStatisticMBean initializes
033 * the ProfileMonitor for each method in this class.
034 * <br/>
035 * For all other methods
036 * or constructors the attached ProfileMonitor is initialized at the first
037 * call. So you don't see the ProfileMonitor if the method or constructor
038 * is never called.
039 * <br/>
040 * <em>Note</em>: This works only for classes which are really loaded.
041 * If a class is loaded you can see it with the ClasspathMonitorMBean.
042 *
043 * @see DontProfileMe
044 * @see patterntesting.runtime.monitor.ProfileStatistic
045 * @see patterntesting.runtime.monitor.ProfileStatistic
046 * @see patterntesting.runtime.monitor.ProfileMonitor
047 * @see patterntesting.runtime.monitor.ClasspathMonitor
048 * @see patterntesting.runtime.monitor.ClasspathMonitorMBean
049 *
050 * @author <a href="boehm@javatux.de">oliver</a>
051 * @since 19.12.2008
052 * @version $Revision: 1.2 $
053 */
054 @Retention(RetentionPolicy.RUNTIME)
055 @Target({ElementType.CONSTRUCTOR, ElementType.METHOD, ElementType.TYPE})
056 public @interface ProfileMe {
057
058 }