Package org.glassfish.hk2.utilities.binding

Examples of org.glassfish.hk2.utilities.binding.AbstractBinder


     *
     * @param name The name to look for
     * @return The indexed filter that can be used to calls to ServiceLocator methods
     */
    public static IndexedFilter createNameFilter(String name) {
        return new IndexedFilterImpl(null, name);
    }
View Full Code Here


     * @param contract The advertised contract to look for
     * @param name The name to look for
     * @return The indexed filter that can be used to calls to ServiceLocator methods
     */
    public static IndexedFilter createNameAndContractFilter(String contract, String name) {
        return new IndexedFilterImpl(contract, name);
    }
View Full Code Here

       
        if (descriptor.getLocatorId() == null) {
            throw new IllegalArgumentException("The descriptor must have a specific locator ID");
        }
       
        return new SpecificFilterImpl(contract, name,
                descriptor.getServiceId(),
                descriptor.getLocatorId());
       
    }
View Full Code Here

        injectionMgr.inject(result, injector);
        return result;
    }
   
    private void parseInHk2LocatorOrig(BufferedReader reader, Map<String, String> cliCommandNames) throws IOException {
        DescriptorImpl desc = new DescriptorImpl();
        while (desc.readObject(reader)) {
            if (StringUtils.ok(desc.getName()) && desc.getAdvertisedContracts().contains(CLICommand.class.getName())) {
                cliCommandNames.put(desc.getName(), desc.getImplementation());
            }
        }
    }
View Full Code Here

        }


        if (monitoringEnabled) {
            context.register(MonitoringEventListener.class);
            context.register(new AbstractBinder() {
                @Override
                protected void configure() {
                    bindFactory(ReferencingFactory.<MonitoringStatistics>referenceFactory()).to(
                            new TypeLiteral<Ref<MonitoringStatistics>>() {
                            }).in(Singleton.class);
View Full Code Here

            // Configure binders and features.
            runtimeCfgState.configureMetaProviders(locator);

            // Bind configuration.
            final AbstractBinder configBinder = new AbstractBinder() {
                @Override
                protected void configure() {
                    bind(runtimeCfgState).to(Configuration.class);
                }
            };
            final DynamicConfiguration dc = Injections.getConfiguration(locator);
            configBinder.bind(dc);
            dc.commit();

            // Bind providers.
            ProviderBinder.bindProviders(runtimeCfgState.getComponentBag(), RuntimeType.CLIENT, null, locator);
View Full Code Here

        if (disabled) {
            return false;
        }

        context.register(WadlModelProcessor.class);
        context.register(new AbstractBinder() {
            @Override
            protected void configure() {
                bind(WadlApplicationContextImpl.class).to(WadlApplicationContext.class).in(Singleton.class);
            }
        });
View Full Code Here

        }

        // SPI/extension hook to configure ResourceConfig
        configure(resourceConfig);

        AbstractBinder webComponentBinder = new WebComponentBinder(resourceConfig.getProperties());
        resourceConfig.register(webComponentBinder);

        this.appHandler = new ApplicationHandler(resourceConfig, webComponentBinder);

        this.asyncExtensionDelegate = getAsyncExtensionDelegate();
View Full Code Here

        final List<Object> providers = Lists.newArrayList(componentBag.getInstances(ComponentBag.EXCLUDE_META_PROVIDERS));

        // Get instances of providers.
        final Set<Class<?>> providerClasses = componentBag.getClasses(ComponentBag.EXCLUDE_META_PROVIDERS);
        if (!providerClasses.isEmpty()) {
            locator = Injections.createLocator(locator, new AbstractBinder() {
                @Override
                protected void configure() {
                    bind(config).to(Configuration.class);
                }
            });
View Full Code Here

      JacksonJaxbJsonProvider provider = new JacksonJaxbJsonProvider();
      provider.setMapper(workManager.getContext().getConfig().getMapper());
      register(provider);
    }

    register(new AbstractBinder() {
      @Override
      protected void configure() {
        bind(workManager).to(WorkManager.class);
        bind(workManager.getContext().getConfig().getMapper()).to(ObjectMapper.class);
        bind(workManager.getContext().getPersistentStoreProvider()).to(PStoreProvider.class);
View Full Code Here

TOP

Related Classes of org.glassfish.hk2.utilities.binding.AbstractBinder

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.