Package org.glassfish.hk2.utilities

Examples of org.glassfish.hk2.utilities.Binder


       
        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


    private Verticle createRealVerticle(Class<?> clazz) throws Exception {

        JsonObject config = container.config();
        String bootstrapName = config.getString(CONFIG_BOOTSTRAP_BINDER_NAME, BOOTSTRAP_BINDER_NAME);
        Binder bootstrap = null;

        try {
            Class bootstrapClass = cl.loadClass(bootstrapName);
            Object obj = bootstrapClass.newInstance();
View Full Code Here

        JsonObject config = this.container.config();
        if (config == null) {
            config = new JsonObject();
        }
        String bootstrapName = config.getString(CONFIG_BOOTSTRAP_BINDER_NAME, BOOTSTRAP_BINDER_NAME);
        Binder bootstrap = null;

        try {
            Class bootstrapClass = cl.loadClass(bootstrapName);
            Object obj = bootstrapClass.newInstance();
View Full Code Here

        JsonObject config = this.container.config();
        if (config == null) {
            config = new JsonObject();
        }
        String bootstrapName = config.getString(CONFIG_BOOTSTRAP_BINDER_NAME, BOOTSTRAP_BINDER_NAME);
        Binder bootstrap = null;

        try {
            Class bootstrapClass = cl.loadClass(bootstrapName);
            Object obj = bootstrapClass.newInstance();
View Full Code Here

        JsonObject config = this.container.config();
        if (config == null) {
            config = new JsonObject();
        }
        String bootstrapName = config.getString(CONFIG_BOOTSTRAP_BINDER_NAME, BOOTSTRAP_BINDER_NAME);
        Binder bootstrap = null;

        try {
            Class bootstrapClass = cl.loadClass(bootstrapName);
            Object obj = bootstrapClass.newInstance();
View Full Code Here

                    if (hk2BinderClasses.length > 0) {
                        Binder[] binders = new Binder[hk2BinderClasses.length];
                        int index = 0;
                        for (Class<? extends Binder> binderClass : hk2BinderClasses) {
                            Binder binder = binderClasses.get(binderClass);

                            if (binder == null) {
                                binder = binderClass.newInstance();
                                binderClasses.put(binderClass, binder);
                            }
View Full Code Here

    injector = Optional.of(Guice.createInjector(raftModule));

    ResourceConfig resourceConfig = new ResourceConfig();

    Binder binder = new AbstractBinder() {
      @Override
      protected void configure() {
        bindFactory(new Factory<Raft>() {
              @Override
              public Raft provide() {
View Full Code Here

    ModelRegistry modelRegistry = new ModelRegistry();

    final
    MetricRegistry metricRegistry = new MetricRegistry();

    Binder binder = new AbstractBinder(){

      @Override
      protected void configure(){
        bind(modelRegistry).to(ModelRegistry.class);
        bind(metricRegistry).to(MetricRegistry.class);
View Full Code Here

            final StartupContext startupContext = new StartupContext(gfProps.getProperties());
           
            ModulesRegistry modulesRegistry = SingleHK2Factory.getInstance().createModulesRegistry();
           
            Binder postProcessorBinder = new Binder() {

        @Override
        public void bind(DynamicConfiguration config) {
          config.bind(BuilderHelper.createConstantDescriptor(new EmbeddedInhabitantsParser()));
        }
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

TOP

Related Classes of org.glassfish.hk2.utilities.Binder

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.