本文整理了Java中io.undertow.servlet.Servlets.listener()
方法的一些代码示例,展示了Servlets.listener()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Servlets.listener()
方法的具体详情如下:
包路径:io.undertow.servlet.Servlets
类名称:Servlets
方法名:listener
暂无
代码示例来源:origin: wildfly/wildfly
private void handleAuthManagerLogout(DeploymentInfo deploymentInfo, JBossWebMetaData mergedMetaData) {
AuthenticationManager manager = securityDomainContextValue.getValue().getAuthenticationManager();
deploymentInfo.addNotificationReceiver(new LogoutNotificationReceiver(manager, securityDomain));
if(mergedMetaData.isFlushOnSessionInvalidation()) {
LogoutSessionListener listener = new LogoutSessionListener(manager);
deploymentInfo.addListener(Servlets.listener(LogoutSessionListener.class, new ImmediateInstanceFactory<EventListener>(listener)));
}
}
代码示例来源:origin: org.commonjava.indy/indy-subsys-jaxrs
@Override
public DeploymentInfo getDeploymentInfo( String contextRoot, Application application )
{
if ( !config.isMetricsEnabled() )
{
return null;
}
final ServletInfo servlet =
Servlets.servlet( "healthcheck", HealthCheckServlet.class ).addMapping( "/healthcheck" );
final DeploymentInfo di = new DeploymentInfo().addListener(
Servlets.listener( IndyHealthCheckServletContextListener.class ) )
.setContextPath( contextRoot )
.addServlet( servlet )
.setDeploymentName( "HealthCheck Deployment" )
.setClassLoader( ClassLoader.getSystemClassLoader() );
logger.info( "Returning deployment info for health check" );
return di;
}
}
代码示例来源:origin: io.squark.yggdrasil.yggdrasil-framework-provider/yggdrasil-servlet-provider
.setDeploymentName(deploymentName).addListener(Servlets.listener(org.jboss.weld.environment.servlet.Listener.class))
.addInitParameter(WeldServletLifecycle.class.getPackage().getName() + ".archive.isolation", "false")
.addServletContextAttribute(WeldServletLifecycle.BEAN_MANAGER_ATTRIBUTE_NAME, beanManager);
di.getWelcomePages().forEach(deployment::addWelcomePage);
di.getInitParameters().forEach(deployment::addInitParameter);
di.getListeners().forEach(listenerClass -> deployment.addListener(Servlets.listener(listenerClass)));
di.getServletContextAttributes().forEach(deployment::addServletContextAttribute);
di.getClassPathResources().forEach(path -> combinedResourceManager.addResourceManager(new ClassPathResourceManager(this.getClass().getClassLoader(), path)));
代码示例来源:origin: vdevigere/undertow-cdi-jaxrs
public static void main(String[] args) throws ServletException {
MyServer myServer = new MyServer(8080, "0.0.0.0");
DeploymentInfo di = myServer.deployApplication("/rest", MyApplication.class)
.setClassLoader(MyServer.class.getClassLoader())
.setContextPath("/myApp")
.setDeploymentName("My Application")
.addServlets(Servlets.servlet("helloServlet", org.viddu.poc.HelloServlet.class).addMapping("/hello"))
.addListeners(Servlets.listener(org.jboss.weld.environment.servlet.Listener.class));
myServer.deploy(di);
}
}
代码示例来源:origin: cassiomolin/jersey-jwt
.setClassLoader(Application.class.getClassLoader())
.setContextPath("/")
.addListeners(listener(Listener.class))
.setResourceManager(new ClassPathResourceManager(Application.class.getClassLoader()))
.addServlets(
代码示例来源:origin: org.wildfly/wildfly-undertow
private void handleAuthManagerLogout(DeploymentInfo deploymentInfo, JBossWebMetaData mergedMetaData) {
AuthenticationManager manager = securityDomainContextValue.getValue().getAuthenticationManager();
deploymentInfo.addNotificationReceiver(new LogoutNotificationReceiver(manager, securityDomain));
if(mergedMetaData.isFlushOnSessionInvalidation()) {
LogoutSessionListener listener = new LogoutSessionListener(manager);
deploymentInfo.addListener(Servlets.listener(LogoutSessionListener.class, new ImmediateInstanceFactory<EventListener>(listener)));
}
}
代码示例来源:origin: org.jboss.eap/wildfly-undertow
private void handleAuthManagerLogout(DeploymentInfo deploymentInfo, JBossWebMetaData mergedMetaData) {
AuthenticationManager manager = securityDomainContextValue.getValue().getAuthenticationManager();
deploymentInfo.addNotificationReceiver(new LogoutNotificationReceiver(manager, securityDomain));
if(mergedMetaData.isFlushOnSessionInvalidation()) {
LogoutSessionListener listener = new LogoutSessionListener(manager);
deploymentInfo.addListener(Servlets.listener(LogoutSessionListener.class, new ImmediateInstanceFactory<EventListener>(listener)));
}
}
代码示例来源:origin: com.qwazr/qwazr-webapps
context.listener(Servlets.listener(ClassLoaderUtils.findClass(listenerClass)));
代码示例来源:origin: ws.ament.hammock/web-undertow
.setClassLoader(ClassLoader.getSystemClassLoader());
super.getListeners().forEach(c ->di.addListener(listener(c)));
代码示例来源:origin: hammock-project/hammock
.setClassLoader(ClassLoader.getSystemClassLoader());
super.getListeners().forEach(c ->di.addListener(listener(c)));
代码示例来源:origin: yangfuhai/jboot
deploymentInfo.addListeners(Servlets.listener(EnvironmentLoaderListener.class));
deploymentInfo.addFilter(
Servlets.filter("shiro", JbootShiroFilter.class))
.addMapping(metricsConfig.getMappingUrl()));
deploymentInfo.addListeners(Servlets.listener(JbootMetricServletContextListener.class));
deploymentInfo.addListeners(Servlets.listener(JbootHealthCheckServletContextListener.class));
deploymentInfo.addListeners(Servlets.listener(listenerClass));
代码示例来源:origin: org.commonjava.indy/indy-subsys-jaxrs
this.apiVersioningFilter ) );
final DeploymentInfo di = new DeploymentInfo().addListener( Servlets.listener( RequestScopeListener.class ) )
内容来源于网络,如有侵权,请联系作者删除!