IBM WebSphere Application ServerTM
Release 8

com.ibm.wsspi.ar
Class ArtifactResouceFactoryImpl

java.lang.Object
  extended by org.eclipse.emf.ecore.resource.impl.ResourceFactoryImpl
      extended by com.ibm.wsspi.ar.ArtifactResouceFactoryImpl
All Implemented Interfaces:
ARConstants, org.eclipse.emf.ecore.resource.Resource.Factory

public class ArtifactResouceFactoryImpl
extends org.eclipse.emf.ecore.resource.impl.ResourceFactoryImpl
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
static ArtifactResouceFactoryImpl INSTANCE
           
static java.lang.String WBI_ARTIFACT_PROTOCOL
           
 
Fields inherited from interface com.ibm.wsspi.ar.ARConstants
SCHEMA, WSDL, XSD
 
Constructor Summary
protected ArtifactResouceFactoryImpl()
           
 
Method Summary
 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

public static final java.lang.String WBI_ARTIFACT_PROTOCOL
See Also:
Constant Field Values

INSTANCE

public static final ArtifactResouceFactoryImpl INSTANCE
Constructor Detail

ArtifactResouceFactoryImpl

protected ArtifactResouceFactoryImpl()
Method Detail

createResource

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)

IBM WebSphere Application ServerTM
Release 8