Methods Summary |
---|
public java.lang.Class | getAnnotationType()
return TransactionAttribute.class;
|
private com.sun.enterprise.deployment.ContainerTransaction | getContainerTransaction(javax.ejb.TransactionAttributeType taType)
switch(taType) {
case MANDATORY:
return new ContainerTransaction(
ContainerTransaction.MANDATORY,
ContainerTransaction.MANDATORY);
case REQUIRED:
return new ContainerTransaction(
ContainerTransaction.REQUIRED,
ContainerTransaction.REQUIRED);
case REQUIRES_NEW:
return new ContainerTransaction(
ContainerTransaction.REQUIRES_NEW,
ContainerTransaction.REQUIRES_NEW);
case SUPPORTS:
return new ContainerTransaction(
ContainerTransaction.SUPPORTS,
ContainerTransaction.SUPPORTS);
case NOT_SUPPORTED:
return new ContainerTransaction(
ContainerTransaction.NOT_SUPPORTED,
ContainerTransaction.NOT_SUPPORTED);
default: // NEVER
return new ContainerTransaction(
ContainerTransaction.NEVER,
ContainerTransaction.NEVER);
}
|
public java.lang.Class[] | getTypeDependencies()
return new Class[] {
MessageDriven.class, Stateful.class, Stateless.class,
Timeout.class, TransactionManagement.class};
|
public void | postProcessAnnotation(com.sun.enterprise.deployment.annotation.AnnotationInfo ainfo, com.sun.enterprise.deployment.annotation.AnnotatedElementHandler aeHandler)
EjbContext ejbContext = (EjbContext)aeHandler;
EjbDescriptor ejbDesc = ejbContext.getDescriptor();
TransactionAttribute taAn =
(TransactionAttribute) ainfo.getAnnotation();
ContainerTransaction containerTransaction =
getContainerTransaction(taAn.value());
Class classAn = (Class)ainfo.getAnnotatedElement();
Set txBusMethods = ejbDesc.getTxBusinessMethodDescriptors();
for (Object mdObj : txBusMethods) {
MethodDescriptor md = (MethodDescriptor)mdObj;
// override by xml
if (classAn.equals(ejbContext.getDeclaringClass(md)) &&
ejbDesc.getContainerTransactionFor(md) == null) {
ejbDesc.setContainerTransactionFor(
md, containerTransaction);
}
}
|
protected com.sun.enterprise.deployment.annotation.HandlerProcessingResult | processAnnotation(com.sun.enterprise.deployment.annotation.AnnotationInfo ainfo, com.sun.enterprise.deployment.annotation.context.EjbContext[] ejbContexts)
TransactionAttribute taAn =
(TransactionAttribute) ainfo.getAnnotation();
for (EjbContext ejbContext : ejbContexts) {
EjbDescriptor ejbDesc = ejbContext.getDescriptor();
ContainerTransaction containerTransaction =
getContainerTransaction(taAn.value());
if (ElementType.TYPE.equals(ainfo.getElementType())) {
ejbContext.addPostProcessInfo(ainfo, this);
} else {
Method annMethod = (Method) ainfo.getAnnotatedElement();
Set txBusMethods = ejbDesc.getTxBusinessMethodDescriptors();
for (Object next : txBusMethods) {
MethodDescriptor nextDesc = (MethodDescriptor) next;
Method m = nextDesc.getMethod(ejbDesc);
if( TypeUtil.sameMethodSignature(m, annMethod) &&
ejbDesc.getContainerTransactionFor(nextDesc) == null ) {
// override by xml
ejbDesc.setContainerTransactionFor
(nextDesc, containerTransaction);
}
}
}
}
return getDefaultProcessedResult();
|
protected boolean | supportTypeInheritance()
return true;
|