/** * Make sure a JNDI context is available */ public boolean isAvailable() { try { GeoTools.getInitialContext(GeoTools.getDefaultHints()); return true; } catch (Exception e) { return false; } }
/** * Make sure a JNDI context is available */ public boolean isAvailable() { try { GeoTools.getInitialContext(GeoTools.getDefaultHints()); return true; } catch (Exception e) { return false; } }
/** * Determines if the datastore is available. * <p> * Check in an Initial Context is available, that is all what can be done * Checking for the right jdbc jars in the classpath is not possible here * </p> */ public boolean isAvailable() { try { GeoTools.getInitialContext(GeoTools.getDefaultHints()); return true; } catch (NamingException e) { return false; } }
ctx = GeoTools.getInitialContext(GeoTools.getDefaultHints()); } catch (NamingException e) { throw new RuntimeException(e);
/** * Implementation of {@code fixName} method. If the context is {@code null}, then * the {@linkplain #getInitialContext GeoTools initial context} will be fetch only * when first needed. */ private static String fixName(Context context, final String name, final Hints hints) { String fixed = null; if (name != null) { final StringTokenizer tokens = new StringTokenizer(name, ":/"); while (tokens.hasMoreTokens()) { final String part = tokens.nextToken(); if (fixed == null) { fixed = part; } else try { if (context == null) { context = getInitialContext(hints); } fixed = context.composeName(fixed, part); } catch (NamingException e) { Logging.unexpectedException(GeoTools.class, "fixName", e); return name; } } } return fixed; }
public DataSource createNewDataSource(Map params) throws IOException { String refName = (String) JNDI_REFNAME.lookUp(params); try { return (DataSource) GeoTools.getInitialContext(GeoTools.getDefaultHints()).lookup(refName); } catch (Exception e) { throw new DataSourceException("Could not find the specified data source in JNDI", e); } }
ctx = GeoTools.getInitialContext(GeoTools.getDefaultHints()); } catch (NamingException e) { throw new RuntimeException(e);
public DataSource createNewDataSource(Map params) throws IOException { String refName = (String) JNDI_REFNAME.lookUp(params); try { return (DataSource) GeoTools.getInitialContext(GeoTools.getDefaultHints()).lookup(refName); } catch (Exception e) { throw new DataSourceException("Could not find the specified data source in JNDI", e); } }
/** * Determines if the datastore is available. * <p> * Check in an Initial Context is available, that is all what can be done Checking for the right * jdbc jars in the classpath is not possible here * </p> * * @see org.geotools.data.DataAccessFactory#isAvailable() */ public boolean isAvailable() { try { GeoTools.getInitialContext(GeoTools.getDefaultHints()); } catch (NamingException e) { return false; } return delegateFactory.isAvailable(); }