FileDocCategorySizeDatePackage
AbstractPersistenceContextType.javaAPI DocGlassfish v2 API3754Fri May 04 22:33:26 BST 2007com.sun.enterprise.tools.verifier.tests

AbstractPersistenceContextType

public abstract class AbstractPersistenceContextType extends VerifierTest implements VerifierCheck
Assertion : Only Stateful Session Bean can use EXTENDED persistence context type.
author
bshankar@sun.com

Fields Summary
static final String
className
Constructors Summary
Methods Summary
public com.sun.enterprise.tools.verifier.Resultcheck(Descriptor descriptor)

    
        
        
        // initialize the result object
        Result result = getInitializedResult();
        addErrorDetails(result,
                getVerifierContext().getComponentNameConstructor());
        result.setStatus(Result.PASSED); //default status is PASSED
        
        if(!isStatefulSessionBean(descriptor)) {
            for (EntityManagerReferenceDescriptor emRefDesc : getEntityManagerReferenceDescriptors(descriptor)) {
                if(emRefDesc.getPersistenceContextType().equals(PersistenceContextType.EXTENDED)) {
                    String unitName = emRefDesc.getUnitName() == null ? "" : emRefDesc.getUnitName();
                    result.failed(
                            smh.getLocalString(className + ".failed", 
                            "Found a persistence unit by name [ {0} ] of EXTENDED context type.", new Object[]{unitName}));
                }
            }
        }
        return result;
    
protected abstract java.util.CollectiongetEntityManagerReferenceDescriptors(Descriptor descriptor)

protected abstract booleanisStatefulSessionBean(Descriptor d)