blob: bf0b5e47c88d57171f13d72eb5186413b7ccab13 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
|
/*******************************************************************************
* Copyright (c) 2003, 2005 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.jem.internal.java.adapters.jdk;
/*
* $RCSfile: JavaJDKAdapterFactory.java,v $
* $Revision: 1.4 $ $Date: 2005/08/24 20:20:25 $
*/
import java.util.Iterator;
import org.eclipse.emf.common.notify.Notifier;
import org.eclipse.jem.internal.java.adapters.JavaReflectionAdapterFactory;
import org.eclipse.jem.internal.java.adapters.ReflectionAdaptor;
/**
* Insert the type's description here.
* Creation date: (6/13/2000 1:20:31 PM)
* @author: Administrator
*/
public class JavaJDKAdapterFactory extends JavaReflectionAdapterFactory {
protected ClassLoader contextClassLoader;
/**
* JavaJDOMAdapterFactory constructor comment.
*/
public JavaJDKAdapterFactory() {
super();
//adapterKey = TYPE_NAME;
}
/**
* JavaJDOMAdapterFactory constructor comment.
*/
public JavaJDKAdapterFactory(ClassLoader aClassLoader) {
this();
setContextClassLoader(aClassLoader);
}
protected ReflectionAdaptor createJavaClassAdaptor(Notifier target) {
return new JavaClassJDKAdaptor(target, this);
}
protected ReflectionAdaptor createJavaFieldAdaptor(Notifier target) {
return new JavaFieldJDKAdaptor(target, this);
}
protected ReflectionAdaptor createJavaMethodAdaptor(Notifier target) {
return new JavaMethodJDKAdaptor(target, this);
}
// Flush ALL adapters, worst case
public void flushAll() {
isBusyIteratingReflected = true;
try {
Iterator i = reflected.values().iterator();
while (i.hasNext())
((JavaClassJDKAdaptor) i.next()).flushReflectedValuesIfNecessary();
} finally {
finishedIteratingReflected();
}
}
// Flush the adapter for a source object
public void flushReflection(String source) {
JavaClassJDKAdaptor a = (JavaClassJDKAdaptor) reflected.get(source);
if (a != null)
a.flushReflectedValuesIfNecessary();
}
/**
* Insert the method's description here.
* Creation date: (11/07/00 3:38:12 PM)
* @return java.lang.ClassLoader
*/
public java.lang.ClassLoader getContextClassLoader() {
return contextClassLoader;
}
/**
* Insert the method's description here.
* Creation date: (11/07/00 3:38:12 PM)
* @param newContextClassLoader java.lang.ClassLoader
*/
public void setContextClassLoader(java.lang.ClassLoader newContextClassLoader) {
contextClassLoader = newContextClassLoader;
}
}
|