1 package org.andromda.core.repository;
2
3 import org.andromda.core.common.ClassUtils;
4 import org.andromda.core.namespace.BaseNamespaceComponent;
5
6
7
8
9
10
11
12 public class Repository
13 extends BaseNamespaceComponent
14 {
15
16
17
18 private RepositoryFacade implementation = null;
19
20
21
22
23
24
25 public void setImplementationClass(final String implementationClass)
26 {
27 final Class type = ClassUtils.loadClass(implementationClass);
28 if (!RepositoryFacade.class.isAssignableFrom(type))
29 {
30 throw new RepositoryException(
31 "Implementation '" + implementationClass + "' must be an instance of '" +
32 RepositoryFacade.class.getName() + '\'');
33 }
34 implementation = (RepositoryFacade)ClassUtils.newInstance(type);
35 }
36
37
38
39
40
41
42 public RepositoryFacade getImplementation()
43 {
44 return this.implementation;
45 }
46 }