(Name name, NamingEntry entry)
| 561 | |
| 562 | |
| 563 | private Object getObjectInstance(Name name, NamingEntry entry) throws Exception { |
| 564 | Object obj = null; |
| 565 | if (!GRAAL) { |
| 566 | obj = NamingManager.getObjectInstance(entry.value, name, this, env); |
| 567 | } else { |
| 568 | // NamingManager.getObjectInstance would simply return the reference here |
| 569 | // Use the configured object factory to resolve it directly if possible |
| 570 | // Note: This may need manual constructor reflection configuration |
| 571 | Reference reference = (Reference) entry.value; |
| 572 | String factoryClassName = reference.getFactoryClassName(); |
| 573 | if (factoryClassName != null) { |
| 574 | Class<?> factoryClass = getClass().getClassLoader().loadClass(factoryClassName); |
| 575 | ObjectFactory factory = (ObjectFactory) factoryClass.getDeclaredConstructor().newInstance(); |
| 576 | obj = factory.getObjectInstance(entry.value, name, this, env); |
| 577 | } |
| 578 | } |
| 579 | return obj; |
| 580 | } |
| 581 | |
| 582 | /** |
| 583 | * Binds a name to an object. All intermediate contexts and the target context (that named by all but terminal |
no test coverage detected