Package org.glassfish.hk2.api

Examples of org.glassfish.hk2.api.ServiceLocator


    public static ServiceLocator createLocator(Binder... binders) {
        return _createLocator(null, null, binders);
    }

    private static ServiceLocator _createLocator(String name, ServiceLocator parent, Binder... binders) {
        final ServiceLocator result = factory.create(name, parent, generator, ServiceLocatorFactory.CreatePolicy.DESTROY);

        result.setNeutralContextClassLoader(false);
        ServiceLocatorUtilities.enablePerThreadScope(result);

        for (Binder binder : binders) {
            bind(result, binder);
        }
View Full Code Here


    protected final static LocalStringManagerImpl localStrings =
            new LocalStringManagerImpl(AbstractEjbHandler.class);
   
    public AbstractEjbHandler() {
        ServiceLocator h = Globals.getDefaultHabitat();
        if( h != null ) {
            provider = h.getService(AnnotationTypesProvider.class, "EJB");
        }
    }
View Full Code Here

        super.start();
    }

    @Override
    public void stop() throws IOException {
        ServiceLocator locator = grizzlyService.getHabitat();
        IndexedFilter removeFilter = BuilderHelper.createNameAndContractFilter(Mapper.class.getName(),
                (address.toString() + port));

        DynamicConfigurationService dcs = locator.getService(DynamicConfigurationService.class);
        DynamicConfiguration config = dcs.createDynamicConfiguration();

        config.addUnbindFilter(removeFilter);

        config.commit();
View Full Code Here

            initializeInvocationInfo();

            setupEnvironment();
           
            ServiceLocator services = ejbContainerUtilImpl.getServices();

            jcdiService = services.getService(JCDIService.class);

            initEjbInterceptors();
        } catch (Exception ex) {
            _logger.log(Level.FINE, "Exception creating BaseContainer : [{0}]", logParams);
            _logger.log(Level.FINE,"", ex);
View Full Code Here

        }
    }

    private void initEjbInterceptors() {
        try {
            ServiceLocator services = ejbContainerUtilImpl.getServices();
            interceptors = services.getAllServices(EjbContainerInterceptor.class);
        } catch (Throwable th) {
            _logger.log(Level.SEVERE, FAILED_TO_INITIALIZE_INTERCEPTOR, th);
        }
    }
View Full Code Here

        return j2eeModuleDirName;
    }
   
    private static ConfigBeansUtilities getConfigBeansUtilities() {
      ServiceLocator locator = Globals.getDefaultHabitat();
      if (locator == null) return null;
     
      return locator.getService(ConfigBeansUtilities.class);
    }
View Full Code Here

        bundleContext = context;
    }

    public <T> void aroundInject(InjectionContext<T> injectionContext) {
        try {
            ServiceLocator h = Globals.getDefaultHabitat();
            ComponentEnvManager compEnvManager = (ComponentEnvManager) h.getService(ComponentEnvManager.class);

            EjbContainerServices containerServices = h.getService(EjbContainerServices.class);

            JndiNameEnvironment componentEnv = compEnvManager.getCurrentJndiNameEnvironment();

            ManagedBeanDescriptor mbDesc = null;
View Full Code Here

            initializeInvocationInfo();

            setupEnvironment();
           
            ServiceLocator services = ejbContainerUtilImpl.getServices();

            jcdiService = services.getService(JCDIService.class);

        } catch (Exception ex) {
            _logger.log(Level.FINE,"ejb.basecontainer_exception",logParams);
            _logger.log(Level.FINE,"", ex);
            throw ex;
View Full Code Here

            useDOLforDeployment = Boolean.valueOf(System.getProperty(DOL_DEPLOYMENT));
        }
    }
   
    private WebConfigListener addAndGetWebConfigListener() {
      ServiceLocator locator = (ServiceLocator) habitat;
     
      DynamicConfigurationService dcs = locator.getService(DynamicConfigurationService.class);
      DynamicConfiguration config = dcs.createDynamicConfiguration();
     
      config.addActiveDescriptor(WebConfigListener.class);
     
      config.commit();
     
      return locator.getService(WebConfigListener.class);
    }
View Full Code Here

            initializeInvocationInfo();

            setupEnvironment();
           
            ServiceLocator services = ejbContainerUtilImpl.getServices();

            jcdiService = services.getService(JCDIService.class);

        } catch (Exception ex) {
            _logger.log(Level.FINE,"ejb.basecontainer_exception",logParams);
            _logger.log(Level.FINE,"", ex);
            throw ex;
View Full Code Here

TOP

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

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.