Package org.glassfish.hk2.api

Examples of org.glassfish.hk2.api.DynamicConfiguration.commit()


        if (classes != null && classes.length > 0) {
            final DynamicConfiguration dc = Injections.getConfiguration(locator);
            for (final Class<?> clazz : classes) {
                bindClass(clazz, locator, dc, false);
            }
            dc.commit();
        }
    }

    /**
     * Register/bind custom provider classes. Registered providers will be handled
View Full Code Here


        final DynamicConfiguration dc = Injections.getConfiguration(locator);
        for (final Class<?> clazz : classes) {
            bindClass(clazz, locator, dc, bindResources);
        }
        dc.commit();
    }

    /**
     * Bind contract provider model to a provider class using the supplied HK2 dynamic configuration.
     *
 
View Full Code Here

                                     final RuntimeType constrainedTo,
                                     final Set<Class<?>> registeredClasses,
                                     final ServiceLocator locator) {
        final DynamicConfiguration dc = Injections.getConfiguration(locator);
        bindProviders(componentBag, constrainedTo, registeredClasses, dc);
        dc.commit();
    }

    /**
     * Bind all providers contained in {@code providerBag} (classes and instances) using HK2 service locator. Configuration is
     * not committed.
View Full Code Here

        config.addActiveDescriptor(BuilderHelper.createConstantDescriptor(
                env.isEmbedded() ?
                new ProcessEnvironment(ProcessEnvironment.ProcessType.Embedded):
                new ProcessEnvironment(ProcessEnvironment.ProcessType.Server)));
        config.commit();
       
       

        // activate the run level services
        masterListener.reset();
View Full Code Here

        DynamicConfigurationService dcs = locator.getService(DynamicConfigurationService.class);
        DynamicConfiguration config = dcs.createDynamicConfiguration();

        config.addUnbindFilter(removeFilter);

        config.commit();

        unregisterMonitoringStatsProviders();
        super.stop();
    }
View Full Code Here

            // Add a bean to the service locator
            CDIHK2Descriptor<Object> descriptor = new CDIHK2Descriptor<Object>(manager, (Bean<Object>) bean, requiredType);
            config.addActiveDescriptor(descriptor);
        }
       
        config.commit();
       
        return true;
    }

}
View Full Code Here

        DynamicConfiguration config = dcs.createDynamicConfiguration();

        config.addActiveDescriptor(CDISecondChanceResolver.class);
        config.addActiveDescriptor(CDIContextBridge.class);

        config.commit();
    }

    public String toString() {
        return "HK2IntegrationExtension(" + locator + "," + System.identityHashCode(this) + ")";
    }
View Full Code Here

            // Add a bean to the service locator
            CDIHK2Descriptor<Object> descriptor = new CDIHK2Descriptor<Object>(manager, (Bean<Object>) bean, requiredType);
            config.addActiveDescriptor(descriptor);
        }
       
        config.commit();
       
        return true;
    }

}
View Full Code Here

        DynamicConfiguration config = dcs.createDynamicConfiguration();
       
        config.addActiveDescriptor(CDISecondChanceResolver.class);
        config.addActiveDescriptor(CDIContextBridge.class);
       
        config.commit();
    }

    public String toString() {
        return "HK2IntegrationExtension(" + locator + "," + System.identityHashCode(this) + ")";
    }
View Full Code Here

      DynamicConfigurationService dcs = locator.getService(DynamicConfigurationService.class);
      DynamicConfiguration config = dcs.createDynamicConfiguration();
     
      config.addActiveDescriptor(WebConfigListener.class);
     
      config.commit();
     
      return locator.getService(WebConfigListener.class);
    }

    public void postConstruct() {
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.