Author: ropalka
Date: 2011-12-16 09:46:01 -0500 (Fri, 16 Dec 2011)
New Revision: 15411
Removed:
container/jboss70/branches/jbossws-jboss701/src/main/java/org/jboss/as/webservices/ioc/
container/jboss70/branches/jbossws-jboss701/src/main/resources/META-INF/services/org.jboss.wsf.spi.ioc.IoCContainerProxyFactory
Modified:
container/jboss70/branches/jbossws-jboss701/src/main/java/org/jboss/as/webservices/config/ServerConfigFactoryImpl.java
container/jboss70/branches/jbossws-jboss701/src/main/java/org/jboss/as/webservices/invocation/InvocationHandlerEJB3.java
container/jboss70/branches/jbossws-jboss701/src/main/java/org/jboss/as/webservices/util/ASHelper.java
Log:
[JBWS-3393] removing all deprecated stuff
Modified:
container/jboss70/branches/jbossws-jboss701/src/main/java/org/jboss/as/webservices/config/ServerConfigFactoryImpl.java
===================================================================
---
container/jboss70/branches/jbossws-jboss701/src/main/java/org/jboss/as/webservices/config/ServerConfigFactoryImpl.java 2011-12-16
14:45:50 UTC (rev 15410)
+++
container/jboss70/branches/jbossws-jboss701/src/main/java/org/jboss/as/webservices/config/ServerConfigFactoryImpl.java 2011-12-16
14:46:01 UTC (rev 15411)
@@ -21,12 +21,9 @@
*/
package org.jboss.as.webservices.config;
+import static org.jboss.as.webservices.util.ASHelper.getMSCService;
+
import org.jboss.as.webservices.util.WSServices;
-import org.jboss.wsf.spi.SPIProvider;
-import org.jboss.wsf.spi.SPIProviderResolver;
-import org.jboss.wsf.spi.classloading.ClassLoaderProvider;
-import org.jboss.wsf.spi.ioc.IoCContainerProxy;
-import org.jboss.wsf.spi.ioc.IoCContainerProxyFactory;
import org.jboss.wsf.spi.management.ServerConfig;
import org.jboss.wsf.spi.management.ServerConfigFactory;
@@ -37,25 +34,9 @@
* @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
*/
public final class ServerConfigFactoryImpl extends ServerConfigFactory {
- /**
- * Constructor.
- */
- public ServerConfigFactoryImpl() {
- super();
- }
- /**
- * Returns config registered in MC kernel.
- *
- * @return config
- */
public ServerConfig getServerConfig() {
- final ClassLoader cl =
ClassLoaderProvider.getDefaultProvider().getServerIntegrationClassLoader();
- final SPIProvider spiProvider =
SPIProviderResolver.getInstance(cl).getProvider();
- final IoCContainerProxyFactory iocContainerFactory =
spiProvider.getSPI(IoCContainerProxyFactory.class, cl);
- final IoCContainerProxy iocContainer = iocContainerFactory.getContainer();
-
- // TODO review IoCContainer spi to avoid conversion to/from String/Service
- return iocContainer.getBean(WSServices.CONFIG_SERVICE.getCanonicalName(),
ServerConfig.class);
+ return getMSCService(WSServices.CONFIG_SERVICE, ServerConfig.class);
}
+
}
Modified:
container/jboss70/branches/jbossws-jboss701/src/main/java/org/jboss/as/webservices/invocation/InvocationHandlerEJB3.java
===================================================================
---
container/jboss70/branches/jbossws-jboss701/src/main/java/org/jboss/as/webservices/invocation/InvocationHandlerEJB3.java 2011-12-16
14:45:50 UTC (rev 15410)
+++
container/jboss70/branches/jbossws-jboss701/src/main/java/org/jboss/as/webservices/invocation/InvocationHandlerEJB3.java 2011-12-16
14:46:01 UTC (rev 15411)
@@ -36,13 +36,12 @@
import org.jboss.invocation.InterceptorContext;
import org.jboss.ws.common.injection.ThreadLocalAwareWebServiceContext;
import org.jboss.ws.common.invocation.AbstractInvocationHandler;
+import org.jboss.msc.service.ServiceName;
import org.jboss.wsf.spi.SPIProvider;
import org.jboss.wsf.spi.SPIProviderResolver;
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.invocation.Invocation;
import org.jboss.wsf.spi.invocation.InvocationContext;
-import org.jboss.wsf.spi.ioc.IoCContainerProxy;
-import org.jboss.wsf.spi.ioc.IoCContainerProxyFactory;
/**
* Handles invocations on EJB3 endpoints.
@@ -53,9 +52,6 @@
/** EJB3 JNDI context. */
private static final String EJB3_JNDI_PREFIX = "java:env/";
- /** MC kernel controller. */
- private final IoCContainerProxy iocContainer;
-
/** EJB3 container name. */
private String ejbName;
@@ -63,15 +59,6 @@
private volatile ComponentViewInstance ejbComponentViewInstance;
/**
- * Constructor.
- */
- InvocationHandlerEJB3() {
- final SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
- final IoCContainerProxyFactory iocContainerFactory =
spiProvider.getSPI(IoCContainerProxyFactory.class);
- iocContainer = iocContainerFactory.getContainer();
- }
-
- /**
* Initializes EJB3 container name.
*
* @param endpoint web service endpoint
@@ -93,7 +80,7 @@
if (ejbComponentViewInstance == null) {
synchronized(this) {
if (ejbComponentViewInstance == null) {
- final ComponentView ejbView = iocContainer.getBean(ejbName,
ComponentView.class);
+ final ComponentView ejbView =
ASHelper.getMSCService(ServiceName.parse(ejbName), ComponentView.class);
if (ejbView == null) {
throw new WebServiceException("Cannot find ejb: " +
ejbName);
}
@@ -150,12 +137,6 @@
throw new IllegalStateException();
}
- public Context getJNDIContext(final Endpoint ep) throws NamingException {
- return null; // TODO: implement
-// final EJBContainer ejb3Container = (EJBContainer) getComponentViewInstance();
-// return (Context) ejb3Container.getEnc().lookup(EJB3_JNDI_PREFIX);
- }
-
/**
* Injects webservice context on target bean.
*
Modified:
container/jboss70/branches/jbossws-jboss701/src/main/java/org/jboss/as/webservices/util/ASHelper.java
===================================================================
---
container/jboss70/branches/jbossws-jboss701/src/main/java/org/jboss/as/webservices/util/ASHelper.java 2011-12-16
14:45:50 UTC (rev 15410)
+++
container/jboss70/branches/jbossws-jboss701/src/main/java/org/jboss/as/webservices/util/ASHelper.java 2011-12-16
14:46:01 UTC (rev 15411)
@@ -43,6 +43,8 @@
import org.jboss.metadata.web.jboss.JBossServletMetaData;
import org.jboss.metadata.web.jboss.JBossWebMetaData;
import org.jboss.metadata.web.spec.ServletMetaData;
+import org.jboss.msc.service.ServiceController;
+import org.jboss.msc.service.ServiceName;
import org.jboss.as.webservices.metadata.WebServiceDeclaration;
import org.jboss.as.webservices.metadata.WebServiceDeployment;
@@ -351,4 +353,10 @@
}
}
+ @SuppressWarnings("unchecked")
+ public static <T> T getMSCService(final ServiceName serviceName, final
Class<T> clazz) {
+ ServiceController<T> service =
(ServiceController<T>)WSServices.getContainerRegistry().getService(serviceName);
+ return service != null ? service.getValue() : null;
+ }
+
}
Deleted:
container/jboss70/branches/jbossws-jboss701/src/main/resources/META-INF/services/org.jboss.wsf.spi.ioc.IoCContainerProxyFactory
===================================================================
---
container/jboss70/branches/jbossws-jboss701/src/main/resources/META-INF/services/org.jboss.wsf.spi.ioc.IoCContainerProxyFactory 2011-12-16
14:45:50 UTC (rev 15410)
+++
container/jboss70/branches/jbossws-jboss701/src/main/resources/META-INF/services/org.jboss.wsf.spi.ioc.IoCContainerProxyFactory 2011-12-16
14:46:01 UTC (rev 15411)
@@ -1 +0,0 @@
-org.jboss.as.webservices.ioc.IoCContainerProxyFactoryImpl
\ No newline at end of file
Show replies by date