public ClassLoader getClassLoader() { return ejbModule.getClassLoader(); }
private org.apache.openejb.api.EjbDeployment getEjbDeploymentAnnotation(final EjbModule ejbModule, final EnterpriseBean bean) { try { final Class<?> beanClass = ejbModule.getClassLoader().loadClass(bean.getEjbClass()); return beanClass.getAnnotation(org.apache.openejb.api.EjbDeployment.class); } catch (final ClassNotFoundException e) { // this should never happen, the class has already been loaded a ton of times by this point // unfortunately we have some unit tests that prevent us from throwing an exception just in case // Those are OpenEjb2ConversionTest and SunCmpConversionTest return null; } }
@Override public void close() { if (ejbModule.getClassLoader() instanceof TempClassLoader) { ClassLoaderUtil.destroyClassLoader(ejbModule.getClassLoader().getParent()); ClassLoaderUtil.destroyClassLoader(ejbModule.getClassLoader()); } super.close(); }
private org.apache.openejb.api.EjbDeployment getEjbDeploymentAnnotation(EjbModule ejbModule, EnterpriseBean bean) { try { Class<?> beanClass = ejbModule.getClassLoader().loadClass(bean.getEjbClass()); return beanClass.getAnnotation(org.apache.openejb.api.EjbDeployment.class); } catch (ClassNotFoundException e) { // this should never happen, the class has already been loaded a ton of times by this point // unfortunately we have some unit tests that prevent us from throwing an exception just in case // Those are OpenEjb2ConversionTest and SunCmpConversionTest return null; } }
@Override public void validate(final EjbModule ejbModule) { check(ejbModule.getClassLoader()); }
private org.apache.openejb.api.EjbDeployment getEjbDeploymentAnnotation(final EjbModule ejbModule, final EnterpriseBean bean) { try { final Class<?> beanClass = ejbModule.getClassLoader().loadClass(bean.getEjbClass()); return beanClass.getAnnotation(org.apache.openejb.api.EjbDeployment.class); } catch (final ClassNotFoundException e) { // this should never happen, the class has already been loaded a ton of times by this point // unfortunately we have some unit tests that prevent us from throwing an exception just in case // Those are OpenEjb2ConversionTest and SunCmpConversionTest return null; } }
public EjbJarInfo configureApplication(EjbModule ejbModule) throws OpenEJBException { ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader(); Thread.currentThread().setContextClassLoader(ejbModule.getClassLoader()); try { return configurationFactory.configureApplication(ejbModule); } finally { Thread.currentThread().setContextClassLoader(oldClassLoader); } }
@Override public void validate(final EjbModule ejbModule) { check(ejbModule.getClassLoader()); }
public void validate(final AppModule appModule) { final ClassLoader loader = Thread.currentThread().getContextClassLoader(); try { for (final EjbModule ejbModule : appModule.getEjbModules()) { Thread.currentThread().setContextClassLoader(ejbModule.getClassLoader()); module = ejbModule; validate(ejbModule); } for (final ClientModule clientModule : appModule.getClientModules()) { Thread.currentThread().setContextClassLoader(clientModule.getClassLoader()); module = clientModule; validate(clientModule); } } finally { Thread.currentThread().setContextClassLoader(loader); } }
public void validate(final AppModule appModule) { final ClassLoader loader = Thread.currentThread().getContextClassLoader(); try { for (final EjbModule ejbModule : appModule.getEjbModules()) { Thread.currentThread().setContextClassLoader(ejbModule.getClassLoader()); module = ejbModule; validate(ejbModule); } for (final ClientModule clientModule : appModule.getClientModules()) { Thread.currentThread().setContextClassLoader(clientModule.getClassLoader()); module = clientModule; validate(clientModule); } } finally { Thread.currentThread().setContextClassLoader(loader); } }
public EjbJarInfo configureApplication(EjbModule ejbModule) throws OpenEJBException { AppModule appModule = new AppModule(ejbModule.getClassLoader(), ejbModule.getJarLocation()); appModule.getEjbModules().add(ejbModule); AppInfo appInfo = configureApplication(appModule); return appInfo.ejbJars.get(0); }
@Override public AppModule deploy(final AppModule appModule) throws OpenEJBException { for (final EjbModule ejbModule : appModule.getEjbModules()) { final ClassLoader classLoader = ejbModule.getClassLoader(); for (final EnterpriseBean bean : ejbModule.getEjbJar().getEnterpriseBeans()) { if (bean.getEjbClass() == null) { continue; } try { final Class<?> clazz = classLoader.loadClass(bean.getEjbClass()); process(clazz, bean); } catch (final ClassNotFoundException e) { // skip, we'll get this in validation } } } return appModule; }
public void setFinderOnContextConfig(final StandardContext standardContext, final AppModule appModule) { final OpenEJBContextConfig openEJBContextConfig = findOpenEJBContextConfig(standardContext); if (openEJBContextConfig != null) { for (final EjbModule ejbModule : appModule.getEjbModules()) { if (ejbModule.getFile() != null && warPath(standardContext).equals(rootPath(ejbModule.getFile()))) { openEJBContextConfig.finder(ejbModule.getFinder(), ejbModule.getClassLoader()); break; } } } }
@Override public AppModule deploy(final AppModule appModule) throws OpenEJBException { for (final EjbModule ejbModule : appModule.getEjbModules()) { final ClassLoader classLoader = ejbModule.getClassLoader(); for (final EnterpriseBean bean : ejbModule.getEjbJar().getEnterpriseBeans()) { if (bean.getEjbClass() == null) { continue; } try { final Class<?> clazz = classLoader.loadClass(bean.getEjbClass()); process(clazz, bean); } catch (final ClassNotFoundException e) { // skip, we'll get this in validation } } } return appModule; }
final Class<?> ejbClass; try { ejbClass = module.getClassLoader().loadClass(bean.getEjbClass()); } catch (final ClassNotFoundException e) { logger.warning("can't load " + bean.getEjbClass());
final Class<?> ejbClass; try { ejbClass = module.getClassLoader().loadClass(bean.getEjbClass()); } catch (final ClassNotFoundException e) { logger.warning("can't load " + bean.getEjbClass());
buildAnnotatedRefs(bean, handlersFinder, ejbModule.getClassLoader());
buildAnnotatedRefs(bean, handlersFinder, ejbModule.getClassLoader());
processResourceEnvRef(ref, ejbDeployment, appResources, ejbModule.getClassLoader()); processResourceEnvRef(ref, ejbDeployment, appResources, ejbModule.getClassLoader());
public void validate(final EjbModule ejbModule) { final ClassLoader loader = ejbModule.getClassLoader(); for (final EnterpriseBean bean : ejbModule.getEjbJar().getEnterpriseBeans()) { try {