Package javax.enterprise.context.spi

Examples of javax.enterprise.context.spi.Contextual.destroy()


            if (!(entry.getKey() instanceof _ContextualKey))
            {           
                Contextual bean = storage.getBean(entry.getKey());

                ContextualInstanceInfo<?> contextualInstanceInfo = entry.getValue();
                bean.destroy(contextualInstanceInfo.getContextualInstance(),
                    contextualInstanceInfo.getCreationalContext());
            }
        }
    }
   
View Full Code Here


                    // therefore we need completely drop the type information :(
                    Contextual contextual = componentEntry.getKey();
                    Object instance = componentEntry.getValue();
                    CreationalContext creational = creationalContextMap.get(contextual);

                    contextual.destroy(instance, creational);
                }
            }
        }
    }
View Full Code Here

            {
               Contextual contextual = componentEntry.getKey();
               Object instance = componentEntry.getValue();
               CreationalContext creational = creationalContextMap.get(contextual);

               contextual.destroy(instance, creational);
            }
         }
      }

      context = event.getNewProject();
View Full Code Here

            {
               Contextual contextual = componentEntry.getKey();
               Object instance = componentEntry.getValue();
               CreationalContext creational = creationalContextMap.get(contextual);

               contextual.destroy(instance, creational);
            }
         }

         getCurrentContext().contextMap.clear();
      }
View Full Code Here

            if (!(entry.getKey() instanceof _ContextualKey))
            {           
                Contextual bean = storage.getBean(entry.getKey());

                ContextualInstanceInfo<?> contextualInstanceInfo = entry.getValue();
                bean.destroy(contextualInstanceInfo.getContextualInstance(),
                    contextualInstanceInfo.getCreationalContext());
            }
        }
        //contextMap.clear();
    }
View Full Code Here

            if (!FlowScopeBeanHolder.CURRENT_FLOW_SCOPE_MAP.equals(entry.getKey()))
            {
                Contextual bean = storage.getBean(entry.getKey());

                ContextualInstanceInfo<?> contextualInstanceInfo = entry.getValue();
                bean.destroy(contextualInstanceInfo.getContextualInstance(),
                    contextualInstanceInfo.getCreationalContext());
            }
        }
    }
View Full Code Here

        for (Map.Entry<Object, ContextualInstanceInfo<?>> entry : contextMap.entrySet())
        {
            Contextual bean = storage.getBean(entry.getKey());

            ContextualInstanceInfo<?> contextualInstanceInfo = entry.getValue();
            bean.destroy(contextualInstanceInfo.getContextualInstance(), contextualInstanceInfo.getCreationalContext());
        }
    }

    /**
     * Make sure that the Context is really active.
View Full Code Here

        for (Map.Entry<Object, ContextualInstanceInfo<?>> entry : contextMap.entrySet())
        {
            Contextual bean = storage.getBean(entry.getKey());

            ContextualInstanceInfo<?> contextualInstanceInfo = entry.getValue();
            bean.destroy(contextualInstanceInfo.getContextualInstance(), contextualInstanceInfo.getCreationalContext());
        }
    }

    /**
     * Make sure that the Context is really active.
View Full Code Here

    public void deactivate() {
        active = false;
        for (Map.Entry<Contextual<?>, Instance> contextualInstanceEntry : storage.entrySet()) {
            Contextual contextual = contextualInstanceEntry.getKey();
            Instance instance = contextualInstanceEntry.getValue();
            contextual.destroy(instance.instance, instance.ctx);
        }
        storage.clear();
    }
}
View Full Code Here

    public void destroy(Contextual<?> contextual) {
        assertTrue(contextual instanceof Serializable); // we also test CDI-24 here
        Instance instance = storage.remove(contextual);
        @SuppressWarnings("rawtypes")
        Contextual rawContextual = contextual;
        rawContextual.destroy(instance.instance, instance.ctx);
    }
}
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.