KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jac > samples > bench > RTTI


1 package org.objectweb.jac.samples.bench;
2
3 import org.objectweb.jac.core.rtti.ClassRepository;
4
5 public class RTTI {
6
7    /**
8     * This sample shows jac's performances in RTTI calls
9     */

10
11    public static void main(String JavaDoc args[]) {
12       String JavaDoc classes[] = new String JavaDoc[] {
13          "org.objectweb.jac.core.dist.Topology",
14          "org.objectweb.jac.util.Repository",
15          "org.objectweb.jac.core.NameRepository",
16          "org.objectweb.jac.core.ApplicationRepository",
17          "org.objectweb.jac.core.ACManager",
18          "org.objectweb.jac.core.dist.rmi.RMIRemoteContainerStub",
19          "org.objectweb.jac.core.Application",
20          "java.util.Arrays$ArrayList",
21          "org.objectweb.jac.aspects.gui.WrappableMap",
22          "org.objectweb.jac.lib.java.util.Vector",
23          "org.objectweb.jac.core.ParserImpl",
24          "org.objectweb.jac.core.rtti.RttiAC",
25          "org.objectweb.jac.ide.Method",
26          "org.objectweb.jac.ide.Project",
27          "org.objectweb.jac.ide.Application",
28          "org.objectweb.jac.ide.AspectConfiguration",
29          "org.objectweb.jac.ide.ModelElement",
30          "org.objectweb.jac.ide.Link",
31          "org.objectweb.jac.ide.Diagram",
32          "org.objectweb.jac.ide.Package",
33          "org.objectweb.jac.aspects.gui.GuiAC",
34          "org.objectweb.jac.aspects.gui.GenericFactory",
35          "org.objectweb.jac.aspects.gui.swing.SwingCustomized",
36          "org.objectweb.jac.aspects.gui.swing.ReferenceView",
37          "org.objectweb.jac.aspects.gui.swing.ObjectChooser",
38          "org.objectweb.jac.aspects.gui.swing.Tree",
39          "org.objectweb.jac.aspects.gui.swing.SwingPanelView",
40          "org.objectweb.jac.aspects.gui.swing.SwingLabel",
41          "org.objectweb.jac.aspects.gui.swing.SwingTabbedView",
42          "org.objectweb.jac.aspects.gui.swing.SwingEditorContainer",
43          "org.objectweb.jac.aspects.gui.swing.SwingContainerView",
44          "org.objectweb.jac.aspects.gui.swing.SingleSlotContainer",
45          "org.objectweb.jac.aspects.gui.swing.DesktopView",
46          "org.objectweb.jac.aspects.gui.swing.SwingMethodView",
47          "org.objectweb.jac.aspects.gui.swing.SwingFieldView",
48          "org.objectweb.jac.aspects.gui.swing.SwingTableView",
49          "org.objectweb.jac.aspects.gui.swing.List",
50          "org.objectweb.jac.aspects.gui.swing.MenuBar",
51          "org.objectweb.jac.aspects.gui.swing.Menu",
52          "org.objectweb.jac.aspects.gui.swing.ToolBar",
53          "org.objectweb.jac.aspects.gui.swing.SwingEmptyView",
54          "org.objectweb.jac.aspects.gui.swing.DateViewer",
55          "org.objectweb.jac.aspects.gui.swing.ImageURLViewer",
56          "org.objectweb.jac.aspects.gui.swing.TextViewer",
57          "org.objectweb.jac.aspects.gui.swing.BooleanEditor",
58          "org.objectweb.jac.aspects.gui.swing.FileEditor",
59          "org.objectweb.jac.aspects.gui.swing.URLEditor",
60          "org.objectweb.jac.aspects.gui.swing.DateEditor",
61          "org.objectweb.jac.aspects.gui.swing.TextEditor",
62          "org.objectweb.jac.aspects.gui.swing.PrimitiveFieldEditor",
63          "org.objectweb.jac.aspects.gui.web.Empty",
64          "org.objectweb.jac.aspects.gui.web.Customized",
65          "org.objectweb.jac.aspects.gui.web.Panel",
66          "org.objectweb.jac.aspects.gui.web.Container",
67          "org.objectweb.jac.aspects.gui.web.SingleSlotContainer",
68          "org.objectweb.jac.aspects.gui.web.Label",
69          "org.objectweb.jac.aspects.gui.web.ReferenceView",
70          "org.objectweb.jac.aspects.gui.web.PrimitiveField",
71          "org.objectweb.jac.aspects.gui.web.Table",
72          "org.objectweb.jac.aspects.gui.web.List",
73          "org.objectweb.jac.aspects.gui.web.Tree",
74          "org.objectweb.jac.aspects.gui.web.Tabs",
75          "org.objectweb.jac.aspects.gui.web.Method",
76          "org.objectweb.jac.aspects.gui.web.Page",
77          "org.objectweb.jac.aspects.gui.web.Dialog",
78          "org.objectweb.jac.aspects.gui.web.MenuBar",
79          "org.objectweb.jac.aspects.gui.web.ToolBar",
80          "org.objectweb.jac.aspects.gui.web.Menu",
81          "org.objectweb.jac.aspects.gui.web.DateViewer",
82          "org.objectweb.jac.aspects.gui.web.ImageURLViewer",
83          "org.objectweb.jac.aspects.gui.web.EditorContainer",
84          "org.objectweb.jac.aspects.gui.web.PrimitiveFieldEditor",
85          "org.objectweb.jac.aspects.gui.web.ObjectChooser",
86          "org.objectweb.jac.aspects.gui.web.DateEditor",
87          "org.objectweb.jac.aspects.gui.web.URLEditor",
88          "org.objectweb.jac.aspects.gui.web.BooleanEditor",
89          "org.objectweb.jac.aspects.gui.CollectionWrapper",
90          "java.util.Date",
91          "java.util.Hashtable$Entry",
92          "org.objectweb.jac.ide.Projects",
93          "org.objectweb.jac.ide.Aspect",
94          "org.objectweb.jac.ide.Class",
95          "org.objectweb.jac.ide.RelationLink",
96          "org.objectweb.jac.ide.PointcutLink",
97          "org.objectweb.jac.ide.TypedElement",
98          "org.objectweb.jac.ide.Field",
99          "org.objectweb.jac.ide.Type",
100          "org.objectweb.jac.ide.Instance",
101          "org.objectweb.jac.ide.Group",
102          "org.objectweb.jac.ide.AspectMethod",
103          "org.objectweb.jac.ide.Parameter",
104          "org.objectweb.jac.ide.TypeRepository",
105          "org.objectweb.jac.ide.diagrams.ClassFigureCreationTool",
106          "org.objectweb.jac.ide.diagrams.PointcutLinkShowTool",
107          "org.objectweb.jac.ide.diagrams.RelationLinkShowTool",
108          "org.objectweb.jac.ide.Errors",
109          "org.objectweb.jac.ide.Error",
110          "org.objectweb.jac.ide.diagrams.DiagramView",
111          "org.objectweb.jac.aspects.persistence.PersistenceAC",
112          "org.objectweb.jac.aspects.persistence.FSStorage",
113          "org.objectweb.jac.lib.java.util.HashSet"};
114       long start = System.currentTimeMillis();
115       ClassRepository cr = ClassRepository.get();
116       cr.ignoreFields("org.objectweb.jac.aspects.gui.swing");
117       for (int i=0; i<classes.length; i++) {
118          long start2 = System.currentTimeMillis();
119          for (int j=0; j<1; j++)
120             cr.getClass(classes[i]);
121          // System.out.println(classes[i]+" in "+(System.currentTimeMillis()-start2)+"ms");
122
}
123       System.out.println("total time "+(System.currentTimeMillis()-start)+"ms");
124    }
125 }
126
Popular Tags