Examples of ResourceInjectionService


Examples of org.apache.webbeans.spi.ResourceInjectionService

    {
        if(getWebBeansType().equals(WebBeansType.MANAGED))
        {
            try
            {
                ResourceInjectionService service = null;
                try
                {
                    service = ServiceLoader.getService(ResourceInjectionService.class);
                   
                }catch(Exception e)
                {
                    // When running in tests
                }
               
                if(service != null)
                {
                    service.injectJavaEEResources(instance);  
                }
            }
            catch (Exception e)
            {
                logger.error("Error is occured while injection Java EE Resources for the bean instance : " + instance);
View Full Code Here

Examples of org.apache.webbeans.spi.ResourceInjectionService

        try
        {
            //X TODO cache proxy class!
            ProxyFactory proxyFactory = JavassistProxyFactory.createProxyFactory(this);
           
            ResourceInjectionService resourceService = ServiceLoader.getService(ResourceInjectionService.class);
            this.actualResourceReference = resourceService.getResourceReference(this.resourceReference);
            proxyFactory.setHandler(new ResourceProxyHandler(this.actualResourceReference));
           
            instance = (X)(JavassistProxyFactory.getProxyClass(proxyFactory).newInstance());
        }
        catch (Exception e)
View Full Code Here

Examples of org.apache.webbeans.spi.ResourceInjectionService

    protected void afterStopApplication(Object stopObject) throws Exception
    {

        //Clear the resource injection service
        ResourceInjectionService injectionServices = webBeansContext.getService(ResourceInjectionService.class);
        if(injectionServices != null)
        {
            injectionServices.clear();
        }

        //Comment out for commit OWB-502
        //ContextFactory.cleanUpContextFactory();
View Full Code Here

Examples of org.apache.webbeans.spi.ResourceInjectionService

    }

    protected void afterStopApplication(final Object stopObject) throws Exception {

        //Clear the resource injection service
        final ResourceInjectionService injectionServices = webBeansContext.getService(ResourceInjectionService.class);
        if (injectionServices != null) {
            injectionServices.clear();
        }

        //Comment out for commit OWB-502
        //ContextFactory.cleanUpContextFactory();
View Full Code Here

Examples of org.apache.webbeans.spi.ResourceInjectionService

            //Delete AnnotateTypeCache
            webBeansContext.getAnnotatedElementFactory().clear();

            //After Stop
            //Clear the resource injection service
            final ResourceInjectionService injectionServices = webBeansContext.getService(ResourceInjectionService.class);
            if (injectionServices != null) {
                injectionServices.clear();
            }

            //Comment out for commit OWB-502
            //ContextFactory.cleanUpContextFactory();
View Full Code Here

Examples of org.apache.webbeans.spi.ResourceInjectionService

    @SuppressWarnings("unchecked")
    protected X createInstance(CreationalContext<X> creationalContext)
    {
        try
        {
            ResourceInjectionService resourceService = getWebBeansContext().getService(ResourceInjectionService.class);
            X instance = resourceService.getResourceReference(resourceReference);

            if (instance == null || Modifier.isFinal(instance.getClass().getModifiers()))
            {
                return instance;
            }
View Full Code Here

Examples of org.apache.webbeans.spi.ResourceInjectionService

     *
     * @return a new instance of this resource bean.
     */
    public X getActualInstance()
    {
        ResourceInjectionService resourceService = getWebBeansContext().getService(ResourceInjectionService.class);
        X instance = resourceService.getResourceReference(resourceReference);
        return instance;
    }
View Full Code Here

Examples of org.apache.webbeans.spi.ResourceInjectionService

    {
        if(getWebBeansType().equals(WebBeansType.MANAGED))
        {
            try
            {
                ResourceInjectionService service = null;
                try
                {
                    service = getWebBeansContext().getService(ResourceInjectionService.class);
                   
                }
                catch(Exception e)
                {
                    // When running in tests
                }
               
                if(service != null)
                {
                    service.injectJavaEEResources(instance);  
                }
            }
            catch (Exception e)
            {
                getLogger().log(Level.SEVERE, OWBLogConst.ERROR_0023, instance);
View Full Code Here

Examples of org.apache.webbeans.spi.ResourceInjectionService

    public void writeExternal(ObjectOutput out) throws IOException
    {       
        // write bean id first
        out.writeObject(bean.getId());
        WebBeansContext webBeansContext = WebBeansContext.getInstance();
        ResourceInjectionService resourceInjectionService = webBeansContext.getService(ResourceInjectionService.class);
        resourceInjectionService.writeExternal(bean, actualResource, out);
    }
View Full Code Here

Examples of org.apache.webbeans.spi.ResourceInjectionService

            ClassNotFoundException
    {
        String id = (String)in.readObject();
        WebBeansContext webBeansContext = WebBeansContext.currentInstance();
        bean = (ResourceBean) webBeansContext.getBeanManagerImpl().getPassivationCapableBean(id);
        ResourceInjectionService resourceInjectionService = webBeansContext.getService(ResourceInjectionService.class);
        actualResource = resourceInjectionService.readExternal(bean, in);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.