1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   *
12   *
13   */
14  
15  package com.liferay.portal.monitoring.statistics.service;
16  
17  import com.liferay.portal.kernel.util.MethodKey;
18  import com.liferay.portal.monitoring.MonitorNames;
19  import com.liferay.portal.monitoring.statistics.BaseDataSample;
20  
21  import java.lang.reflect.Method;
22  
23  import org.aopalliance.intercept.MethodInvocation;
24  
25  /**
26   * <a href="ServiceRequestDataSample.java.html"><b><i>View Source</i></b></a>
27   *
28   * @author Michael C. Han
29   */
30  public class ServiceRequestDataSample extends BaseDataSample {
31  
32      public ServiceRequestDataSample(MethodInvocation methodInvocation) {
33          setNamespace(MonitorNames.SERVICE);
34  
35          Method method = methodInvocation.getMethod();
36  
37          String className = method.getDeclaringClass().getName();
38          String methodName = method.getName();
39          Class<?>[] parameterTypes = method.getParameterTypes();
40  
41          _methodKey = new MethodKey(className, methodName, parameterTypes);
42  
43          setDescription(_methodKey.toString());
44      }
45  
46      public MethodKey getMethodKey() {
47          return _methodKey;
48      }
49  
50      private MethodKey _methodKey;
51  
52  }