Search in sources :

Example 1 with MessageDestinationReferenceDescriptor

use of com.sun.enterprise.deployment.MessageDestinationReferenceDescriptor in project Payara by payara.

the class EjbNode method addDescriptor.

@Override
public void addDescriptor(Object newDescriptor) {
    if (newDescriptor instanceof EjbReference) {
        if (DOLUtils.getDefaultLogger().isLoggable(Level.FINE)) {
            DOLUtils.getDefaultLogger().fine("Adding ejb ref " + newDescriptor);
        }
        getEjbDescriptor().addEjbReferenceDescriptor((EjbReference) newDescriptor);
    } else if (newDescriptor instanceof RunAsIdentityDescriptor) {
        if (DOLUtils.getDefaultLogger().isLoggable(Level.FINE)) {
            DOLUtils.getDefaultLogger().fine("Adding security-identity" + newDescriptor);
        }
        getEjbDescriptor().setUsesCallerIdentity(false);
        getEjbDescriptor().setRunAsIdentity((RunAsIdentityDescriptor) newDescriptor);
    } else if (newDescriptor instanceof MessageDestinationReferenceDescriptor) {
        MessageDestinationReferenceDescriptor msgDestRef = (MessageDestinationReferenceDescriptor) newDescriptor;
        EjbBundleDescriptorImpl ejbBundle = (EjbBundleDescriptorImpl) getParentNode().getDescriptor();
        // EjbBundle might not be set yet on EjbDescriptor, so set it
        // explicitly here.
        msgDestRef.setReferringBundleDescriptor(ejbBundle);
        getEjbDescriptor().addMessageDestinationReferenceDescriptor(msgDestRef);
    } else {
        super.addDescriptor(newDescriptor);
    }
}
Also used : EjbReference(com.sun.enterprise.deployment.types.EjbReference) MessageDestinationReferenceDescriptor(com.sun.enterprise.deployment.MessageDestinationReferenceDescriptor) RunAsIdentityDescriptor(com.sun.enterprise.deployment.RunAsIdentityDescriptor) EjbBundleDescriptorImpl(org.glassfish.ejb.deployment.descriptor.EjbBundleDescriptorImpl)

Example 2 with MessageDestinationReferenceDescriptor

use of com.sun.enterprise.deployment.MessageDestinationReferenceDescriptor in project Payara by payara.

the class WebBundleDescriptorImpl method combineMessageDestinationReferenceDescriptors.

@Override
protected void combineMessageDestinationReferenceDescriptors(JndiNameEnvironment env) {
    for (Object omdRef : env.getMessageDestinationReferenceDescriptors()) {
        MessageDestinationReferenceDescriptor mdRef = (MessageDestinationReferenceDescriptor) omdRef;
        MessageDestinationReferenceDescriptor mdr = _getMessageDestinationReferenceByName(mdRef.getName());
        if (mdr != null) {
            combineInjectionTargets(mdr, mdRef);
        } else {
            if (env instanceof WebBundleDescriptor && ((WebBundleDescriptor) env).isConflictMessageDestinationReference()) {
                throw new IllegalArgumentException(localStrings.getLocalString("web.deployment.exceptionconflictmessagedestinationref", "There are more than one message destination references defined in web fragments with the same name, but not overrided in web.xml"));
            } else {
                addMessageDestinationReferenceDescriptor(mdRef);
            }
        }
    }
}
Also used : MessageDestinationReferenceDescriptor(com.sun.enterprise.deployment.MessageDestinationReferenceDescriptor) WebBundleDescriptor(com.sun.enterprise.deployment.WebBundleDescriptor)

Example 3 with MessageDestinationReferenceDescriptor

use of com.sun.enterprise.deployment.MessageDestinationReferenceDescriptor in project Payara by payara.

the class EjbDescriptor method addMessageDestinationReferenceDescriptor.

@Override
public final void addMessageDestinationReferenceDescriptor(MessageDestinationReferenceDescriptor messageDestRef) {
    try {
        MessageDestinationReferenceDescriptor existing = getMessageDestinationReferenceByName(messageDestRef.getName());
        for (InjectionTarget next : messageDestRef.getInjectionTargets()) {
            existing.addInjectionTarget(next);
        }
    } catch (IllegalArgumentException e) {
        if (env != null)
            env.addMessageDestinationReferenceDescriptor(messageDestRef);
        else
            messageDestReferences.add(messageDestRef);
        if (getEjbBundleDescriptor() != null) {
            messageDestRef.setReferringBundleDescriptor(getEjbBundleDescriptor());
        }
    }
}
Also used : MessageDestinationReferenceDescriptor(com.sun.enterprise.deployment.MessageDestinationReferenceDescriptor) InjectionTarget(com.sun.enterprise.deployment.InjectionTarget)

Aggregations

MessageDestinationReferenceDescriptor (com.sun.enterprise.deployment.MessageDestinationReferenceDescriptor)3 InjectionTarget (com.sun.enterprise.deployment.InjectionTarget)1 RunAsIdentityDescriptor (com.sun.enterprise.deployment.RunAsIdentityDescriptor)1 WebBundleDescriptor (com.sun.enterprise.deployment.WebBundleDescriptor)1 EjbReference (com.sun.enterprise.deployment.types.EjbReference)1 EjbBundleDescriptorImpl (org.glassfish.ejb.deployment.descriptor.EjbBundleDescriptorImpl)1