org.apache.tuscany.sca.contribution.groovy
Class GroovyModelResolver

java.lang.Object
  extended by org.apache.tuscany.sca.contribution.groovy.GroovyModelResolver
All Implemented Interfaces:
ModelResolver

public class GroovyModelResolver
extends java.lang.Object
implements ModelResolver

A ModelResolver that compiles Groovy scripts into the contribution class loader so they can be used just like a regular java class.


Field Summary
protected  Contribution contribution
           
protected  ModelResolver modelresolver
           
 
Constructor Summary
GroovyModelResolver(Contribution contribution, ModelFactoryExtensionPoint modelFactories)
           
 
Method Summary
 void addModel(java.lang.Object model)
          Add a resolved model.
 java.lang.Object removeModel(java.lang.Object arg0)
          Remove a resolved model.
<T> T
resolveModel(java.lang.Class<T> arg0, T arg1)
          Resolve the model representing an artifact.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

modelresolver

protected ModelResolver modelresolver

contribution

protected Contribution contribution
Constructor Detail

GroovyModelResolver

public GroovyModelResolver(Contribution contribution,
                           ModelFactoryExtensionPoint modelFactories)
Method Detail

addModel

public void addModel(java.lang.Object model)
Description copied from interface: ModelResolver
Add a resolved model.

Specified by:
addModel in interface ModelResolver
Parameters:
model - The model

removeModel

public java.lang.Object removeModel(java.lang.Object arg0)
Description copied from interface: ModelResolver
Remove a resolved model.

Specified by:
removeModel in interface ModelResolver
Returns:
The removed model, or null if the model was not removed

resolveModel

public <T> T resolveModel(java.lang.Class<T> arg0,
                          T arg1)
Description copied from interface: ModelResolver
Resolve the model representing an artifact.

Specified by:
resolveModel in interface ModelResolver
Parameters:
arg0 - the type of artifact
arg1 - the unresolved model
Returns:
the resolved model