Author: asoldano
Date: 2014-02-26 07:17:10 -0500 (Wed, 26 Feb 2014)
New Revision: 18438
Modified:
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/Loggers.java
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/CXFClientConfigurer.java
Log:
[JBWS-3767] Avoid throwing/catching exception when JASPIC is not available (performance
issue)
Modified:
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/Loggers.java
===================================================================
---
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/Loggers.java 2014-02-26
09:19:16 UTC (rev 18437)
+++
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/Loggers.java 2014-02-26
12:17:10 UTC (rev 18438)
@@ -225,7 +225,7 @@
@Message(id = 24100, value = "Could not delete wsdl directory %s")
void couldNotDeleteWsdlDirectory(String filename);
- @LogMessage(level = INFO)
- @Message(id = 24102, value = "jaspi authentication isn't enabled, can not
find jaspi modules and classes")
+ @LogMessage(level = DEBUG)
+ @Message(id = 24102, value = "JASPI authentication isn't enabled, can not
find JASPI modules and classes")
void cannotFindJaspiClasses();
}
Modified:
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/CXFClientConfigurer.java
===================================================================
---
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/CXFClientConfigurer.java 2014-02-26
09:19:16 UTC (rev 18437)
+++
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/CXFClientConfigurer.java 2014-02-26
12:17:10 UTC (rev 18438)
@@ -28,9 +28,8 @@
import org.apache.cxf.endpoint.Endpoint;
import org.apache.cxf.frontend.ClientProxy;
import org.apache.cxf.jaxws.DispatchImpl;
+import org.jboss.ws.api.util.ServiceLoader;
import org.jboss.ws.common.configuration.ConfigHelper;
-import org.jboss.wsf.spi.SPIProvider;
-import org.jboss.wsf.spi.WSFException;
import org.jboss.wsf.spi.classloading.ClassLoaderProvider;
import org.jboss.wsf.spi.metadata.config.ClientConfig;
import org.jboss.wsf.spi.security.JASPIAuthenticationProvider;
@@ -64,18 +63,15 @@
setConfigProperties(cxfClient, props);
//config jaspi
- try
- {
- JASPIAuthenticationProvider japsiProvider =
SPIProvider.getInstance().getSPI(JASPIAuthenticationProvider.class,
-
ClassLoaderProvider.getDefaultProvider().getServerIntegrationClassLoader());
- if (japsiProvider != null)
- {
- japsiProvider.enableClientAuthentication(cxfClient, props);
- }
+ JASPIAuthenticationProvider japsiProvider = (JASPIAuthenticationProvider)
ServiceLoader.loadService(
+ JASPIAuthenticationProvider.class.getName(), null,
ClassLoaderProvider.getDefaultProvider().getServerIntegrationClassLoader());
+ if (japsiProvider != null)
+ {
+ japsiProvider.enableClientAuthentication(cxfClient, props);
}
- catch (WSFException e)
+ else
{
- Loggers.DEPLOYMENT_LOGGER.cannotFindJaspiClasses();
+ Loggers.SECURITY_LOGGER.cannotFindJaspiClasses();
}
}