Methods Summary |
---|
private BundleDescriptor | getBundleDescriptor()
return ownedByMessageDestinationRef() ?
ownerMsgDestRef.getReferringBundleDescriptor() :
ownerMsgBean.getEjbBundleDescriptor();
|
public EjbMessageBeanDescriptor | getMessageBeanOwner()Get the descriptor for the message-driven bean owner.
return ownerMsgBean;
|
public MessageDestinationDescriptor | getMessageDestination()
return messageDestination;
|
public java.lang.String | getMessageDestinationLinkName()
return messageDestinationLinkName;
|
public MessageDestinationReferenceDescriptor | getMessageDestinationRefOwner()Get the descriptor for the message destination reference owner.
return ownerMsgDestRef;
|
public boolean | isLinkedToMessageDestination()True if this reference has been resolved to a valid MessageDestination
object.
return (messageDestination != null);
|
public boolean | ownedByMessageBean()True if the owner is a message-driven bean.
return (ownerMsgBean != null);
|
public boolean | ownedByMessageDestinationRef()True if the owner is a message destination reference.
return (ownerMsgDestRef != null);
|
public MessageDestinationDescriptor | resolveLinkName()Try to resolve the current link name value to a MessageDestination
object.
MessageDestinationDescriptor msgDest = null;
String linkName = messageDestinationLinkName;
if( (linkName != null) && (linkName.length() > 0) ) {
int hashIndex = linkName.indexOf('#");
BundleDescriptor bundleDescriptor = getBundleDescriptor();
Application app = bundleDescriptor.getApplication();
BundleDescriptor targetBundle = bundleDescriptor;
String msgDestName = linkName;
if( app != null ) {
// explicit reference to another module
if( hashIndex != -1 ) {
String relativeModuleUri = linkName.substring(0, hashIndex);
msgDestName = linkName.substring(hashIndex + 1);
targetBundle = app.getRelativeBundle(bundleDescriptor,
relativeModuleUri);
} else {
// Default is to find message destination within this
// module. If it's not there, try searching the other
// modules. NOTE that it's up to the deployer to ensure
// that any message destinations that are referred to
// from outside the defining module without an explicit
// reference have names that are unique within all the
// message destinations in the .ear. There is no
// required search ordering.
if( !bundleDescriptor.hasMessageDestinationByName
(msgDestName) ) {
Set modules = app.getBundleDescriptors();
for(Iterator iter = modules.iterator(); iter.hasNext();)
{
BundleDescriptor next=(BundleDescriptor)iter.next();
if( next.hasMessageDestinationByName(msgDestName) ) {
targetBundle = next;
break;
}
}
}
}
}
try {
if( targetBundle != null ) {
msgDest = targetBundle.getMessageDestinationByName
(msgDestName);
}
} catch(IllegalArgumentException iae) {}
}
if( msgDest != null ) {
setMessageDestination(msgDest);
}
return msgDest;
|
public void | setMessageDestination(MessageDestinationDescriptor newMsgDest)
if( messageDestination != null ) {
messageDestination.removeReferencer(this);
}
if( newMsgDest != null ) {
newMsgDest.addReferencer(this);
// Keep message destination link name in synch with message
// destination object.
BundleDescriptor bundleDescriptor = getBundleDescriptor();
BundleDescriptor targetBundleDescriptor =
newMsgDest.getBundleDescriptor();
String linkName = newMsgDest.getName();
if( bundleDescriptor != targetBundleDescriptor ) {
Application app = bundleDescriptor.getApplication();
String relativeUri = app.getRelativeUri(bundleDescriptor,
targetBundleDescriptor);
linkName = relativeUri + "#" + linkName;
}
messageDestinationLinkName = linkName;
}
messageDestination = newMsgDest;
|
public void | setMessageDestinationLinkName(java.lang.String linkName)Sets the name of the message destination to which I refer.
NOTE : Does *NOT* attempt to resolve link name. Use
alternate version of setMessageDestinationLinkName or resolveLink
if link resolution is required.
setMessageDestinationLinkName(linkName, false);
|
public MessageDestinationDescriptor | setMessageDestinationLinkName(java.lang.String linkName, boolean resolve)Sets the name of the message destination to which I refer.
messageDestinationLinkName = linkName;
MessageDestinationDescriptor msgDest = null;
if( resolve ) {
msgDest = resolveLinkName();
}
return msgDest;
|