use of com.sun.enterprise.deployment.LifecycleCallbackDescriptor in project Payara by payara.
the class EjbDescriptor method addAroundInvokeDescriptor.
public void addAroundInvokeDescriptor(LifecycleCallbackDescriptor aroundInvokeDesc) {
String className = aroundInvokeDesc.getLifecycleCallbackClass();
boolean found = false;
for (LifecycleCallbackDescriptor next : getAroundInvokeDescriptors()) {
if (next.getLifecycleCallbackClass().equals(className)) {
found = true;
break;
}
}
if (!found) {
getAroundInvokeDescriptors().add(aroundInvokeDesc);
}
}
use of com.sun.enterprise.deployment.LifecycleCallbackDescriptor in project Payara by payara.
the class EjbDescriptor method applyDefaultClassToLifecycleMethods.
/**
* Since ejb-class is optional, in some cases the lifecycle-class
* for AroundInvoke, PostConstruct, etc. methods on the bean-class
* is not known at processing time and must be applied lazily. As such,
* this method should only be called if the ejb-class has been set
* on this EjbDescriptor.
*/
public void applyDefaultClassToLifecycleMethods() {
Set<LifecycleCallbackDescriptor> lifecycleMethods = getLifecycleCallbackDescriptors();
lifecycleMethods.addAll(getAroundInvokeDescriptors());
lifecycleMethods.addAll(getAroundTimeoutDescriptors());
for (LifecycleCallbackDescriptor next : lifecycleMethods) {
if (next.getLifecycleCallbackClass() == null) {
next.setLifecycleCallbackClass(getEjbClassName());
}
}
}
use of com.sun.enterprise.deployment.LifecycleCallbackDescriptor in project Payara by payara.
the class EjbSessionDescriptor method addPostActivateDescriptor.
public void addPostActivateDescriptor(LifecycleCallbackDescriptor postActivateDesc) {
String className = postActivateDesc.getLifecycleCallbackClass();
boolean found = false;
for (LifecycleCallbackDescriptor next : getPostActivateDescriptors()) {
if (next.getLifecycleCallbackClass().equals(className)) {
found = true;
break;
}
}
if (!found) {
getPostActivateDescriptors().add(postActivateDesc);
}
}
use of com.sun.enterprise.deployment.LifecycleCallbackDescriptor in project Payara by payara.
the class AroundInvokeNode method getDescriptor.
@Override
public LifecycleCallbackDescriptor getDescriptor() {
if (descriptor == null) {
descriptor = new LifecycleCallbackDescriptor();
Descriptor parentDesc = (Descriptor) getParentNode().getDescriptor();
if (parentDesc instanceof EjbDescriptor) {
EjbDescriptor ejbDesc = (EjbDescriptor) parentDesc;
descriptor.setDefaultLifecycleCallbackClass(ejbDesc.getEjbClassName());
} else if (parentDesc instanceof EjbInterceptor) {
EjbInterceptor ejbInterceptor = (EjbInterceptor) parentDesc;
descriptor.setDefaultLifecycleCallbackClass(ejbInterceptor.getInterceptorClassName());
}
}
return descriptor;
}
use of com.sun.enterprise.deployment.LifecycleCallbackDescriptor in project Payara by payara.
the class AroundConstructHandler method getAroundConstructDescriptor.
private LifecycleCallbackDescriptor getAroundConstructDescriptor(AnnotationInfo ainfo) {
Method annotatedMethod = (Method) ainfo.getAnnotatedElement();
LifecycleCallbackDescriptor aroundConstruct = new LifecycleCallbackDescriptor();
aroundConstruct.setLifecycleCallbackClass(annotatedMethod.getDeclaringClass().getName());
aroundConstruct.setLifecycleCallbackMethod(annotatedMethod.getName());
return aroundConstruct;
}
Aggregations