public Set<Node> getChildren() { Set<Node> result = new HashSet<Node>(); Class<?>[] interfaces = interf.getInterfaces(); for (int ctr = 0; ctr < interfaces.length; ctr++) { Class<?> cls = interfaces[ctr]; if (Remote.class.isAssignableFrom(cls) && !Remote.class.equals(cls)) result.add(new NodeImpl(cls)); } return result; }
public Set<Node> getChildren() { Set<Node> result = new HashSet<Node>(); Class<?>[] interfaces = interf.getInterfaces(); for (int ctr = 0; ctr < interfaces.length; ctr++) { Class<?> cls = interfaces[ctr]; if (Remote.class.isAssignableFrom(cls) && !Remote.class.equals(cls)) result.add(new NodeImpl(cls)); } return result; }
private Set<Node> getRootSet(Class<?> target, NodeImpl root, Graph gr) { Set<Node> rootSet = null; if (target.isInterface()) { gr.add(root); rootSet = gr.getRoots(); // rootSet just contains root here } else { // Use this class and its superclasses (not Object) as initial roots Class<?> superclass = target; Set<Node> initialRootSet = new HashSet<Node>(); while ((superclass != null) && !superclass.equals(Object.class)) { Node node = new NodeImpl(superclass); gr.add(node); initialRootSet.add(node); superclass = superclass.getSuperclass(); } // Expand all nodes into the graph gr.getRoots(); // remove the roots and find roots again gr.removeAll(initialRootSet); rootSet = gr.getRoots(); } return rootSet; }
private Set<Node> getRootSet(Class<?> target, NodeImpl root, Graph gr) { Set<Node> rootSet = null; if (target.isInterface()) { gr.add(root); rootSet = gr.getRoots(); // rootSet just contains root here } else { // Use this class and its superclasses (not Object) as initial roots Class<?> superclass = target; Set<Node> initialRootSet = new HashSet<Node>(); while ((superclass != null) && !superclass.equals(Object.class)) { Node node = new NodeImpl(superclass); gr.add(node); initialRootSet.add(node); superclass = superclass.getSuperclass(); } // Expand all nodes into the graph gr.getRoots(); // remove the roots and find roots again gr.removeAll(initialRootSet); rootSet = gr.getRoots(); } return rootSet; }
public ClassDataImpl(Class<?> cls) { this.cls = cls; Graph gr = new GraphImpl(); NodeImpl root = new NodeImpl(cls); Set<Node> rootSet = getRootSet(cls, root, gr); // At this point, rootSet contains those remote interfaces that are not related by inheritance, and gr // contains all reachable remote interfaces. Class<?>[] interfaces = getInterfaces(rootSet); nameTranslator = IDLNameTranslatorImpl.get(interfaces); typeIds = makeTypeIds(root, gr, rootSet); ihfactory = new InvocationHandlerFactoryImpl(PresentationManagerImpl.this, this); dictionary = new HashMap<Object, Object>(); }
public ClassDataImpl(Class<?> cls) { this.cls = cls; Graph gr = new GraphImpl(); NodeImpl root = new NodeImpl(cls); Set<Node> rootSet = getRootSet(cls, root, gr); // At this point, rootSet contains those remote interfaces that are not related by inheritance, and gr // contains all reachable remote interfaces. Class<?>[] interfaces = getInterfaces(rootSet); nameTranslator = IDLNameTranslatorImpl.get(interfaces); typeIds = makeTypeIds(root, gr, rootSet); ihfactory = new InvocationHandlerFactoryImpl(PresentationManagerImpl.this, this); dictionary = new HashMap<Object, Object>(); }