JBossWS SVN: r17017 - common/tags.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2012-11-16 10:13:55 -0500 (Fri, 16 Nov 2012)
New Revision: 17017
Added:
common/tags/jbossws-common-2.1.1.Beta1/
Log:
tagging JBossWS Common 2.1.1.Beta1
12 years, 1 month
JBossWS SVN: r17014 - spi/tags.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2012-11-16 10:00:32 -0500 (Fri, 16 Nov 2012)
New Revision: 17014
Added:
spi/tags/jbossws-spi-2.1.1.Beta1/
Log:
tagging JBossWS SPI 2.1.1.Beta1
12 years, 1 month
JBossWS SVN: r17012 - in container/jboss71/branches: jbossws-jboss711/server-integration/src/main/java/org/jboss/as/webservices/util and 7 other directories.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2012-11-16 09:39:04 -0500 (Fri, 16 Nov 2012)
New Revision: 17012
Modified:
container/jboss71/branches/jbossws-jboss711/pom.xml
container/jboss71/branches/jbossws-jboss711/server-integration/src/main/java/org/jboss/as/webservices/util/VirtualFileAdaptor.java
container/jboss71/branches/jbossws-jboss711/server-integration/src/main/java/org/jboss/as/webservices/webserviceref/WSRefUtils.java
container/jboss71/branches/jbossws-jboss711/server-integration/src/main/java/org/jboss/as/webservices/webserviceref/WSRefValueSource.java
container/jboss71/branches/jbossws-jboss712/pom.xml
container/jboss71/branches/jbossws-jboss712/server-integration/src/main/java/org/jboss/as/webservices/util/VirtualFileAdaptor.java
container/jboss71/branches/jbossws-jboss712/server-integration/src/main/java/org/jboss/as/webservices/webserviceref/WSRefUtils.java
container/jboss71/branches/jbossws-jboss712/server-integration/src/main/java/org/jboss/as/webservices/webserviceref/WSRefValueSource.java
container/jboss71/branches/jbossws-jboss713/pom.xml
container/jboss71/branches/jbossws-jboss713/server-integration/src/main/java/org/jboss/as/webservices/util/VirtualFileAdaptor.java
container/jboss71/branches/jbossws-jboss713/server-integration/src/main/java/org/jboss/as/webservices/webserviceref/WSRefUtils.java
container/jboss71/branches/jbossws-jboss713/server-integration/src/main/java/org/jboss/as/webservices/webserviceref/WSRefValueSource.java
Log:
[JBWS-3565] WS ref optimization
Modified: container/jboss71/branches/jbossws-jboss711/pom.xml
===================================================================
--- container/jboss71/branches/jbossws-jboss711/pom.xml 2012-11-16 14:15:11 UTC (rev 17011)
+++ container/jboss71/branches/jbossws-jboss711/pom.xml 2012-11-16 14:39:04 UTC (rev 17012)
@@ -51,8 +51,8 @@
<properties>
<jbossws.api.version>1.0.1.Final</jbossws.api.version>
- <jbossws.spi.version>2.1.0.Final</jbossws.spi.version>
- <jbossws.common.version>2.1.0.Final</jbossws.common.version>
+ <jbossws.spi.version>2.1.1-SNAPSHOT</jbossws.spi.version>
+ <jbossws.common.version>2.1.1-SNAPSHOT</jbossws.common.version>
<jboss.msc.version>1.0.2.GA</jboss.msc.version>
<jboss.version>7.1.1.Final</jboss.version>
<jboss.jaxws.api.version>2.0.0.Final</jboss.jaxws.api.version>
Modified: container/jboss71/branches/jbossws-jboss711/server-integration/src/main/java/org/jboss/as/webservices/util/VirtualFileAdaptor.java
===================================================================
--- container/jboss71/branches/jbossws-jboss711/server-integration/src/main/java/org/jboss/as/webservices/util/VirtualFileAdaptor.java 2012-11-16 14:15:11 UTC (rev 17011)
+++ container/jboss71/branches/jbossws-jboss711/server-integration/src/main/java/org/jboss/as/webservices/util/VirtualFileAdaptor.java 2012-11-16 14:39:04 UTC (rev 17012)
@@ -23,29 +23,13 @@
import static org.jboss.as.webservices.WSMessages.MESSAGES;
-import java.io.File;
-import java.io.FileFilter;
import java.io.IOException;
-import java.io.InputStream;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.ObjectStreamField;
-import java.io.OutputStream;
-import java.net.URI;
-import java.net.URISyntaxException;
import java.net.URL;
import java.util.LinkedList;
import java.util.List;
-import java.util.jar.JarEntry;
-import java.util.jar.JarInputStream;
-import java.util.jar.JarOutputStream;
-import org.jboss.vfs.VFS;
-import org.jboss.vfs.VFSUtils;
import org.jboss.vfs.VirtualFile;
import org.jboss.wsf.spi.deployment.UnifiedVirtualFile;
-import org.jboss.wsf.spi.deployment.WritableUnifiedVirtualFile;
-import org.jboss.wsf.spi.util.URLLoaderAdapter;
/**
* A VirtualFile adaptor.
@@ -54,68 +38,20 @@
* @author Ales.Justin(a)jboss.org
* @author alessio.soldano(a)jboss.com
*/
-public final class VirtualFileAdaptor implements WritableUnifiedVirtualFile {
- private static final long serialVersionUID = -4509594124653184348L;
+public final class VirtualFileAdaptor implements UnifiedVirtualFile {
- private static final ObjectStreamField[] serialPersistentFields = { new ObjectStreamField("rootUrl", URL.class),
- new ObjectStreamField("path", String.class), new ObjectStreamField("requiresMount", boolean.class) };
+ private static final long serialVersionUID = -4509594124653184349L;
- /** Minimal info to get full vfs file structure */
- private URL rootUrl;
- private String path;
- private boolean requiresMount;
- /** The virtual file */
private transient VirtualFile file;
public VirtualFileAdaptor(VirtualFile file) {
this.file = file;
}
- public VirtualFileAdaptor(URL rootUrl, String path) {
- this(rootUrl, path, false);
- }
-
- protected VirtualFileAdaptor(URL rootUrl, String path, boolean requiresMount) {
- if (rootUrl == null)
- throw MESSAGES.nullRootUrl();
- if (path == null)
- throw MESSAGES.nullPath();
-
- this.rootUrl = rootUrl;
- this.path = path;
- this.requiresMount = requiresMount;
- }
-
- /**
- * Get the virtual file. Create file from root url and path if it doesn't exist yet.
- *
- * @return virtual file root
- * @throws IOException for any error
- */
- protected VirtualFile getFile() throws IOException {
- if (file == null) {
- VirtualFile root;
- try {
- root = VFS.getChild(rootUrl.toURI());
- } catch (URISyntaxException e) {
- throw MESSAGES.cannotGetVirtualFile(e, rootUrl);
- }
- file = root.getChild(path);
-
- if (!file.exists()) {
- throw MESSAGES.missingVirtualFile(file);
- } else if (requiresMount && !isMounted(root, file)) {
- throw MESSAGES.unmountedVirtualFile(file);
- }
- }
+ private VirtualFile getFile() throws IOException {
return file;
}
- private static boolean isMounted(VirtualFile root, VirtualFile child) throws IOException {
- return !(root.getPathName().equals(root.getPhysicalFile().getAbsolutePath()) && child.getPathName().equals(
- child.getPhysicalFile().getAbsolutePath()));
- }
-
public UnifiedVirtualFile findChild(String child) throws IOException {
final VirtualFile virtualFile = getFile();
final VirtualFile childFile = file.getChild(child);
@@ -132,84 +68,6 @@
}
}
- public void writeContent(OutputStream bos) throws IOException {
- writeContent(bos, null);
- }
-
- public void writeContent(OutputStream bos, NameFilter filter) throws IOException {
- InputStream is = null;
- try {
- is = getFile().openStream();
- if (is instanceof JarInputStream) {
- JarInputStream jis = (JarInputStream) is;
- JarOutputStream os = new JarOutputStream(bos);
- JarEntry je = null;
- while ((je = jis.getNextJarEntry()) != null) {
- if (filter != null && filter.accept(je.getName())) {
- os.putNextEntry(je);
- VFSUtils.copyStream(jis, os);
- }
- }
- VFSUtils.safeClose(os);
- } else {
- VFSUtils.copyStream(is, bos);
- }
- } finally {
- VFSUtils.safeClose(is);
- }
- }
-
- private void writeObject(ObjectOutputStream out) throws IOException, URISyntaxException {
- VirtualFile file = getFile();
- URL url = rootUrl;
- if (url == null) {
- VirtualFile parentFile = file.getParent();
- url = parentFile != null ? parentFile.toURL() : null;
- }
- String pathName = path;
- if (pathName == null)
- pathName = file.getName();
-
- ObjectOutputStream.PutField fields = out.putFields();
- fields.put("rootUrl", url);
- fields.put("path", pathName);
-
- URI uri = url != null ? url.toURI() : null;
- VirtualFile newRoot = VFS.getChild(uri);
- VirtualFile newChild = newRoot.getChild(pathName);
- fields.put("requiresMount", isMounted(newRoot, newChild));
-
- out.writeFields();
- }
-
- private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
- ObjectInputStream.GetField fields = in.readFields();
- rootUrl = (URL) fields.get("rootUrl", null);
- path = (String) fields.get("path", null);
- requiresMount = fields.get("requiresMount", false);
- }
-
- private Object writeReplace() {
- // TODO: hack to enable remote tests
- try {
- File archive = file.getPhysicalFile();
- if (archive.list().length == 0) {
- final File parent = file.getPhysicalFile().getParentFile();
- final File[] children = parent.listFiles(new FileFilter() {
- @Override
- public boolean accept(File fileOrDir) {
- return fileOrDir.isFile();
- }
- });
- archive = children[0];
- }
- // Offer different UnifiedVirtualFile implementation for deserialization process
- return new URLLoaderAdapter(archive.toURI().toURL());
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
-
public List<UnifiedVirtualFile> getChildren() throws IOException {
List<VirtualFile> vfList = getFile().getChildren();
if (vfList == null)
Modified: container/jboss71/branches/jbossws-jboss711/server-integration/src/main/java/org/jboss/as/webservices/webserviceref/WSRefUtils.java
===================================================================
--- container/jboss71/branches/jbossws-jboss711/server-integration/src/main/java/org/jboss/as/webservices/webserviceref/WSRefUtils.java 2012-11-16 14:15:11 UTC (rev 17011)
+++ container/jboss71/branches/jbossws-jboss711/server-integration/src/main/java/org/jboss/as/webservices/webserviceref/WSRefUtils.java 2012-11-16 14:39:04 UTC (rev 17012)
@@ -57,7 +57,7 @@
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedPortComponentRefMetaData;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaData;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedStubPropertyMetaData;
-import org.jboss.wsf.spi.serviceref.ServiceRefHandler.Type;
+import org.jboss.wsf.spi.serviceref.ServiceRefType;
/**
* Translates WS Refs from JBossAS MD to JBossWS UMDM format.
@@ -241,7 +241,7 @@
static void processType(final UnifiedServiceRefMetaData serviceRefUMDM) {
final boolean isJAXRPC = serviceRefUMDM.getMappingFile() != null || "javax.xml.rpc.Service".equals(serviceRefUMDM.getServiceInterface());
- serviceRefUMDM.setType(isJAXRPC ? Type.JAXRPC : Type.JAXWS);
+ serviceRefUMDM.setType(isJAXRPC ? ServiceRefType.JAXRPC : ServiceRefType.JAXWS);
}
static void processAnnotatedElement(final AnnotatedElement anElement, final UnifiedServiceRefMetaData serviceRefUMDM) {
Modified: container/jboss71/branches/jbossws-jboss711/server-integration/src/main/java/org/jboss/as/webservices/webserviceref/WSRefValueSource.java
===================================================================
--- container/jboss71/branches/jbossws-jboss711/server-integration/src/main/java/org/jboss/as/webservices/webserviceref/WSRefValueSource.java 2012-11-16 14:15:11 UTC (rev 17011)
+++ container/jboss71/branches/jbossws-jboss711/server-integration/src/main/java/org/jboss/as/webservices/webserviceref/WSRefValueSource.java 2012-11-16 14:39:04 UTC (rev 17012)
@@ -25,9 +25,6 @@
import static org.jboss.as.webservices.webserviceref.SecurityActions.getContextClassLoader;
import static org.jboss.as.webservices.webserviceref.SecurityActions.setContextClassLoader;
-import javax.naming.Referenceable;
-import javax.naming.spi.ObjectFactory;
-
import org.jboss.as.ee.component.InjectionSource;
import org.jboss.as.naming.ManagedReferenceFactory;
import org.jboss.as.naming.ValueManagedReferenceFactory;
@@ -41,9 +38,9 @@
import org.jboss.wsf.spi.SPIProviderResolver;
import org.jboss.wsf.spi.classloading.ClassLoaderProvider;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaData;
-import org.jboss.wsf.spi.serviceref.ServiceRefHandler;
-import org.jboss.wsf.spi.serviceref.ServiceRefHandler.Type;
-import org.jboss.wsf.spi.serviceref.ServiceRefHandlerFactory;
+import org.jboss.wsf.spi.serviceref.ServiceRefType;
+import org.jboss.wsf.spi.serviceref.ServiceRefFactory;
+import org.jboss.wsf.spi.serviceref.ServiceRefFactoryFactory;
/**
* WebServiceRef injection source.
@@ -64,17 +61,13 @@
serviceBuilder.addInjection(injector, factory);
}
- public Object getValue() throws IllegalStateException, IllegalArgumentException {
+ public Object getValue() {
final ClassLoader oldCL = getContextClassLoader();
try {
final ClassLoader integrationCL = new DelegateClassLoader(getClassLoader(), classLoader);
setContextClassLoader(integrationCL);
- final Referenceable referenceable = getReferenceable(integrationCL);
- final Class<?> clazz = Class.forName(referenceable.getReference().getFactoryClassName(), true, integrationCL);
- final ObjectFactory factory = (ObjectFactory)clazz.newInstance();
- return factory.getObjectInstance(referenceable.getReference(), null, null, null);
- } catch (final Exception e) {
- throw new RuntimeException(e);
+ final ServiceRefFactory serviceRefFactory = getServiceRefFactory();
+ return serviceRefFactory.newServiceRef(serviceRef);
} finally {
setContextClassLoader(oldCL);
}
@@ -82,17 +75,16 @@
private ClassLoader getClassLoader() {
ClassLoaderProvider provider = ClassLoaderProvider.getDefaultProvider();
- if (!Type.JAXRPC.equals(serviceRef.getType())) {
+ if (!ServiceRefType.JAXRPC.equals(serviceRef.getType())) {
return provider.getServerIntegrationClassLoader();
} else {
return provider.getServerJAXRPCIntegrationClassLoader();
}
}
- private Referenceable getReferenceable(final ClassLoader loader) {
+ private ServiceRefFactory getServiceRefFactory() {
final SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
- final ServiceRefHandler serviceRefHandler = spiProvider.getSPI(ServiceRefHandlerFactory.class, loader).getServiceRefHandler();
- return serviceRefHandler.createReferenceable(serviceRef);
+ return spiProvider.getSPI(ServiceRefFactoryFactory.class).newServiceRefFactory();
}
}
\ No newline at end of file
Modified: container/jboss71/branches/jbossws-jboss712/pom.xml
===================================================================
--- container/jboss71/branches/jbossws-jboss712/pom.xml 2012-11-16 14:15:11 UTC (rev 17011)
+++ container/jboss71/branches/jbossws-jboss712/pom.xml 2012-11-16 14:39:04 UTC (rev 17012)
@@ -51,8 +51,8 @@
<properties>
<jbossws.api.version>1.0.1.Final</jbossws.api.version>
- <jbossws.spi.version>2.1.0.Final</jbossws.spi.version>
- <jbossws.common.version>2.1.0.Final</jbossws.common.version>
+ <jbossws.spi.version>2.1.1-SNAPSHOT</jbossws.spi.version>
+ <jbossws.common.version>2.1.1-SNAPSHOT</jbossws.common.version>
<jboss.msc.version>1.0.2.GA</jboss.msc.version>
<jboss.version>7.1.2.Final</jboss.version>
<jboss.jaxws.api.version>2.0.1.Final</jboss.jaxws.api.version>
Modified: container/jboss71/branches/jbossws-jboss712/server-integration/src/main/java/org/jboss/as/webservices/util/VirtualFileAdaptor.java
===================================================================
--- container/jboss71/branches/jbossws-jboss712/server-integration/src/main/java/org/jboss/as/webservices/util/VirtualFileAdaptor.java 2012-11-16 14:15:11 UTC (rev 17011)
+++ container/jboss71/branches/jbossws-jboss712/server-integration/src/main/java/org/jboss/as/webservices/util/VirtualFileAdaptor.java 2012-11-16 14:39:04 UTC (rev 17012)
@@ -23,29 +23,13 @@
import static org.jboss.as.webservices.WSMessages.MESSAGES;
-import java.io.File;
-import java.io.FileFilter;
import java.io.IOException;
-import java.io.InputStream;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.ObjectStreamField;
-import java.io.OutputStream;
-import java.net.URI;
-import java.net.URISyntaxException;
import java.net.URL;
import java.util.LinkedList;
import java.util.List;
-import java.util.jar.JarEntry;
-import java.util.jar.JarInputStream;
-import java.util.jar.JarOutputStream;
-import org.jboss.vfs.VFS;
-import org.jboss.vfs.VFSUtils;
import org.jboss.vfs.VirtualFile;
import org.jboss.wsf.spi.deployment.UnifiedVirtualFile;
-import org.jboss.wsf.spi.deployment.WritableUnifiedVirtualFile;
-import org.jboss.wsf.spi.util.URLLoaderAdapter;
/**
* A VirtualFile adaptor.
@@ -54,68 +38,20 @@
* @author Ales.Justin(a)jboss.org
* @author alessio.soldano(a)jboss.com
*/
-public final class VirtualFileAdaptor implements WritableUnifiedVirtualFile {
- private static final long serialVersionUID = -4509594124653184348L;
+public final class VirtualFileAdaptor implements UnifiedVirtualFile {
- private static final ObjectStreamField[] serialPersistentFields = { new ObjectStreamField("rootUrl", URL.class),
- new ObjectStreamField("path", String.class), new ObjectStreamField("requiresMount", boolean.class) };
+ private static final long serialVersionUID = -4509594124653184349L;
- /** Minimal info to get full vfs file structure */
- private URL rootUrl;
- private String path;
- private boolean requiresMount;
- /** The virtual file */
private transient VirtualFile file;
public VirtualFileAdaptor(VirtualFile file) {
this.file = file;
}
- public VirtualFileAdaptor(URL rootUrl, String path) {
- this(rootUrl, path, false);
- }
-
- protected VirtualFileAdaptor(URL rootUrl, String path, boolean requiresMount) {
- if (rootUrl == null)
- throw MESSAGES.nullRootUrl();
- if (path == null)
- throw MESSAGES.nullPath();
-
- this.rootUrl = rootUrl;
- this.path = path;
- this.requiresMount = requiresMount;
- }
-
- /**
- * Get the virtual file. Create file from root url and path if it doesn't exist yet.
- *
- * @return virtual file root
- * @throws IOException for any error
- */
- protected VirtualFile getFile() throws IOException {
- if (file == null) {
- VirtualFile root;
- try {
- root = VFS.getChild(rootUrl.toURI());
- } catch (URISyntaxException e) {
- throw MESSAGES.cannotGetVirtualFile(e, rootUrl);
- }
- file = root.getChild(path);
-
- if (!file.exists()) {
- throw MESSAGES.missingVirtualFile(file);
- } else if (requiresMount && !isMounted(root, file)) {
- throw MESSAGES.unmountedVirtualFile(file);
- }
- }
+ private VirtualFile getFile() throws IOException {
return file;
}
- private static boolean isMounted(VirtualFile root, VirtualFile child) throws IOException {
- return !(root.getPathName().equals(root.getPhysicalFile().getAbsolutePath()) && child.getPathName().equals(
- child.getPhysicalFile().getAbsolutePath()));
- }
-
public UnifiedVirtualFile findChild(String child) throws IOException {
final VirtualFile virtualFile = getFile();
final VirtualFile childFile = file.getChild(child);
@@ -132,84 +68,6 @@
}
}
- public void writeContent(OutputStream bos) throws IOException {
- writeContent(bos, null);
- }
-
- public void writeContent(OutputStream bos, NameFilter filter) throws IOException {
- InputStream is = null;
- try {
- is = getFile().openStream();
- if (is instanceof JarInputStream) {
- JarInputStream jis = (JarInputStream) is;
- JarOutputStream os = new JarOutputStream(bos);
- JarEntry je = null;
- while ((je = jis.getNextJarEntry()) != null) {
- if (filter != null && filter.accept(je.getName())) {
- os.putNextEntry(je);
- VFSUtils.copyStream(jis, os);
- }
- }
- VFSUtils.safeClose(os);
- } else {
- VFSUtils.copyStream(is, bos);
- }
- } finally {
- VFSUtils.safeClose(is);
- }
- }
-
- private void writeObject(ObjectOutputStream out) throws IOException, URISyntaxException {
- VirtualFile file = getFile();
- URL url = rootUrl;
- if (url == null) {
- VirtualFile parentFile = file.getParent();
- url = parentFile != null ? parentFile.toURL() : null;
- }
- String pathName = path;
- if (pathName == null)
- pathName = file.getName();
-
- ObjectOutputStream.PutField fields = out.putFields();
- fields.put("rootUrl", url);
- fields.put("path", pathName);
-
- URI uri = url != null ? url.toURI() : null;
- VirtualFile newRoot = VFS.getChild(uri);
- VirtualFile newChild = newRoot.getChild(pathName);
- fields.put("requiresMount", isMounted(newRoot, newChild));
-
- out.writeFields();
- }
-
- private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
- ObjectInputStream.GetField fields = in.readFields();
- rootUrl = (URL) fields.get("rootUrl", null);
- path = (String) fields.get("path", null);
- requiresMount = fields.get("requiresMount", false);
- }
-
- private Object writeReplace() {
- // TODO: hack to enable remote tests
- try {
- File archive = file.getPhysicalFile();
- if (archive.list().length == 0) {
- final File parent = file.getPhysicalFile().getParentFile();
- final File[] children = parent.listFiles(new FileFilter() {
- @Override
- public boolean accept(File fileOrDir) {
- return fileOrDir.isFile();
- }
- });
- archive = children[0];
- }
- // Offer different UnifiedVirtualFile implementation for deserialization process
- return new URLLoaderAdapter(archive.toURI().toURL());
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
-
public List<UnifiedVirtualFile> getChildren() throws IOException {
List<VirtualFile> vfList = getFile().getChildren();
if (vfList == null)
Modified: container/jboss71/branches/jbossws-jboss712/server-integration/src/main/java/org/jboss/as/webservices/webserviceref/WSRefUtils.java
===================================================================
--- container/jboss71/branches/jbossws-jboss712/server-integration/src/main/java/org/jboss/as/webservices/webserviceref/WSRefUtils.java 2012-11-16 14:15:11 UTC (rev 17011)
+++ container/jboss71/branches/jbossws-jboss712/server-integration/src/main/java/org/jboss/as/webservices/webserviceref/WSRefUtils.java 2012-11-16 14:39:04 UTC (rev 17012)
@@ -57,7 +57,7 @@
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedPortComponentRefMetaData;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaData;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedStubPropertyMetaData;
-import org.jboss.wsf.spi.serviceref.ServiceRefHandler.Type;
+import org.jboss.wsf.spi.serviceref.ServiceRefType;
/**
* Translates WS Refs from JBossAS MD to JBossWS UMDM format.
@@ -241,7 +241,7 @@
static void processType(final UnifiedServiceRefMetaData serviceRefUMDM) {
final boolean isJAXRPC = serviceRefUMDM.getMappingFile() != null || "javax.xml.rpc.Service".equals(serviceRefUMDM.getServiceInterface());
- serviceRefUMDM.setType(isJAXRPC ? Type.JAXRPC : Type.JAXWS);
+ serviceRefUMDM.setType(isJAXRPC ? ServiceRefType.JAXRPC : ServiceRefType.JAXWS);
}
static void processAnnotatedElement(final AnnotatedElement anElement, final UnifiedServiceRefMetaData serviceRefUMDM) {
Modified: container/jboss71/branches/jbossws-jboss712/server-integration/src/main/java/org/jboss/as/webservices/webserviceref/WSRefValueSource.java
===================================================================
--- container/jboss71/branches/jbossws-jboss712/server-integration/src/main/java/org/jboss/as/webservices/webserviceref/WSRefValueSource.java 2012-11-16 14:15:11 UTC (rev 17011)
+++ container/jboss71/branches/jbossws-jboss712/server-integration/src/main/java/org/jboss/as/webservices/webserviceref/WSRefValueSource.java 2012-11-16 14:39:04 UTC (rev 17012)
@@ -25,9 +25,6 @@
import static org.jboss.as.webservices.webserviceref.SecurityActions.getContextClassLoader;
import static org.jboss.as.webservices.webserviceref.SecurityActions.setContextClassLoader;
-import javax.naming.Referenceable;
-import javax.naming.spi.ObjectFactory;
-
import org.jboss.as.ee.component.InjectionSource;
import org.jboss.as.naming.ManagedReferenceFactory;
import org.jboss.as.naming.ValueManagedReferenceFactory;
@@ -41,9 +38,9 @@
import org.jboss.wsf.spi.SPIProviderResolver;
import org.jboss.wsf.spi.classloading.ClassLoaderProvider;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaData;
-import org.jboss.wsf.spi.serviceref.ServiceRefHandler;
-import org.jboss.wsf.spi.serviceref.ServiceRefHandler.Type;
-import org.jboss.wsf.spi.serviceref.ServiceRefHandlerFactory;
+import org.jboss.wsf.spi.serviceref.ServiceRefType;
+import org.jboss.wsf.spi.serviceref.ServiceRefFactory;
+import org.jboss.wsf.spi.serviceref.ServiceRefFactoryFactory;
/**
* WebServiceRef injection source.
@@ -64,17 +61,13 @@
serviceBuilder.addInjection(injector, factory);
}
- public Object getValue() throws IllegalStateException, IllegalArgumentException {
+ public Object getValue() {
final ClassLoader oldCL = getContextClassLoader();
try {
final ClassLoader integrationCL = new DelegateClassLoader(getClassLoader(), classLoader);
setContextClassLoader(integrationCL);
- final Referenceable referenceable = getReferenceable(integrationCL);
- final Class<?> clazz = Class.forName(referenceable.getReference().getFactoryClassName(), true, integrationCL);
- final ObjectFactory factory = (ObjectFactory)clazz.newInstance();
- return factory.getObjectInstance(referenceable.getReference(), null, null, null);
- } catch (final Exception e) {
- throw new RuntimeException(e);
+ final ServiceRefFactory serviceRefFactory = getServiceRefFactory();
+ return serviceRefFactory.newServiceRef(serviceRef);
} finally {
setContextClassLoader(oldCL);
}
@@ -82,17 +75,16 @@
private ClassLoader getClassLoader() {
ClassLoaderProvider provider = ClassLoaderProvider.getDefaultProvider();
- if (!Type.JAXRPC.equals(serviceRef.getType())) {
+ if (!ServiceRefType.JAXRPC.equals(serviceRef.getType())) {
return provider.getServerIntegrationClassLoader();
} else {
return provider.getServerJAXRPCIntegrationClassLoader();
}
}
- private Referenceable getReferenceable(final ClassLoader loader) {
+ private ServiceRefFactory getServiceRefFactory() {
final SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
- final ServiceRefHandler serviceRefHandler = spiProvider.getSPI(ServiceRefHandlerFactory.class, loader).getServiceRefHandler();
- return serviceRefHandler.createReferenceable(serviceRef);
+ return spiProvider.getSPI(ServiceRefFactoryFactory.class).newServiceRefFactory();
}
}
\ No newline at end of file
Modified: container/jboss71/branches/jbossws-jboss713/pom.xml
===================================================================
(Binary files differ)
Modified: container/jboss71/branches/jbossws-jboss713/server-integration/src/main/java/org/jboss/as/webservices/util/VirtualFileAdaptor.java
===================================================================
--- container/jboss71/branches/jbossws-jboss713/server-integration/src/main/java/org/jboss/as/webservices/util/VirtualFileAdaptor.java 2012-11-16 14:15:11 UTC (rev 17011)
+++ container/jboss71/branches/jbossws-jboss713/server-integration/src/main/java/org/jboss/as/webservices/util/VirtualFileAdaptor.java 2012-11-16 14:39:04 UTC (rev 17012)
@@ -23,29 +23,13 @@
import static org.jboss.as.webservices.WSMessages.MESSAGES;
-import java.io.File;
-import java.io.FileFilter;
import java.io.IOException;
-import java.io.InputStream;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.ObjectStreamField;
-import java.io.OutputStream;
-import java.net.URI;
-import java.net.URISyntaxException;
import java.net.URL;
import java.util.LinkedList;
import java.util.List;
-import java.util.jar.JarEntry;
-import java.util.jar.JarInputStream;
-import java.util.jar.JarOutputStream;
-import org.jboss.vfs.VFS;
-import org.jboss.vfs.VFSUtils;
import org.jboss.vfs.VirtualFile;
import org.jboss.wsf.spi.deployment.UnifiedVirtualFile;
-import org.jboss.wsf.spi.deployment.WritableUnifiedVirtualFile;
-import org.jboss.wsf.spi.util.URLLoaderAdapter;
/**
* A VirtualFile adaptor.
@@ -54,68 +38,20 @@
* @author Ales.Justin(a)jboss.org
* @author alessio.soldano(a)jboss.com
*/
-public final class VirtualFileAdaptor implements WritableUnifiedVirtualFile {
- private static final long serialVersionUID = -4509594124653184348L;
+public final class VirtualFileAdaptor implements UnifiedVirtualFile {
- private static final ObjectStreamField[] serialPersistentFields = { new ObjectStreamField("rootUrl", URL.class),
- new ObjectStreamField("path", String.class), new ObjectStreamField("requiresMount", boolean.class) };
+ private static final long serialVersionUID = -4509594124653184349L;
- /** Minimal info to get full vfs file structure */
- private URL rootUrl;
- private String path;
- private boolean requiresMount;
- /** The virtual file */
private transient VirtualFile file;
public VirtualFileAdaptor(VirtualFile file) {
this.file = file;
}
- public VirtualFileAdaptor(URL rootUrl, String path) {
- this(rootUrl, path, false);
- }
-
- protected VirtualFileAdaptor(URL rootUrl, String path, boolean requiresMount) {
- if (rootUrl == null)
- throw MESSAGES.nullRootUrl();
- if (path == null)
- throw MESSAGES.nullPath();
-
- this.rootUrl = rootUrl;
- this.path = path;
- this.requiresMount = requiresMount;
- }
-
- /**
- * Get the virtual file. Create file from root url and path if it doesn't exist yet.
- *
- * @return virtual file root
- * @throws IOException for any error
- */
- protected VirtualFile getFile() throws IOException {
- if (file == null) {
- VirtualFile root;
- try {
- root = VFS.getChild(rootUrl.toURI());
- } catch (URISyntaxException e) {
- throw MESSAGES.cannotGetVirtualFile(e, rootUrl);
- }
- file = root.getChild(path);
-
- if (!file.exists()) {
- throw MESSAGES.missingVirtualFile(file);
- } else if (requiresMount && !isMounted(root, file)) {
- throw MESSAGES.unmountedVirtualFile(file);
- }
- }
+ private VirtualFile getFile() throws IOException {
return file;
}
- private static boolean isMounted(VirtualFile root, VirtualFile child) throws IOException {
- return !(root.getPathName().equals(root.getPhysicalFile().getAbsolutePath()) && child.getPathName().equals(
- child.getPhysicalFile().getAbsolutePath()));
- }
-
public UnifiedVirtualFile findChild(String child) throws IOException {
final VirtualFile virtualFile = getFile();
final VirtualFile childFile = file.getChild(child);
@@ -132,84 +68,6 @@
}
}
- public void writeContent(OutputStream bos) throws IOException {
- writeContent(bos, null);
- }
-
- public void writeContent(OutputStream bos, NameFilter filter) throws IOException {
- InputStream is = null;
- try {
- is = getFile().openStream();
- if (is instanceof JarInputStream) {
- JarInputStream jis = (JarInputStream) is;
- JarOutputStream os = new JarOutputStream(bos);
- JarEntry je = null;
- while ((je = jis.getNextJarEntry()) != null) {
- if (filter != null && filter.accept(je.getName())) {
- os.putNextEntry(je);
- VFSUtils.copyStream(jis, os);
- }
- }
- VFSUtils.safeClose(os);
- } else {
- VFSUtils.copyStream(is, bos);
- }
- } finally {
- VFSUtils.safeClose(is);
- }
- }
-
- private void writeObject(ObjectOutputStream out) throws IOException, URISyntaxException {
- VirtualFile file = getFile();
- URL url = rootUrl;
- if (url == null) {
- VirtualFile parentFile = file.getParent();
- url = parentFile != null ? parentFile.toURL() : null;
- }
- String pathName = path;
- if (pathName == null)
- pathName = file.getName();
-
- ObjectOutputStream.PutField fields = out.putFields();
- fields.put("rootUrl", url);
- fields.put("path", pathName);
-
- URI uri = url != null ? url.toURI() : null;
- VirtualFile newRoot = VFS.getChild(uri);
- VirtualFile newChild = newRoot.getChild(pathName);
- fields.put("requiresMount", isMounted(newRoot, newChild));
-
- out.writeFields();
- }
-
- private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
- ObjectInputStream.GetField fields = in.readFields();
- rootUrl = (URL) fields.get("rootUrl", null);
- path = (String) fields.get("path", null);
- requiresMount = fields.get("requiresMount", false);
- }
-
- private Object writeReplace() {
- // TODO: hack to enable remote tests
- try {
- File archive = file.getPhysicalFile();
- if (archive.list().length == 0) {
- final File parent = file.getPhysicalFile().getParentFile();
- final File[] children = parent.listFiles(new FileFilter() {
- @Override
- public boolean accept(File fileOrDir) {
- return fileOrDir.isFile();
- }
- });
- archive = children[0];
- }
- // Offer different UnifiedVirtualFile implementation for deserialization process
- return new URLLoaderAdapter(archive.toURI().toURL());
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
-
public List<UnifiedVirtualFile> getChildren() throws IOException {
List<VirtualFile> vfList = getFile().getChildren();
if (vfList == null)
Modified: container/jboss71/branches/jbossws-jboss713/server-integration/src/main/java/org/jboss/as/webservices/webserviceref/WSRefUtils.java
===================================================================
--- container/jboss71/branches/jbossws-jboss713/server-integration/src/main/java/org/jboss/as/webservices/webserviceref/WSRefUtils.java 2012-11-16 14:15:11 UTC (rev 17011)
+++ container/jboss71/branches/jbossws-jboss713/server-integration/src/main/java/org/jboss/as/webservices/webserviceref/WSRefUtils.java 2012-11-16 14:39:04 UTC (rev 17012)
@@ -57,7 +57,7 @@
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedPortComponentRefMetaData;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaData;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedStubPropertyMetaData;
-import org.jboss.wsf.spi.serviceref.ServiceRefHandler.Type;
+import org.jboss.wsf.spi.serviceref.ServiceRefType;
/**
* Translates WS Refs from JBossAS MD to JBossWS UMDM format.
@@ -241,7 +241,7 @@
static void processType(final UnifiedServiceRefMetaData serviceRefUMDM) {
final boolean isJAXRPC = serviceRefUMDM.getMappingFile() != null || "javax.xml.rpc.Service".equals(serviceRefUMDM.getServiceInterface());
- serviceRefUMDM.setType(isJAXRPC ? Type.JAXRPC : Type.JAXWS);
+ serviceRefUMDM.setType(isJAXRPC ? ServiceRefType.JAXRPC : ServiceRefType.JAXWS);
}
static void processAnnotatedElement(final AnnotatedElement anElement, final UnifiedServiceRefMetaData serviceRefUMDM) {
Modified: container/jboss71/branches/jbossws-jboss713/server-integration/src/main/java/org/jboss/as/webservices/webserviceref/WSRefValueSource.java
===================================================================
--- container/jboss71/branches/jbossws-jboss713/server-integration/src/main/java/org/jboss/as/webservices/webserviceref/WSRefValueSource.java 2012-11-16 14:15:11 UTC (rev 17011)
+++ container/jboss71/branches/jbossws-jboss713/server-integration/src/main/java/org/jboss/as/webservices/webserviceref/WSRefValueSource.java 2012-11-16 14:39:04 UTC (rev 17012)
@@ -25,9 +25,6 @@
import static org.jboss.as.webservices.webserviceref.SecurityActions.getContextClassLoader;
import static org.jboss.as.webservices.webserviceref.SecurityActions.setContextClassLoader;
-import javax.naming.Referenceable;
-import javax.naming.spi.ObjectFactory;
-
import org.jboss.as.ee.component.InjectionSource;
import org.jboss.as.naming.ManagedReferenceFactory;
import org.jboss.as.naming.ValueManagedReferenceFactory;
@@ -41,9 +38,9 @@
import org.jboss.wsf.spi.SPIProviderResolver;
import org.jboss.wsf.spi.classloading.ClassLoaderProvider;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaData;
-import org.jboss.wsf.spi.serviceref.ServiceRefHandler;
-import org.jboss.wsf.spi.serviceref.ServiceRefHandler.Type;
-import org.jboss.wsf.spi.serviceref.ServiceRefHandlerFactory;
+import org.jboss.wsf.spi.serviceref.ServiceRefType;
+import org.jboss.wsf.spi.serviceref.ServiceRefFactory;
+import org.jboss.wsf.spi.serviceref.ServiceRefFactoryFactory;
/**
* WebServiceRef injection source.
@@ -64,17 +61,13 @@
serviceBuilder.addInjection(injector, factory);
}
- public Object getValue() throws IllegalStateException, IllegalArgumentException {
+ public Object getValue() {
final ClassLoader oldCL = getContextClassLoader();
try {
final ClassLoader integrationCL = new DelegateClassLoader(getClassLoader(), classLoader);
setContextClassLoader(integrationCL);
- final Referenceable referenceable = getReferenceable(integrationCL);
- final Class<?> clazz = Class.forName(referenceable.getReference().getFactoryClassName(), true, integrationCL);
- final ObjectFactory factory = (ObjectFactory)clazz.newInstance();
- return factory.getObjectInstance(referenceable.getReference(), null, null, null);
- } catch (final Exception e) {
- throw new RuntimeException(e);
+ final ServiceRefFactory serviceRefFactory = getServiceRefFactory();
+ return serviceRefFactory.newServiceRef(serviceRef);
} finally {
setContextClassLoader(oldCL);
}
@@ -82,17 +75,16 @@
private ClassLoader getClassLoader() {
ClassLoaderProvider provider = ClassLoaderProvider.getDefaultProvider();
- if (!Type.JAXRPC.equals(serviceRef.getType())) {
+ if (!ServiceRefType.JAXRPC.equals(serviceRef.getType())) {
return provider.getServerIntegrationClassLoader();
} else {
return provider.getServerJAXRPCIntegrationClassLoader();
}
}
- private Referenceable getReferenceable(final ClassLoader loader) {
+ private ServiceRefFactory getServiceRefFactory() {
final SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
- final ServiceRefHandler serviceRefHandler = spiProvider.getSPI(ServiceRefHandlerFactory.class, loader).getServiceRefHandler();
- return serviceRefHandler.createReferenceable(serviceRef);
+ return spiProvider.getSPI(ServiceRefFactoryFactory.class).newServiceRefFactory();
}
}
\ No newline at end of file
12 years, 1 month
JBossWS SVN: r17011 - stack/cxf/branches.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2012-11-16 09:15:11 -0500 (Fri, 16 Nov 2012)
New Revision: 17011
Removed:
stack/cxf/branches/ropalka/
Log:
removing obsolete branch
12 years, 1 month
JBossWS SVN: r17010 - stack/cxf/trunk.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2012-11-16 09:12:30 -0500 (Fri, 16 Nov 2012)
New Revision: 17010
Modified:
stack/cxf/trunk/pom.xml
Log:
switch to CXF 2.6.3 for a while
Modified: stack/cxf/trunk/pom.xml
===================================================================
--- stack/cxf/trunk/pom.xml 2012-11-16 14:11:55 UTC (rev 17009)
+++ stack/cxf/trunk/pom.xml 2012-11-16 14:12:30 UTC (rev 17010)
@@ -73,7 +73,7 @@
<jboss713.version>7.1.3.Final</jboss713.version>
<jboss720.version>7.2.0.Alpha1-SNAPSHOT</jboss720.version>
<ejb.api.version>1.0.1.Final</ejb.api.version>
- <cxf.version>2.7.1-SNAPSHOT</cxf.version>
+ <cxf.version>2.6.3</cxf.version>
<cxf.asm.version>3.3.1</cxf.asm.version>
<cxf.xjcplugins.version>2.6.0</cxf.xjcplugins.version>
<jboss.common.core.version>2.2.17.GA</jboss.common.core.version>
12 years, 1 month
JBossWS SVN: r17009 - in stack/cxf/trunk: modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref and 1 other directories.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2012-11-16 09:11:55 -0500 (Fri, 16 Nov 2012)
New Revision: 17009
Added:
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/AbstractServiceObjectFactoryJAXWS.java
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFServiceRefFactoryFactoryImpl.java
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFServiceRefFactoryImpl.java
stack/cxf/trunk/modules/server/src/main/resources/jbossws-cxf-server.jar/META-INF/services/org.jboss.wsf.spi.serviceref.ServiceRefFactoryFactory
Removed:
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFServiceRefBinderFactoryImpl.java
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFServiceRefBinderJAXRPC.java
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFServiceRefBinderJAXWS.java
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFServiceReferenceableJAXWS.java
stack/cxf/trunk/modules/server/src/main/resources/jbossws-cxf-server.jar/META-INF/services/org.jboss.wsf.spi.serviceref.ServiceRefBinderFactory
Modified:
stack/cxf/trunk/
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFServiceObjectFactoryJAXWS.java
stack/cxf/trunk/pom.xml
Log:
[JBWS-3565] WS ref optimization
Property changes on: stack/cxf/trunk
___________________________________________________________________
Modified: svn:mergeinfo
- /stack/cxf/branches/asoldano:14032-14050,14068
/stack/cxf/branches/ropalka:16301-16305
/stack/cxf/branches/ropalka_JBWS-3550:16747-16757
+ /stack/cxf/branches/asoldano:14032-14050,14068
/stack/cxf/branches/ropalka:16301-16305,16966-17008
/stack/cxf/branches/ropalka_JBWS-3550:16747-16757
Copied: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/AbstractServiceObjectFactoryJAXWS.java (from rev 17008, stack/cxf/branches/ropalka/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/AbstractServiceObjectFactoryJAXWS.java)
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/AbstractServiceObjectFactoryJAXWS.java (rev 0)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/AbstractServiceObjectFactoryJAXWS.java 2012-11-16 14:11:55 UTC (rev 17009)
@@ -0,0 +1,454 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, 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.stack.cxf.client.serviceref;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.net.URL;
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.RespectBindingFeature;
+import javax.xml.ws.Service;
+import javax.xml.ws.WebServiceClient;
+import javax.xml.ws.WebServiceFeature;
+import javax.xml.ws.soap.AddressingFeature;
+import javax.xml.ws.soap.MTOMFeature;
+
+import org.jboss.ws.common.Messages;
+import org.jboss.wsf.spi.WSFException;
+import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedPortComponentRefMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaData;
+
+/**
+ * This ServiceObjectFactory reconstructs a javax.xml.ws.Service
+ * for a given WSDL when the webservice client does a JNDI lookup.
+ *
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+public abstract class AbstractServiceObjectFactoryJAXWS
+{
+ public final Object getObjectInstance(UnifiedServiceRefMetaData serviceRef)
+ {
+ try
+ {
+ // class names
+ final String serviceImplClass = this.getServiceClassName(serviceRef);
+ final String targetClassName = this.getTargetClassName(serviceRef);
+ // class instances
+ final Class<?> serviceClass = this.getClass(serviceImplClass);
+ final Class<?> targetClass = this.getClass(targetClassName);
+ final Service serviceInstance;
+
+ this.init(serviceRef);
+ try
+ {
+ serviceInstance = this.instantiateService(serviceRef, serviceClass);
+ this.configure(serviceRef, serviceInstance);
+
+ // construct port
+ final boolean instantiatePort = targetClassName != null && !Service.class.isAssignableFrom(targetClass);
+ if (instantiatePort)
+ {
+ final QName portQName = this.getPortQName(targetClassName, serviceImplClass, serviceRef);
+ final WebServiceFeature[] portFeatures = this.getFeatures(targetClassName, serviceImplClass, serviceRef);
+
+ return instantiatePort(serviceClass, targetClass, serviceInstance, portQName, portFeatures);
+ }
+ }
+ finally
+ {
+ this.destroy(serviceRef);
+ }
+
+ return serviceInstance;
+ }
+ catch (Exception ex)
+ {
+ WSFException.rethrow("Cannot create service", ex);
+ }
+
+ return null;
+ }
+
+ /**
+ * Lifecycle template method called before javax.xml.ws.Service object instantiation.
+ *
+ * @param serviceRefUMDM service reference meta data
+ */
+ protected abstract void init(final UnifiedServiceRefMetaData serviceRefUMDM);
+
+ /**
+ * Lifecycle template method called after javax.xml.ws.Service object was created
+ * and before port is instantiated. It allows stack to configure service before
+ * creating ports.
+ *
+ * @param serviceRefUMDM service reference meta data
+ * @param service service instance
+ */
+ protected abstract void configure(final UnifiedServiceRefMetaData serviceRefUMDM, final Service service);
+
+ /**
+ * Lifecycle template method called after javax.xml.ws.Service object and after port instantiation.
+ *
+ * @param serviceRefUMDM
+ */
+ protected abstract void destroy(final UnifiedServiceRefMetaData serviceRefUMDM);
+
+ private Class<?> getClass(final String className) throws ClassNotFoundException
+ {
+ if (className != null)
+ {
+ return Thread.currentThread().getContextClassLoader().loadClass(className);
+ }
+
+ return null;
+ }
+
+ private String getServiceClassName(final UnifiedServiceRefMetaData serviceRefMD)
+ {
+ final String serviceImplClassName = serviceRefMD.getServiceImplClass();
+ if (serviceImplClassName != null)
+ return serviceImplClassName;
+
+ final String serviceInterfaceName = serviceRefMD.getServiceInterface();
+ if (serviceInterfaceName != null)
+ return serviceInterfaceName;
+
+ return Service.class.getName(); // fallback
+ }
+
+ private String getTargetClassName(final UnifiedServiceRefMetaData serviceRefMD)
+ {
+ return serviceRefMD.getServiceRefType();
+ }
+
+ private Object instantiatePort(final Class<?> serviceClass, final Class<?> targetClass, final Service target,
+ final QName portQName, final WebServiceFeature[] features) throws NoSuchMethodException,
+ InstantiationException, IllegalAccessException, InvocationTargetException
+ {
+ Object retVal = null;
+
+ Object port = null;
+ if (serviceClass != Service.class)
+ {
+ for (Method method : serviceClass.getDeclaredMethods())
+ {
+ String methodName = method.getName();
+ Class<?> retType = method.getReturnType();
+ if (methodName.startsWith("get") && targetClass.isAssignableFrom(retType))
+ {
+ final Method targetMethod = getMethodFor(methodName, features, serviceClass);
+ final Object[] args = getArgumentsFor(features);
+ port = targetMethod.invoke(target, args);
+ retVal = port;
+ break;
+ }
+ }
+ }
+
+ if (port == null)
+ {
+ Method method = getMethodFor("getPort", portQName, features, serviceClass);
+ Object[] args = getArgumentsFor(portQName, features, targetClass);
+ port = method.invoke(target, args);
+ retVal = port;
+ }
+
+ return retVal;
+ }
+
+ private Service instantiateService(final UnifiedServiceRefMetaData serviceRefMD, final Class<?> serviceClass)
+ throws NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException
+ {
+ final WebServiceFeature[] features = getFeatures(serviceRefMD);
+ final URL wsdlURL = this.getWsdlURL(serviceRefMD, serviceClass);
+ final QName serviceQName = this.getServiceQName(serviceRefMD, serviceClass);
+
+ Service target = null;
+ if (serviceClass == Service.class)
+ {
+ // Generic javax.xml.ws.Service
+ if (wsdlURL != null)
+ {
+ if (features != null)
+ {
+ target = Service.create(wsdlURL, serviceQName, features);
+ }
+ else
+ {
+ target = Service.create(wsdlURL, serviceQName);
+ }
+ }
+ else
+ {
+ throw Messages.MESSAGES.cannotCreateServiceWithoutWsdlLocation(serviceRefMD);
+ }
+ }
+ else
+ {
+ // Generated javax.xml.ws.Service subclass
+ if (wsdlURL != null)
+ {
+ if (features != null)
+ {
+ Constructor<?> ctor = serviceClass.getConstructor(new Class[]
+ {URL.class, QName.class, WebServiceFeature[].class});
+ target = (Service) ctor.newInstance(new Object[]
+ {wsdlURL, serviceQName, features});
+ }
+ else
+ {
+ Constructor<?> ctor = serviceClass.getConstructor(new Class[]
+ {URL.class, QName.class});
+ target = (Service) ctor.newInstance(new Object[]
+ {wsdlURL, serviceQName});
+ }
+ }
+ else
+ {
+ if (features != null)
+ {
+ Constructor<?> ctor = serviceClass.getConstructor(new Class[]
+ {WebServiceFeature[].class});
+ target = (Service) ctor.newInstance(new Object[]
+ {features});
+ }
+ else
+ {
+ target = (Service) serviceClass.newInstance();
+ }
+ }
+ }
+
+ return target;
+ }
+
+ private URL getWsdlURL(final UnifiedServiceRefMetaData serviceRefMD, final Class<?> serviceClass)
+ {
+ if (serviceRefMD.getWsdlLocation() == null)
+ {
+ final WebServiceClient webServiceClientAnnotation = serviceClass.getAnnotation(WebServiceClient.class);
+ if (webServiceClientAnnotation != null)
+ {
+ // use the @WebServiceClien(wsdlLocation=...) if the service ref wsdl location returned at this time would be null
+ if (webServiceClientAnnotation.wsdlLocation().length() > 0)
+ {
+ serviceRefMD.setWsdlOverride(webServiceClientAnnotation.wsdlLocation());
+ }
+ }
+ }
+
+ return serviceRefMD.getWsdlLocation();
+ }
+
+ private QName getServiceQName(final UnifiedServiceRefMetaData serviceRefMD, final Class<?> serviceClass)
+ {
+ QName retVal = serviceRefMD.getServiceQName();
+
+ if (retVal == null)
+ {
+ final WebServiceClient webServiceClientAnnotation = serviceClass.getAnnotation(WebServiceClient.class);
+ if (webServiceClientAnnotation != null)
+ {
+ retVal = new QName(webServiceClientAnnotation.targetNamespace(), webServiceClientAnnotation.name());
+ }
+ }
+
+ return retVal;
+ }
+
+ private WebServiceFeature[] getFeatures(final String targetClassName, final String serviceClassName,
+ final UnifiedServiceRefMetaData serviceRefMD)
+ {
+ if (targetClassName != null && !targetClassName.equals(serviceClassName))
+ {
+ final Collection<UnifiedPortComponentRefMetaData> portComponentRefs = serviceRefMD.getPortComponentRefs();
+ for (final UnifiedPortComponentRefMetaData portComponentRefMD : portComponentRefs)
+ {
+ if (targetClassName.equals(portComponentRefMD.getServiceEndpointInterface()))
+ {
+ return getFeatures(portComponentRefMD);
+ }
+ }
+ }
+
+ return null;
+ }
+
+ private QName getPortQName(final String targetClassName, final String serviceClassName,
+ final UnifiedServiceRefMetaData serviceRefMD)
+ {
+ if (targetClassName != null && !targetClassName.equals(serviceClassName))
+ {
+ final Collection<UnifiedPortComponentRefMetaData> portComponentRefs = serviceRefMD.getPortComponentRefs();
+ for (final UnifiedPortComponentRefMetaData portComponentRefMD : portComponentRefs)
+ {
+ if (targetClassName.equals(portComponentRefMD.getServiceEndpointInterface()))
+ {
+ return portComponentRefMD.getPortQName();
+ }
+ }
+ }
+
+ return null;
+ }
+
+ private Method getMethodFor(final String methodName, final QName portQName, final WebServiceFeature[] features, final Class<?> serviceClass)
+ throws NoSuchMethodException
+ {
+ if ((portQName == null) && (features == null))
+ return serviceClass.getMethod(methodName, new Class[]
+ {Class.class});
+ if ((portQName != null) && (features == null))
+ return serviceClass.getMethod(methodName, new Class[]
+ {QName.class, Class.class});
+ if ((portQName == null) && (features != null))
+ return serviceClass.getMethod(methodName, new Class[]
+ {Class.class, WebServiceFeature[].class});
+ if ((portQName != null) && (features != null))
+ return serviceClass.getMethod(methodName, new Class[]
+ {QName.class, Class.class, WebServiceFeature[].class});
+
+ throw new IllegalStateException();
+ }
+
+ private Method getMethodFor(final String methodName, final WebServiceFeature[] features, final Class<?> serviceClass)
+ throws NoSuchMethodException
+ {
+ if (features == null)
+ {
+ return serviceClass.getMethod(methodName, new Class[] {});
+ }
+ else
+ {
+ return serviceClass.getMethod(methodName, new Class[] { WebServiceFeature[].class } );
+ }
+ }
+
+ private Object[] getArgumentsFor(final QName portQName, final WebServiceFeature[] features,
+ final Class<?> targetClass) throws NoSuchMethodException
+ {
+ if ((portQName == null) && (features == null))
+ return new Object[]
+ {targetClass};
+ if ((portQName != null) && (features == null))
+ return new Object[]
+ {portQName, targetClass};
+ if ((portQName == null) && (features != null))
+ return new Object[]
+ {targetClass, features};
+ if ((portQName != null) && (features != null))
+ return new Object[]
+ {portQName, targetClass, features};
+
+ throw new IllegalStateException();
+ }
+
+ private Object[] getArgumentsFor(final WebServiceFeature[] features) throws NoSuchMethodException
+ {
+ if (features == null)
+ {
+ return new Object[] {};
+ }
+ else
+ {
+ return new Object[] {features};
+ }
+ }
+
+ private WebServiceFeature[] getFeatures(final UnifiedServiceRefMetaData serviceRef)
+ {
+ List<WebServiceFeature> features = new LinkedList<WebServiceFeature>();
+
+ // configure @Addressing feature
+ if (serviceRef.isAddressingAnnotationSpecified())
+ {
+ final boolean enabled = serviceRef.isAddressingEnabled();
+ final boolean required = serviceRef.isAddressingRequired();
+ final String refResponses = serviceRef.getAddressingResponses();
+ AddressingFeature.Responses responses = AddressingFeature.Responses.ALL;
+ if ("ANONYMOUS".equals(refResponses))
+ responses = AddressingFeature.Responses.ANONYMOUS;
+ if ("NON_ANONYMOUS".equals(refResponses))
+ responses = AddressingFeature.Responses.NON_ANONYMOUS;
+
+ features.add(new AddressingFeature(enabled, required, responses));
+ }
+
+ // configure @MTOM feature
+ if (serviceRef.isMtomAnnotationSpecified())
+ {
+ final boolean enabled = serviceRef.isMtomEnabled();
+ final int threshold = serviceRef.getMtomThreshold();
+ features.add(new MTOMFeature(enabled, threshold));
+ }
+
+ // configure @RespectBinding feature
+ if (serviceRef.isRespectBindingAnnotationSpecified())
+ {
+ final boolean enabled = serviceRef.isRespectBindingEnabled();
+ features.add(new RespectBindingFeature(enabled));
+ }
+
+ return features.size() == 0 ? null : features.toArray(new WebServiceFeature[]
+ {});
+ }
+
+ private WebServiceFeature[] getFeatures(final UnifiedPortComponentRefMetaData portComponentRefMD)
+ {
+ List<WebServiceFeature> features = new LinkedList<WebServiceFeature>();
+ // configure @Addressing feature
+ if (portComponentRefMD.isAddressingAnnotationSpecified())
+ {
+ final boolean enabled = portComponentRefMD.isAddressingEnabled();
+ final boolean required = portComponentRefMD.isAddressingRequired();
+ final String refResponses = portComponentRefMD.getAddressingResponses();
+ AddressingFeature.Responses responses = AddressingFeature.Responses.ALL;
+ if ("ANONYMOUS".equals(refResponses))
+ responses = AddressingFeature.Responses.ANONYMOUS;
+ if ("NON_ANONYMOUS".equals(refResponses))
+ responses = AddressingFeature.Responses.NON_ANONYMOUS;
+
+ features.add(new AddressingFeature(enabled, required, responses));
+ }
+
+ // configure @MTOM feature
+ if (portComponentRefMD.isMtomEnabled())
+ {
+ features.add(new MTOMFeature(true, portComponentRefMD.getMtomThreshold()));
+ }
+
+ // configure @RespectBinding feature
+ if (portComponentRefMD.isRespectBindingAnnotationSpecified())
+ {
+ final boolean enabled = portComponentRefMD.isRespectBindingEnabled();
+ features.add(new RespectBindingFeature(enabled));
+ }
+
+ return features.size() == 0 ? null : features.toArray(new WebServiceFeature[]
+ {});
+ }
+}
Modified: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFServiceObjectFactoryJAXWS.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFServiceObjectFactoryJAXWS.java 2012-11-16 14:10:08 UTC (rev 17008)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFServiceObjectFactoryJAXWS.java 2012-11-16 14:11:55 UTC (rev 17009)
@@ -29,7 +29,6 @@
import org.apache.cxf.BusFactory;
import org.apache.cxf.bus.spring.SpringBusFactory;
import org.apache.cxf.configuration.Configurer;
-import org.jboss.ws.common.serviceref.AbstractServiceObjectFactoryJAXWS;
import org.jboss.wsf.spi.deployment.UnifiedVirtualFile;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaData;
import org.jboss.wsf.stack.cxf.client.Constants;
Deleted: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFServiceRefBinderFactoryImpl.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFServiceRefBinderFactoryImpl.java 2012-11-16 14:10:08 UTC (rev 17008)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFServiceRefBinderFactoryImpl.java 2012-11-16 14:11:55 UTC (rev 17009)
@@ -1,43 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2010, 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.stack.cxf.client.serviceref;
-
-import org.jboss.wsf.spi.serviceref.ServiceRefBinder;
-import org.jboss.wsf.spi.serviceref.ServiceRefBinderFactory;
-import org.jboss.wsf.spi.serviceref.ServiceRefHandler.Type;
-
-/**
- * Binds either JAXRPC or JAXWS Service object in the client's ENC.
- *
- * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
- */
-public final class CXFServiceRefBinderFactoryImpl implements ServiceRefBinderFactory
-{
- private static final ServiceRefBinder JAXRPC_BINDER = new CXFServiceRefBinderJAXRPC();
-
- private static final ServiceRefBinder JAXWS_BINDER = new CXFServiceRefBinderJAXWS();
-
- public ServiceRefBinder newServiceRefBinder(final Type type)
- {
- return type == Type.JAXRPC ? JAXRPC_BINDER : JAXWS_BINDER;
- }
-}
Deleted: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFServiceRefBinderJAXRPC.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFServiceRefBinderJAXRPC.java 2012-11-16 14:10:08 UTC (rev 17008)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFServiceRefBinderJAXRPC.java 2012-11-16 14:11:55 UTC (rev 17009)
@@ -1,42 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2010, 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.stack.cxf.client.serviceref;
-
-import javax.naming.Referenceable;
-
-import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaData;
-import org.jboss.wsf.spi.serviceref.ServiceRefBinder;
-import org.jboss.wsf.stack.cxf.Messages;
-
-/**
- * Binds a JAXRPC Service object to the client's ENC.
- *
- * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
- */
-final class CXFServiceRefBinderJAXRPC implements ServiceRefBinder
-{
- @Override
- public Referenceable createReferenceable(final UnifiedServiceRefMetaData serviceRefUMDM)
- {
- throw Messages.MESSAGES.jaxrpcServiceRefNotSupported();
- }
-}
Deleted: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFServiceRefBinderJAXWS.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFServiceRefBinderJAXWS.java 2012-11-16 14:10:08 UTC (rev 17008)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFServiceRefBinderJAXWS.java 2012-11-16 14:11:55 UTC (rev 17009)
@@ -1,41 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2010, 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.stack.cxf.client.serviceref;
-
-import javax.naming.Referenceable;
-
-import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaData;
-import org.jboss.wsf.spi.serviceref.ServiceRefBinder;
-
-/**
- * Binds a JAXWS Service object to the client's ENC.
- *
- * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
- */
-final class CXFServiceRefBinderJAXWS implements ServiceRefBinder
-{
- @Override
- public Referenceable createReferenceable(final UnifiedServiceRefMetaData serviceRefUMDM)
- {
- return new CXFServiceReferenceableJAXWS(serviceRefUMDM);
- }
-}
Copied: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFServiceRefFactoryFactoryImpl.java (from rev 17008, stack/cxf/branches/ropalka/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFServiceRefFactoryFactoryImpl.java)
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFServiceRefFactoryFactoryImpl.java (rev 0)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFServiceRefFactoryFactoryImpl.java 2012-11-16 14:11:55 UTC (rev 17009)
@@ -0,0 +1,36 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, 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.stack.cxf.client.serviceref;
+
+import org.jboss.wsf.spi.serviceref.ServiceRefFactory;
+import org.jboss.wsf.spi.serviceref.ServiceRefFactoryFactory;
+
+/**
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+public final class CXFServiceRefFactoryFactoryImpl implements ServiceRefFactoryFactory
+{
+ public ServiceRefFactory newServiceRefFactory()
+ {
+ return new CXFServiceRefFactoryImpl();
+ }
+}
Copied: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFServiceRefFactoryImpl.java (from rev 17008, stack/cxf/branches/ropalka/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFServiceRefFactoryImpl.java)
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFServiceRefFactoryImpl.java (rev 0)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFServiceRefFactoryImpl.java 2012-11-16 14:11:55 UTC (rev 17009)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, 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.stack.cxf.client.serviceref;
+
+import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaData;
+import org.jboss.wsf.spi.serviceref.ServiceRefFactory;
+import org.jboss.wsf.spi.serviceref.ServiceRefType;
+import org.jboss.wsf.stack.cxf.Messages;
+
+/**
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+final class CXFServiceRefFactoryImpl implements ServiceRefFactory
+{
+ @Override
+ public Object newServiceRef(final UnifiedServiceRefMetaData serviceRefUMDM)
+ {
+ if (serviceRefUMDM.getType() == ServiceRefType.JAXWS) {
+ return new CXFServiceObjectFactoryJAXWS().getObjectInstance(serviceRefUMDM);
+ } else {
+ throw Messages.MESSAGES.jaxrpcServiceRefNotSupported();
+ }
+ }
+}
Deleted: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFServiceReferenceableJAXWS.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFServiceReferenceableJAXWS.java 2012-11-16 14:10:08 UTC (rev 17008)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFServiceReferenceableJAXWS.java 2012-11-16 14:11:55 UTC (rev 17009)
@@ -1,44 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2010, 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.stack.cxf.client.serviceref;
-
-import org.jboss.ws.common.serviceref.AbstractServiceReferenceableJAXWS;
-import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaData;
-
-/**
- * {@inheritDoc}
- *
- * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
- */
-final class CXFServiceReferenceableJAXWS extends AbstractServiceReferenceableJAXWS<CXFServiceObjectFactoryJAXWS>
-{
- public CXFServiceReferenceableJAXWS(final UnifiedServiceRefMetaData serviceRefMD)
- {
- super(serviceRefMD);
- }
-
- @Override
- protected Class<CXFServiceObjectFactoryJAXWS> getObjectFactory()
- {
- return CXFServiceObjectFactoryJAXWS.class;
- }
-}
Deleted: stack/cxf/trunk/modules/server/src/main/resources/jbossws-cxf-server.jar/META-INF/services/org.jboss.wsf.spi.serviceref.ServiceRefBinderFactory
===================================================================
--- stack/cxf/trunk/modules/server/src/main/resources/jbossws-cxf-server.jar/META-INF/services/org.jboss.wsf.spi.serviceref.ServiceRefBinderFactory 2012-11-16 14:10:08 UTC (rev 17008)
+++ stack/cxf/trunk/modules/server/src/main/resources/jbossws-cxf-server.jar/META-INF/services/org.jboss.wsf.spi.serviceref.ServiceRefBinderFactory 2012-11-16 14:11:55 UTC (rev 17009)
@@ -1 +0,0 @@
-org.jboss.wsf.stack.cxf.client.serviceref.CXFServiceRefBinderFactoryImpl
\ No newline at end of file
Copied: stack/cxf/trunk/modules/server/src/main/resources/jbossws-cxf-server.jar/META-INF/services/org.jboss.wsf.spi.serviceref.ServiceRefFactoryFactory (from rev 17008, stack/cxf/branches/ropalka/modules/server/src/main/resources/jbossws-cxf-server.jar/META-INF/services/org.jboss.wsf.spi.serviceref.ServiceRefFactoryFactory)
===================================================================
--- stack/cxf/trunk/modules/server/src/main/resources/jbossws-cxf-server.jar/META-INF/services/org.jboss.wsf.spi.serviceref.ServiceRefFactoryFactory (rev 0)
+++ stack/cxf/trunk/modules/server/src/main/resources/jbossws-cxf-server.jar/META-INF/services/org.jboss.wsf.spi.serviceref.ServiceRefFactoryFactory 2012-11-16 14:11:55 UTC (rev 17009)
@@ -0,0 +1 @@
+org.jboss.wsf.stack.cxf.client.serviceref.CXFServiceRefFactoryFactoryImpl
\ No newline at end of file
Modified: stack/cxf/trunk/pom.xml
===================================================================
--- stack/cxf/trunk/pom.xml 2012-11-16 14:10:08 UTC (rev 17008)
+++ stack/cxf/trunk/pom.xml 2012-11-16 14:11:55 UTC (rev 17009)
@@ -60,14 +60,14 @@
<!-- Properties -->
<properties>
<jbossws.api.version>1.0.1.Final</jbossws.api.version>
- <jbossws.spi.version>2.1.0.Final</jbossws.spi.version>
- <jbossws.common.version>2.1.0.Final</jbossws.common.version>
+ <jbossws.spi.version>2.1.1-SNAPSHOT</jbossws.spi.version>
+ <jbossws.common.version>2.1.1-SNAPSHOT</jbossws.common.version>
<jbossws.common.tools.version>1.1.0.Final</jbossws.common.tools.version>
<jbossws.shared.testsuite.version>4.1.1-SNAPSHOT</jbossws.shared.testsuite.version>
<jbossws.jboss711.version>4.1.1-SNAPSHOT</jbossws.jboss711.version>
<jbossws.jboss712.version>4.1.1-SNAPSHOT</jbossws.jboss712.version>
<jbossws.jboss713.version>4.1.1-SNAPSHOT</jbossws.jboss713.version>
- <jbossws.native.version>4.1.0.Final</jbossws.native.version>
+ <jbossws.native.version>4.1.1-SNAPSHOT</jbossws.native.version>
<jboss711.version>7.1.1.Final</jboss711.version>
<jboss712.version>7.1.2.Final</jboss712.version>
<jboss713.version>7.1.3.Final</jboss713.version>
12 years, 1 month
JBossWS SVN: r17008 - stack/native/branches.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2012-11-16 09:10:08 -0500 (Fri, 16 Nov 2012)
New Revision: 17008
Removed:
stack/native/branches/ropalka/
Log:
removing obsolete branch
12 years, 1 month