contextTransaction.setProperty(Constants.FACTORY, UserTransactionFactory.class.getName());
naming.setTransaction(contextTransaction);
}
public void mergeRef(NamingResources naming, EnvEntryInfo ref) {
ContextEnvironment environment = naming.findEnvironment(ref.name);
boolean addEntry = false;
if (environment == null) {
environment = new ContextEnvironment();
environment.setName(ref.name);
addEntry = true;
}
environment.setType(ref.type);
environment.setValue(ref.value);
if (addEntry) {
naming.addEnvironment(environment);
}
if (replaceEntry) {
ContextAccessController.setWritable(namingContextListener.getName(), standardContext);
if (!addEntry) namingContextListener.removeEnvironment(environment.getName());
namingContextListener.addEnvironment(environment);
ContextAccessController.setReadOnly(namingContextListener.getName());
}
}