Package org.glassfish.hk2.classmodel.reflect

Examples of org.glassfish.hk2.classmodel.reflect.ParsingContext


    // Jersey client methods
    //******************************************************************************************************************

    public static ClientBuilder initialize(ClientBuilder clientBuilder) {
        try {
            ServiceLocator habitat = SecurityServicesUtil.getInstance().getHabitat();
            SecureAdmin secureAdmin = habitat.getService(SecureAdmin.class);

            final SSLContext sslContext = habitat
                    .<SSLUtils>getService(SSLUtils.class)
                    .getAdminSSLContext(SecureAdmin.Util.DASAlias(secureAdmin), null);

            // Instruct Jersey to use HostNameVerifier and SSLContext provided by us.
            clientBuilder
View Full Code Here


    /**
     * Given a command name, return the name of the class that implements
     * that command in the server.
     */
    private static String getCommandClass(String cmdName) {
        ServiceLocator h = getManHabitat();
        String cname = "org.glassfish.api.admin.AdminCommand";
        for (ActiveDescriptor<?> ad : h.getDescriptors(BuilderHelper.createContractFilter(cname))) {
            if (ad.getName() != null && ad.getName().equals(cmdName)) {
                return ad.getImplementation();
            }
        }
       
View Full Code Here

    private static synchronized ServiceLocator getManHabitat() {
        if (manServiceLocator != null)
            return manServiceLocator;
       
        ModulesRegistry registry = new StaticModulesRegistry(getModuleClassLoader());
        ServiceLocator serviceLocator = registry.createServiceLocator("default");
        manServiceLocator = serviceLocator;
        return manServiceLocator;
    }
View Full Code Here

            if (loginErrorPage == null) {
                throw new AuthException("'loginErrorPage' "
                        + "must be supplied as a property in the provider-config "
                        + "in the domain.xml file!");
            }
            ServiceLocator habitat = SecurityServicesUtil.getInstance().getHabitat();
            Domain domain = habitat.getService(Domain.class);
            NetworkListener adminListener = domain.getServerNamed("server").getConfig().getNetworkConfig().getNetworkListener("admin-listener");
            SecureAdmin secureAdmin = habitat.getService(SecureAdmin.class);
           
            final String host = adminListener.getAddress();
            // Save the REST URL we need to authenticate the user.
            this.restURL =  (SecureAdmin.Util.isEnabled(secureAdmin) ? "https://" : "http://") +
                    (host.equals("0.0.0.0") ? "localhost" : host) + ":" + adminListener.getPort() + "/management/sessions";
View Full Code Here

    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

                        + " 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

        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.classmodel.reflect.ParsingContext

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.