Examples of LifecycleManagersRegistry


Examples of org.apache.wink.common.internal.lifecycle.LifecycleManagersRegistry

     * Thus, we need to ensure the providersCache continues to be instantiated with ConcurrentHashMap.
     */
    public void testProtectionModel() throws Exception {

        // I need the instantiated object providersCache in the abstract private nested class MediaTypeMap, so here we go!
        ProvidersRegistry providersRegistry = new ProvidersRegistry(new LifecycleManagersRegistry(), new ApplicationValidator());
        Field field = providersRegistry.getClass().getDeclaredField("messageBodyReaders");
        field.setAccessible(true);
        Object messageBodyReaders = field.get(providersRegistry);
        Field field2 = messageBodyReaders.getClass().getSuperclass().getDeclaredField("providersCache");
        field2.setAccessible(true);
View Full Code Here

Examples of org.apache.wink.common.internal.lifecycle.LifecycleManagersRegistry

     *
     * @throws Exception
     */
    public void testProvidesStructuredSyntaxSuffixHandledOk() throws Exception {
      ProvidersRegistry providersRegistry =
          new ProvidersRegistry(new LifecycleManagersRegistry(), new ApplicationValidator());
      providersRegistry.addProvider(GenericProvider.class);
      providersRegistry.addProvider(SpecificProvider.class);

      MediaType mediaType;
      MessageBodyWriter<String> writer;
View Full Code Here

Examples of org.apache.wink.common.internal.lifecycle.LifecycleManagersRegistry

     *
     * @throws Exception
     */
    public void testConsumesStructuredSyntaxSuffixHandledOk() throws Exception {
      ProvidersRegistry providersRegistry =
          new ProvidersRegistry(new LifecycleManagersRegistry(), new ApplicationValidator());
      providersRegistry.addProvider(GenericProvider.class);
      providersRegistry.addProvider(SpecificProvider.class);

      MediaType mediaType;
      MessageBodyReader<String> reader;
View Full Code Here

Examples of org.apache.wink.common.internal.lifecycle.LifecycleManagersRegistry

    // concurrent writes.
   
    // Utility:
    private ProvidersRegistry createProvidersRegistryImpl() {
        ProvidersRegistry providers =
            new ProvidersRegistry(new LifecycleManagersRegistry(), new ApplicationValidator());
        ;
        return providers;
    }
View Full Code Here

Examples of org.apache.wink.common.internal.lifecycle.LifecycleManagersRegistry

    public void testGoodAppStartupInfoLogOutput() throws Exception {
        WinkLogHandler.turnLoggingCaptureOn(WinkLogHandler.LEVEL.INFO);
        MockAppValidator mockAppValidator = new MockAppValidator();
        ResourceRegistry mockResourceRegistry =
            new ResourceRegistry(new LifecycleManagersRegistry(), mockAppValidator);
        ProvidersRegistry mockProvidersRegistry =
            new ProvidersRegistry(new LifecycleManagersRegistry(), mockAppValidator);
        ApplicationProcessor appProcessor =
            new ApplicationProcessor(new MyApp(), mockResourceRegistry, mockProvidersRegistry, false);
        appProcessor.process();
        WinkLogHandler.turnLoggingCaptureOff();
        List<LogRecord> records = WinkLogHandler.getRecords();
View Full Code Here

Examples of org.apache.wink.common.internal.lifecycle.LifecycleManagersRegistry

                if (runtimeContext != null) {
                    providers = runtimeContext.getProviders();
                }

                if (providers == null) {
                    LifecycleManagersRegistry ofFactoryRegistry = new LifecycleManagersRegistry();
                    ofFactoryRegistry.addFactoryFactory(new ScopeLifecycleManager<Object>());
                    ProvidersRegistry providersRegistry =
                        new ProvidersRegistry(ofFactoryRegistry, new ApplicationValidator());

                    final Set<Class<?>> classes = new ApplicationFileLoader(true).getClasses();
View Full Code Here

Examples of org.apache.wink.common.internal.lifecycle.LifecycleManagersRegistry

public class GuiceDeploymentConfiguration extends DeploymentConfiguration {

    @SuppressWarnings("unchecked")
    public GuiceDeploymentConfiguration() {
        LifecycleManagersRegistry lifecycleManagersRegistry = new LifecycleManagersRegistry();
        setOfFactoryRegistry(lifecycleManagersRegistry);
        Injector injector = Guice.createInjector(createModules());
        lifecycleManagersRegistry.addFactoryFactory(new GuiceInjectorLifeCycleManager(injector));
    }
View Full Code Here

Examples of org.apache.wink.common.internal.lifecycle.LifecycleManagersRegistry

     * use the same instance of the ApplicationValidator.
     */
    protected void initRegistries() {
        InjectableFactory.setInstance(new ServerInjectableFactory());
        if (ofFactoryRegistry == null) {
            ofFactoryRegistry = new LifecycleManagersRegistry();
            ofFactoryRegistry.addFactoryFactory(new ScopeLifecycleManager<Object>());
        }
        ApplicationValidator applicationValidator = new ApplicationValidator();
        providersRegistry = new ProvidersRegistry(ofFactoryRegistry, applicationValidator);
        resourceRegistry = new ResourceRegistry(ofFactoryRegistry, applicationValidator);
View Full Code Here

Examples of org.apache.wink.common.internal.lifecycle.LifecycleManagersRegistry

        }
    }

    private ProvidersRegistry createProvidersRegistryImpl() {
        ProvidersRegistry providers =
            new ProvidersRegistry(new LifecycleManagersRegistry(), new ApplicationValidator());
        ;
        return providers;
    }
View Full Code Here

Examples of org.apache.wink.common.internal.lifecycle.LifecycleManagersRegistry

     * Thus, we need to ensure the providersCache continues to be instantiated with ConcurrentHashMap.
     */
    public void testProtectionModel() throws Exception {

        // I need the instantiated object providersCache in the abstract private nested class MediaTypeMap, so here we go!
        ProvidersRegistry providersRegistry = new ProvidersRegistry(new LifecycleManagersRegistry(), new ApplicationValidator());
        Field field = providersRegistry.getClass().getDeclaredField("messageBodyReaders");
        field.setAccessible(true);
        Object messageBodyReaders = field.get(providersRegistry);
        Field field2 = messageBodyReaders.getClass().getSuperclass().getDeclaredField("providersCache");
        field2.setAccessible(true);
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.