use of javax.naming.Referenceable in project jackrabbit by apache.
the class RepositoryImpl method getReference.
//------------------------------------------------------< Referenceable >---
/**
* @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<RefAddr> en = confref.getReference().getAll(); en.hasMoreElements(); ) {
reference.add(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;
} else {
throw new javax.naming.OperationNotSupportedException("Contained RepositoryConfig needs to implement javax.naming.Referenceable");
}
}
Aggregations