@Override public Object lookup(String name) throws NamingException { try { return super.lookup(name); } catch (NameNotFoundException e) { Object answer = createEntry(name); if (answer == null) { throw e; } internalBind(name, answer); return answer; } }
@Override public Object lookupLink(String name) throws NamingException { return lookup(name); }
/** * set the properties for this instance as retrieved from JNDI * * @param props * The properties to apply to this instance. * * @return a new, unmodifiable, map containing any unused properties, or empty if none were. */ synchronized void setProperties(Properties props) { buildFromProperties(props); }
if (object instanceof Reference) { Reference reference = (Reference) object; Class<?> theClass = loadClass(this, reference.getClassName()); if (JNDIStorable.class.isAssignableFrom(theClass)) { JNDIStorable store = (JNDIStorable) theClass.newInstance(); store.setProperties(getProperties(reference)); result = store;
@Override public NamingEnumeration<NameClassPair> list(String name) throws NamingException { Object o = lookup(name); if (o == this) { return new ListEnumeration(); } else if (o instanceof Context) { return ((Context) o).list(""); } else { throw new NotContextException(); } }
@Override public NamingEnumeration<Binding> listBindings(String name) throws NamingException { Object o = lookup(name); if (o == this) { return new ListBindingEnumeration(); } else if (o instanceof Context) { return ((Context) o).listBindings(""); } else { throw new NotContextException(); } }
/** * Retrieve a Reference for this instance to store in JNDI * * @return the built Reference * @throws NamingException * if error on building Reference */ @Override public Reference getReference() throws NamingException { return JNDIReferenceFactory.createReference(this.getClass().getName(), this); }
protected ReadOnlyContext createContext(Hashtable<?, ?> environment, Map<String, Object> data) { return new ReadOnlyContext(environment, data); }
@Override public Object next() throws NamingException { return nextElement(); }
@Override public Object next() throws NamingException { return nextElement(); }
/** * Get the properties from this instance for storing in JNDI * * @return the properties */ synchronized Properties getProperties() { Properties properties = new Properties(); populateProperties(properties); return properties; }
/** * Method for class's implementing externalizable to delegate to if not custom implementing. * * @param out * @throws IOException * @see java.io.Externalizable#writeExternal(java.io.ObjectOutput) */ public void writeObject(ObjectOutput out) throws IOException { out.writeObject(getProperties()); }
@Override public Object lookupLink(Name name) throws NamingException { return lookupLink(name.toString()); }
/** * Method for class's implementing externalizable to delegate to if not custom implementing. * * @param in * @throws IOException * @throws ClassNotFoundException * @see java.io.Externalizable#readExternal(java.io.ObjectInput) */ public void readObject(ObjectInput in) throws IOException, ClassNotFoundException { Properties props = (Properties)in.readObject(); if (props != null) { setProperties(props); } }
@Override public NamingEnumeration<NameClassPair> list(Name name) throws NamingException { return list(name.toString()); }
@Override public NamingEnumeration<Binding> listBindings(Name name) throws NamingException { return listBindings(name.toString()); }
@Override public Object nextElement() { Map.Entry<String, Object> entry = getNext(); return new Binding(entry.getKey(), entry.getValue()); } }
@Override public Object nextElement() { Map.Entry<String, Object> entry = getNext(); return new NameClassPair(entry.getKey(), entry.getValue().getClass().getName()); } }
@Override public Object lookup(Name name) throws NamingException { return lookup(name.toString()); }
protected ReadOnlyContext newContext() { return new ReadOnlyContext(); }