Package org.glassfish.hk2.api

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


            Logger logger = Logger.getLogger(Logger.GLOBAL_LOGGER_NAME);
            AbstractActiveDescriptor<Logger> di = BuilderHelper.createConstantDescriptor(logger);
            di.addContractType(Logger.class);
            config.addActiveDescriptor(di);
           
            config.commit();
       }
    }


    static ServiceLocator getHabitat() {
View Full Code Here


        DynamicConfiguration dc = dcs.createDynamicConfiguration();

        locator.inject(binder);
        binder.bind(dc);

        dc.commit();
    }

}
View Full Code Here

       
        for (Class<?> clazz : clazzes) {
            config.addActiveDescriptor(clazz);
        }
       
        config.commit();
       
        testLocator.inject(this);
    }
   
    protected void setVerbosity(boolean verbose) {
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

            for (Binder binder : binders) {
                binder.bind(dc);
                allConfigured.add(binder);
            }
            dc.commit();
        }

        return allConfigured;
    }
View Full Code Here

                    bind(configuration).to(Configuration.class);
                }
            };
            final DynamicConfiguration dc = Injections.getConfiguration(locator);
            configBinder.bind(dc);
            dc.commit();

            // Bind providers.
            ProviderBinder.bindProviders(runtimeConfig.getComponentBag(), RuntimeType.CLIENT, null, locator);

            final ClientRuntime crt = new ClientRuntime(configuration, connector, locator);
View Full Code Here

        DynamicConfiguration dc = dcs.createDynamicConfiguration();

        locator.inject(binder);
        binder.bind(dc);

        dc.commit();
    }

    /**
     * Get the class by contract or create and inject a new instance.
     *
 
View Full Code Here

    public void bindInstances(Iterable<Object> instances) {
        final DynamicConfiguration dc = Injections.getConfiguration(locator);
        for (Object instance : instances) {
            bindInstance(instance, dc);
        }
        dc.commit();
    }


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

        if (classes != null && classes.length > 0) {
            final DynamicConfiguration dc = Injections.getConfiguration(locator);
            for (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 (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

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.