Package com.medallia.tiny

Examples of com.medallia.tiny.ObjectProvider$ObjectFactory


    return null;
  }
 
  /** @return an instance of ObjectProvider with all the objects that are available for dependency injection */
  private ObjectProvider makeObjectProvider(RequestHandler request) {
    ObjectProvider injector = new ObjectProvider();
    registerObjects(injector, request);
    return injector;
  }
View Full Code Here


          addEmbedded(embeddedContent, st);
        return super.renderFinal(st);
      }
    };
   
    ObjectProvider injector = makeObjectProvider(request);

    long nt = System.nanoTime();
    PostAction po = renderer.actionAndRender(injector, makeLifecycleHandlerSet(request), dynamicInput);
    log.info("StRender of " + t.getClass().getSimpleName() + " in " + TimeUnit.MILLISECONDS.convert(System.nanoTime() - nt, TimeUnit.NANOSECONDS) + " ms");
    return po;
View Full Code Here

    return null;
  }
 
  /** @return an instance of ObjectProvider with all the objects that are available for dependency injection */
  private ObjectProvider makeObjectProvider(RequestHandler request) {
    ObjectProvider injector = new ObjectProvider();
    registerObjects(injector, request);
    return injector;
  }
View Full Code Here

        return super.renderFinal(st);
      }
    };
    registerInputArgParser(renderer);
   
    ObjectProvider injector = makeObjectProvider(request);

    long nt = System.nanoTime();
    PostAction po = renderer.actionAndRender(injector, makeLifecycleHandlerSet(request), reqParams);
    log.info("StRender of " + t.getClass().getSimpleName() + " in " + TimeUnit.MILLISECONDS.convert(System.nanoTime() - nt, TimeUnit.NANOSECONDS) + " ms");
    return po;
View Full Code Here

  public void test21() {
    ActionBuilder actionNameBuilder = new DefaultActionBuilder();
    ProfileService profileService = new ProfileServiceImpl();
    actionNameBuilder.setProfileService(profileService);

    ObjectFactory of = new ObjectFactory();
    final DummyContainer mockContainer = new DummyContainer();
    Configuration configuration = new DefaultConfiguration() {
      @Override
      public Container getContainer() {
        return mockContainer;
View Full Code Here

            this.name = name;
            this.type = type;
        }

        public Object create(Context context) throws Exception {
            ObjectFactory objFactory = context.getContainer().getInstance(ObjectFactory.class);
            try {
                return objFactory.buildBean(name, null, true);
            } catch (ClassNotFoundException ex) {
                throw new ConfigurationException("Unable to load bean "+type.getName()+" ("+name+")");
            }
        }
View Full Code Here

    protected void tearDown() throws Exception {
        super.tearDown();
    }

    protected ValidationInterceptor create() {
        ObjectFactory objectFactory = container.getInstance(ObjectFactory.class);
        return (ValidationInterceptor) objectFactory.buildInterceptor(
                new InterceptorConfig.Builder("model", ValidationInterceptor.class.getName()).build(), new HashMap<String, String>());
    }
View Full Code Here

     * Releases all instances bound to this dispatcher instance.
     */
    public void cleanup() {

      // clean up ObjectFactory
        ObjectFactory objectFactory = getContainer().getInstance(ObjectFactory.class);
        if (objectFactory == null) {
            if (LOG.isWarnEnabled()) {
          LOG.warn("Object Factory is null, something is seriously wrong, no clean up will be performed");
            }
        }
        if (objectFactory instanceof ObjectFactoryDestroyable) {
            try {
                ((ObjectFactoryDestroyable)objectFactory).destroy();
            }
            catch(Exception e) {
                // catch any exception that may occurred during destroy() and log it
                LOG.error("exception occurred while destroying ObjectFactory [#0]", e, objectFactory.toString());
            }
        }

        // clean up Dispatcher itself for this thread
        instance.set(null);
View Full Code Here

            .addParam("param2", "value 2")
            .addParam("param3", "value 3")
            .addParam("anchor", "fragment")
            .build();

        ObjectFactory factory = container.getInstance(ObjectFactory.class);
        ServletActionRedirectResult result = (ServletActionRedirectResult) factory.buildResult(resultConfig, new HashMap<String, Object>());
        assertNotNull(result);
    }
View Full Code Here

       
        Map<String, PackageConfig> packageConfigs = new HashMap<String, PackageConfig>();
        packageConfigs.put("test", packageConfig);

        Mock mockContainer = new Mock(Container.class);
        mockContainer.matchAndReturn("getInstance", C.args(C.eq(ObjectFactory.class)), new ObjectFactory());
        String reloadConfigs = container.getInstance(String.class, XWorkConstants.RELOAD_XML_CONFIGURATION);
        mockContainer.expectAndReturn("getInstance", C.args(C.eq(String.class), C.eq(XWorkConstants.RELOAD_XML_CONFIGURATION)),
                reloadConfigs);

        Mock mockConfiguration = new Mock(Configuration.class);
View Full Code Here

TOP

Related Classes of com.medallia.tiny.ObjectProvider$ObjectFactory

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.