Search in sources :

Example 1 with ActivationConfigProperty

use of javax.ejb.ActivationConfigProperty in project Payara by payara.

the class MessageDrivenHandler method setEjbDescriptorInfo.

/**
 * Set Annotation information to Descriptor.
 * This method will also be invoked for an existing descriptor with
 * annotation as user may not specific a complete xml.
 * @param ejbDesc
 * @param ainfo
 * @return HandlerProcessingResult
 */
protected HandlerProcessingResult setEjbDescriptorInfo(EjbDescriptor ejbDesc, AnnotationInfo ainfo) throws AnnotationProcessorException {
    MessageDriven mdAn = (MessageDriven) ainfo.getAnnotation();
    Class ejbClass = (Class) ainfo.getAnnotatedElement();
    EjbMessageBeanDescriptor ejbMsgBeanDesc = (EjbMessageBeanDescriptor) ejbDesc;
    HandlerProcessingResult procResult = setMessageListenerInterface(mdAn, ejbMsgBeanDesc, ejbClass, ainfo);
    doDescriptionProcessing(mdAn.description(), ejbMsgBeanDesc);
    doMappedNameProcessing(mdAn.mappedName(), ejbMsgBeanDesc);
    for (ActivationConfigProperty acProp : mdAn.activationConfig()) {
        EnvironmentProperty envProp = new EnvironmentProperty(acProp.propertyName(), (String) TranslatedConfigView.getTranslatedValue(acProp.propertyValue()), "");
        // xml override
        if (acProp.propertyName().equals("resourceAdapter")) {
            ejbMsgBeanDesc.setResourceAdapterMid(envProp.getValue());
        } else if (ejbMsgBeanDesc.getActivationConfigValue(envProp.getName()) == null) {
            ejbMsgBeanDesc.putActivationConfigProperty(envProp);
        }
    }
    return procResult;
}
Also used : ActivationConfigProperty(javax.ejb.ActivationConfigProperty) EjbMessageBeanDescriptor(org.glassfish.ejb.deployment.descriptor.EjbMessageBeanDescriptor) HandlerProcessingResult(org.glassfish.apf.HandlerProcessingResult) EnvironmentProperty(com.sun.enterprise.deployment.EnvironmentProperty) MessageDriven(javax.ejb.MessageDriven)

Aggregations

EnvironmentProperty (com.sun.enterprise.deployment.EnvironmentProperty)1 ActivationConfigProperty (javax.ejb.ActivationConfigProperty)1 MessageDriven (javax.ejb.MessageDriven)1 HandlerProcessingResult (org.glassfish.apf.HandlerProcessingResult)1 EjbMessageBeanDescriptor (org.glassfish.ejb.deployment.descriptor.EjbMessageBeanDescriptor)1