1 23 24 29 30 package com.sun.enterprise.resource; 31 32 import java.util.Timer ; 33 import java.lang.reflect.Method ; 34 import java.util.logging.*; 35 import java.lang.reflect.Field ; 37 39 40 45 48 public class PortabilityUtils extends java.lang.Object { 49 50 51 public PortabilityUtils() { 52 } 53 54 58 62 64 67 public static Timer GetTimer() { 68 try { 69 Class cls = Class.forName("com.sun.enterprise.Switch"); 71 Class param[] = new Class [0]; 72 Method meth = cls.getMethod("getSwitch",param); 74 Object obj = meth.invoke(cls,(java.lang.Object [])param); 76 meth = cls.getMethod("getTimer",param); 80 obj = meth.invoke(obj,(java.lang.Object [])param); 82 return (Timer )obj; 84 } catch (ClassNotFoundException ex) { 85 return new Timer (true); 87 } catch (Exception ex) { 88 return new Timer (true); 90 } 91 } 92 } 93 | Popular Tags |