public T get ( Env env ) throws APIException { Thread t = Thread . currentThread ( ) ; T obj = objs . get ( t ) ; if ( obj == null || refreshed > obj . created ( ) ) { try { obj = cnst . newInstance ( new Object [ ] { env } ) ; } catch ( InvocationTargetException e ) { throw new APIException ( e . getTargetException ( ) ) ; } catch ( Exception e ) { throw new APIException ( e ) ; } T destroyMe = objs . put ( t , obj ) ; if ( destroyMe != null ) { destroyMe . destroy ( env ) ; } } return obj ; }
Get the T class from the current thread