org.apache.webbeans.intercept
Class NormalScopedBeanInterceptorHandler

java.lang.Object
  extended by org.apache.webbeans.intercept.NormalScopedBeanInterceptorHandler
All Implemented Interfaces:
Serializable, Provider
Direct Known Subclasses:
ApplicationScopedBeanInterceptorHandler

public class NormalScopedBeanInterceptorHandler
extends Object
implements Provider, Serializable

A Provider which handles all NormalScoped proxying. It's two main responsibilities are to provide the one active Contextual Instance, the second is to provide serialisation.

The generated proxy will writeReplace() with this class and any NormalScopedBean provider must readResolve() and regenerate the proxy class from the NormalScopeProxyFactory again.

Any subclass should either declare all their fields transient or handle the serialisation properly!

See Also:
Serialized Form

Field Summary
protected  Bean<?> bean
           
 
Constructor Summary
NormalScopedBeanInterceptorHandler(BeanManager beanManager, Bean<?> bean)
           
 
Method Summary
 Object get()
           
 Bean<?> getBean()
           
protected  BeanManager getBeanManager()
           
protected  Object getContextualInstance()
           
protected  Object readResolve()
          The following code gets generated into the proxy: Object writeReplace() throws ObjectStreamException { return provider; }
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bean

protected transient Bean<?> bean
Constructor Detail

NormalScopedBeanInterceptorHandler

public NormalScopedBeanInterceptorHandler(BeanManager beanManager,
                                          Bean<?> bean)
Method Detail

get

public Object get()
Specified by:
get in interface Provider

getBean

public Bean<?> getBean()

getBeanManager

protected BeanManager getBeanManager()

getContextualInstance

protected Object getContextualInstance()

readResolve

protected Object readResolve()
                      throws ObjectStreamException
The following code gets generated into the proxy:
 Object writeReplace() throws ObjectStreamException
 {
     return provider;
 }
 

Throws:
ObjectStreamException


Copyright © 2008–2014 The Apache Software Foundation. All rights reserved.