@Override public String getUniqueFile() { throw new TomEERuntimeException("This method is not used"); }
lastException = TomEERuntimeException.class.cast(lastException).getCause();
@Override public String getUniqueFile() { throw new TomEERuntimeException("This method is not used"); }
private Object invoke(final Method method, final Object... args) { if (method == null) { return null; } try { return method.invoke(delegate, args); } catch (final InvocationTargetException e) { if (e.getCause() instanceof RuntimeException) { throw (RuntimeException) e.getCause(); } throw new TomEERuntimeException(e.getCause()); } catch (final IllegalAccessException e) { throw new TomEERuntimeException(e); } }
@Override public void setConfigFile(StandardContext standardContext, File contextXmlFile) { try { standardContext.setConfigFile(contextXmlFile.toURI().toURL()); } catch (MalformedURLException e) { throw new TomEERuntimeException(e); } } }
@Override public HttpListener removeListener(final String completePath) { String path = completePath; if (path == null) { return listeners.get(path); } // assure context root with a leading slash if (!path.startsWith("/") && !path.startsWith("http://") && !path.startsWith("https://")) { path = "/" + path; } if (TomcatHelper.isTomcat7() && TomcatHelper.isStopping() && listeners.containsKey(path)) { return listeners.get(path); } Context context = contexts.remove(path); try { context.stop(); context.destroy(); } catch (Exception e) { throw new TomEERuntimeException(e); } Host host = (Host) context.getParent(); host.removeChild(context); return listeners.remove(completePath); } }
/** * Creates an openejb {@link AppModule} instance * from given tomcat context. * * @param standardContext tomcat context instance * @return a openejb application module */ private AppModule loadApplication(final StandardContext standardContext) { final ServletContext servletContext = standardContext.getServletContext(); final TomcatDeploymentLoader tomcatDeploymentLoader = new TomcatDeploymentLoader(standardContext, getId(standardContext)); final AppModule appModule; try { appModule = tomcatDeploymentLoader.load(new File(servletContext.getRealPath(".")).getParentFile()); } catch (OpenEJBException e) { throw new TomEERuntimeException(e); } // create the web module loadWebModule(appModule, standardContext); return appModule; }
public DeployMessage(final String path) { file = path; if (SystemInstance.get().getOptions().get(TOMEE_CLUSTER_DEPLOY_SEND_ARCHIVE, false)) { final ByteArrayOutputStream baos = new ByteArrayOutputStream(); FileInputStream fis = null; try { fis = new FileInputStream(path); IO.copy(fis, baos); archive = baos.toByteArray(); } catch (final Exception e) { throw new TomEERuntimeException(e); } finally { IO.close(fis); IO.close(baos); } } }
public void removeWsContainer(String path) { if (path == null) return; // assure context root with a leading slash if (!path.startsWith("/")) path = "/" + path; if (TomcatHelper.isTomcat7() && TomcatHelper.isStopping()) { return; } Context context = webserviceContexts.remove(path); if (WEBSERVICE_OLDCONTEXT_ACTIVE) { try { context.destroy(); context.stop(); } catch (Exception e) { throw new TomEERuntimeException(e); } Host host = (Host) context.getParent(); host.removeChild(context); } // else let tomcat manages its context }
/** * Creates an openejb {@link AppModule} instance * from given tomcat context. * * @param standardContext tomcat context instance * @return a openejb application module */ private AppModule loadApplication(final StandardContext standardContext) { // don't use getId since the app id shouldnt get the host (jndi) // final TomcatDeploymentLoader tomcatDeploymentLoader = new TomcatDeploymentLoader(standardContext, getId(standardContext)); String id = standardContext.getName(); if (id.startsWith("/")) { id = id.substring(1); } final TomcatDeploymentLoader tomcatDeploymentLoader = new TomcatDeploymentLoader(standardContext, id); final AppModule appModule; try { appModule = tomcatDeploymentLoader.load(Contexts.warPath(standardContext), configuredClasspath(standardContext)); } catch (final OpenEJBException e) { throw new TomEERuntimeException(e); } // create the web module loadWebModule(appModule, standardContext); return appModule; }
clazz = cl.loadClass(delegateClassName); } catch (final ClassNotFoundException e) { throw new TomEERuntimeException(e); throw new TomEERuntimeException(e);
clazz = cl.loadClass(realmClass); } catch (final ClassNotFoundException e) { throw new TomEERuntimeException(e); throw new TomEERuntimeException(e); throw new TomEERuntimeException("realm can't be retrieved from cdi");
final TomEERuntimeException tre = new TomEERuntimeException(e); DeploymentExceptionManager dem = SystemInstance.get().getComponent(DeploymentExceptionManager.class); dem.saveDeploymentException(contextInfo.appInfo, tre);
final TomEERuntimeException tre = new TomEERuntimeException(e); final DeploymentExceptionManager dem = SystemInstance.get().getComponent(DeploymentExceptionManager.class); dem.saveDeploymentException(contextInfo.appInfo, tre); throw RuntimeException.class.cast(e); throw new TomEERuntimeException(e);