本文整理了Java中org.apache.catalina.Context.bind()
方法的一些代码示例,展示了Context.bind()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Context.bind()
方法的具体详情如下:
包路径:org.apache.catalina.Context
类名称:Context
方法名:bind
暂无
代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core
private void bind(Context context) {
if (clBindRequired) {
context.bind(Globals.IS_SECURITY_ENABLED, MY_CLASSLOADER);
}
}
代码示例来源:origin: org.apache.tomcat/tomcat-catalina
private void bind(Context context) {
if (clBindRequired) {
context.bind(Globals.IS_SECURITY_ENABLED, MY_CLASSLOADER);
}
}
代码示例来源:origin: org.apache.tomcat/tomcat-catalina
@Override
public void run() {
ClassLoader oldCL = context.bind(Globals.IS_SECURITY_ENABLED, null);
try {
wrapped.run();
} finally {
context.unbind(Globals.IS_SECURITY_ENABLED, oldCL);
}
// Since this runnable is not executing as a result of a socket
// event, we need to ensure that any registered dispatches are
// executed.
coyoteRequest.action(ActionCode.DISPATCH_EXECUTE, null);
}
}
代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core
@Override
public void run() {
ClassLoader oldCL = context.bind(Globals.IS_SECURITY_ENABLED, null);
try {
wrapped.run();
} finally {
context.unbind(Globals.IS_SECURITY_ENABLED, oldCL);
}
// Since this runnable is not executing as a result of a socket
// event, we need to ensure that any registered dispatches are
// executed.
coyoteRequest.action(ActionCode.DISPATCH_EXECUTE, null);
}
}
代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core
@Override
public void fireOnComplete() {
List<AsyncListenerWrapper> listenersCopy = new ArrayList<>();
listenersCopy.addAll(listeners);
ClassLoader oldCL = context.bind(Globals.IS_SECURITY_ENABLED, null);
try {
for (AsyncListenerWrapper listener : listenersCopy) {
try {
listener.fireOnComplete(event);
} catch (Throwable t) {
ExceptionUtils.handleThrowable(t);
log.warn("onComplete() failed for listener of type [" +
listener.getClass().getName() + "]", t);
}
}
} finally {
context.fireRequestDestroyEvent(request.getRequest());
clearServletRequestResponse();
context.unbind(Globals.IS_SECURITY_ENABLED, oldCL);
}
}
代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core
public boolean timeout() {
AtomicBoolean result = new AtomicBoolean();
request.getCoyoteRequest().action(ActionCode.ASYNC_TIMEOUT, result);
// Avoids NPEs during shutdown. A call to recycle will null this field.
Context context = this.context;
if (result.get()) {
ClassLoader oldCL = context.bind(false, null);
try {
List<AsyncListenerWrapper> listenersCopy = new ArrayList<>();
listenersCopy.addAll(listeners);
for (AsyncListenerWrapper listener : listenersCopy) {
try {
listener.fireOnTimeout(event);
} catch (Throwable t) {
ExceptionUtils.handleThrowable(t);
log.warn("onTimeout() failed for listener of type [" +
listener.getClass().getName() + "]", t);
}
}
request.getCoyoteRequest().action(
ActionCode.ASYNC_IS_TIMINGOUT, result);
} finally {
context.unbind(false, oldCL);
}
}
return !result.get();
}
代码示例来源:origin: org.apache.tomcat/tomcat-catalina
public boolean timeout() {
AtomicBoolean result = new AtomicBoolean();
request.getCoyoteRequest().action(ActionCode.ASYNC_TIMEOUT, result);
// Avoids NPEs during shutdown. A call to recycle will null this field.
Context context = this.context;
if (result.get()) {
ClassLoader oldCL = context.bind(false, null);
try {
List<AsyncListenerWrapper> listenersCopy = new ArrayList<>();
listenersCopy.addAll(listeners);
for (AsyncListenerWrapper listener : listenersCopy) {
try {
listener.fireOnTimeout(event);
} catch (Throwable t) {
ExceptionUtils.handleThrowable(t);
log.warn(sm.getString("asyncContextImpl.onTimeoutError",
listener.getClass().getName()), t);
}
}
request.getCoyoteRequest().action(
ActionCode.ASYNC_IS_TIMINGOUT, result);
} finally {
context.unbind(false, oldCL);
}
}
return !result.get();
}
代码示例来源:origin: org.apache.tomcat/tomcat-catalina
@Override
public void fireOnComplete() {
List<AsyncListenerWrapper> listenersCopy = new ArrayList<>();
listenersCopy.addAll(listeners);
ClassLoader oldCL = context.bind(Globals.IS_SECURITY_ENABLED, null);
try {
for (AsyncListenerWrapper listener : listenersCopy) {
try {
listener.fireOnComplete(event);
} catch (Throwable t) {
ExceptionUtils.handleThrowable(t);
log.warn(sm.getString("asyncContextImpl.onCompleteError",
listener.getClass().getName()), t);
}
}
} finally {
context.fireRequestDestroyEvent(request.getRequest());
clearServletRequestResponse();
context.unbind(Globals.IS_SECURITY_ENABLED, oldCL);
}
}
代码示例来源:origin: org.apache.tomcat/tomcat-catalina
ClassLoader oldThreadContextCL = null;
if (localDataSource) {
oldThreadContextCL = context.bind(Globals.IS_SECURITY_ENABLED, null);
代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core
ClassLoader oldThreadContextCL = null;
if (localDataSource) {
oldThreadContextCL = context.bind(Globals.IS_SECURITY_ENABLED, null);
代码示例来源:origin: pivotalsoftware/session-managers
ObjectInputStream in = null;
Context context = this.manager.getContext();
ClassLoader oldThreadContextCL = context.bind(Globals.IS_SECURITY_ENABLED, null);
代码示例来源:origin: com.gopivotal.manager/common
ObjectInputStream in = null;
Context context = this.manager.getContext();
ClassLoader oldThreadContextCL = context.bind(Globals.IS_SECURITY_ENABLED, null);
代码示例来源:origin: org.apache.tomcat/tomcat-catalina
ClassLoader oldThreadContextCL = context.bind(Globals.IS_SECURITY_ENABLED, null);
代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core
ClassLoader oldThreadContextCL = context.bind(Globals.IS_SECURITY_ENABLED, null);
代码示例来源:origin: org.apache.tomcat/tomcat-catalina
ClassLoader oldThreadContextCL = context.bind(Globals.IS_SECURITY_ENABLED, null);
代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core
protected void processChildren(Container container) {
ClassLoader originalClassLoader = null;
try {
if (container instanceof Context) {
Loader loader = ((Context) container).getLoader();
// Loader will be null for FailedContext instances
if (loader == null) {
return;
}
// Ensure background processing for Contexts and Wrappers
// is performed under the web app's class loader
originalClassLoader = ((Context) container).bind(false, null);
}
container.backgroundProcess();
Container[] children = container.findChildren();
for (int i = 0; i < children.length; i++) {
if (children[i].getBackgroundProcessorDelay() <= 0) {
processChildren(children[i]);
}
}
} catch (Throwable t) {
ExceptionUtils.handleThrowable(t);
log.error("Exception invoking periodic operation: ", t);
} finally {
if (container instanceof Context) {
((Context) container).unbind(false, originalClassLoader);
}
}
}
}
代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core
ClassLoader oldThreadContextCL = context.bind(Globals.IS_SECURITY_ENABLED, null);
代码示例来源:origin: org.apache.tomcat/tomcat-catalina
protected void processChildren(Container container) {
ClassLoader originalClassLoader = null;
try {
if (container instanceof Context) {
Loader loader = ((Context) container).getLoader();
// Loader will be null for FailedContext instances
if (loader == null) {
return;
}
// Ensure background processing for Contexts and Wrappers
// is performed under the web app's class loader
originalClassLoader = ((Context) container).bind(false, null);
}
container.backgroundProcess();
Container[] children = container.findChildren();
for (int i = 0; i < children.length; i++) {
if (children[i].getBackgroundProcessorDelay() <= 0) {
processChildren(children[i]);
}
}
} catch (Throwable t) {
ExceptionUtils.handleThrowable(t);
log.error(sm.getString("containerBase.backgroundProcess.error"), t);
} finally {
if (container instanceof Context) {
((Context) container).unbind(false, originalClassLoader);
}
}
}
}
代码示例来源:origin: org.apache.tomcat/tomcat-catalina
context.bind(Globals.IS_SECURITY_ENABLED, MY_CLASSLOADER);
代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core
context.bind(Globals.IS_SECURITY_ENABLED, MY_CLASSLOADER);
内容来源于网络,如有侵权,请联系作者删除!