/** * {@inheritDoc} */ public String browse() throws DSBWebServiceException { String result = null; try { InitialContext initialContext = this.jndiService.getInitialContext(); result = JNDIUtil.browseJNDI(initialContext, null, 0); System.out.println(result); } catch (NamingException e) { throw new DSBWebServiceException(e.getMessage()); } return result; }
public String browseJNDI() throws PetalsException { if (this.containerConfiguration == null) { throw new PetalsException("The container configuration is not properly set"); } String result = null; Component jndiComponent = FractalHelper.getRecursiveComponentByName( this.petalsContentController, FractalHelper.JNDI_COMPONENT); try { JNDIService jndiService = (JNDIService) jndiComponent.getFcInterface("service"); InitialContext initialContext = jndiService.getInitialContext(); if (this.domainConfiguration.getJndiConfiguration() == null) { result = JNDIUtil.browseJNDI(initialContext, (String) null, 0); } else { URI providerUrl = this.domainConfiguration.getJndiConfiguration() .getJndiProviderUrl(); result = JNDIUtil.browseJNDI(initialContext, providerUrl.getHost(), providerUrl .getPort()); } } catch (NoSuchInterfaceException e) { throw new PetalsException(e); } catch (NamingException e) { throw new PetalsException(e); } return result; }
@Override public String browseJNDI() throws PetalsException { if (this.containerConfiguration == null) { throw new PetalsException("The container configuration is not properly set"); } String result = null; Component jndiComponent = FractalHelper.getRecursiveComponentByName( this.petalsContentController, FractalHelper.JNDI_COMPONENT); try { JNDIService jndiService = (JNDIService) jndiComponent.getFcInterface("service"); InitialContext initialContext = jndiService.getInitialContext(); if (this.domainConfiguration.getJndiConfiguration() == null) { result = JNDIUtil.browseJNDI(initialContext, (String) null, 0); } else { URI providerUrl = this.domainConfiguration.getJndiConfiguration() .getJndiProviderUrl(); result = JNDIUtil.browseJNDI(initialContext, providerUrl.getHost(), providerUrl .getPort()); } } catch (NoSuchInterfaceException e) { throw new PetalsException(e); } catch (NamingException e) { throw new PetalsException(e); } return result; }