Package org.glassfish.hk2.utilities

Examples of org.glassfish.hk2.utilities.BuilderHelper


    public Object getContainer(Object info) {

        Object[] params = (Object[])info;
        String appName = (String)params[0];

        ServiceLocator habitat = Globals.getDefaultHabitat();
        ApplicationRegistry reg = habitat.getService(ApplicationRegistry.class);
        ApplicationInfo appInfo = reg.get(appName);
        Application app = appInfo.getMetaData(Application.class);

        EjbDescriptor desc = app.getEjbByName((String)params[1]);

        return habitat.<EjbContainerUtil>getService(EjbContainerUtil.class).getContainer(desc.getUniqueId());
    }
View Full Code Here


            logger.fine("ejb.DeploymentHelper.getconnection", name); //NOI18N
        }

        // TODO - pass Habitat or ConnectorRuntime as an argument.

        ServiceLocator habitat = Globals.getDefaultHabitat();
        DataSource ds = null;
        try {
            ConnectorRuntime connectorRuntime = habitat.getService(ConnectorRuntime.class);
            ds = DataSource.class.cast(connectorRuntime.lookupNonTxResource(name, true));
        } catch (Exception e) {
            throw new JDOFatalUserException(
                I18NHelper.getMessage(messages,
                        "ejb.jndi.lookupfailed", name)); //NOI18N
View Full Code Here

                }
            };

            // Install the all-trusting trust manager
            SSLContext sc = SSLContext.getInstance(TLS);
            ServiceLocator habitat = Globals.getDefaultHabitat();
            SSLUtils sslUtils = habitat.getService(SSLUtils.class);
            sc.init(sslUtils.getKeyManagers(), trustAllCerts, new java.security.SecureRandom());

            //---------------------------------
            url = new URL(HTTPS_PROTOCOL, _lbHost, Integer.parseInt(_lbPort), contextRoot);
            if (_lbProxyHost != null && _lbProxyPort != null) {
View Full Code Here

        ctx.setLogger(LogDomains.getLogger(
                DomainInitializer.class, LogDomains.SERVER_LOGGER));

        // now for every such Inhabitant, fetch the actual initial config and
        // insert it into the module that initial config was targeted for.
        ServiceLocator habitat = glassfish.getService(ServiceLocator.class);
        Collection<DomainInitializer> inits =
                habitat.getAllServices(DomainInitializer.class);
        if (inits.isEmpty()) {
            logger.info(strings.get("NoCustomization"));
        }
        for (DomainInitializer inhabitant : habitat.<DomainInitializer>getAllServices(
                DomainInitializer.class)) {
            logger.info(strings.get("InvokeInitializer",
                    inhabitant.getClass()));
            Container newContainerConfig = inhabitant.getInitialConfig(ctx);
            try {
View Full Code Here

                        + " was not found.  Are you missing injection bindings?");
            }
        }

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

        bind(locator, new VertxBinder(vertx, container));
        for (Binder bootstrap : bootstraps) {
            bind(locator, bootstrap);
        }
View Full Code Here

            container.logger().error("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();
        locator = factory.create(null);

        bind(locator, new VertxBinder(vertx, 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

        if (Factory.class.isAssignableFrom(clazz)) {
            type = DescriptorType.PROVIDE_METHOD;
        }
       
        Boolean proxy = null;
        UseProxy up = clazz.getAnnotation(UseProxy.class);
        if (up != null) {
            proxy = new Boolean(up.value());
        }
       
        Boolean proxyForSameScope = null;
        ProxyForSameScope pfss = clazz.getAnnotation(ProxyForSameScope.class);
        if (pfss != null) {
View Full Code Here

                proxyForSameScope = Boolean.FALSE;
            }
        }
       
        DescriptorVisibility visibility = DescriptorVisibility.NORMAL;
        Visibility vi = constant.getClass().getAnnotation(Visibility.class);
        if (vi != null) {
            visibility = vi.value();
        }
       
        String classAnalysisName = null;
        Service service = constant.getClass().getAnnotation(Service.class);
        if (service != null) {
View Full Code Here

        if (pfss != null) {
            proxyForSameScope = new Boolean(pfss.value());
        }
       
        DescriptorVisibility visibility = DescriptorVisibility.NORMAL;
        Visibility vi = clazz.getAnnotation(Visibility.class);
        if (vi != null) {
            visibility = vi.value();
        }
       
        // TODO:  Can we get metadata from @Service?
        return new DescriptorImpl(
                contracts,
View Full Code Here

TOP

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

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.