Author: alessio.soldano(a)jboss.com
Date: 2013-05-31 13:32:51 -0400 (Fri, 31 May 2013)
New Revision: 17637
Modified:
spi/trunk/src/main/java/org/jboss/wsf/spi/SPIProvider.java
Log:
[JBWS-3644] Adding getInstance to SPIProvider
Modified: spi/trunk/src/main/java/org/jboss/wsf/spi/SPIProvider.java
===================================================================
--- spi/trunk/src/main/java/org/jboss/wsf/spi/SPIProvider.java 2013-05-30 15:48:41 UTC
(rev 17636)
+++ spi/trunk/src/main/java/org/jboss/wsf/spi/SPIProvider.java 2013-05-31 17:32:51 UTC
(rev 17637)
@@ -21,6 +21,8 @@
*/
package org.jboss.wsf.spi;
+import org.jboss.wsf.spi.classloading.ClassLoaderProvider;
+
/**
* Gives access to the SPI implementation.
*
@@ -29,7 +31,25 @@
*/
public abstract class SPIProvider
{
+ private static SPIProvider me;
+
/**
+ * Gets the a singleton reference to the SPIProvider returned by the
SPIProviderResolver
+ * retrieved using the default server integration classloader.
+ *
+ * @return
+ */
+ public static SPIProvider getInstance()
+ {
+ if (me == null)
+ {
+ final ClassLoader cl =
ClassLoaderProvider.getDefaultProvider().getServerIntegrationClassLoader();
+ me = SPIProviderResolver.getInstance(cl).getProvider();
+ }
+ return me;
+ }
+
+ /**
* Gets the specified SPI, using the current thread context classloader
*
* @param <T>
Show replies by date