// Path: spring-integration-aws/src/main/java/org/springframework/integration/aws/config/AwsParserUtils.java
// public final class AwsParserUtils {
// 
// 	private AwsParserUtils() {
// 	}
// 
// 	public static void registerPermissions(Element element,
// 			BeanDefinitionBuilder executorBuilder,
// 			ParserContext parserContext) {
// 
// 		Element permissionsElement = DomUtils.getChildElementByTagName(element,
// 				"permissions");
// 		if (permissionsElement != null) {
// 			Set<Permission> permissions = new HashSet<Permission>();
// 			NodeList permNodes = permissionsElement.getChildNodes();
// 			for (int i = 0; i < permNodes.getLength(); i++) {
// 				Node permNode = permNodes.item(i);
// 				if (Node.ELEMENT_NODE == permNode.getNodeType()) {
// 					Element permissionElement = (Element) permNode;
// 					Permission permission = new Permission(
// 							permissionElement.getAttribute("label"),
// 							new HashSet<String>(), new HashSet<String>());
// 
// 					Element actionsElement = DomUtils.getChildElementByTagName(
// 							permissionElement, "actions");
// 					NodeList actionNodes = actionsElement.getChildNodes();
// 					for (int j = 0; j < actionNodes.getLength(); j++) {
// 						Node actionNode = actionNodes.item(j);
// 						if (Node.ELEMENT_NODE == actionNode.getNodeType()) {
// 							Element actionElement = (Element) actionNode;
// 							permission.getActions().add(
// 									actionElement.getTextContent());
// 						}
// 					}
// 
// 					Element accountsElement = DomUtils
// 							.getChildElementByTagName(permissionElement,
// 									"aws-accounts");
// 					NodeList accountNodes = accountsElement.getChildNodes();
// 					for (int j = 0; j < accountNodes.getLength(); j++) {
// 						Node accountNode = accountNodes.item(j);
// 						if (Node.ELEMENT_NODE == accountNode.getNodeType()) {
// 							Element accountElement = (Element) accountNode;
// 							permission.getAwsAccountIds().add(
// 									accountElement.getTextContent());
// 						}
// 					}
// 
// 					permissions.add(permission);
// 				}
// 			}
// 
// 			executorBuilder.addPropertyValue("permissions", permissions);
// 		}
// 	}
// 
// }
// 
// Path: spring-integration-aws/src/main/java/org/springframework/integration/aws/sns/outbound/SnsOutboundGateway.java
// public class SnsOutboundGateway extends AbstractReplyProducingMessageHandler
// 		implements DisposableBean {
// 
// 	private final Log log = LogFactory.getLog(SnsOutboundGateway.class);
// 
// 	private volatile SnsExecutor snsExecutor;
// 	private boolean producesReply = true; // false for outbound-channel-adapter,
// 											// true for outbound-gateway
// 
// 	public SnsOutboundGateway() {
// 		super();
// 	}
// 
// 	public void setSnsExecutor(SnsExecutor snsExecutor) {
// 		this.snsExecutor = snsExecutor;
// 	}
// 
// 	@Override
// 	protected void doInit() {
// 		super.doInit();
// 		Assert.notNull(snsExecutor, "'snsExecutor' must not be null");
// 
// 		log.info(getComponentName() + "[" + this.getClass().getName()
// 				+ "] ready to send messages...");
// 	}
// 
// 	@Override
// 	protected Object handleRequestMessage(Message<?> requestMessage) {
// 
// 		final Object result;
// 
// 		result = this.snsExecutor.executeOutboundOperation(requestMessage);
// 
// 		if (result == null || !producesReply) {
// 			return null;
// 		}
// 
// 		return MessageBuilder.withPayload(result)
// 				.copyHeaders(requestMessage.getHeaders()).build();
// 
// 	}
// 
// 	/**
// 	 * If set to 'false', this component will act as an Outbound Channel
// 	 * Adapter. If not explicitly set this property will default to 'true'.
// 	 * 
// 	 * @param producesReply
// 	 *            Defaults to 'true'.
// 	 * 
// 	 */
// 	public void setProducesReply(boolean producesReply) {
// 		this.producesReply = producesReply;
// 	}
// 
// 	@Override
// 	public void destroy() throws Exception {
// 		// no op
// 	}
// 
// }


import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.parsing.BeanComponentDefinition;
import org.springframework.beans.factory.support.AbstractBeanDefinition;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.xml.ParserContext;
import org.springframework.integration.aws.config.AwsParserUtils;
import org.springframework.integration.aws.sns.outbound.SnsOutboundGateway;
import org.springframework.integration.config.xml.AbstractOutboundChannelAdapterParser;
import org.w3c.dom.Element;
package org.springframework.integration.aws.sns.config;


/**
 * The parser for the Sns Outbound Channel Adapter.
 * 
 * @author Sayantam Dey
 * @since 1.0
 * 
 */
public class SnsOutboundChannelAdapterParser extends
		AbstractOutboundChannelAdapterParser {

	@Override
	protected boolean shouldGenerateId() {
		return false;
	}

	@Override
// Path: spring-integration-aws/src/main/java/org/springframework/integration/aws/config/AwsParserUtils.java
// public final class AwsParserUtils {
// 
// 	private AwsParserUtils() {
// 	}
// 
// 	public static void registerPermissions(Element element,
// 			BeanDefinitionBuilder executorBuilder,
// 			ParserContext parserContext) {
// 
// 		Element permissionsElement = DomUtils.getChildElementByTagName(element,
// 				"permissions");
// 		if (permissionsElement != null) {
// 			Set<Permission> permissions = new HashSet<Permission>();
// 			NodeList permNodes = permissionsElement.getChildNodes();
// 			for (int i = 0; i < permNodes.getLength(); i++) {
// 				Node permNode = permNodes.item(i);
// 				if (Node.ELEMENT_NODE == permNode.getNodeType()) {
// 					Element permissionElement = (Element) permNode;
// 					Permission permission = new Permission(
// 							permissionElement.getAttribute("label"),
// 							new HashSet<String>(), new HashSet<String>());
// 
// 					Element actionsElement = DomUtils.getChildElementByTagName(
// 							permissionElement, "actions");
// 					NodeList actionNodes = actionsElement.getChildNodes();
// 					for (int j = 0; j < actionNodes.getLength(); j++) {
// 						Node actionNode = actionNodes.item(j);
// 						if (Node.ELEMENT_NODE == actionNode.getNodeType()) {
// 							Element actionElement = (Element) actionNode;
// 							permission.getActions().add(
// 									actionElement.getTextContent());
// 						}
// 					}
// 
// 					Element accountsElement = DomUtils
// 							.getChildElementByTagName(permissionElement,
// 									"aws-accounts");
// 					NodeList accountNodes = accountsElement.getChildNodes();
// 					for (int j = 0; j < accountNodes.getLength(); j++) {
// 						Node accountNode = accountNodes.item(j);
// 						if (Node.ELEMENT_NODE == accountNode.getNodeType()) {
// 							Element accountElement = (Element) accountNode;
// 							permission.getAwsAccountIds().add(
// 									accountElement.getTextContent());
// 						}
// 					}
// 
// 					permissions.add(permission);
// 				}
// 			}
// 
// 			executorBuilder.addPropertyValue("permissions", permissions);
// 		}
// 	}
// 
// }
// 
// Path: spring-integration-aws/src/main/java/org/springframework/integration/aws/sns/outbound/SnsOutboundGateway.java
// public class SnsOutboundGateway extends AbstractReplyProducingMessageHandler
// 		implements DisposableBean {
// 
// 	private final Log log = LogFactory.getLog(SnsOutboundGateway.class);
// 
// 	private volatile SnsExecutor snsExecutor;
// 	private boolean producesReply = true; // false for outbound-channel-adapter,
// 											// true for outbound-gateway
// 
// 	public SnsOutboundGateway() {
// 		super();
// 	}
// 
// 	public void setSnsExecutor(SnsExecutor snsExecutor) {
// 		this.snsExecutor = snsExecutor;
// 	}
// 
// 	@Override
// 	protected void doInit() {
// 		super.doInit();
// 		Assert.notNull(snsExecutor, "'snsExecutor' must not be null");
// 
// 		log.info(getComponentName() + "[" + this.getClass().getName()
// 				+ "] ready to send messages...");
// 	}
// 
// 	@Override
// 	protected Object handleRequestMessage(Message<?> requestMessage) {
// 
// 		final Object result;
// 
// 		result = this.snsExecutor.executeOutboundOperation(requestMessage);
// 
// 		if (result == null || !producesReply) {
// 			return null;
// 		}
// 
// 		return MessageBuilder.withPayload(result)
// 				.copyHeaders(requestMessage.getHeaders()).build();
// 
// 	}
// 
// 	/**
// 	 * If set to 'false', this component will act as an Outbound Channel
// 	 * Adapter. If not explicitly set this property will default to 'true'.
// 	 * 
// 	 * @param producesReply
// 	 *            Defaults to 'true'.
// 	 * 
// 	 */
// 	public void setProducesReply(boolean producesReply) {
// 		this.producesReply = producesReply;
// 	}
// 
// 	@Override
// 	public void destroy() throws Exception {
// 		// no op
// 	}
// 
// }


// Path: spring-integration-aws/src/main/java/org/springframework/integration/aws/sns/config/SnsOutboundChannelAdapterParser.java
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.parsing.BeanComponentDefinition;
import org.springframework.beans.factory.support.AbstractBeanDefinition;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.xml.ParserContext;
import org.springframework.integration.aws.config.AwsParserUtils;
import org.springframework.integration.aws.sns.outbound.SnsOutboundGateway;
import org.springframework.integration.config.xml.AbstractOutboundChannelAdapterParser;
import org.w3c.dom.Element;

package org.springframework.integration.aws.sns.config;


/**
 * The parser for the Sns Outbound Channel Adapter.
 * 
 * @author Sayantam Dey
 * @since 1.0
 * 
 */
public class SnsOutboundChannelAdapterParser extends
		AbstractOutboundChannelAdapterParser {

	@Override
	protected boolean shouldGenerateId() {
		return false;
	}

	@Override
	protected boolean shouldGenerateIdAsFallback() {