/**
* @see Referenceable#getReference()
*/
public Reference getReference() throws NamingException {
if (config instanceof Referenceable) {
Referenceable confref = (Referenceable)config;
if (reference == null) {
reference = new Reference(RepositoryImpl.class.getName(), RepositoryImpl.Factory.class.getName(), null);
// carry over all addresses from referenceable config
for (Enumeration en = confref.getReference().getAll(); en.hasMoreElements(); ) {
reference.add((RefAddr)(en.nextElement()));
}
// also add the information required by factory class
reference.add(new StringRefAddr(Factory.RCF, confref.getReference().getFactoryClassName()));
reference.add(new StringRefAddr(Factory.RCC, config.getClass().getName()));
}
return reference;
}