Package org.glassfish.hk2.api

Examples of org.glassfish.hk2.api.ServiceLocatorFactory


     * @param binders The non-null list of binders to be added to the locator
     * @return The service locator that was either found or created
     * @throws MultiException if any error was encountered while binding services
     */
    public static ServiceLocator bind(String name, Binder... binders) {
        ServiceLocatorFactory factory = ServiceLocatorFactory.getInstance();

        ServiceLocator locator = factory.create(name);
        bind(locator, binders);

        return locator;
    }
View Full Code Here


        this.source = source;
    }
   
    private void createServiceLocator() {
        String locatorName = APP_SERVICE_LOCATOR_PREFIX + name;
        ServiceLocatorFactory slf = ServiceLocatorFactory.getInstance();
       
        if (slf.find(locatorName) != null) {
            slf.destroy(locatorName);
        }
       
        appServiceLocator = slf.create(locatorName);
        deploymentFailedListener = new DeploymentFailedListener(source);
        events.register(deploymentFailedListener);
       
    }
View Full Code Here

        this.source = source;
    }
   
    private void createServiceLocator() {
        String locatorName = APP_SERVICE_LOCATOR_PREFIX + name;
        ServiceLocatorFactory slf = ServiceLocatorFactory.getInstance();
       
        if (slf.find(locatorName) != null) {
            slf.destroy(locatorName);
        }
       
        appServiceLocator = slf.create(locatorName);
        deploymentFailedListener = new DeploymentFailedListener(source);
        events.register(deploymentFailedListener);
       
    }
View Full Code Here

     * @param binders The non-null list of binders to be added to the locator
     * @return The service locator that was either found or created
     * @throws MultiException if any error was encountered while binding services
     */
    public static ServiceLocator bind(String name, Binder... binders) {
        ServiceLocatorFactory factory = ServiceLocatorFactory.getInstance();

        ServiceLocator locator = factory.create(name);
        bind(locator, binders);

        return locator;
    }
View Full Code Here

            logger.warn("HK2 bootstrap binder class " + bootstrapName
                    + " was not found.  Are you missing injection bindings?");
        }

        setServiceLocatorFactory(config);
        ServiceLocatorFactory factory = ServiceLocatorFactory.getInstance();
        ServiceLocator locator = factory.create(null);

        bind(locator, new VertxBinder(this.vertx, this.container));
        if (bootstrap != null) {
            bind(locator, bootstrap);
        }
View Full Code Here

        return (Verticle) locator.createAndInitialize(clazz);
    }

    private void setServiceLocatorFactory(JsonObject config) {
        String containerName = config.getString(CONFIG_SERVICE_LOCATOR_NAME, SERVICE_LOCATOR_NAME);
        ServiceLocatorFactory factory = new HK2ServiceLocatorFactoryImpl(containerName);

        Class factoryClass = ServiceLocatorFactory.class;

        try {
            Field instance = factoryClass.getDeclaredField("INSTANCE");
View Full Code Here

            logger.warn("HK2 bootstrap binder class " + bootstrapName
                    + " was not found.  Are you missing injection bindings?");
        }

        setServiceLocatorFactory(config);
        ServiceLocatorFactory factory = ServiceLocatorFactory.getInstance();
        ServiceLocator locator = factory.create(null);

        bind(locator, new VertxBinder(this.vertx, this.container));
        if (bootstrap != null) {
            bind(locator, bootstrap);
        }
View Full Code Here

        return (Verticle) locator.createAndInitialize(clazz);
    }

    private void setServiceLocatorFactory(JsonObject config) {
        String containerName = config.getString(CONFIG_SERVICE_LOCATOR_NAME, SERVICE_LOCATOR_NAME);
        ServiceLocatorFactory factory = new HK2ServiceLocatorFactoryImpl(containerName);

        Class factoryClass = ServiceLocatorFactory.class;

        try {
            Field instance = factoryClass.getDeclaredField("INSTANCE");
View Full Code Here

            logger.warn("HK2 bootstrap binder class " + bootstrapName
                    + " was not found.  Are you missing injection bindings?");
        }

        // Each verticle factory will have it's own service locator instance
        ServiceLocatorFactory factory = ServiceLocatorFactory.getInstance();
        ServiceLocator locator = factory.create(null);

        bind(locator, new VertxBinder(this.vertx, this.container));
        if (bootstrap != null) {
            bind(locator, bootstrap);
        }
View Full Code Here

        for (Type cType : contracts) {
            contractsAsSet.add(cType);
        }
       
        Boolean proxy = null;
        UseProxy up = constant.getClass().getAnnotation(UseProxy.class);
        if (up != null) {
            if (up.value()) {
                proxy = Boolean.TRUE;
            }
            else {
                proxy = Boolean.FALSE;
            }
View Full Code Here

TOP

Related Classes of org.glassfish.hk2.api.ServiceLocatorFactory

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.