/** * @see javax.naming.spi.InitialContextFactory#getInitialContext(java.util.Hashtable) */ public Context getInitialContext(Hashtable environment) throws NamingException { return super.getInitialContext(transformEnvironment(environment)); }
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; } }
/** * set the properties for this instance as retrieved from JNDI * * @param props */ public synchronized void setProperties(Properties props) { this.properties = props; buildFromProperties(props); }
public NamingEnumeration 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(); } }
public NamingEnumeration 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(); } }
public Object lookupLink(String name) throws NamingException { return lookup(name); }
protected ReadOnlyContext createContext(Hashtable environment, Map<String, Object> data) { return new ReadOnlyContext(environment, data); }
public Object next() throws NamingException { return nextElement(); }
public Object next() throws NamingException { return nextElement(); }
/** * @param in * @throws IOException * @throws ClassNotFoundException * @see java.io.Externalizable#readExternal(java.io.ObjectInput) */ public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { Properties props = (Properties)in.readObject(); if (props != null) { setProperties(props); } }
/** * Get the properties from this instance for storing in JNDI * * @return the properties */ public synchronized Properties getProperties() { if (this.properties == null) { this.properties = new Properties(); } populateProperties(this.properties); return this.properties; }
/** * @param out * @throws IOException * @see java.io.Externalizable#writeExternal(java.io.ObjectOutput) */ public void writeExternal(ObjectOutput out) throws IOException { out.writeObject(getProperties()); }
public NamingEnumeration listBindings(Name name) throws NamingException { return listBindings(name.toString()); }
public Object lookupLink(Name name) throws NamingException { return lookupLink(name.toString()); }
public NamingEnumeration list(Name name) throws NamingException { return list(name.toString()); }
/** * Retrive a Reference for this instance to store in JNDI * * @return the built Reference * @throws NamingException if error on building Reference */ public Reference getReference() throws NamingException { return JNDIReferenceFactory.createReference(this.getClass().getName(), this); }
public Object nextElement() { Map.Entry entry = getNext(); return new Binding((String)entry.getKey(), entry.getValue()); } }
/** * Factory method to create a new connection factory from the given * environment */ protected ActiveMQConnectionFactory createConnectionFactory(Hashtable environment) throws URISyntaxException { ActiveMQConnectionFactory answer = needsXA(environment) ? new ActiveMQXAConnectionFactory() : new ActiveMQConnectionFactory(); Properties properties = new Properties(); properties.putAll(environment); answer.setProperties(properties); return answer; }
public Object lookup(Name name) throws NamingException { return lookup(name.toString()); }
protected ReadOnlyContext newContext() { return new ReadOnlyContext(); }