Package org.glassfish.hk2.api

Examples of org.glassfish.hk2.api.Metadata


    Domain domain = null;

    @Override
    public void initialize(NotDuplicateTargetName constraintAnnotation) {
      ServiceLocator locator = ServiceLocatorFactory.getInstance().find("default");
      if (locator == null) return;
     
      ConfigBeansUtilities cbu = locator.getService(ConfigBeansUtilities.class);
      if (cbu == null) return;
     
        domain = cbu.getDomain();
    }
View Full Code Here


        }
        return sb.toString();
    }

    public static Map<String, String> getCurrentValues(String basePath) {
        ServiceLocator serviceLocator = Globals.getDefaultBaseServiceLocator();
        return getCurrentValues(basePath, serviceLocator);
    }
View Full Code Here

        return javaGlobalPrefix.toString();
    }

    protected EJBContextImpl createEjbInstanceAndContext() throws Exception {

        ServiceLocator services = ejbContainerUtilImpl.getServices();

        JCDIService jcdiService = services.getService(JCDIService.class);

        EjbBundleDescriptorImpl ejbBundle = ejbDescriptor.getEjbBundleDescriptor();

  Object instance = null;
  JCDIService.JCDIInjectionContext jcdiCtx = null;
View Full Code Here

  return ejbClass.newInstance();
    }

    protected void injectEjbInstance(EJBContextImpl context) throws Exception {
       
        ServiceLocator services = ejbContainerUtilImpl.getServices();

        JCDIService jcdiService = services.getService(JCDIService.class);

        EjbBundleDescriptorImpl ejbBundle = ejbDescriptor.getEjbBundleDescriptor();

        Object[] interceptorInstances = null;
View Full Code Here

    public static final Logger logger = Logger.getAnonymousLogger();
   
    private final Subject adminSubject = prepareAdminSubject();
   
    private Subject prepareAdminSubject() {
        final ServiceLocator locator = getBaseServiceLocator();
        if (locator != null) {
            final List<ServiceHandle<? extends Object>> adminIdentities =
/*               
                    (List<ServiceHandle<? extends Object>>) getBaseServiceLocator().getAllServices(
                    new Filter() {
View Full Code Here

     * Returns a configured Habitat with the configuration.
     *
     * @return a configured Habitat
     */
    public ServiceLocator getHabitat() {
        ServiceLocator habitat = Utils.instance.getHabitat(this);
       
        assertNotNull("Transactions service from Configuration subsystem is null", habitat.getService(Transactions.class));
        return habitat;
    }
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";
        ActiveDescriptor<?> ad = h.getBestDescriptor(
                BuilderHelper.createNameAndContractFilter(cname, cmdName));
        if (ad == null) return null;
        return ad.getImplementation();
    }
View Full Code Here

    public static void initialize(Client client) {
        if (client == null) {
            client = getJerseyClient();
        }
        try {
            ServiceLocator habitat = SecurityServicesUtil.getInstance().getHabitat();
            SecureAdmin secureAdmin = habitat.getService(SecureAdmin.class);
            client.property(ClientProperties.SSL_CONFIG, new SslConfig(new BasicHostnameVerifier(),
                                                                                          habitat.<SSLUtils>getService(SSLUtils.class).getAdminSSLContext(SecureAdmin.Util.DASAlias(secureAdmin), null)));
            client.register(CsrfProtectionFilter.class);

        } catch (Exception ex) {
            Throwable cause = ex;
            int lcv = 0;
View Full Code Here

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

TOP

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

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.