n.initCause(e); throw n; } catch (SecurityException ex) {
public Object getContent() throws NameNotFoundException { Properties p = new Properties(); p.put("java.naming.factory.initial", "org.apache.openejb.client.RemoteInitialContextFactory"); p.put("java.naming.provider.url", url); p.put("openejb.client.moduleId", "openejb/Deployment"); try { InitialContext ctx = new InitialContext(p); Object value = ctx.lookup(deploymentId); return value; } catch (NamingException e) { throw (NameNotFoundException) new NameNotFoundException().initCause(e); } } }
@Override public Object create(Context ctx) throws NamingException { // create the ValidatorFactory using the spec. if (null == validatorFactory) { try { validatorFactory = Validation.buildDefaultValidatorFactory(); } catch (ValidationException e) { _logger.log(Level.WARNING, "Unable to lookup {0}, or build a default Bean Validator Factory: {1}", new Object[]{nameForValidatorFactory, e}); NameNotFoundException ne = new NameNotFoundException(); ne.initCause(e); throw ne; } } return validatorFactory; } }
return value; } catch (NamingException e2) { throw (NameNotFoundException) new NameNotFoundException().initCause(e2);
public Object getContent() throws NameNotFoundException { Kernel kernel = getKernel(); AbstractName target; try { target = resolveTargetName(); } catch (GBeanNotFoundException e) { throw (NameNotFoundException) new NameNotFoundException("Could not resolve name query: " + abstractNameQueries).initCause(e); } Object entityManager; try { entityManager = kernel.invoke(target, "getEntityManager", new Object[] {Boolean.valueOf(transactionScoped), properties}, new String[] {boolean.class.getName(), Map.class.getName()}); } catch (Exception e) { throw (IllegalStateException) new IllegalStateException("Could not get entityManager").initCause(e); } if (entityManager == null) { throw new IllegalStateException("entity manager not returned. Target " + target + " not started"); } return entityManager; } }
public Object getContent() throws NameNotFoundException { Kernel kernel = getKernel(); AbstractName target; try { target = resolveTargetName(); } catch (GBeanNotFoundException e) { throw (NameNotFoundException) new NameNotFoundException("Could not resolve name query: " + abstractNameQueries).initCause(e); } Object entityManager; try { entityManager = kernel.invoke(target, "getEntityManager", new Object[] {Boolean.valueOf(transactionScoped), properties}, new String[] {boolean.class.getName(), Map.class.getName()}); } catch (Exception e) { throw (IllegalStateException) new IllegalStateException("Could not get entityManager").initCause(e); } if (entityManager == null) { throw new IllegalStateException("entity manager not returned. Target " + target + " not started"); } return entityManager; } }
} catch (final NoSuchElementException e) { throw (NamingException) new NameNotFoundException(baseName) .initCause(e);
public Object getContent() throws NameNotFoundException { Kernel kernel = getKernel(); AbstractName target; try { target = resolveTargetName(); } catch (GBeanNotFoundException e) { throw (NameNotFoundException) new NameNotFoundException("Could not resolve name query: " + abstractNameQueries).initCause(e); } Object entityManagerFactory; try { entityManagerFactory = kernel.getAttribute(target, "entityManagerFactory"); } catch (Exception e) { throw (IllegalStateException) new IllegalStateException("Could not get EntityManagerFactory").initCause(e); } if (entityManagerFactory == null) { throw new IllegalStateException("entity manager not returned. Target " + target + " not started"); } return entityManagerFactory; } }
protected S getGBean(Kernel kernel) throws NamingException { AbstractName target; try { target = resolveTargetName(kernel); } catch (GBeanNotFoundException e) { throw (NameNotFoundException) new NameNotFoundException("Could not resolve name query: " + abstractNameQueries).initCause(e); } Object proxy; try { proxy = kernel.getGBean(target); } catch (Exception e) { throw (IllegalStateException) new IllegalStateException("Could not get proxy").initCause(e); } if (proxy == null) { throw new IllegalStateException("Proxy not returned. Target " + target + " not started"); } checkClass(proxy, gbeanClass); return (S)proxy; }
public Object getContent() throws NamingException { Kernel kernel = getKernel(); try { return kernel.getGBean(UserTransaction.class); } catch (Exception e) { throw (NameNotFoundException) new NameNotFoundException("Error getting UserTransaction from kernel").initCause(e); } } }
public Object getContent() throws NamingException { Kernel kernel = getKernel(); try { return kernel.getGBean(UserTransaction.class); } catch (Exception e) { throw (NameNotFoundException) new NameNotFoundException("Error getting UserTransaction from kernel").initCause(e); } } }
public Object getContent() throws IllegalStateException, NameNotFoundException { AbstractName target; try { target = resolveTargetName(); } catch (GBeanNotFoundException e) { throw (NameNotFoundException)new NameNotFoundException("Could not resolve gbean from name query: " + abstractNameQueries).initCause(e); } try { return getKernel().getGBean(target); } catch (GBeanNotFoundException e) { IllegalStateException illegalStateException = new IllegalStateException(); illegalStateException.initCause(e); throw illegalStateException; } } }
public Object getContent() throws IllegalStateException, NameNotFoundException { AbstractName target; try { target = resolveTargetName(); } catch (GBeanNotFoundException e) { throw (NameNotFoundException)new NameNotFoundException("Could not resolve gbean from name query: " + abstractNameQueries).initCause(e); } try { return getKernel().getGBean(target); } catch (GBeanNotFoundException e) { IllegalStateException illegalStateException = new IllegalStateException(); illegalStateException.initCause(e); throw illegalStateException; } } }
public Object getContent() throws NameNotFoundException { Kernel kernel = getKernel(); AbstractName target; try { target = resolveTargetName(); } catch (GBeanNotFoundException e) { throw (NameNotFoundException) new NameNotFoundException("Could not resolve name query: " + abstractNameQueries).initCause(e); } Object entityManagerFactory; try { entityManagerFactory = kernel.getAttribute(target, "entityManagerFactory"); } catch (Exception e) { throw (IllegalStateException) new IllegalStateException("Could not get EntityManagerFactory").initCause(e); } if (entityManagerFactory == null) { throw new IllegalStateException("entity manager not returned. Target " + target + " not started"); } return entityManagerFactory; } }
public Object getContent() throws NamingException { Kernel kernel = getKernel(); try { AbstractName targetName = resolveTargetName(); return kernel.getAttribute(targetName, "ORB"); } catch (Exception e) { throw (NameNotFoundException) new NameNotFoundException("Error getting ORB attribute from CORBAGBean: name query =" + abstractNameQueries).initCause(e); } } }
public Object getContent() throws NamingException { Kernel kernel = getKernel(); try { AbstractName targetName = resolveTargetName(); return kernel.getAttribute(targetName, "ORB"); } catch (Exception e) { throw (NameNotFoundException) new NameNotFoundException("Error getting ORB attribute from CORBAGBean: name query =" + abstractNameQueries).initCause(e); } } }
public Object getContent() throws NamingException { Kernel kernel = getKernel(); try { AbstractName targetName = resolveTargetName(); return kernel.getAttribute(targetName, "handleDelegate"); } catch (Exception e) { throw (NameNotFoundException) new NameNotFoundException("Error getting handle delegate attribute from CORBAGBean: name query =" + abstractNameQueries).initCause(e); } } }
public Object getContent() throws NamingException { Kernel kernel = getKernel(); try { AbstractName targetName = resolveTargetName(); return kernel.getAttribute(targetName, "handleDelegate"); } catch (Exception e) { throw (NameNotFoundException) new NameNotFoundException("Error getting handle delegate attribute from CORBAGBean: name query =" + abstractNameQueries).initCause(e); } } }
public Object getContent() throws NameNotFoundException { try { AbstractName abstractName = resolveTargetName(); EjbDeployment ejbDeployment = (EjbDeployment) getKernel().getGBean(abstractName); if (remote) { return ejbDeployment.getEJBHome(); } else { return ejbDeployment.getEJBLocalHome(); } } catch (GBeanNotFoundException e) { throw (NameNotFoundException) new NameNotFoundException().initCause(e); } } }
n.initCause(e); throw n; } catch (SecurityException ex) {