Author: asoldano
Date: 2014-03-07 09:19:31 -0500 (Fri, 07 Mar 2014)
New Revision: 18481
Modified:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/ServerBeanCustomizer.java
Log:
[JBWS-3767] Avoid throwing/catching exception when JASPIC is not available (performance
issue) - server side
Modified:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/ServerBeanCustomizer.java
===================================================================
---
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/ServerBeanCustomizer.java 2014-03-07
14:00:31 UTC (rev 18480)
+++
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/ServerBeanCustomizer.java 2014-03-07
14:19:31 UTC (rev 18481)
@@ -27,6 +27,7 @@
import org.apache.cxf.frontend.ServerFactoryBean;
import org.jboss.ws.api.annotation.EndpointConfig;
+import org.jboss.ws.api.util.ServiceLoader;
import org.jboss.ws.common.management.AbstractServerConfig;
import org.jboss.wsf.spi.SPIProvider;
import org.jboss.wsf.spi.WSFException;
@@ -163,19 +164,20 @@
throw Messages.MESSAGES.couldNotReadConfigFile(configFile);
}
}
- try
+ //JASPI
+ final JASPIAuthenticationProvider jaspiProvider = (JASPIAuthenticationProvider)
ServiceLoader.loadService(
+ JASPIAuthenticationProvider.class.getName(), null,
ClassLoaderProvider.getDefaultProvider().getServerIntegrationClassLoader());
+ if (jaspiProvider == null)
{
- final JASPIAuthenticationProvider jaspiProvider =
SPIProvider.getInstance().getSPI(JASPIAuthenticationProvider.class,
-
ClassLoaderProvider.getDefaultProvider().getServerIntegrationClassLoader());
- if (jaspiProvider != null &&
jaspiProvider.enableServerAuthentication(endpoint, depEndpoints.get(0)))
+ Loggers.DEPLOYMENT_LOGGER.cannotFindJaspiClasses();
+ }
+ else
+ {
+ if (jaspiProvider.enableServerAuthentication(endpoint, depEndpoints.get(0)))
{
endpoint.getInInterceptors().add(new
AutenticationMgrSubjectCreatingInterceptor());
}
}
- catch (WSFException e)
- {
- Loggers.DEPLOYMENT_LOGGER.cannotFindJaspiClasses();
- }
}
}
Show replies by date