jdk/src/share/classes/sun/tracing/dtrace/DTraceProvider.java
changeset 10419 12c063b39232
parent 5506 202f599c92aa
child 14342 8435a30053c1
equal deleted inserted replaced
10418:1d57022fdb6e 10419:12c063b39232
    24  */
    24  */
    25 
    25 
    26 package sun.tracing.dtrace;
    26 package sun.tracing.dtrace;
    27 
    27 
    28 import java.lang.reflect.Method;
    28 import java.lang.reflect.Method;
    29 import java.lang.reflect.InvocationTargetException;
       
    30 import java.lang.reflect.Modifier;
    29 import java.lang.reflect.Modifier;
    31 import java.lang.reflect.Constructor;
    30 import java.lang.reflect.Constructor;
    32 import java.lang.reflect.InvocationHandler;
    31 import java.lang.reflect.InvocationHandler;
    33 import java.lang.reflect.InvocationTargetException;
    32 import java.lang.reflect.InvocationTargetException;
    34 import java.lang.annotation.Annotation;
    33 import java.lang.annotation.Annotation;
    35 import java.util.HashMap;
       
    36 
    34 
    37 import sun.tracing.ProviderSkeleton;
    35 import sun.tracing.ProviderSkeleton;
    38 import sun.tracing.ProbeSkeleton;
    36 import sun.tracing.ProbeSkeleton;
    39 import com.sun.tracing.Provider;
    37 import com.sun.tracing.Provider;
    40 import com.sun.tracing.ProviderName;
       
    41 import com.sun.tracing.ProbeName;
    38 import com.sun.tracing.ProbeName;
    42 import com.sun.tracing.dtrace.Attributes;
    39 import com.sun.tracing.dtrace.Attributes;
    43 import com.sun.tracing.dtrace.ModuleName;
    40 import com.sun.tracing.dtrace.ModuleName;
    44 import com.sun.tracing.dtrace.FunctionName;
    41 import com.sun.tracing.dtrace.FunctionName;
    45 import com.sun.tracing.dtrace.StabilityLevel;
    42 import com.sun.tracing.dtrace.StabilityLevel;
   138          * Invoke its constructor with the designated invocation handler.
   135          * Invoke its constructor with the designated invocation handler.
   139          */
   136          */
   140         try {
   137         try {
   141             Constructor cons = proxyClass.getConstructor(constructorParams);
   138             Constructor cons = proxyClass.getConstructor(constructorParams);
   142             return (T)cons.newInstance(new Object[] { this });
   139             return (T)cons.newInstance(new Object[] { this });
   143         } catch (NoSuchMethodException e) {
   140         } catch (ReflectiveOperationException e) {
   144             throw new InternalError(e.toString());
   141             throw new InternalError(e.toString(), e);
   145         } catch (IllegalAccessException e) {
       
   146             throw new InternalError(e.toString());
       
   147         } catch (InstantiationException e) {
       
   148             throw new InternalError(e.toString());
       
   149         } catch (InvocationTargetException e) {
       
   150             throw new InternalError(e.toString());
       
   151         }
   142         }
   152     }
   143     }
   153 
   144 
   154     // In the normal case, the proxy object's method implementations will call
   145     // In the normal case, the proxy object's method implementations will call
   155     // this method (it usually calls the ProviderSkeleton's version).  That
   146     // this method (it usually calls the ProviderSkeleton's version).  That