public String getKey() { return getMessageDestinationName(); }
public void parseWebDD(JndiConsumer annotatedWebAppDD, GerWebAppType webApp) { if (annotatedWebAppDD instanceof WebApp) { WebApp webAppDD = (WebApp) annotatedWebAppDD; List<MessageDestination> messageDestinations = webAppDD.getMessageDestination(); for (MessageDestination messageDestination: messageDestinations) { String messageDestinationName = messageDestination.getMessageDestinationName(); GerMessageDestinationType gerMessageDestination = webApp.addNewMessageDestination(); messageDestination.setMessageDestinationName(messageDestinationName); // messageDestination.setAdminObjectLink(messageDestinationName); } } }
String moduleId = ejbModule.getModuleId(); for (MessageDestination destination : assembly.getMessageDestination()) { destinationResolver.add(moduleId, destination.getMessageDestinationName(), destination); String moduleId = appModule.getModuleId(); for (MessageDestination destination : clientModule.getApplicationClient().getMessageDestination()) { destinationResolver.add(moduleId, destination.getMessageDestinationName(), destination); String moduleId = appModule.getModuleId(); for (MessageDestination destination : webModule.getWebApp().getMessageDestination()) { destinationResolver.add(moduleId, destination.getMessageDestinationName(), destination); String destinationId = destination.getMappedName(); if (destinationId == null) { destination.setMappedName(destinationId);
private String resolveDestinationId(MessageDestinationRef ref, URI moduleUri, LinkResolver<MessageDestination> destinationResolver, Map<MessageDestination,String> destinationTypes) throws OpenEJBException { // skip destination refs without a destination link String link = ref.getMessageDestinationLink(); if (link == null || link.length() == 0) { return null; } // resolve the destination... if we don't find one it is a configuration bug MessageDestination destination = destinationResolver.resolveLink(link, moduleUri); if (destination == null) { throw new OpenEJBException("Message destination " + link + " for message-destination-ref " + ref.getMessageDestinationRefName() + " not found"); } // remember the type of each destination so we can use it to fillin MDBs that don't declare destination type if (ref.getMessageDestinationType() != null && !destinationTypes.containsKey(destination)) { destinationTypes.put(destination, ref.getMessageDestinationType()); } // get the destinationId String destinationId = destination.getMappedName(); if (destinationId == null) destination.getMessageDestinationName(); return destinationId; }
if (assembly != null) { for (final MessageDestination destination : assembly.getMessageDestination()) { destinationResolver.add(ejbModule.getModuleUri(), destination.getMessageDestinationName(), destination); destinationResolver.add(appModule.getModuleUri(), destination.getMessageDestinationName(), destination); destinationResolver.add(appModule.getModuleUri(), destination.getMessageDestinationName(), destination); String destinationId = destination.getMappedName(); if (destinationId == null) { destination.setMappedName(destinationId);
private String resolveDestinationId(final MessageDestinationRef ref, final URI moduleUri, final LinkResolver<MessageDestination> destinationResolver, final Map<MessageDestination, String> destinationTypes) throws OpenEJBException { // skip destination refs without a destination link final String link = ref.getMessageDestinationLink(); if (link == null || link.length() == 0) { return null; } // resolve the destination... if we don't find one it is a configuration bug final MessageDestination destination = destinationResolver.resolveLink(link, moduleUri); if (destination == null) { throw new OpenEJBException("Message destination " + link + " for message-destination-ref " + ref.getMessageDestinationRefName() + " not found"); } // remember the type of each destination so we can use it to fillin MDBs that don't declare destination type if (ref.getMessageDestinationType() != null && !destinationTypes.containsKey(destination)) { destinationTypes.put(destination, ref.getMessageDestinationType()); } // get the destinationId final String destinationId = destination.getMappedName(); if (destinationId == null) { destination.getMessageDestinationName(); } return destinationId; }
if (assembly != null) { for (final MessageDestination destination : assembly.getMessageDestination()) { destinationResolver.add(ejbModule.getModuleUri(), destination.getMessageDestinationName(), destination); destinationResolver.add(appModule.getModuleUri(), destination.getMessageDestinationName(), destination); destinationResolver.add(appModule.getModuleUri(), destination.getMessageDestinationName(), destination); String destinationId = destination.getMappedName(); if (destinationId == null) { destination.setMappedName(destinationId);
public String getKey() { return getMessageDestinationName(); }
private String resolveDestinationId(final MessageDestinationRef ref, final URI moduleUri, final LinkResolver<MessageDestination> destinationResolver, final Map<MessageDestination, String> destinationTypes) throws OpenEJBException { // skip destination refs without a destination link final String link = ref.getMessageDestinationLink(); if (link == null || link.length() == 0) { return null; } // resolve the destination... if we don't find one it is a configuration bug final MessageDestination destination = destinationResolver.resolveLink(link, moduleUri); if (destination == null) { throw new OpenEJBException("Message destination " + link + " for message-destination-ref " + ref.getMessageDestinationRefName() + " not found"); } // remember the type of each destination so we can use it to fillin MDBs that don't declare destination type if (ref.getMessageDestinationType() != null && !destinationTypes.containsKey(destination)) { destinationTypes.put(destination, ref.getMessageDestinationType()); } // get the destinationId final String destinationId = destination.getMappedName(); if (destinationId == null) { destination.getMessageDestinationName(); } return destinationId; }
public String getKey() { return getMessageDestinationName(); }
@Override public void preProcessWebXmlElement(WebApp webApp, MergeContext context) throws DeploymentException { for (MessageDestination messageDestination : webApp.getMessageDestination()) { context.setAttribute(createMessageDestinationConfiguredInWebXMLKey(messageDestination.getMessageDestinationName()), Boolean.TRUE); } }
public void initContext(JndiConsumer specDD, XmlObject plan, Module module) throws DeploymentException { Collection<MessageDestination> specDestinations; try { Method m = specDD.getClass().getMethod("getMessageDestination", new Class[0]); m.setAccessible(true); specDestinations = (Collection<MessageDestination>) m.invoke(specDD, new Object[0]); } catch (Exception e) { specDestinations = new ArrayList<MessageDestination>(); } XmlObject[] gerDestinations = plan.selectChildren(GER_MESSAGE_DESTINATION_QNAME_SET); Map<String, GerMessageDestinationType> nameMap = new HashMap<String, GerMessageDestinationType>(); for (XmlObject gerDestination : gerDestinations) { GerMessageDestinationType destination = (GerMessageDestinationType) gerDestination.copy().changeType(GerMessageDestinationType.type); String name = destination.getMessageDestinationName().trim(); nameMap.put(name, destination); boolean found = false; for (MessageDestination specDestination : specDestinations) { if (specDestination.getMessageDestinationName().trim().equals(name)) { found = true; break; } } if (!found) { throw new DeploymentException("No spec DD message-destination for " + name); } } module.getRootEarContext().registerMessageDestionations(module.getModuleURI().toString(), nameMap); }
@Override public void merge(WebFragment webFragment, WebApp webApp, MergeContext mergeContext) throws DeploymentException { for (MessageDestination messageDestination : webApp.getMessageDestination()) { String messageDestinationName = messageDestination.getMessageDestinationName(); if (mergeContext.containsAttribute(createMessageDestinationConfiguredInWebXMLKey(messageDestination.getMessageDestinationName()))) { continue; } if (mergeContext.containsAttribute(createMessageDestinationConfiguredInWebFragmentXMLKey(messageDestinationName))) { MergeItem mergeItem = (MergeItem) mergeContext.getAttribute(createMessageDestinationConfiguredInWebFragmentXMLKey(messageDestinationName)); throw new DeploymentException(WebDeploymentMessageUtils.createDuplicateJNDIRefMessage("message-destination", messageDestinationName, mergeItem.getBelongedURL(), mergeContext.getCurrentJarUrl())); } else { webApp.getMessageDestination().add(messageDestination); mergeContext.setAttribute(createMessageDestinationConfiguredInWebFragmentXMLKey(messageDestinationName), new MergeItem(messageDestination, mergeContext.getCurrentJarUrl(), ElementSource.WEB_FRAGMENT)); } } }