Author: richard.opalka(a)jboss.com
Date: 2009-09-24 09:05:14 -0400 (Thu, 24 Sep 2009)
New Revision: 10770
Added:
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/management/DefaultEndpointRegistryFactory.java
Removed:
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/management/ServerConfigFactoryImpl.java
Modified:
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/DefaultSPIProvider.java
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/DefaultDeploymentAspectManagerFactory.java
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/http/DefaultHttpServerFactory.java
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/management/MBeanServerLocator.java
Log:
[JBWS-2772] removing AS IL dependency
Modified:
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/DefaultSPIProvider.java
===================================================================
---
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/DefaultSPIProvider.java 2009-09-24
13:03:38 UTC (rev 10769)
+++
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/DefaultSPIProvider.java 2009-09-24
13:05:14 UTC (rev 10770)
@@ -21,14 +21,12 @@
*/
package org.jboss.wsf.framework;
-import org.jboss.logging.Logger;
import org.jboss.wsf.framework.deployment.DefaultDeploymentAspectManagerFactory;
import org.jboss.wsf.framework.deployment.DefaultDeploymentModelFactory;
import org.jboss.wsf.framework.deployment.DefaultLifecycleHandlerFactory;
import org.jboss.wsf.framework.http.DefaultHttpContextFactory;
import org.jboss.wsf.framework.http.DefaultHttpServerFactory;
import org.jboss.wsf.framework.invocation.DefaultResourceInjectorFactory;
-import org.jboss.wsf.framework.management.ServerConfigFactoryImpl;
import org.jboss.wsf.framework.management.DefaultEndpointMetricsFactory;
import org.jboss.wsf.framework.serviceref.DefaultServiceRefHandlerFactory;
import org.jboss.wsf.framework.serviceref.DefaultServiceRefMetaDataParserFactory;
@@ -44,6 +42,7 @@
import org.jboss.wsf.spi.invocation.ResourceInjectorFactory;
import org.jboss.wsf.spi.invocation.SecurityAdaptorFactory;
import org.jboss.wsf.spi.invocation.WebServiceContextFactory;
+import org.jboss.wsf.spi.ioc.IoCContainerProxyFactory;
import org.jboss.wsf.spi.management.EndpointMetricsFactory;
import org.jboss.wsf.spi.management.EndpointRegistryFactory;
import org.jboss.wsf.spi.management.ServerConfigFactory;
@@ -59,18 +58,12 @@
*/
class DefaultSPIProvider extends SPIProvider
{
- // provide logging
- private static final Logger log = Logger.getLogger(DefaultSPIProvider.class);
/**
* Gets the specified SPI.
*/
public <T> T getSPI(Class<T> spiType)
{
- boolean debugEnabled = log.isDebugEnabled();
- if (debugEnabled)
- log.debug("provide SPI '" + spiType + "'");
-
T returnType = null;
// SPI provided by framework, default that can be overridden
@@ -120,7 +113,7 @@
}
else if (ServerConfigFactory.class.equals(spiType))
{
- returnType = (T)loadService(spiType, ServerConfigFactoryImpl.class.getName());
+ returnType = (T)loadService(spiType, null);
}
else if (EndpointRegistryFactory.class.equals(spiType))
{
@@ -146,14 +139,14 @@
{
returnType = (T)loadService(spiType, null);
}
+ else if (IoCContainerProxyFactory.class.equals(spiType))
+ {
+ returnType = (T)loadService(spiType, null);
+ }
if (returnType == null)
throw new WSFException("Failed to provide SPI '" + spiType +
"'");
- // help debugging
- if (debugEnabled)
- log.debug(spiType + " Implementation: " + returnType);
-
return returnType;
}
Modified:
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/DefaultDeploymentAspectManagerFactory.java
===================================================================
---
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/DefaultDeploymentAspectManagerFactory.java 2009-09-24
13:03:38 UTC (rev 10769)
+++
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/DefaultDeploymentAspectManagerFactory.java 2009-09-24
13:05:14 UTC (rev 10770)
@@ -21,8 +21,6 @@
*/
package org.jboss.wsf.framework.deployment;
-import org.jboss.logging.Logger;
-import org.jboss.wsf.common.KernelAwareSPIFactory;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.DeploymentAspectManager;
import org.jboss.wsf.spi.deployment.DeploymentAspectManagerFactory;
@@ -34,31 +32,19 @@
* @see org.jboss.wsf.framework.deployment.DeploymentAspectInstaller
*
* @author Heiko.Braun(a)jboss.com
- * Created: Jul 20, 2007
*/
public class DefaultDeploymentAspectManagerFactory extends
DeploymentAspectManagerFactory
{
- private static final Logger log =
Logger.getLogger(DefaultDeploymentAspectManagerFactory.class);
+ // TODO: review this class methods, maybe only one method getDeploymentAspectManager()
will be sufficient
public DeploymentAspectManager getDeploymentAspectManager(Deployment.DeploymentType
deploymentType)
{
- String beanName;
-
- if (deploymentType.toString().indexOf("EJB") != -1)
- {
- beanName = "WSDeploymentAspectManagerEJB";
- }
- else
- {
- beanName = "WSDeploymentAspectManagerJSE";
- }
- return getDeploymentAspectManager(beanName);
+ throw new UnsupportedOperationException();
}
public DeploymentAspectManager getDeploymentAspectManager(String beanName)
{
- if (log.isDebugEnabled())
- log.debug("DeploymentAspectManager for: " + beanName);
- return new KernelAwareSPIFactory().getKernelProvidedSPI(beanName,
DeploymentAspectManager.class);
+ throw new UnsupportedOperationException();
}
+
}
Modified:
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/http/DefaultHttpServerFactory.java
===================================================================
---
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/http/DefaultHttpServerFactory.java 2009-09-24
13:03:38 UTC (rev 10769)
+++
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/http/DefaultHttpServerFactory.java 2009-09-24
13:05:14 UTC (rev 10770)
@@ -21,7 +21,6 @@
*/
package org.jboss.wsf.framework.http;
-import org.jboss.wsf.common.KernelAwareSPIFactory;
import org.jboss.wsf.spi.http.HttpServer;
import org.jboss.wsf.spi.http.HttpServerFactory;
@@ -36,6 +35,6 @@
@Override
public HttpServer getHttpServer()
{
- return new KernelAwareSPIFactory().getKernelProvidedSPI(HttpServer.BEAN_NAME,
HttpServer.class);
+ throw new UnsupportedOperationException();
}
}
Added:
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/management/DefaultEndpointRegistryFactory.java
===================================================================
---
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/management/DefaultEndpointRegistryFactory.java
(rev 0)
+++
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/management/DefaultEndpointRegistryFactory.java 2009-09-24
13:05:14 UTC (rev 10770)
@@ -0,0 +1,65 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.wsf.framework.management;
+
+import org.jboss.wsf.spi.SPIProvider;
+import org.jboss.wsf.spi.SPIProviderResolver;
+import org.jboss.wsf.spi.ioc.IoCContainerProxy;
+import org.jboss.wsf.spi.ioc.IoCContainerProxyFactory;
+import org.jboss.wsf.spi.management.EndpointRegistry;
+import org.jboss.wsf.spi.management.EndpointRegistryFactory;
+
+/**
+ * Retrieves registry from MC kernel.
+ *
+ * @author <a href="mailto:hbraun@redhat.com">Heiko Braun</a>
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+public final class DefaultEndpointRegistryFactory extends EndpointRegistryFactory
+{
+
+ /** The bean name in the kernel registry. */
+ private static final String BEAN_NAME = "WSEndpointRegistry";
+
+ /**
+ * Constructor.
+ */
+ public DefaultEndpointRegistryFactory()
+ {
+ super();
+ }
+
+ /**
+ * Returns endpoint registry registered in MC kernel.
+ *
+ * @return endpoint registry
+ */
+ public EndpointRegistry getEndpointRegistry()
+ {
+ final SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
+ final IoCContainerProxyFactory iocContainerFactory =
spiProvider.getSPI(IoCContainerProxyFactory.class);
+ final IoCContainerProxy iocContainer = iocContainerFactory.getContainer();
+
+ return iocContainer.getBean(DefaultEndpointRegistryFactory.BEAN_NAME,
EndpointRegistry.class);
+ }
+
+}
Modified:
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/management/MBeanServerLocator.java
===================================================================
---
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/management/MBeanServerLocator.java 2009-09-24
13:03:38 UTC (rev 10769)
+++
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/management/MBeanServerLocator.java 2009-09-24
13:05:14 UTC (rev 10770)
@@ -21,40 +21,28 @@
*/
package org.jboss.wsf.framework.management;
-import java.util.Iterator;
-
import javax.management.MBeanServer;
-import javax.management.MBeanServerFactory;
/**
* Locate the single instance of the MBeanServer
*
* @author Thomas.Diesler(a)jboss.org
- * @since 30-Jul-2007
*/
-public class MBeanServerLocator
+public final class MBeanServerLocator
{
- private MBeanServer mbeanServer;
+
+ private final MBeanServer mbeanServer;
- public MBeanServer getMbeanServer()
+ public MBeanServerLocator(final MBeanServer mbeanServer)
{
- // In jboss-4.2 the MBeanServer cannot be injected
- if (mbeanServer == null)
- {
- for (Iterator i = MBeanServerFactory.findMBeanServer(null).iterator();
i.hasNext();)
- {
- mbeanServer = (MBeanServer)i.next();
- if (mbeanServer.getClass().getName().startsWith("org.jboss")) //
JBWS-2580
- {
- break;
- }
- }
- }
- return mbeanServer;
+ super();
+
+ this.mbeanServer = mbeanServer;
}
- public void setMbeanServer(MBeanServer mbeanServer)
+ public MBeanServer getMbeanServer()
{
- this.mbeanServer = mbeanServer;
+ return mbeanServer;
}
+
}
Deleted:
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/management/ServerConfigFactoryImpl.java
===================================================================
---
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/management/ServerConfigFactoryImpl.java 2009-09-24
13:03:38 UTC (rev 10769)
+++
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/management/ServerConfigFactoryImpl.java 2009-09-24
13:05:14 UTC (rev 10770)
@@ -1,42 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.wsf.framework.management;
-
-import org.jboss.wsf.common.KernelAwareSPIFactory;
-import org.jboss.wsf.spi.management.ServerConfig;
-import org.jboss.wsf.spi.management.ServerConfigFactory;
-
-/**
- * @author Heiko.Braun(a)jboss.com
- * Created: Jul 23, 2007
- */
-public class ServerConfigFactoryImpl extends ServerConfigFactory
-{
- public ServerConfig getServerConfig()
- {
- ServerConfig serverConfig = new
KernelAwareSPIFactory().getKernelProvidedSPI(ServerConfig.BEAN_NAME, ServerConfig.class);
- if (serverConfig == null)
- throw new IllegalStateException("Cannot obtain ServerConfig for bean name:
" + ServerConfig.BEAN_NAME);
-
- return serverConfig;
- }
-}