Package org.apache.cayenne.di.spi

Examples of org.apache.cayenne.di.spi.DefaultInjector


    /**
     * Creates and returns an injector instance working with the set of provided modules.
     */
    public static Injector createInjector(Module... modules)
            throws ConfigurationException {
        return new DefaultInjector(modules);
    }
View Full Code Here


public class WebModuleTest extends TestCase {

    public void testBind_Scopes() {

        Injector injector = new DefaultInjector(new WebModule());
        RequestHandler handler = injector.getInstance(RequestHandler.class);
        assertTrue(handler instanceof SessionContextRequestHandler);

        RequestHandler handler1 = injector.getInstance(RequestHandler.class);
        assertNotSame("Incorrect singleton scope for request handler", handler, handler1);
    }
View Full Code Here

TOP

Related Classes of org.apache.cayenne.di.spi.DefaultInjector

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.