1 package org.codehaus.plexus.component.factory;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 import org.codehaus.classworlds.ClassRealmAdapter;
20 import org.codehaus.plexus.PlexusContainer;
21 import org.codehaus.plexus.classworlds.realm.ClassRealm;
22 import org.codehaus.plexus.component.repository.ComponentDescriptor;
23
24
25
26
27
28
29
30 public abstract class AbstractComponentFactory implements ComponentFactory {
31
32 private String id;
33
34 public Object newInstance(ComponentDescriptor componentDescriptor, ClassRealm classRealm, PlexusContainer container)
35 throws ComponentInstantiationException {
36
37 return newInstance(componentDescriptor, ClassRealmAdapter.getInstance(classRealm), container);
38 }
39
40 protected Object newInstance(
41 ComponentDescriptor componentDescriptor,
42 org.codehaus.classworlds.ClassRealm classRealm,
43 PlexusContainer container)
44 throws ComponentInstantiationException {
45 throw new IllegalStateException(getClass().getName() + " does not implement component creation.");
46 }
47 }