Examples of AbstractBinder


Examples of net.hasor.core.binder.AbstractBinder

    }
    //
    /*--------------------------------------------------------------------------------------Utils*/
    /**为模块创建ApiBinder。*/
    protected ApiBinder newApiBinder(final Module forModule) {
        return new AbstractBinder(this.getEnvironment()) {
            protected BindInfoDefineManager getBuilderRegister() {
                return getBindInfoFactory().getManager();
            }
        };
    }
View Full Code Here

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

        }


        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

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

            // 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

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

        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

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

        }

        // 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

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

        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

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

      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

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

        resourceConfig.property(name, value);
        return this;
    }

    public Jersey withInjectables(final Object... instances) {
        resourceConfig.register(new AbstractBinder() {
            @SuppressWarnings("unchecked")
            @Override
            protected void configure() {
                for (final Object instance : instances) {
                    bind(instance).to((Class<Object>) instance.getClass());
View Full Code Here

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

    };

    public static ServiceLocator createServiceLocator(Binder... customBinders) {
        Binder[] binders = new Binder[customBinders.length + 2];

        binders[0] = new AbstractBinder() {
            @Override
            protected void configure() {
                bindFactory(new Factory<Configuration>() {
                    @Override
                    public Configuration provide() {
View Full Code Here

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

    @Override
    public boolean configure(FeatureContext context) {

        Configuration config = context.getConfiguration();
        if (!config.isRegistered(ResponseLinkFilter.class)) {
            context.register(new AbstractBinder() {

                @Override
                protected void configure() {
                    bindAsContract(NaiveResourceMappingContext.class)
                            .to(ResourceMappingContext.class).in(Singleton.class);
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.