org.apache.catalina.Wrapper.getServlet()方法的使用及代码示例

x33g5p2x  于2022-02-02 转载在 其他  
字(8.6k)|赞(0)|评价(0)|浏览(101)

本文整理了Java中org.apache.catalina.Wrapper.getServlet()方法的一些代码示例,展示了Wrapper.getServlet()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Wrapper.getServlet()方法的具体详情如下:
包路径:org.apache.catalina.Wrapper
类名称:Wrapper
方法名:getServlet

Wrapper.getServlet介绍

[英]Return the associated servlet instance.
[中]返回关联的servlet实例。

代码示例

代码示例来源:origin: org.apache.openejb/tomee-catalina

public Servlet getServlet(Wrapper wrapper) {
  return wrapper.getServlet();
}

代码示例来源:origin: org.apache.openejb/openejb-tomcat-catalina

public Servlet getServlet(Wrapper wrapper) {
  return wrapper.getServlet();
}

代码示例来源:origin: com.springsource.insight/insight-collection-tcserver

private String parseServletName(Request request) {
  Wrapper wrapper = (Wrapper) request.getMappingData().wrapper;
  Servlet servlet = null;
  
  if (wrapper != null) {
    servlet = wrapper.getServlet();
  }
  
  if (servlet != null) {
    ServletConfig config = wrapper.getServlet().getServletConfig();
    if (config != null) {
      return config.getServletName();
    }
  }
  return "Unknown";
}

代码示例来源:origin: codefollower/Tomcat-Research

/**
 * hook to register that we need to scan for security annotations.
 * @param wrapper   The wrapper for the Servlet that was added
 */
public ServletRegistration.Dynamic dynamicServletAdded(Wrapper wrapper) {
  Servlet s = wrapper.getServlet();
  if (s != null && createdServlets.contains(s)) {
    // Mark the wrapper to indicate annotations need to be scanned
    wrapper.setServletSecurityAnnotationScanRequired(true);
  }
  return new ApplicationServletRegistration(wrapper, this);
}

代码示例来源:origin: org.apache.geronimo.ext.tomcat/catalina

/**
 * hook to register that we need to scan for security annotations.
 * @param wrapper   The wrapper for the Servlet that was added
 */
public ServletRegistration.Dynamic dynamicServletAdded(Wrapper wrapper) {
  Servlet s = wrapper.getServlet();
  if (s != null && createdServlets.contains(s)) {
    // Mark the wrapper to indicate annotations need to be scanned
    wrapper.setServletSecurityAnnotationScanRequired(true);
  }
  return new ApplicationServletRegistration(wrapper, this);
}

代码示例来源:origin: org.apache.catalina/com.springsource.org.apache.catalina

/**
 * hook to register that we need to scan for security annotations.
 * @param wrapper   The wrapper for the Servlet that was added
 */
public ServletRegistration.Dynamic dynamicServletAdded(Wrapper wrapper) {
  Servlet s = wrapper.getServlet();
  if (s != null && createdServlets.contains(s)) {
    // Mark the wrapper to indicate annotations need to be scanned
    wrapper.setServletSecurityAnnotationScanRequired(true);
  }
  return new ApplicationServletRegistration(wrapper, this);
}

代码示例来源:origin: com.ovea.tajin.server/tajin-server-tomcat7

@Override
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 {
        CometEventImpl event = req.getEvent();
        event.setEventType(CometEvent.EventType.END);
        event.setEventSubType(CometEvent.EventSubType.SESSION_END);
        ((CometProcessor)
            req.getWrapper().getServlet()).event(event);
        event.close();
      } catch (Exception e) {
        req.getWrapper().getParent().getLogger().warn(sm.getString(
            "cometConnectionManagerValve.listenerEvent"), e);
      }
    }
  }
}

代码示例来源:origin: org.apache.geronimo.ext.tomcat/catalina

@Override
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 {
        CometEventImpl event = req.getEvent();
        event.setEventType(CometEvent.EventType.END);
        event.setEventSubType(CometEvent.EventSubType.SESSION_END);
        ((CometProcessor)
            req.getWrapper().getServlet()).event(event);
        event.close();
      } catch (Exception e) {
        req.getWrapper().getParent().getLogger().warn(sm.getString(
            "cometConnectionManagerValve.listenerEvent"), e);
      }
    }
  }
}

代码示例来源:origin: com.ovea.tajin.servers/tajin-server-jetty9

@Override
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 {
        CometEventImpl event = req.getEvent();
        event.setEventType(CometEvent.EventType.END);
        event.setEventSubType(CometEvent.EventSubType.SESSION_END);
        ((CometProcessor)
            req.getWrapper().getServlet()).event(event);
        event.close();
      } catch (Exception e) {
        req.getWrapper().getParent().getLogger().warn(sm.getString(
            "cometConnectionManagerValve.listenerEvent"), e);
      }
    }
  }
}

代码示例来源:origin: org.apache.catalina/com.springsource.org.apache.catalina

@Override
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 {
        CometEventImpl event = req.getEvent();
        event.setEventType(CometEvent.EventType.END);
        event.setEventSubType(CometEvent.EventSubType.SESSION_END);
        ((CometProcessor)
            req.getWrapper().getServlet()).event(event);
        event.close();
      } catch (Exception e) {
        req.getWrapper().getParent().getLogger().warn(sm.getString(
            "cometConnectionManagerValve.listenerEvent"), e);
      }
    }
  }
}

代码示例来源:origin: com.ovea.tajin.server/tajin-server-jetty9

@Override
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 {
        CometEventImpl event = req.getEvent();
        event.setEventType(CometEvent.EventType.END);
        event.setEventSubType(CometEvent.EventSubType.SESSION_END);
        ((CometProcessor)
            req.getWrapper().getServlet()).event(event);
        event.close();
      } catch (Exception e) {
        req.getWrapper().getParent().getLogger().warn(sm.getString(
            "cometConnectionManagerValve.listenerEvent"), e);
      }
    }
  }
}

代码示例来源:origin: jboss.web/jbossweb

public ServletRegistration.Dynamic addServlet(String servletName, Servlet servlet) {
  if (restricted) {
    throw new UnsupportedOperationException(sm.getString("applicationContext.restricted"));
  }
  if (!context.isStarting()) {
    throw new IllegalStateException(sm.getString("applicationContext.alreadyInitialized",
            getContextPath()));
  }
  if (context.findChild(servletName) != null) {
    return null;
  }
  // Servlet instance unicity
  for (Container container : context.getParent().findChildren()) {
    for (Container wrapper : container.findChildren()) {
      if (((Wrapper) wrapper).getServlet() == servlet) {
        return null;
      }
    }
  }
  Wrapper wrapper = context.createWrapper();
  wrapper.setDynamic(true);
  wrapper.setName(servletName);
  wrapper.setServletClass(servlet.getClass().getName());
  wrapper.setServlet(servlet);
  context.addChild(wrapper);
  return (ServletRegistration.Dynamic) wrapper.getFacade();
}

代码示例来源:origin: jboss.web/jbossweb

Servlet servlet = wrapper.getServlet();
pointer++;
try {

代码示例来源:origin: codefollower/Tomcat-Research

@Override
public void sessionDestroyed(HttpSessionEvent se) {
  // Close all Comet connections associated with this session
  ConnectionList list = (ConnectionList) se.getSession().getAttribute(
      cometRequestsAttribute);
  Request[] reqs = null;
  if (list != null) {
    reqs = list.get();
  }
  if (reqs != null) {
    for (int i = 0; i < reqs.length; i++) {
      Request req = reqs[i];
      try {
        CometEventImpl event = req.getEvent();
        event.setEventType(CometEvent.EventType.END);
        event.setEventSubType(CometEvent.EventSubType.SESSION_END);
        ((CometProcessor)
            req.getWrapper().getServlet()).event(event);
        event.close();
      } catch (Exception e) {
        req.getWrapper().getParent().getLogger().warn(sm.getString(
            "cometConnectionManagerValve.listenerEvent"), e);
      }
    }
  }
}

代码示例来源:origin: jboss-switchyard/release

SwitchYardRemotingServlet remotingServlet = (SwitchYardRemotingServlet) wrapper.getServlet();
remotingServlet.setEndpointPublisher(this);
_log.info("Published Remote Service Endpoint " + _serverContext.getPath());

代码示例来源:origin: org.switchyard/switchyard-deploy-jboss-as7

SwitchYardRemotingServlet remotingServlet = (SwitchYardRemotingServlet) wrapper.getServlet();
remotingServlet.setEndpointPublisher(this);
_log.info("Published Remote Service Endpoint " + _serverContext.getPath());

代码示例来源:origin: org.switchyard/switchyard-deploy-jboss-as7

serverContext.create();
serverContext.start();
HttpGatewayServlet instance = (HttpGatewayServlet) wrapper.getServlet();
instance.setHandler(handler);
LOG.info("Published HTTP context " + serverContext.getPath());

代码示例来源:origin: jboss-switchyard/release

serverContext.create();
serverContext.start();
HttpGatewayServlet instance = (HttpGatewayServlet) wrapper.getServlet();
instance.setHandler(handler);
LOG.info("Published HTTP context " + serverContext.getPath());

代码示例来源:origin: org.jboss.web/jbossweb

if (((Wrapper) wrapper).getServlet() == servlet) {
  return null;

代码示例来源:origin: org.jboss.web/jbossweb

if (wrapper.getServlet() == null)
  return (null);

相关文章