Skip to content
Browse files

Add the ability to get the resource set configurators

  • Loading branch information...
1 parent 49b6f11 commit 3dfc320f1f4c8ba88da8252ede0e0f8c58b785e8 Bryan Hunt committed Oct 31, 2012
View
7 .../org.eclipselabs.mongo.emf.ext/src/org/eclipselabs/mongo/emf/ext/IResourceSetFactory.java
@@ -11,6 +11,8 @@
package org.eclipselabs.mongo.emf.ext;
+import java.util.Collection;
+
import org.eclipse.emf.ecore.resource.ResourceSet;
/**
@@ -26,4 +28,9 @@
* @return the newly created ResourceSet
*/
ResourceSet createResourceSet();
+
+ /**
+ * @return the collection of resource set configurators currently bound to the factory
+ */
+ Collection<IResourceSetConfigurator> getResourceSetConfigurators();
}
View
17 ...pselabs.mongo.emf.ext/src/org/eclipselabs/mongo/emf/ext/impl/MongoResourceSetFactory.java
@@ -11,6 +11,8 @@
package org.eclipselabs.mongo.emf.ext.impl;
+import java.util.Collection;
+import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
import java.util.concurrent.locks.ReentrantReadWriteLock;
@@ -48,6 +50,21 @@ public ResourceSet createResourceSet()
return resourceSet;
}
+ @Override
+ public Collection<IResourceSetConfigurator> getResourceSetConfigurators()
+ {
+ lock.readLock().lock();
+
+ try
+ {
+ return Collections.unmodifiableCollection(configurators);
+ }
+ finally
+ {
+ lock.readLock().unlock();
+ }
+ }
+
public void bindResourceSetConfigurator(IResourceSetConfigurator resourceSetConfigurator)
{
lock.writeLock().lock();

0 comments on commit 3dfc320

Please sign in to comment.
Something went wrong with that request. Please try again.