Package org.nanocontainer.aop

Examples of org.nanocontainer.aop.Dao


                "    component(key:Dao, class:DaoImpl)\n" +
                "    component(key:StringBuffer, instance:log)\n" +
                "}\n";

        PicoContainer pico = buildContainer(script);
        Dao dao = (Dao) pico.getComponentInstance(Dao.class);
        StringBuffer log = (StringBuffer) pico.getComponentInstance(StringBuffer.class);
        verifyIntercepted(dao, log);
    }
View Full Code Here


                "    component(key:Dao, class:DaoImpl)\n" +
                "    component(key:StringBuffer, instance:log)\n" +
                "}\n";

        PicoContainer pico = buildContainer(script);
        Dao dao = (Dao) pico.getComponentInstance(Dao.class);
        StringBuffer log = (StringBuffer) pico.getComponentInstance(StringBuffer.class);
        verifyIntercepted(dao, log);
    }
View Full Code Here

                "    component(LoggingInterceptor)\n" +
                "    component(key:Dao, class:DaoImpl)\n" +
                "}\n";

        PicoContainer pico = buildContainer(script);
        Dao dao = (Dao) pico.getComponentInstance(Dao.class);
        StringBuffer log = (StringBuffer) pico.getComponentInstance("log");
        verifyIntercepted(dao, log);
    }
View Full Code Here

                "    component(key:'log', instance:log)\n" +
                "    component(key:'notIntercepted', class:DaoImpl)\n" +
                "}\n";

        PicoContainer pico = buildContainer(script);
        Dao intercepted = (Dao) pico.getComponentInstance("intercepted");
        Dao notIntercepted = (Dao) pico.getComponentInstance("notIntercepted");
        StringBuffer log = (StringBuffer) pico.getComponentInstance("log");

        verifyIntercepted(intercepted, log);
        verifyNotIntercepted(notIntercepted, log);
    }
View Full Code Here

                "    component(key:Dao, class:DaoImpl) \n" +
                "    aspect(classCut:cuts.instancesOf(Dao), mixinClass:IdentifiableMixin)\n" +
                "}";

        PicoContainer pico = buildContainer(script);
        Dao dao = (Dao) pico.getComponentInstance(Dao.class);
        verifyMixin(dao);
    }
View Full Code Here

                "    component(key:Dao, class:DaoImpl) \n" +
                "    aspect(classCut:cuts.instancesOf(Dao), mixinClass:IdentifiableMixin)\n" +
                "}";

        PicoContainer pico = buildContainer(script);
        Dao dao = (Dao) pico.getComponentInstance(Dao.class);
        verifyMixin(dao);
    }
View Full Code Here

                "    component(key:'intLog', instance:intLog)\n" +
                "    component(key:'cafLog', instance:cafLog)\n" +
                "}";

        PicoContainer pico = buildContainer(script);
        Dao dao = (Dao) pico.getComponentInstance(Dao.class);
        StringBuffer intLog = (StringBuffer) pico.getComponentInstance("intLog");
        verifyIntercepted(dao, intLog);
        StringBuffer cafLog = (StringBuffer) pico.getComponentInstance("cafLog");
        assertEquals("called", cafLog.toString());
    }
View Full Code Here

    public void testInterceptor() {
        StringBuffer log = new StringBuffer();
        aspects.registerInterceptor(cuts.instancesOf(Dao.class), cuts.allMethods(), new LoggingInterceptor(log));
        pico.registerComponentImplementation(Dao.class, DaoImpl.class);
        Dao dao = (Dao) pico.getComponentInstance(Dao.class);
        verifyIntercepted(dao, log);
    }
View Full Code Here

        pico.registerComponentImplementation("log", StringBuffer.class);
        pico.registerComponentImplementation(LoggingInterceptor.class);
        pico.registerComponentImplementation(Dao.class, DaoImpl.class);

        Dao dao = (Dao) pico.getComponentInstance(Dao.class);
        StringBuffer log = (StringBuffer) pico.getComponentInstance("log");
        verifyIntercepted(dao, log);
    }
View Full Code Here

        aspects.registerInterceptor(cuts.component("intercepted"), cuts.allMethods(), new LoggingInterceptor(log));
        pico.registerComponentImplementation("intercepted", DaoImpl.class);
        pico.registerComponentImplementation("notIntercepted", DaoImpl.class);

        Dao intercepted = (Dao) pico.getComponentInstance("intercepted");
        Dao notIntercepted = (Dao) pico.getComponentInstance("notIntercepted");

        verifyIntercepted(intercepted, log);
        verifyNotIntercepted(notIntercepted, log);
    }
View Full Code Here

TOP

Related Classes of org.nanocontainer.aop.Dao

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.