KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > object > bytecode > aspectwerkz > ClassInfoFactory


1 /*
2  * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
3  */

4 package com.tc.object.bytecode.aspectwerkz;
5
6 import com.tc.aspectwerkz.reflect.ClassInfo;
7
8 import java.util.HashMap JavaDoc;
9 import java.util.Map JavaDoc;
10
11 /**
12  *
13  */

14 public class ClassInfoFactory {
15     private final Map JavaDoc classInfoCache = new HashMap JavaDoc();
16
17     public ClassInfo getClassInfo(String JavaDoc className) {
18         ClassInfo info;
19         synchronized (classInfoCache) {
20             info = (ClassInfo) classInfoCache.get(className);
21             if (info == null) {
22                 info = new SimpleClassInfo(className);
23                 classInfoCache.put(className, info);
24             }
25         }
26         return info;
27     }
28 }
29
Popular Tags