MCPcopy Create free account
hub / github.com/apache/tomcat / getObjectInstance

Method getObjectInstance

java/org/apache/naming/NamingContext.java:563–580  ·  view source on GitHub ↗
(Name name, NamingEntry entry)

Source from the content-addressed store, hash-verified

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

Callers 1

lookupMethod · 0.95

Calls 4

getClassLoaderMethod · 0.65
newInstanceMethod · 0.65
getFactoryClassNameMethod · 0.45
loadClassMethod · 0.45

Tested by

no test coverage detected