Author: thomas.diesler(a)jboss.com
Date: 2007-08-01 11:01:13 -0400 (Wed, 01 Aug 2007)
New Revision: 4059
Added:
trunk/integration/spi/src/main/java/org/jboss/wsf/framework/serviceref/DefaultServiceRefHandler.java
trunk/integration/spi/src/main/java/org/jboss/wsf/framework/serviceref/DefaultServiceRefHandlerFactory.java
Removed:
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/serviceref/ServiceRefHandlerFactoryImpl.java
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/serviceref/ServiceRefHandlerImpl.java
Modified:
trunk/integration/jboss42/src/main/java/org/jboss/ws/integration/KernelLocator.java
trunk/integration/jboss42/src/main/java/org/jboss/ws/integration/ServiceRefElement.java
trunk/integration/jboss42/src/main/java/org/jboss/ws/integration/ServiceRefHandler.java
trunk/integration/jboss42/src/main/java/org/jboss/ws/integration/ServiceRefMetaData.java
trunk/integration/jboss42/src/main/java/org/jboss/ws/integration/URLLoaderAdapter.java
trunk/integration/jboss42/src/main/java/org/jboss/ws/integration/UnifiedVirtualFile.java
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/serviceref/DelegatingCallPropertyMetaData.java
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/serviceref/DelegatingHandlerChainMetaData.java
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/serviceref/DelegatingHandlerChainsMetaData.java
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/serviceref/DelegatingHandlerMetaData.java
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/serviceref/DelegatingInitParamMetaData.java
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/serviceref/DelegatingPortComponentRefMetaData.java
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/serviceref/DelegatingServiceRefMetaData.java
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/serviceref/DelegatingStubPropertyMetaData.java
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/serviceref/ServiceRefHandlerImpl.java
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/serviceref/ServiceRefObjectFactory.java
trunk/integration/spi/src/main/java/org/jboss/wsf/framework/DefaultSPIProviderResolver.java
Log:
Add DefaultServiceRefHandler to framework
Modified:
trunk/integration/jboss42/src/main/java/org/jboss/ws/integration/KernelLocator.java
===================================================================
---
trunk/integration/jboss42/src/main/java/org/jboss/ws/integration/KernelLocator.java 2007-08-01
14:55:50 UTC (rev 4058)
+++
trunk/integration/jboss42/src/main/java/org/jboss/ws/integration/KernelLocator.java 2007-08-01
15:01:13 UTC (rev 4059)
@@ -26,10 +26,7 @@
import org.jboss.kernel.Kernel;
/**
- * Locate the single instance of the kernel
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 12-May-2006
+ * @deprecated
*/
public class KernelLocator
{
Modified:
trunk/integration/jboss42/src/main/java/org/jboss/ws/integration/ServiceRefElement.java
===================================================================
---
trunk/integration/jboss42/src/main/java/org/jboss/ws/integration/ServiceRefElement.java 2007-08-01
14:55:50 UTC (rev 4058)
+++
trunk/integration/jboss42/src/main/java/org/jboss/ws/integration/ServiceRefElement.java 2007-08-01
15:01:13 UTC (rev 4059)
@@ -26,10 +26,7 @@
import java.io.Serializable;
/**
- * A marker for all <service-ref> related objects.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 08-Mar-2007
+ * @deprecated
*/
public abstract class ServiceRefElement implements Serializable
{
Modified:
trunk/integration/jboss42/src/main/java/org/jboss/ws/integration/ServiceRefHandler.java
===================================================================
---
trunk/integration/jboss42/src/main/java/org/jboss/ws/integration/ServiceRefHandler.java 2007-08-01
14:55:50 UTC (rev 4058)
+++
trunk/integration/jboss42/src/main/java/org/jboss/ws/integration/ServiceRefHandler.java 2007-08-01
15:01:13 UTC (rev 4059)
@@ -30,10 +30,7 @@
import org.xml.sax.Attributes;
/**
- * An implementation of this interface handles all service-ref binding concerns
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 05-May-2004
+ * @deprecated
*/
public interface ServiceRefHandler
{
Modified:
trunk/integration/jboss42/src/main/java/org/jboss/ws/integration/ServiceRefMetaData.java
===================================================================
---
trunk/integration/jboss42/src/main/java/org/jboss/ws/integration/ServiceRefMetaData.java 2007-08-01
14:55:50 UTC (rev 4058)
+++
trunk/integration/jboss42/src/main/java/org/jboss/ws/integration/ServiceRefMetaData.java 2007-08-01
15:01:13 UTC (rev 4059)
@@ -28,10 +28,7 @@
import org.w3c.dom.Element;
/**
- * An abstract service-ref meta data object.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 08-Mar-2007
+ * @deprecated
*/
public abstract class ServiceRefMetaData extends ServiceRefElement implements
Serializable
{
Modified:
trunk/integration/jboss42/src/main/java/org/jboss/ws/integration/URLLoaderAdapter.java
===================================================================
---
trunk/integration/jboss42/src/main/java/org/jboss/ws/integration/URLLoaderAdapter.java 2007-08-01
14:55:50 UTC (rev 4058)
+++
trunk/integration/jboss42/src/main/java/org/jboss/ws/integration/URLLoaderAdapter.java 2007-08-01
15:01:13 UTC (rev 4059)
@@ -30,12 +30,7 @@
import java.net.URLClassLoader;
/**
- * Load resources through a URLClassLoader.<br>
- * NOTE: The associated classloader doesn't do parent delegation.
- *
- *
- * @author Heiko.Braun(a)jboss.org
- * @since 25.01.2007
+ * @deprecated
*/
public class URLLoaderAdapter implements UnifiedVirtualFile
{
Modified:
trunk/integration/jboss42/src/main/java/org/jboss/ws/integration/UnifiedVirtualFile.java
===================================================================
---
trunk/integration/jboss42/src/main/java/org/jboss/ws/integration/UnifiedVirtualFile.java 2007-08-01
14:55:50 UTC (rev 4058)
+++
trunk/integration/jboss42/src/main/java/org/jboss/ws/integration/UnifiedVirtualFile.java 2007-08-01
15:01:13 UTC (rev 4059)
@@ -28,11 +28,7 @@
import java.net.URL;
/**
- * An adaptor to a VirtualFile from jboss-vfs.jar
- * jboss-vfs cannot be used in jboss-4.x because of its dependeny on
jboss-common-core.jar
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 05-May-2006
+ * @deprecated
*/
public interface UnifiedVirtualFile extends Serializable
{
Modified:
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/serviceref/DelegatingCallPropertyMetaData.java
===================================================================
---
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/serviceref/DelegatingCallPropertyMetaData.java 2007-08-01
14:55:50 UTC (rev 4058)
+++
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/serviceref/DelegatingCallPropertyMetaData.java 2007-08-01
15:01:13 UTC (rev 4059)
@@ -27,7 +27,7 @@
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedCallPropertyMetaData;
/**
- * @author Thomas.Diesler(a)jboss.org
+ * @deprecated
*/
public class DelegatingCallPropertyMetaData extends ServiceRefElement
{
Modified:
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/serviceref/DelegatingHandlerChainMetaData.java
===================================================================
---
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/serviceref/DelegatingHandlerChainMetaData.java 2007-08-01
14:55:50 UTC (rev 4058)
+++
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/serviceref/DelegatingHandlerChainMetaData.java 2007-08-01
15:01:13 UTC (rev 4059)
@@ -29,10 +29,7 @@
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainMetaData;
/**
- * The metdata data from service-ref element in web.xml, ejb-jar.xml, and
- * application-client.xml.
- *
- * @author Thomas.Diesler(a)jboss.org
+ * @deprecated
*/
public class DelegatingHandlerChainMetaData extends ServiceRefElement
{
Modified:
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/serviceref/DelegatingHandlerChainsMetaData.java
===================================================================
---
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/serviceref/DelegatingHandlerChainsMetaData.java 2007-08-01
14:55:50 UTC (rev 4058)
+++
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/serviceref/DelegatingHandlerChainsMetaData.java 2007-08-01
15:01:13 UTC (rev 4059)
@@ -30,18 +30,15 @@
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainsMetaData;
/**
- * The metdata data from service-ref element in web.xml, ejb-jar.xml, and
- * application-client.xml.
- *
- * @author Thomas.Diesler(a)jboss.org
+ * @deprecated
*/
public class DelegatingHandlerChainsMetaData extends ServiceRefElement
{
UnifiedHandlerChainsMetaData delegate;
-
+
public DelegatingHandlerChainsMetaData()
{
- delegate = new UnifiedHandlerChainsMetaData();
+ delegate = new UnifiedHandlerChainsMetaData();
}
public void addHandlerChain(UnifiedHandlerChainMetaData handlerChain)
Modified:
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/serviceref/DelegatingHandlerMetaData.java
===================================================================
---
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/serviceref/DelegatingHandlerMetaData.java 2007-08-01
14:55:50 UTC (rev 4058)
+++
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/serviceref/DelegatingHandlerMetaData.java 2007-08-01
15:01:13 UTC (rev 4059)
@@ -30,7 +30,7 @@
import org.w3c.dom.Element;
/**
- * @author Thomas.Diesler(a)jboss.org
+ * @deprecated
*/
public class DelegatingHandlerMetaData extends ServiceRefElement
{
Modified:
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/serviceref/DelegatingInitParamMetaData.java
===================================================================
---
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/serviceref/DelegatingInitParamMetaData.java 2007-08-01
14:55:50 UTC (rev 4058)
+++
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/serviceref/DelegatingInitParamMetaData.java 2007-08-01
15:01:13 UTC (rev 4059)
@@ -27,7 +27,7 @@
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedInitParamMetaData;
/**
- * @author Thomas.Diesler(a)jboss.org
+ * @deprecated
*/
public class DelegatingInitParamMetaData extends ServiceRefElement
{
Modified:
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/serviceref/DelegatingPortComponentRefMetaData.java
===================================================================
---
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/serviceref/DelegatingPortComponentRefMetaData.java 2007-08-01
14:55:50 UTC (rev 4058)
+++
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/serviceref/DelegatingPortComponentRefMetaData.java 2007-08-01
15:01:13 UTC (rev 4059)
@@ -29,7 +29,7 @@
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedPortComponentRefMetaData;
/**
- * @author Thomas.Diesler(a)jboss.org
+ * @deprecated
*/
public class DelegatingPortComponentRefMetaData extends ServiceRefElement
{
Modified:
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/serviceref/DelegatingServiceRefMetaData.java
===================================================================
---
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/serviceref/DelegatingServiceRefMetaData.java 2007-08-01
14:55:50 UTC (rev 4058)
+++
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/serviceref/DelegatingServiceRefMetaData.java 2007-08-01
15:01:13 UTC (rev 4059)
@@ -34,10 +34,7 @@
import org.w3c.dom.Element;
/**
- * The metdata data from service-ref element in web.xml, ejb-jar.xml, and
- * application-client.xml.
- *
- * @author Thomas.Diesler(a)jboss.org
+ * @deprecated
*/
public class DelegatingServiceRefMetaData extends ServiceRefMetaData
{
Modified:
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/serviceref/DelegatingStubPropertyMetaData.java
===================================================================
---
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/serviceref/DelegatingStubPropertyMetaData.java 2007-08-01
14:55:50 UTC (rev 4058)
+++
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/serviceref/DelegatingStubPropertyMetaData.java 2007-08-01
15:01:13 UTC (rev 4059)
@@ -27,7 +27,7 @@
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedStubPropertyMetaData;
/**
- * @author Thomas.Diesler(a)jboss.org
+ * @deprecated
*/
public class DelegatingStubPropertyMetaData extends ServiceRefElement
{
Modified:
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/serviceref/ServiceRefHandlerImpl.java
===================================================================
---
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/serviceref/ServiceRefHandlerImpl.java 2007-08-01
14:55:50 UTC (rev 4058)
+++
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/serviceref/ServiceRefHandlerImpl.java 2007-08-01
15:01:13 UTC (rev 4059)
@@ -38,19 +38,12 @@
import org.jboss.ws.integration.URLLoaderAdapter;
import org.jboss.ws.integration.UnifiedVirtualFile;
import org.jboss.wsf.spi.WSFException;
-import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaData;
import org.jboss.wsf.spi.serviceref.ServiceRefBinder;
import org.jboss.xb.binding.UnmarshallingContext;
import org.xml.sax.Attributes;
/**
- * Bind service refs in the client's ENC
- * for every service-ref element in the deployment descriptor.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @author Heiko.Braun(a)jboss.com
- *
- * @since 04-Nov-2006
+ * @deprecated
*/
public class ServiceRefHandlerImpl implements ServiceRefHandler
{
Modified:
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/serviceref/ServiceRefObjectFactory.java
===================================================================
---
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/serviceref/ServiceRefObjectFactory.java 2007-08-01
14:55:50 UTC (rev 4058)
+++
trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/serviceref/ServiceRefObjectFactory.java 2007-08-01
15:01:13 UTC (rev 4059)
@@ -30,9 +30,7 @@
import org.xml.sax.Attributes;
/**
- * A object model factory for <service-ref>
- *
- * @author Thomas.Diesler(a)jboss.com
+ * @deprecated
*/
public class ServiceRefObjectFactory
{
Deleted:
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/serviceref/ServiceRefHandlerFactoryImpl.java
===================================================================
---
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/serviceref/ServiceRefHandlerFactoryImpl.java 2007-08-01
14:55:50 UTC (rev 4058)
+++
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/serviceref/ServiceRefHandlerFactoryImpl.java 2007-08-01
15:01:13 UTC (rev 4059)
@@ -1,41 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.container.jboss50.serviceref;
-
-//$Id: ServiceRefHandlerFactory.java 4049 2007-08-01 11:26:30Z thomas.diesler(a)jboss.com
$
-
-import org.jboss.wsf.spi.serviceref.ServiceRefHandler;
-import org.jboss.wsf.spi.serviceref.ServiceRefHandlerFactory;
-
-/**
- * A factory for the ServiceRefHandler
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 05-May-2004
- */
-public class ServiceRefHandlerFactoryImpl implements ServiceRefHandlerFactory
-{
- public ServiceRefHandler getServiceRefHandler()
- {
- return new ServiceRefHandlerImpl();
- }
-}
Deleted:
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/serviceref/ServiceRefHandlerImpl.java
===================================================================
---
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/serviceref/ServiceRefHandlerImpl.java 2007-08-01
14:55:50 UTC (rev 4058)
+++
trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/serviceref/ServiceRefHandlerImpl.java 2007-08-01
15:01:13 UTC (rev 4059)
@@ -1,187 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.container.jboss50.serviceref;
-
-// $Id: ServiceRefHandlerImpl.java 4043 2007-07-31 17:11:42Z thomas.diesler(a)jboss.com $
-
-import java.io.File;
-import java.lang.reflect.AnnotatedElement;
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import javax.naming.Context;
-import javax.naming.NamingException;
-
-import org.jboss.logging.Logger;
-import org.jboss.wsf.framework.deployment.URLLoaderAdapter;
-import org.jboss.wsf.framework.serviceref.ServiceRefObjectFactory;
-import org.jboss.wsf.spi.SPIProvider;
-import org.jboss.wsf.spi.SPIProviderResolver;
-import org.jboss.wsf.spi.WSFException;
-import org.jboss.wsf.spi.deployment.UnifiedVirtualFile;
-import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaData;
-import org.jboss.wsf.spi.serviceref.ServiceRefBinder;
-import org.jboss.wsf.spi.serviceref.ServiceRefBinderFactory;
-import org.jboss.wsf.spi.serviceref.ServiceRefElement;
-import org.jboss.wsf.spi.serviceref.ServiceRefHandler;
-import org.jboss.wsf.spi.serviceref.ServiceRefMetaData;
-import org.jboss.xb.binding.UnmarshallingContext;
-import org.xml.sax.Attributes;
-
-/**
- * Bind service refs in the client's ENC
- * for every service-ref element in the deployment descriptor.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @author Heiko.Braun(a)jboss.com
- *
- * @since 04-Nov-2006
- */
-public class ServiceRefHandlerImpl implements ServiceRefHandler
-{
- // logging support
- private static Logger log = Logger.getLogger(ServiceRefHandlerImpl.class);
-
- private ServiceRefObjectFactory objectFactory = new ServiceRefObjectFactory();
-
- private ServiceRefBinder getJaxrpcBinder()
- {
- SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
- return
spiProvider.getSPI(ServiceRefBinderFactory.class).newServiceRefBinder(Type.JAXRPC);
- }
-
- private ServiceRefBinder getJaxwsBinder()
- {
- SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
- return
spiProvider.getSPI(ServiceRefBinderFactory.class).newServiceRefBinder(Type.JAXWS);
- }
-
- public ServiceRefMetaData newServiceRefMetaData()
- {
- return new UnifiedServiceRefMetaData();
- }
-
- public void bindServiceRef(Context encCtx, String encName, UnifiedVirtualFile vfsRoot,
ClassLoader loader, ServiceRefMetaData sref) throws NamingException
- {
- if (sref.isProcessed())
- {
- log.debug("Attempt to rebind the service-ref: " +
sref.getServiceRefName());
- return;
- }
-
- // In case of an .war deployment the associated root file doesn't point to
- // the expanded war file structure and thus breaks service-ref usage for servlet
clients.
- // This needs to be fixed in org.jboss.web.AbstractWebDeployer (JBOSS_AS/server
module)
- if (vfsRoot instanceof URLLoaderAdapter)
- {
- URLLoaderAdapter ula = (URLLoaderAdapter)vfsRoot;
- URL rootURL = ula.toURL();
- if ("file".equals(rootURL.getProtocol()) &&
rootURL.getFile().endsWith(".war"))
- {
- String fileName = rootURL.getFile();
-
- if (!new File(fileName).exists()) // might be an exploded directory
- {
- // There is a filename convention for exploded directories
- fileName = fileName.substring(0, fileName.indexOf(".war")) +
"-exp.war";
-
- File expandedDirectory = new File(fileName);
- if (!expandedDirectory.exists())
- throw new WSFException("Failed to bind service-ref, the deployment
root expandedDirectory doesn't exist: " + fileName);
-
- // update the rootFile
- try
- {
- vfsRoot = new URLLoaderAdapter(expandedDirectory.toURL());
- }
- catch (MalformedURLException e)
- {
- }
- }
-
- }
- }
-
- UnifiedServiceRefMetaData serviceRef = (UnifiedServiceRefMetaData)sref;
- serviceRef.setVfsRoot(vfsRoot);
- try
- {
- if (getServiceRefType(serviceRef, loader) == Type.JAXRPC)
- {
- getJaxrpcBinder().setupServiceRef(encCtx, encName, null, serviceRef,
loader);
- }
- else
- {
- AnnotatedElement anElement = (AnnotatedElement)sref.getAnnotatedElement();
- getJaxwsBinder().setupServiceRef(encCtx, encName, anElement, serviceRef,
loader);
- }
- }
- finally
- {
- sref.setProcessed(true);
- }
- }
-
- public Object newChild(ServiceRefElement ref, UnmarshallingContext navigator, String
namespaceURI, String localName, Attributes attrs)
- {
- return objectFactory.newChild(ref, navigator, namespaceURI, localName, attrs);
- }
-
- public void setValue(ServiceRefElement ref, UnmarshallingContext navigator, String
namespaceURI, String localName, String value)
- {
- objectFactory.setValue(ref, navigator, namespaceURI, localName, value);
- }
-
- private Type getServiceRefType(UnifiedServiceRefMetaData serviceRef, ClassLoader
loader) throws NamingException
- {
- // The service-ref-type is JAXWS specific
- String serviceRefType = serviceRef.getServiceRefType();
- if (serviceRefType != null || serviceRef.getAnnotatedElement() != null)
- return Type.JAXWS;
-
- // The mapping-file is JAXRPC specific
- if (serviceRef.getMappingFile() != null)
- return Type.JAXRPC;
-
- String siName = serviceRef.getServiceInterface();
- if (siName == null)
- throw new IllegalStateException("<service-interface> cannot be
null");
-
- if (siName.equals("javax.xml.rpc.Service"))
- return Type.JAXRPC;
-
- try
- {
- Class siClass = loader.loadClass(siName);
- if (javax.xml.ws.Service.class.isAssignableFrom(siClass))
- return Type.JAXWS;
- else if (javax.xml.rpc.Service.class.isAssignableFrom(siClass))
- return Type.JAXRPC;
- else
- throw new IllegalStateException("Illegal service interface: " +
siName);
- }
- catch (ClassNotFoundException e)
- {
- throw new IllegalStateException("Cannot load <service-interface>:
" + siName);
- }
- }
-}
Modified:
trunk/integration/spi/src/main/java/org/jboss/wsf/framework/DefaultSPIProviderResolver.java
===================================================================
---
trunk/integration/spi/src/main/java/org/jboss/wsf/framework/DefaultSPIProviderResolver.java 2007-08-01
14:55:50 UTC (rev 4058)
+++
trunk/integration/spi/src/main/java/org/jboss/wsf/framework/DefaultSPIProviderResolver.java 2007-08-01
15:01:13 UTC (rev 4059)
@@ -29,6 +29,8 @@
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.serviceref.DefaultServiceRefHandler;
+import org.jboss.wsf.framework.serviceref.DefaultServiceRefHandlerFactory;
import org.jboss.wsf.spi.SPIProvider;
import org.jboss.wsf.spi.SPIProviderResolver;
import org.jboss.wsf.spi.WSFException;
@@ -100,6 +102,10 @@
{
returnType = (T)loadService(spiType,
DefaultResourceInjectorFactory.class.getName());
}
+ else if (ServiceRefHandlerFactory.class.equals(spiType))
+ {
+ returnType = (T)loadService(spiType,
DefaultServiceRefHandlerFactory.class.getName());
+ }
// SPI provided by either container or stack integration
@@ -127,10 +133,6 @@
{
returnType = (T)loadService(spiType, null);
}
- else if (ServiceRefHandlerFactory.class.equals(spiType))
- {
- returnType = (T)loadService(spiType, null);
- }
else if (WebServiceContextFactory.class.equals(spiType))
{
returnType = (T)loadService(spiType, null);
Added:
trunk/integration/spi/src/main/java/org/jboss/wsf/framework/serviceref/DefaultServiceRefHandler.java
===================================================================
---
trunk/integration/spi/src/main/java/org/jboss/wsf/framework/serviceref/DefaultServiceRefHandler.java
(rev 0)
+++
trunk/integration/spi/src/main/java/org/jboss/wsf/framework/serviceref/DefaultServiceRefHandler.java 2007-08-01
15:01:13 UTC (rev 4059)
@@ -0,0 +1,186 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.serviceref;
+
+// $Id: ServiceRefHandlerImpl.java 4043 2007-07-31 17:11:42Z thomas.diesler(a)jboss.com $
+
+import java.io.File;
+import java.lang.reflect.AnnotatedElement;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import javax.naming.Context;
+import javax.naming.NamingException;
+
+import org.jboss.logging.Logger;
+import org.jboss.wsf.framework.deployment.URLLoaderAdapter;
+import org.jboss.wsf.spi.SPIProvider;
+import org.jboss.wsf.spi.SPIProviderResolver;
+import org.jboss.wsf.spi.WSFException;
+import org.jboss.wsf.spi.deployment.UnifiedVirtualFile;
+import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaData;
+import org.jboss.wsf.spi.serviceref.ServiceRefBinder;
+import org.jboss.wsf.spi.serviceref.ServiceRefBinderFactory;
+import org.jboss.wsf.spi.serviceref.ServiceRefElement;
+import org.jboss.wsf.spi.serviceref.ServiceRefHandler;
+import org.jboss.wsf.spi.serviceref.ServiceRefMetaData;
+import org.jboss.xb.binding.UnmarshallingContext;
+import org.xml.sax.Attributes;
+
+/**
+ * Bind service refs in the client's ENC
+ * for every service-ref element in the deployment descriptor.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @author Heiko.Braun(a)jboss.com
+ *
+ * @since 04-Nov-2006
+ */
+public class DefaultServiceRefHandler implements ServiceRefHandler
+{
+ // logging support
+ private static Logger log = Logger.getLogger(DefaultServiceRefHandler.class);
+
+ private ServiceRefObjectFactory objectFactory = new ServiceRefObjectFactory();
+
+ private ServiceRefBinder getJaxrpcBinder()
+ {
+ SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
+ return
spiProvider.getSPI(ServiceRefBinderFactory.class).newServiceRefBinder(Type.JAXRPC);
+ }
+
+ private ServiceRefBinder getJaxwsBinder()
+ {
+ SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
+ return
spiProvider.getSPI(ServiceRefBinderFactory.class).newServiceRefBinder(Type.JAXWS);
+ }
+
+ public ServiceRefMetaData newServiceRefMetaData()
+ {
+ return new UnifiedServiceRefMetaData();
+ }
+
+ public void bindServiceRef(Context encCtx, String encName, UnifiedVirtualFile vfsRoot,
ClassLoader loader, ServiceRefMetaData sref) throws NamingException
+ {
+ if (sref.isProcessed())
+ {
+ log.debug("Attempt to rebind the service-ref: " +
sref.getServiceRefName());
+ return;
+ }
+
+ // In case of an .war deployment the associated root file doesn't point to
+ // the expanded war file structure and thus breaks service-ref usage for servlet
clients.
+ // This needs to be fixed in org.jboss.web.AbstractWebDeployer (JBOSS_AS/server
module)
+ if (vfsRoot instanceof URLLoaderAdapter)
+ {
+ URLLoaderAdapter ula = (URLLoaderAdapter)vfsRoot;
+ URL rootURL = ula.toURL();
+ if ("file".equals(rootURL.getProtocol()) &&
rootURL.getFile().endsWith(".war"))
+ {
+ String fileName = rootURL.getFile();
+
+ if (!new File(fileName).exists()) // might be an exploded directory
+ {
+ // There is a filename convention for exploded directories
+ fileName = fileName.substring(0, fileName.indexOf(".war")) +
"-exp.war";
+
+ File expandedDirectory = new File(fileName);
+ if (!expandedDirectory.exists())
+ throw new WSFException("Failed to bind service-ref, the deployment
root expandedDirectory doesn't exist: " + fileName);
+
+ // update the rootFile
+ try
+ {
+ vfsRoot = new URLLoaderAdapter(expandedDirectory.toURL());
+ }
+ catch (MalformedURLException e)
+ {
+ }
+ }
+
+ }
+ }
+
+ UnifiedServiceRefMetaData serviceRef = (UnifiedServiceRefMetaData)sref;
+ serviceRef.setVfsRoot(vfsRoot);
+ try
+ {
+ if (getServiceRefType(serviceRef, loader) == Type.JAXRPC)
+ {
+ getJaxrpcBinder().setupServiceRef(encCtx, encName, null, serviceRef,
loader);
+ }
+ else
+ {
+ AnnotatedElement anElement = (AnnotatedElement)sref.getAnnotatedElement();
+ getJaxwsBinder().setupServiceRef(encCtx, encName, anElement, serviceRef,
loader);
+ }
+ }
+ finally
+ {
+ sref.setProcessed(true);
+ }
+ }
+
+ public Object newChild(ServiceRefElement ref, UnmarshallingContext navigator, String
namespaceURI, String localName, Attributes attrs)
+ {
+ return objectFactory.newChild(ref, navigator, namespaceURI, localName, attrs);
+ }
+
+ public void setValue(ServiceRefElement ref, UnmarshallingContext navigator, String
namespaceURI, String localName, String value)
+ {
+ objectFactory.setValue(ref, navigator, namespaceURI, localName, value);
+ }
+
+ private Type getServiceRefType(UnifiedServiceRefMetaData serviceRef, ClassLoader
loader) throws NamingException
+ {
+ // The service-ref-type is JAXWS specific
+ String serviceRefType = serviceRef.getServiceRefType();
+ if (serviceRefType != null || serviceRef.getAnnotatedElement() != null)
+ return Type.JAXWS;
+
+ // The mapping-file is JAXRPC specific
+ if (serviceRef.getMappingFile() != null)
+ return Type.JAXRPC;
+
+ String siName = serviceRef.getServiceInterface();
+ if (siName == null)
+ throw new IllegalStateException("<service-interface> cannot be
null");
+
+ if (siName.equals("javax.xml.rpc.Service"))
+ return Type.JAXRPC;
+
+ try
+ {
+ Class siClass = loader.loadClass(siName);
+ if (javax.xml.ws.Service.class.isAssignableFrom(siClass))
+ return Type.JAXWS;
+ else if (javax.xml.rpc.Service.class.isAssignableFrom(siClass))
+ return Type.JAXRPC;
+ else
+ throw new IllegalStateException("Illegal service interface: " +
siName);
+ }
+ catch (ClassNotFoundException e)
+ {
+ throw new IllegalStateException("Cannot load <service-interface>:
" + siName);
+ }
+ }
+}
Added:
trunk/integration/spi/src/main/java/org/jboss/wsf/framework/serviceref/DefaultServiceRefHandlerFactory.java
===================================================================
---
trunk/integration/spi/src/main/java/org/jboss/wsf/framework/serviceref/DefaultServiceRefHandlerFactory.java
(rev 0)
+++
trunk/integration/spi/src/main/java/org/jboss/wsf/framework/serviceref/DefaultServiceRefHandlerFactory.java 2007-08-01
15:01:13 UTC (rev 4059)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.serviceref;
+
+//$Id: ServiceRefHandlerFactory.java 4049 2007-08-01 11:26:30Z thomas.diesler(a)jboss.com
$
+
+import org.jboss.wsf.spi.serviceref.ServiceRefHandler;
+import org.jboss.wsf.spi.serviceref.ServiceRefHandlerFactory;
+
+/**
+ * A factory for the ServiceRefHandler
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 05-May-2004
+ */
+public class DefaultServiceRefHandlerFactory implements ServiceRefHandlerFactory
+{
+ public ServiceRefHandler getServiceRefHandler()
+ {
+ return new DefaultServiceRefHandler();
+ }
+}