org.andromda.repositories.mdr
Class MDRepositoryFacade

java.lang.Object
  extended by org.andromda.repositories.mdr.MDRepositoryFacade
All Implemented Interfaces:
org.andromda.core.repository.RepositoryFacade

public class MDRepositoryFacade
extends java.lang.Object
implements org.andromda.core.repository.RepositoryFacade

Implements an AndroMDA object model repository by using the NetBeans MetaDataRepository .

Author:
Anthony Mowers , Chad Brandon

Field Summary
protected  java.net.URL metamodelUri
           
protected  javax.jmi.reflect.RefPackage model
           
 
Constructor Summary
MDRepositoryFacade()
           
 
Method Summary
 void clear()
           
 void close()
          Closes the repository and reclaims all resources.
 org.andromda.core.metafacade.ModelAccessFacade getModel()
           
 void open()
          Opens the repository and prepares it to read in models.
 void readModel(java.io.InputStream[] streams, java.lang.String[] uris, java.lang.String[] moduleSearchPath)
           
 void readModel(java.lang.String[] uris, java.lang.String[] moduleSearchPath)
           
 void setMetamodelLocation(java.lang.String metamodelLocation)
          Sets the location of the metamodel.
 void setMetamodelPackage(java.lang.String metamodelPackage)
          Sets the name of the root package of the metamodel.
 void setModelAccessFacade(java.lang.Class modelAccessFacade)
          Sets the model access facade instance to be used with this repository.
 void setXmiReaderFactory(java.lang.String xmiReaderFactory)
          Sets the org.netbeans.api.xmi.XMIReaderFactory implementation to use.
 void writeModel(java.lang.Object model, java.lang.String outputLocation, java.lang.String xmiVersion)
           
 void writeModel(java.lang.Object model, java.lang.String outputLocation, java.lang.String xmiVersion, java.lang.String encoding)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

metamodelUri

protected java.net.URL metamodelUri

model

protected javax.jmi.reflect.RefPackage model
Constructor Detail

MDRepositoryFacade

public MDRepositoryFacade()
Method Detail

open

public void open()
Opens the repository and prepares it to read in models.

All the file reads are done within the context of a transaction: this seems to speed up the processing.

Specified by:
open in interface org.andromda.core.repository.RepositoryFacade
See Also:
RepositoryFacade.open()

close

public void close()
Closes the repository and reclaims all resources.

This should only be called after all model processing has been completed.

Specified by:
close in interface org.andromda.core.repository.RepositoryFacade
See Also:
RepositoryFacade.close()

readModel

public void readModel(java.lang.String[] uris,
                      java.lang.String[] moduleSearchPath)
Specified by:
readModel in interface org.andromda.core.repository.RepositoryFacade
See Also:
RepositoryFacade.readModel(java.lang.String[], java.lang.String[])

readModel

public void readModel(java.io.InputStream[] streams,
                      java.lang.String[] uris,
                      java.lang.String[] moduleSearchPath)
Specified by:
readModel in interface org.andromda.core.repository.RepositoryFacade
See Also:
RepositoryFacade.readModel(java.io.InputStream[], java.lang.String[], java.lang.String[])

writeModel

public void writeModel(java.lang.Object model,
                       java.lang.String outputLocation,
                       java.lang.String xmiVersion)
Specified by:
writeModel in interface org.andromda.core.repository.RepositoryFacade
See Also:
RepositoryFacade.writeModel(java.lang.Object, java.lang.String, java.lang.String)

setMetamodelLocation

public void setMetamodelLocation(java.lang.String metamodelLocation)
Sets the location of the metamodel.

Parameters:
metamodelLocation - the metamodel location.

setMetamodelPackage

public void setMetamodelPackage(java.lang.String metamodelPackage)
Sets the name of the root package of the metamodel.

Parameters:
metamodelPackage - the root is metamodel package name.

setXmiReaderFactory

public void setXmiReaderFactory(java.lang.String xmiReaderFactory)
Sets the org.netbeans.api.xmi.XMIReaderFactory implementation to use.

Parameters:
xmiReaderFactory - the fully qualified implementation class name to use.

writeModel

public void writeModel(java.lang.Object model,
                       java.lang.String outputLocation,
                       java.lang.String xmiVersion,
                       java.lang.String encoding)
Specified by:
writeModel in interface org.andromda.core.repository.RepositoryFacade
See Also:
RepositoryFacade.writeModel(java.lang.Object, java.lang.String, java.lang.String)

setModelAccessFacade

public void setModelAccessFacade(java.lang.Class modelAccessFacade)
Sets the model access facade instance to be used with this repository.

Parameters:
modelAccessFacade - the model access facade

getModel

public org.andromda.core.metafacade.ModelAccessFacade getModel()
Specified by:
getModel in interface org.andromda.core.repository.RepositoryFacade
See Also:
RepositoryFacade.getModel()

clear

public void clear()
Specified by:
clear in interface org.andromda.core.repository.RepositoryFacade
See Also:
RepositoryFacade.clear()


Copyright © 2003-2008 AndroMDA.org. All Rights Reserved.