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

Method getBoundContext

java/org/apache/naming/SelectorContext.java:345–370  ·  view source on GitHub ↗

Get the bound context. @return the Context bound with either the current thread or the current classloader @throws NamingException Bindings exception

()

Source from the content-addressed store, hash-verified

343 * @throws NamingException Bindings exception
344 */
345 protected Context getBoundContext() throws NamingException {
346
347 if (initialContext) {
348 String ICName = IC_PREFIX;
349 if (ContextBindings.isThreadBound()) {
350 ICName += ContextBindings.getThreadName();
351 } else if (ContextBindings.isClassLoaderBound()) {
352 ICName += ContextBindings.getClassLoaderName();
353 }
354 Context initialContext = ContextBindings.getContext(ICName);
355 if (initialContext == null) {
356 // Allocating a new context and binding it to the appropriate
357 // name
358 initialContext = new NamingContext(env, ICName);
359 ContextBindings.bindContext(ICName, initialContext);
360 }
361 return initialContext;
362 } else {
363 if (ContextBindings.isThreadBound()) {
364 return ContextBindings.getThread();
365 } else {
366 return ContextBindings.getClassLoader();
367 }
368 }
369
370 }
371
372
373 /**

Callers 15

lookupMethod · 0.95
bindMethod · 0.95
rebindMethod · 0.95
unbindMethod · 0.95
renameMethod · 0.95
listMethod · 0.95
listBindingsMethod · 0.95
destroySubcontextMethod · 0.95
createSubcontextMethod · 0.95
lookupLinkMethod · 0.95
getNameParserMethod · 0.95
addToEnvironmentMethod · 0.95

Calls 8

isThreadBoundMethod · 0.95
getThreadNameMethod · 0.95
isClassLoaderBoundMethod · 0.95
getClassLoaderNameMethod · 0.95
getContextMethod · 0.95
bindContextMethod · 0.95
getThreadMethod · 0.95
getClassLoaderMethod · 0.95

Tested by

no test coverage detected