org.apache.tuscany.sca.contribution.osgi.impl
Class OSGiModelResolverImpl

java.lang.Object
  extended by org.apache.tuscany.sca.contribution.osgi.impl.OSGiModelResolverImpl
All Implemented Interfaces:
ModelResolver

public class OSGiModelResolverImpl
extends java.lang.Object
implements ModelResolver

An implementation of an artifact resolver for OSGi bundles.


Constructor Summary
OSGiModelResolverImpl(java.util.Hashtable<java.lang.String,Bundle> bundles)
           
 
Method Summary
 void addModel(java.lang.Object resolved)
          Add a resolved model.
 java.util.Collection<java.lang.Object> getModels()
           
 java.lang.Object removeModel(java.lang.Object resolved)
          Remove a resolved model.
<T> T
resolveModel(java.lang.Class<T> modelClass, T unresolved)
          Resolve the model representing an artifact.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OSGiModelResolverImpl

public OSGiModelResolverImpl(java.util.Hashtable<java.lang.String,Bundle> bundles)
Method Detail

resolveModel

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

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

addModel

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

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

removeModel

public java.lang.Object removeModel(java.lang.Object resolved)
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

getModels

public java.util.Collection<java.lang.Object> getModels()