/** * If the message destination ref is linked to a message destination, fetch the linked destination and validate it. * We might be duplicating our validation efforts since we are already validating message destination separately. */ private void parseResources(MessageDestinationReferenceDescriptor msgDestRef, JndiNameEnvironment env, AppResources appResources) { String name = getLogicalJNDIName(msgDestRef.getName(), env); String jndiName; if (msgDestRef.isLinkedToMessageDestination()) { jndiName = msgDestRef.getMessageDestination().getJndiName(); } else { jndiName = msgDestRef.getJndiName(); } appResources.store(new AppResource(name, jndiName, msgDestRef.getType(), env, true)); }
boolean isConflict(MessageDestinationReferenceDescriptor other) { return getName().equals(other.getName()) && (!( DOLUtils.equals(getDestinationType(), other.getDestinationType()) && DOLUtils.equals(getUsage(), other.getUsage()) && DOLUtils.equals(getMessageDestinationLinkName(), other.getMessageDestinationLinkName()) ) || isConflictResourceGroup(other)); }
@Override public void addMessageDestinationReferenceDescriptor (MessageDestinationReferenceDescriptor messageDestRef) { messageDestRef.setReferringBundleDescriptor(this); messageDestReferences.add(messageDestRef); }
/** * Set runtime default value for MessageDestinationReferenceDescriptor. */ private void computeRuntimeDefault(MessageDestinationReferenceDescriptor msgDestRef) { if (msgDestRef.getJndiName() == null || msgDestRef.getJndiName().length() == 0) { msgDestRef.setJndiName(getDefaultResourceJndiName(msgDestRef.getName())); } }
/** returns a formatted string representing me. */ public void print(StringBuffer toStringBuffer) { if (isLinkedToMessageDestination()) { toStringBuffer.append("Resolved Message-Destination-Ref ").append(getName()).append( "points to logical message destination ").append(getMessageDestination().getName()); } else { toStringBuffer.append("Unresolved Message-Destination-Ref ").append(getName()).append( "@").append(getType()).append("@").append(usage); } }
desc.getName()); appendTextChild(msgDestRefNode, TagNames.MESSAGE_DESTINATION_TYPE, desc.getDestinationType()); appendTextChild(msgDestRefNode, TagNames.MESSAGE_DESTINATION_USAGE, desc.getUsage()); appendTextChild(msgDestRefNode, TagNames.MESSAGE_DESTINATION_LINK, desc.getMessageDestinationLinkName()); appendTextChild(msgDestRefNode, TagNames.MAPPED_NAME, desc.getMappedName()); if( desc.isInjectable() ) { InjectionTargetNode ijNode = new InjectionTargetNode(); for (InjectionTarget target : desc.getInjectionTargets()) { ijNode.writeDescriptor(msgDestRefNode, TagNames.INJECTION_TARGET, target); desc.getLookupName());
private CompEnvBinding getCompEnvBinding(MessageDestinationReferenceDescriptor next) { String name = descriptorToLogicalJndiName(next); String physicalJndiName = null; if (next.isLinkedToMessageDestination()) { physicalJndiName = next.getMessageDestination().getJndiName(); } else { physicalJndiName = next.getJndiName(); } Object value = namingUtils.createLazyNamingObjectFactory(name, physicalJndiName, true); return new CompEnvBinding(name, value); }
@Override public 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()); } } }
public String getName() { return decoree.getName(); }
@Override public Node writeDescriptor(Node parent, String nodeName, MessageDestinationReferenceDescriptor msgDestRef) { Node msgDestRefNode = super.writeDescriptor(parent, nodeName, msgDestRef); appendTextChild(msgDestRefNode, RuntimeTagNames.MESSAGE_DESTINATION_REFERENCE_NAME, msgDestRef.getName()); appendTextChild(msgDestRefNode, RuntimeTagNames.JNDI_NAME, msgDestRef.getJndiName()); return msgDestRefNode; }
/** * Visits a message destination referencer for the last J2EE * component visited * @param the message destination referencer */ public void accept(MessageDestinationReferencer msgDestReferencer) { // if it is linked to a logical destination if( msgDestReferencer.isLinkedToMessageDestination() ) { return; // if it is referred to a physical destination } else if (msgDestReferencer.ownedByMessageDestinationRef() && msgDestReferencer.getMessageDestinationRefOwner( ).getJndiName() != null) { return; } else { MessageDestinationDescriptor msgDest = msgDestReferencer.resolveLinkName(); if( msgDest == null ) { String linkName = msgDestReferencer.getMessageDestinationLinkName(); DOLUtils.getDefaultLogger().log(Level.WARNING, "enterprise.deployment.backend.invalidDescriptorMappingFailure", new Object[] {"message-destination", linkName}); } else { if (msgDestReferencer instanceof MessageDestinationReferenceDescriptor) { ((MessageDestinationReferenceDescriptor)msgDestReferencer).setJndiName(msgDest.getJndiName()); } } } }
@Override protected void combineMessageDestinationReferenceDescriptors(JndiNameEnvironment env) { for (Object omdRef : env.getMessageDestinationReferenceDescriptors()) { MessageDestinationReferenceDescriptor mdRef = (MessageDestinationReferenceDescriptor)omdRef; MessageDestinationReferenceDescriptor mdr = _getMessageDestinationReferenceByName(mdRef.getName()); if (mdr != null) { if (mdr.isConflict(mdRef)) { conflictMessageDestinationReference = true; } unionInjectionTargets(mdr, mdRef); } else { addMessageDestinationReferenceDescriptor(mdRef); } } }
public String getType() { return decoree.getDestinationType(); }
public String getLink() { return decoree.getMessageDestinationLinkName(); }
public String getUsage() { return decoree.getUsage(); }
@Override public MessageDestinationReferenceDescriptor getDescriptor() { if (descriptor == null) descriptor = new MessageDestinationReferenceDescriptor(); return descriptor; }
desc.getName()); appendTextChild(msgDestRefNode, TagNames.MESSAGE_DESTINATION_TYPE, desc.getDestinationType()); appendTextChild(msgDestRefNode, TagNames.MESSAGE_DESTINATION_USAGE, desc.getUsage()); appendTextChild(msgDestRefNode, TagNames.MESSAGE_DESTINATION_LINK, desc.getMessageDestinationLinkName()); appendTextChild(msgDestRefNode, TagNames.MAPPED_NAME, desc.getMappedName()); if( desc.isInjectable() ) { InjectionTargetNode ijNode = new InjectionTargetNode(); for (InjectionTarget target : desc.getInjectionTargets()) { ijNode.writeDescriptor(msgDestRefNode, TagNames.INJECTION_TARGET, target); desc.getLookupName());
private CompEnvBinding getCompEnvBinding(MessageDestinationReferenceDescriptor next) { String name = descriptorToLogicalJndiName(next); String physicalJndiName = null; if (next.isLinkedToMessageDestination()) { physicalJndiName = next.getMessageDestination().getJndiName(); } else { physicalJndiName = next.getJndiName(); } Object value = namingUtils.createLazyNamingObjectFactory(name, physicalJndiName, true); return new CompEnvBinding(name, value); }
@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()); } } }
public int hashCode() { int result = NULL_HASH_CODE; String name = getName(); if (name != null) { result += name.hashCode(); } return result; } }