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);
}
}
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);
}
}
}
}
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());
}
}
}
Aggregations