Search in sources :

Example 11 with ClassNode

use of act.util.ClassNode in project actframework by actframework.

the class DependencyInjectorBase method registerDiListener.

@Override
public synchronized void registerDiListener(DependencyInjectionListener listener) {
    Class[] targets = listener.listenTo();
    for (Class c : targets) {
        List<DependencyInjectionListener> list = listeners.get(c);
        if (null == list) {
            final List<DependencyInjectionListener> list0 = new ArrayList<>();
            list = list0;
            final AppClassLoader cl = app().classLoader();
            ClassNode node = cl.classInfoRepository().node(c.getName());
            node.visitPublicNotAbstractTreeNodes(new $.Visitor<ClassNode>() {

                @Override
                public void visit(ClassNode classNode) throws Osgl.Break {
                    listeners.put($.classForName(classNode.name(), cl), list0);
                }
            });
            listeners.put(c, list);
        }
        list.add(listener);
    }
}
Also used : ClassNode(act.util.ClassNode) org.osgl.$(org.osgl.$) AppClassLoader(act.app.AppClassLoader) ArrayList(java.util.ArrayList)

Example 12 with ClassNode

use of act.util.ClassNode in project actframework by actframework.

the class EntityClassEnhancer method visit.

@Override
public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) {
    super.visit(version, access, name, signature, superName, interfaces);
    classDesc = "L" + name + ";";
    String className = Type.getType(classDesc).getClassName();
    ClassNode node = app.classLoader().classInfoRepository().node(className);
    isModel = node != null && node.hasInterface(Model.class.getName());
}
Also used : ClassNode(act.util.ClassNode)

Aggregations

ClassNode (act.util.ClassNode)12 ClassInfoRepository (act.util.ClassInfoRepository)6 AppClassLoader (act.app.AppClassLoader)2 ArrayList (java.util.ArrayList)2 org.osgl.$ (org.osgl.$)2 C (org.osgl.util.C)2 App (act.app.App)1 Osgl (org.osgl.Osgl)1