Examples of ObjectCreator


Examples of org.apache.tapestry5.ioc.ObjectCreator

        this.source = new ObjectCreatorSource()
        {
            public ObjectCreator constructCreator(final ServiceBuilderResources resources)
            {
                return new ObjectCreator()
                {
                    public Object createObject()
                    {
                        return builder.buildService(resources);
                    }
View Full Code Here

Examples of org.apache.tapestry5.ioc.ObjectCreator

    }


    public ObjectCreator constructCreator(final ServiceBuilderResources resources)
    {
        return new ObjectCreator()
        {
            public Object createObject()
            {
                return createReloadableProxy(resources);
            }
View Full Code Here

Examples of org.apache.tapestry5.ioc.ObjectCreator

        SpringModuleDef moduleDef = new SpringModuleDef(servletContext);

        ServiceDef serviceDef = moduleDef.getServiceDef(SpringModuleDef.SERVICE_ID);

        ObjectCreator serviceCreator = serviceDef.createServiceCreator(resources);

        assertSame(serviceCreator.createObject(), ac);

        verify();

        // Now, let's test for some of the services.
View Full Code Here

Examples of org.apache.tapestry5.ioc.ObjectCreator

                    ClassFactory.class);

             final PersistenceContext annotation = annotationProvider
                            .getAnnotation(PersistenceContext.class);

            proxy = classFactory.createProxy(EntityManager.class, new ObjectCreator()
            {
                public Object createObject()
                {
                    final EntityManagerManager entityManagerManager = objectLocator
                            .getService(EntityManagerManager.class);
View Full Code Here

Examples of org.apache.tapestry5.ioc.ObjectCreator

             * When the method is invoked, we don't immediately proceed. Instead, we return a thunk instance
             * that defers its behavior to the lazily invoked invocation.
             */
            public void advise(final Invocation invocation)
            {
                ObjectCreator deferred = new ObjectCreator()
                {
                    public Object createObject()
                    {
                        invocation.proceed();

                        return invocation.getResult();
                    }
                };

                ObjectCreator cachingObjectCreator = new CachingObjectCreator(deferred);

                Object thunk = thunkCreator.createThunk(thunkType, cachingObjectCreator, description);

                invocation.overrideResult(thunk);
            }
View Full Code Here

Examples of org.apache.tapestry5.ioc.ObjectCreator

             * When the method is invoked, we don't immediately proceed. Intead, we return a thunk instance
             * that defers its behavior to the lazyily invoked invocation.
             */
            public void advise(final Invocation invocation)
            {
                ObjectCreator deferred = new ObjectCreator()
                {
                    public Object createObject()
                    {
                        invocation.proceed();

                        return invocation.getResult();
                    }
                };

                ObjectCreator oneShot = new OneShotObjectCreator(deferred);

                Object thunk = createThunk(thunkClass, description, oneShot);

                invocation.overrideResult(thunk);
            }
View Full Code Here

Examples of org.apache.tapestry5.ioc.ObjectCreator

        return false;
    }

    public Object createService(ServiceResources resources, ObjectCreator creator)
    {
        ObjectCreator perThreadCreator = new PerThreadServiceCreator(perthreadManager, creator);

        Class serviceInterface = resources.getServiceInterface();

        return proxyFactory.createProxy(serviceInterface, perThreadCreator, String.format("<PerThread Proxy for %s(%s)>", resources.getServiceId(), serviceInterface.getName()));
    }
View Full Code Here

Examples of org.apache.tapestry5.ioc.ObjectCreator

        if (constructor == null)
            throw new RuntimeException(String.format(
                    "Service implementation class %s does not have a suitable public constructor.", clazz.getName()));

        ObjectCreator constructorServiceCreator = new ConstructorServiceCreator(resources, constructor.toString(),
                constructor);

        return constructorServiceCreator.createObject();
    }
View Full Code Here

Examples of org.apache.tapestry5.ioc.ObjectCreator

    private static final String SERVICE_ID = "FooBar";

    @Test
    public void create_after_shutdown()
    {
        ObjectCreator creator = mockObjectCreator();

        replay();

        JustInTimeObjectCreator j = new JustInTimeObjectCreator(null, creator, SERVICE_ID);
View Full Code Here

Examples of org.apache.tapestry5.ioc.ObjectCreator

    }

    @Test
    public void eager_load()
    {
        ObjectCreator creator = mockObjectCreator();
        Object service = new Object();
        ServiceActivityTracker tracker = mockServiceActivityTracker();

        replay();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.