com.ibm.wsspi.ar

Class ArtifactResouceFactoryImpl

  1. java.lang.Object
  2. extended byorg.eclipse.emf.ecore.resource.impl.ResourceFactoryImpl
  3. extended bycom.ibm.wsspi.ar.ArtifactResouceFactoryImpl
All implemented interfaces:
ARConstants, org.eclipse.emf.ecore.resource.Resource.Factory

  1. public class ArtifactResouceFactoryImpl
  2. extends org.eclipse.emf.ecore.resource.impl.ResourceFactoryImpl
  3. implements ARConstants
Extension to EMF to support loading WSDL and XSD documents within an EAR file. Since a the files in an EAR are physically a JAR within a JAR, we also support a custom scheme, "archive:/" which can open streams and within these nested JARs. To configure a ResourceSet for the ArtifactResolver use the following steps:

   Resource.Factory rf = ArtifactResouceFactoryImpl.INSTANCE;
         Resource.Factory.Registry registry = resourceSet.getResourceFactoryRegistry ();

        // Register the resource factory for wbi_artifact protocol
        registry.getProtocolToFactoryMap ().put (
                                ArtifactResourceFactoryImpl.WBI_ARTIFACT_PROTOCOL, rf);
        registry.getExtensionToFactoryMap ().put ("xsd", rf);
        registry.getExtensionToFactoryMap ().put ("wsdl", rf);
        resourceSet.getAdapterFactories ().add (ArtifactURIResolver.getFactory ());
        resourceSet.setURIConverter (ArtifactURIConverter.INSTANCE);
        
If a WSDL target namespace is spread across several documents the elements are merged into a single model.

Nested Class Summary

Nested classes/interfaces inherited from interface org.eclipse.emf.ecore.resource.Resource.Factory
org.eclipse.emf.ecore.resource.Resource.Factory.Descriptor, org.eclipse.emf.ecore.resource.Resource.Factory.Registry

Field Summary

Modifier and Type Field and Description
  1. static
  2. ArtifactResouceFactoryImpl
INSTANCE
  1. static
  2. java.lang.String
WBI_ARTIFACT_PROTOCOL
Fields inherited from interface com.ibm.wsspi.ar.ARConstants
SCHEMA, WSDL, XSD

Constructor Summary

Modifier Constructor and Description
  1. protected
ArtifactResouceFactoryImpl()

Method Summary

Modifier and Type Method and Description
  1. org.eclipse.emf.ecore.resource.Resource
createResource(org.eclipse.emf.common.util.URI uri)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

WBI_ARTIFACT_PROTOCOL

  1. public static final java.lang.String WBI_ARTIFACT_PROTOCOL
See Also:

INSTANCE

  1. public static final ArtifactResouceFactoryImpl INSTANCE

Constructor Detail

ArtifactResouceFactoryImpl

  1. protected ArtifactResouceFactoryImpl( )

Method Detail

createResource

  1. public org.eclipse.emf.ecore.resource.Resource createResource( org.eclipse.emf.common.util.URI uri)
Specified by:
createResource in interface org.eclipse.emf.ecore.resource.Resource.Factory
Overrides:
createResource in class org.eclipse.emf.ecore.resource.impl.ResourceFactoryImpl
See Also:
Resource.Factory.createResource(org.eclipse.emf.common.util.URI)