FileDocCategorySizeDatePackage
EjbInterceptor.javaAPI DocGlassfish v2 API7118Fri May 04 22:31:20 BST 2007com.sun.enterprise.deployment

EjbInterceptor

public class EjbInterceptor extends JndiEnvironmentRefsGroupDescriptor
Contains information about 1 ejb interceptor.

Fields Summary
private static com.sun.enterprise.util.LocalStringManagerImpl
localStrings
private static final Logger
_logger
private Set
aroundInvokeDescriptors
private String
interceptorClassName
private boolean
fromBeanClass
Constructors Summary
Methods Summary
public voidaddAroundInvokeDescriptor(LifecycleCallbackDescriptor aroundInvokeDesc)

        Set<LifecycleCallbackDescriptor> aroundInvokeDescs =
            getAroundInvokeDescriptors();
        boolean found = false;       
        for (LifecycleCallbackDescriptor ai : aroundInvokeDescs) {
            if ((aroundInvokeDesc.getLifecycleCallbackClass() != null) &&
                aroundInvokeDesc.getLifecycleCallbackClass().equals(
                    ai.getLifecycleCallbackClass())) {
                found = true;
            }
        }

        if (!found) {
            aroundInvokeDescs.add(aroundInvokeDesc);
        }
    
public voidaddAroundInvokeDescriptors(java.util.Set aroundInvokes)

        for (LifecycleCallbackDescriptor ai : aroundInvokes) {
            addAroundInvokeDescriptor(ai);
        }
    
public voidaddPostActivateDescriptor(LifecycleCallbackDescriptor lcDesc)

        addCallbackDescriptor(CallbackType.POST_ACTIVATE, lcDesc);
    
public voidaddPrePassivateDescriptor(LifecycleCallbackDescriptor lcDesc)

        addCallbackDescriptor(CallbackType.PRE_PASSIVATE, lcDesc);
    
public java.util.SetgetAroundInvokeDescriptors()

        if (aroundInvokeDescriptors == null) {
            aroundInvokeDescriptors =
                new HashSet<LifecycleCallbackDescriptor>(); 
        }
        return aroundInvokeDescriptors;
    
public booleangetFromBeanClass()

        return fromBeanClass;
    
public java.lang.StringgetInterceptorClassName()


       
        return interceptorClassName;
    
public java.util.ListgetOrderedAroundInvokeDescriptors(java.lang.ClassLoader loader)
Some clients need the AroundInvoke methods for this inheritance hierarchy in the spec-defined "least derived --> most derived" order.


        return orderDescriptors(getAroundInvokeDescriptors(), loader);

    
public java.util.ListgetOrderedCallbackDescriptors(com.sun.enterprise.deployment.LifecycleCallbackDescriptor.CallbackType type, java.lang.ClassLoader loader)
Some clients need the Callback methods for this inheritance hierarchy in the spec-defined "least derived --> most derived" order.


        return orderDescriptors(getCallbackDescriptors(type), loader);
    
public booleanhasAroundInvokeDescriptor()

        return (getAroundInvokeDescriptors().size() > 0);
    
private java.util.ListorderDescriptors(java.util.Set lcds, java.lang.ClassLoader loader)
Order a set of lifecycle method descriptors for a particular inheritance hierarchy with highest precedence assigned to the least derived class.


        LinkedList<LifecycleCallbackDescriptor> orderedDescs =
            new LinkedList<LifecycleCallbackDescriptor>();

        Map<String, LifecycleCallbackDescriptor> map =
            new HashMap<String, LifecycleCallbackDescriptor>();

        for(LifecycleCallbackDescriptor next : lcds) {
            map.put(next.getLifecycleCallbackClass(), next);
        }

        Class nextClass = loader.loadClass(getInterceptorClassName());

        while((nextClass != Object.class) && (nextClass != null)) {
            String nextClassName = nextClass.getName();
            if( map.containsKey(nextClassName) ) {
                LifecycleCallbackDescriptor lcd = map.get(nextClassName);
                orderedDescs.addFirst(lcd);
            }

            nextClass = nextClass.getSuperclass();
        }


        return orderedDescs;

    
public voidsetFromBeanClass(boolean flag)

        fromBeanClass = flag;
    
public voidsetInterceptorClassName(java.lang.String className)

        interceptorClassName = className;
    
public java.lang.StringtoString()

        return "EjbInterceptor class = " + getInterceptorClassName();