public class ResourceContainerContextImpl extends AnnotationContext implements ResourceContainerContext, ComponentContext, HandlerContext, ServiceReferenceContainerContext
This provides an abstraction for handle resource references.
Looks up an ejb reference with the given name.
Return null if it is not found.
param
the name of the ejb-reference
EjbReference ejbRef = null;
try {
ejbRef = getEjbReferenceContainer().getEjbReference(name);
// annotation has a corresponding ejb-local-ref/ejb-ref
// in xml. Just add annotation info and continue.
// This logic might change depending on overriding rules
// and order in which annotations are read w.r.t. to xml.
// E.g. sparse overriding in xml or loading annotations
// first.
} catch(IllegalArgumentException e) {
// DOL API is (unfortunately) defined to return
// IllegalStateException if name doesn't exist.
}
return ejbRef;
EntityManagerFactoryReferenceDescriptor emfRefDesc = null;
try {
emfRefDesc = getEmfRefContainer().
getEntityManagerFactoryReferenceByName(name);
// annotation has a corresponding entry
// in xml. Just add annotation info and continue.
// This logic might change depending on overriding rules
// and order in which annotations are read w.r.t. to xml.
// E.g. sparse overriding in xml or loading annotations
// first.
} catch(IllegalArgumentException e) {
// DOL API is (unfortunately) defined to return
// IllegalStateException if name doesn't exist.
}
return emfRefDesc;
EntityManagerReferenceDescriptor emRefDesc = null;
try {
emRefDesc = getEmRefContainer().
getEntityManagerReferenceByName(name);
// annotation has a corresponding entry
// in xml. Just add annotation info and continue.
// This logic might change depending on overriding rules
// and order in which annotations are read w.r.t. to xml.
// E.g. sparse overriding in xml or loading annotations
// first.
} catch(IllegalArgumentException e) {
// DOL API is (unfortunately) defined to return
// IllegalStateException if name doesn't exist.
}
return emRefDesc;
EnvironmentProperty envEntry = null;
try {
envEntry = getEnvEntryContainer().
getEnvironmentPropertyByName(name);
// annotation has a corresponding env-entry
// in xml. Just add annotation info and continue.
// This logic might change depending on overriding rules
// and order in which annotations are read w.r.t. to xml.
// E.g. sparse overriding in xml or loading annotations
// first.
} catch(IllegalArgumentException e) {
// DOL API is (unfortunately) defined to return
// IllegalStateException if name doesn't exist.
}
return envEntry;
JmsDestinationReferenceDescriptor jmsDestRef = null;
try {
jmsDestRef = getJmsDestinationReferenceContainer().
getJmsDestinationReferenceByName(name);
// annotation has a corresponding resource-env-ref
// in xml. Just add annotation info and continue.
// This logic might change depending on overriding rules
// and order in which annotations are read w.r.t. to xml.
// E.g. sparse overriding in xml or loading annotations
// first.
} catch(IllegalArgumentException e) {
// DOL API is (unfortunately) defined to return
// IllegalStateException if name doesn't exist.
}
return jmsDestRef;
MessageDestinationReferenceDescriptor msgDestRef = null;
try {
msgDestRef = getMessageDestinationReferenceContainer().
getMessageDestinationReferenceByName(name);
// annotation has a corresponding message-destination-ref
// in xml. Just add annotation info and continue.
// This logic might change depending on overriding rules
// and order in which annotations are read w.r.t. to xml.
// E.g. sparse overriding in xml or loading annotations
// first.
} catch(IllegalArgumentException e) {
// DOL API is (unfortunately) defined to return
// IllegalStateException if name doesn't exist.
}
return msgDestRef;
Looks up an resource reference with the given name.
Return null if it is not found.
param
the name of the resource-reference
ResourceReferenceDescriptor resourceRef = null;
try {
resourceRef = getResourceReferenceContainer().
getResourceReferenceByName(name);
// annotation has a corresponding resource-ref
// in xml. Just add annotation info and continue.
// This logic might change depending on overriding rules
// and order in which annotations are read w.r.t. to xml.
// E.g. sparse overriding in xml or loading annotations
// first.
} catch(IllegalArgumentException e) {
// DOL API is (unfortunately) defined to return
// IllegalStateException if name doesn't exist.
}
return resourceRef;