本文整理了Java中org.apache.catalina.Wrapper.getParent()
方法的一些代码示例,展示了Wrapper.getParent()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Wrapper.getParent()
方法的具体详情如下:
包路径:org.apache.catalina.Wrapper
类名称:Wrapper
方法名:getParent
暂无
代码示例来源:origin: psi-probe/psi-probe
@Override
public void setWrapper(Wrapper wrapper) {
Valve valve = createValve();
if (wrapper != null) {
host = (Host) wrapper.getParent().getParent();
Engine engine = (Engine) host.getParent();
Service service = engine.getService();
connectors = service.findConnectors();
try {
deployerOName =
new ObjectName(host.getParent().getName() + ":type=Deployer,host=" + host.getName());
} catch (MalformedObjectNameException e) {
logger.trace("", e);
}
host.getPipeline().addValve(valve);
mbeanServer = ManagementFactory.getPlatformMBeanServer();
} else if (host != null) {
host.getPipeline().removeValve(valve);
}
}
代码示例来源:origin: org.glassfish.main.web/web-core
/**
* Set the Wrapper with which we are associated.
*
* @param wrapper The new wrapper
*/
public synchronized void setWrapper(Wrapper wrapper) {
this.wrapper = wrapper;
if (wrapper == null)
context = null;
else
context = (Context) wrapper.getParent();
}
代码示例来源:origin: org.apache.tomcat/tomcat-catalina
/**
* Set the Wrapper with which we are associated.
*
* @param wrapper The new wrapper
*/
@Override
public void setWrapper(Wrapper wrapper) {
this.wrapper = wrapper;
if (wrapper == null) {
context = null;
installedHost = null;
engine = null;
} else {
context = (Context) wrapper.getParent();
installedHost = (Host) context.getParent();
engine = (Engine) installedHost.getParent();
}
}
代码示例来源:origin: codefollower/Tomcat-Research
/**
* Set the Wrapper with which we are associated.
*
* @param wrapper The new wrapper
*/
@Override
public void setWrapper(Wrapper wrapper) {
this.wrapper = wrapper;
if (wrapper == null) {
context = null;
installedHost = null;
engine = null;
} else {
context = (Context) wrapper.getParent();
installedHost = (Host) context.getParent();
engine = (Engine) installedHost.getParent();
}
}
代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core
/**
* Set the Wrapper with which we are associated.
*
* @param wrapper The new wrapper
*/
@Override
public void setWrapper(Wrapper wrapper) {
this.wrapper = wrapper;
if (wrapper == null) {
context = null;
installedHost = null;
engine = null;
} else {
context = (Context) wrapper.getParent();
installedHost = (Host) context.getParent();
engine = (Engine) installedHost.getParent();
}
}
代码示例来源:origin: org.jboss.web/jbossweb
public void sessionDestroyed(HttpSessionEvent se) {
// Close all Comet connections associated with this session
Request[] reqs = (Request[])
se.getSession().getAttribute(cometRequestsAttribute);
if (reqs != null) {
for (int i = 0; i < reqs.length; i++) {
Request req = reqs[i];
try {
req.getEvent().close();
} catch (Exception e) {
req.getWrapper().getParent().getLogger().warn(MESSAGES.eventValveSessionListenerException(), e);
}
}
}
}
代码示例来源:origin: jboss.web/jbossweb
public void sessionDestroyed(HttpSessionEvent se) {
// Close all Comet connections associated with this session
Request[] reqs = (Request[])
se.getSession().getAttribute(cometRequestsAttribute);
if (reqs != null) {
for (int i = 0; i < reqs.length; i++) {
Request req = reqs[i];
try {
req.getEvent().close();
} catch (Exception e) {
req.getWrapper().getParent().getLogger().warn(sm.getString(
"cometConnectionManagerValve.listenerEvent"), e);
}
}
}
}
代码示例来源:origin: org.glassfish.web/web-glue
public void instanceEvent(InstanceEvent event) {
Context context = (Context) event.getWrapper().getParent();
if (!(context instanceof WebModule)) {
return;
}
WebModule wm = (WebModule)context;
init(wm);
InstanceEvent.EventType eventType = event.getType();
if(_logger.isLoggable(Level.FINEST)) {
_logger.log(Level.FINEST,"*** InstanceEvent: " + eventType);
}
if (eventType.isBefore) {
handleBeforeEvent(event, eventType);
} else {
handleAfterEvent(event, eventType);
}
}
代码示例来源:origin: org.apache.geronimo.modules/geronimo-tomcat6
public void instanceEvent(InstanceEvent event) {
if (event.getType().equals(InstanceEvent.BEFORE_DISPATCH_EVENT)) {
Container parent = event.getWrapper().getParent();
if (parent instanceof GeronimoStandardContext) {
beforeDispatch((GeronimoStandardContext) parent, event.getRequest(), event.getResponse());
}
}
if (event.getType().equals(InstanceEvent.AFTER_DISPATCH_EVENT)) {
Container parent = event.getWrapper().getParent();
if (parent instanceof GeronimoStandardContext) {
afterDispatch((GeronimoStandardContext) parent, event.getRequest(), event.getResponse());
}
}
}
代码示例来源:origin: org.apache.catalina/com.springsource.org.apache.catalina
/**
* Unregister wrapper.
*/
private void unregisterWrapper(Wrapper wrapper) {
String contextPath = ((Context) wrapper.getParent()).getPath();
String wrapperName = wrapper.getName();
if ("/".equals(contextPath)) {
contextPath = "";
}
String version = ((Context) wrapper.getParent()).getWebappVersion();
String hostName = wrapper.getParent().getParent().getName();
String[] mappings = wrapper.findMappings();
for (String mapping : mappings) {
mapper.removeWrapper(hostName, contextPath, version, mapping);
}
if(log.isDebugEnabled()) {
log.debug(sm.getString("mapperListener.unregisterWrapper",
wrapperName, contextPath, connector));
}
}
代码示例来源:origin: com.ovea.tajin.server/tajin-server-jetty9
/**
* Unregister wrapper.
*/
private void unregisterWrapper(Wrapper wrapper) {
String contextPath = ((Context) wrapper.getParent()).getPath();
String wrapperName = wrapper.getName();
if ("/".equals(contextPath)) {
contextPath = "";
}
String version = ((Context) wrapper.getParent()).getWebappVersion();
String hostName = wrapper.getParent().getParent().getName();
String[] mappings = wrapper.findMappings();
for (String mapping : mappings) {
mapper.removeWrapper(hostName, contextPath, version, mapping);
}
if(log.isDebugEnabled()) {
log.debug(sm.getString("mapperListener.unregisterWrapper",
wrapperName, contextPath, connector));
}
}
代码示例来源:origin: codefollower/Tomcat-Research
/**
* Unregister wrapper.
*/
private void unregisterWrapper(Wrapper wrapper) {
String contextPath = ((Context) wrapper.getParent()).getPath();
String wrapperName = wrapper.getName();
if ("/".equals(contextPath)) {
contextPath = "";
}
String version = ((Context) wrapper.getParent()).getWebappVersion();
String hostName = wrapper.getParent().getParent().getName();
String[] mappings = wrapper.findMappings();
for (String mapping : mappings) {
mapper.removeWrapper(hostName, contextPath, version, mapping);
}
if(log.isDebugEnabled()) {
log.debug(sm.getString("mapperListener.unregisterWrapper",
wrapperName, contextPath, service));
}
}
代码示例来源:origin: org.apache.geronimo.modules/geronimo-tomcat
public void instanceEvent(InstanceEvent event) {
if (event.getType().equals(InstanceEvent.BEFORE_DISPATCH_EVENT)) {
Container parent = event.getWrapper().getParent();
if (parent instanceof GeronimoStandardContext) {
beforeDispatch((GeronimoStandardContext) parent, event
.getRequest(), event.getResponse());
}
}
if (event.getType().equals(InstanceEvent.AFTER_DISPATCH_EVENT)) {
Container parent = event.getWrapper().getParent();
if (parent instanceof GeronimoStandardContext) {
afterDispatch((GeronimoStandardContext) parent, event
.getRequest(), event.getResponse());
}
}
}
代码示例来源:origin: com.ovea.tajin.server/tajin-server-jetty9
/**
* Set the Wrapper with which we are associated.
*
* @param wrapper The new wrapper
*/
@Override
public void setWrapper(Wrapper wrapper) {
this.wrapper = wrapper;
if (wrapper == null) {
context = null;
installedHost = null;
engine = null;
} else {
context = (Context) wrapper.getParent();
installedHost = (Host) context.getParent();
engine = (Engine) installedHost.getParent();
}
// Retrieve the MBean server
mBeanServer = Registry.getRegistry(null, null).getMBeanServer();
}
代码示例来源:origin: org.apache.geronimo.ext.tomcat/catalina
/**
* Set the Wrapper with which we are associated.
*
* @param wrapper The new wrapper
*/
@Override
public void setWrapper(Wrapper wrapper) {
this.wrapper = wrapper;
if (wrapper == null) {
context = null;
installedHost = null;
engine = null;
} else {
context = (Context) wrapper.getParent();
installedHost = (Host) context.getParent();
engine = (Engine) installedHost.getParent();
}
// Retrieve the MBean server
mBeanServer = Registry.getRegistry(null, null).getMBeanServer();
}
代码示例来源:origin: org.apache.catalina/com.springsource.org.apache.catalina
/**
* Set the Wrapper with which we are associated.
*
* @param wrapper The new wrapper
*/
@Override
public void setWrapper(Wrapper wrapper) {
this.wrapper = wrapper;
if (wrapper == null) {
context = null;
installedHost = null;
engine = null;
} else {
context = (Context) wrapper.getParent();
installedHost = (Host) context.getParent();
engine = (Engine) installedHost.getParent();
}
// Retrieve the MBean server
mBeanServer = Registry.getRegistry(null, null).getMBeanServer();
}
代码示例来源:origin: com.ovea.tajin.server/tajin-server-tomcat7
/**
* Set the Wrapper with which we are associated.
*
* @param wrapper The new wrapper
*/
@Override
public void setWrapper(Wrapper wrapper) {
this.wrapper = wrapper;
if (wrapper == null) {
context = null;
installedHost = null;
engine = null;
} else {
context = (Context) wrapper.getParent();
installedHost = (Host) context.getParent();
engine = (Engine) installedHost.getParent();
}
// Retrieve the MBean server
mBeanServer = Registry.getRegistry(null, null).getMBeanServer();
}
代码示例来源:origin: org.apache.tomcat/tomcat-catalina
/**
* Register wrapper.
*/
private void registerWrapper(Wrapper wrapper) {
Context context = (Context) wrapper.getParent();
String contextPath = context.getPath();
if ("/".equals(contextPath)) {
contextPath = "";
}
String version = context.getWebappVersion();
String hostName = context.getParent().getName();
List<WrapperMappingInfo> wrappers = new ArrayList<>();
prepareWrapperMappingInfo(context, wrapper, wrappers);
mapper.addWrappers(hostName, contextPath, version, wrappers);
if(log.isDebugEnabled()) {
log.debug(sm.getString("mapperListener.registerWrapper",
wrapper.getName(), contextPath, service));
}
}
代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core
/**
* Register wrapper.
*/
private void registerWrapper(Wrapper wrapper) {
Context context = (Context) wrapper.getParent();
String contextPath = context.getPath();
if ("/".equals(contextPath)) {
contextPath = "";
}
String version = context.getWebappVersion();
String hostName = context.getParent().getName();
List<WrapperMappingInfo> wrappers = new ArrayList<>();
prepareWrapperMappingInfo(context, wrapper, wrappers);
mapper.addWrappers(hostName, contextPath, version, wrappers);
if(log.isDebugEnabled()) {
log.debug(sm.getString("mapperListener.registerWrapper",
wrapper.getName(), contextPath, service));
}
}
代码示例来源:origin: org.apache.tomcat/tomcat-catalina
/**
* Unregister wrapper.
*/
private void unregisterWrapper(Wrapper wrapper) {
Context context = ((Context) wrapper.getParent());
String contextPath = context.getPath();
String wrapperName = wrapper.getName();
if ("/".equals(contextPath)) {
contextPath = "";
}
String version = context.getWebappVersion();
String hostName = context.getParent().getName();
String[] mappings = wrapper.findMappings();
for (String mapping : mappings) {
mapper.removeWrapper(hostName, contextPath, version, mapping);
}
if(log.isDebugEnabled()) {
log.debug(sm.getString("mapperListener.unregisterWrapper",
wrapperName, contextPath, service));
}
}
内容来源于网络,如有侵权,请联系作者删除!