public boolean isInitialized() { try { return (Boolean) isInitialized.invoke(null); } catch (final InvocationTargetException e) { throw new LoaderRuntimeException("OpenEJB.isInitialized: ", e.getCause()); } catch (final Exception e) { throw new LoaderRuntimeException("OpenEJB.isInitialized: ", e); } }
public boolean isInitialized() { try { return (Boolean) isInitialized.invoke(null); } catch (final InvocationTargetException e) { throw new LoaderRuntimeException("OpenEJB.isInitialized: ", e.getCause()); } catch (final Exception e) { throw new LoaderRuntimeException("OpenEJB.isInitialized: ", e); } }
private Method getGetURLsMethod() { return AccessController.doPrivileged(new PrivilegedAction<Method>() { @Override public Method run() { try { final Object cp = getURLClassPath((URLClassLoader) getClassLoader()); final Class<?> clazz = cp.getClass(); return clazz.getDeclaredMethod("getURLs", URL.class); } catch (final Exception e) { throw new LoaderRuntimeException(e); } } }); }
public void init(final Properties props) throws Exception { try { init.invoke(null, props); } catch (final InvocationTargetException e) { if (e.getCause() instanceof Exception) { throw (Exception) e.getCause(); } throw (Error) e.getCause(); } catch (final Exception e) { throw new LoaderRuntimeException("OpenEJB.init: ", e); } }
private Method getGetURLsMethod() { return AccessController.doPrivileged(new PrivilegedAction<Method>() { @Override public Method run() { try { final URLClassLoader loader = getSystemLoader(); final Object cp = getURLClassPath(loader); final Class<?> clazz = cp.getClass(); try { return clazz.getDeclaredMethod("getURLs", URL.class); } catch (final NoSuchMethodException e) { return clazz.getDeclaredMethod("getURLs"); } } catch (final Exception e) { throw new LoaderRuntimeException(e); } } }); } }
private Method getGetURLsMethod() { return AccessController.doPrivileged(new PrivilegedAction<Method>() { @Override public Method run() { try { final URLClassLoader loader = getSystemLoader(); final Object cp = getURLClassPath(loader); final Class<?> clazz = cp.getClass(); try { return clazz.getDeclaredMethod("getURLs", URL.class); } catch (final NoSuchMethodException e) { return clazz.getDeclaredMethod("getURLs"); } } catch (final Exception e) { throw new LoaderRuntimeException(e); } } }); } }
public void init(final Properties props) throws Exception { try { init.invoke(null, props); } catch (final InvocationTargetException e) { if (e.getCause() instanceof Exception) { throw (Exception) e.getCause(); } throw (Error) e.getCause(); } catch (final Exception e) { throw new LoaderRuntimeException("OpenEJB.init: ", e); } }
@Override public ClassLoader getClassLoader() { try { return getSystemLoader(); } catch (final Exception e) { throw new LoaderRuntimeException(e); } }
@Override public ClassLoader getClassLoader() { try { return getSystemLoader(); } catch (final Exception e) { throw new LoaderRuntimeException(e); } }
public static synchronized void reset() { try { System.clearProperty("openejb.loader"); system = new SystemInstance(new Properties()); // don't put system properties here, it is already done initialized = false; } catch (final Exception e) { throw new LoaderRuntimeException("Failed to create default instance of SystemInstance", e); } }
public static synchronized void reset() { try { System.clearProperty("openejb.loader"); system.set(new SystemInstance(new Properties())); // don't put system properties here, it is already done initialized = false; } catch (final Exception e) { throw new LoaderRuntimeException("Failed to create default instance of SystemInstance", e); } }
@Override public Method run() { try { final URLClassLoader loader = getSystemLoader(); final Object cp = getURLClassPath(loader); final Class<?> clazz = cp.getClass(); try { return clazz.getDeclaredMethod("getURLs", URL.class); } catch (final NoSuchMethodException e) { return clazz.getDeclaredMethod("getURLs"); } } catch (final Exception e) { throw new LoaderRuntimeException(e); } }
@Override public Method run() { try { final URLClassLoader loader = getSystemLoader(); final Object cp = getURLClassPath(loader); final Class<?> clazz = cp.getClass(); try { return clazz.getDeclaredMethod("getURLs", URL.class); } catch (final NoSuchMethodException e) { return clazz.getDeclaredMethod("getURLs"); } } catch (final Exception e) { throw new LoaderRuntimeException(e); } }
@Override public Method run() { try { final Object cp = getURLClassPath((URLClassLoader) getClassLoader()); final Class<?> clazz = cp.getClass(); return clazz.getDeclaredMethod("getURLs", URL.class); } catch (final Exception e) { throw new LoaderRuntimeException(e); } }
@Override public Method run() { try { final Object cp = getURLClassPath((URLClassLoader) getClassLoader()); final Class<?> clazz = cp.getClass(); return clazz.getDeclaredMethod("addURL", URL.class); } catch (final Exception e) { throw new LoaderRuntimeException(e); } }
digest = MessageDigest.getInstance(algo); } catch (final NoSuchAlgorithmException e) { throw new LoaderRuntimeException(e);
digest = MessageDigest.getInstance(algo); } catch (final NoSuchAlgorithmException e) { throw new LoaderRuntimeException(e);
baseDirCanonicalPath = base.getDirectory().getCanonicalPath(); } catch (final IOException e) { throw new LoaderRuntimeException("Failed to create default instance of SystemInstance", e);
public TomcatClassPath(final ClassLoader classLoader) { this.commonLoader = classLoader; try { addRepositoryMethod = getAddRepositoryMethod(); } catch (final Exception tomcat4Exception) { try { addURLMethod = getAddURLMethod(); } catch (final Exception tomcat5Exception) { throw new LoaderRuntimeException("Failed accessing classloader for Tomcat 5 or 6", tomcat5Exception); } } final ClassLoader serverLoader = getServerLoader(getContextClassLoader()); if (serverLoader != null && serverLoader != commonLoader) { this.serverLoader = serverLoader; } else { this.serverLoader = null; } }