@@ -0,0 +1,1607 @@
+package com.gss.gmo.cao.integration.xmpp.component.inbound;%0D%0A%0D%0Aimport static org.springframework.util.Assert.isTrue;%0D%0Aimport static org.springframework.util.Assert.notNull;%0D%0A%0D%0Aimport org.springframework.integration.support.AbstractIntegrationMessageBuilder;%0D%0Aimport org.springframework.messaging.Message;%0D%0Aimport org.xmpp.packet.IQ;%0D%0A%0D%0Aimport com.gss.gmo.cao.integration.xmpp.component.core.AbstractComponentManagerAwareGatewaySupport;%0D%0Aimport com.gss.gmo.cao.integration.xmpp.component.core.ComponentManager;%0D%0Aimport com.gss.gmo.cao.integration.xmpp.component.core.IQHandler;%0D%0A%0D%0A/**%0D%0A * @author linus_chien%0D%0A *%0D%0A */%0D%0Apublic class IQHandlerGateway extends AbstractComponentManagerAwareGatewaySupport %7B%0D%0A%0D%0A%09private IQHandler.IQType iqType;%0D%0A%0D%0A%09public IQHandlerGateway(ComponentManager componentManager) %7B%0D%0A%09%09super(componentManager);%0D%0A%09%7D%0D%0A%0D%0A%09public void setIqType(IQHandler.IQType iqType) %7B%0D%0A%09%09this.iqType = iqType;%0D%0A%09%7D%0D%0A%0D%0A%09@Override%0D%0A%09public String getComponentType() %7B%0D%0A%09%09return %22xmpp-component:iq-inbound-channel-gateway%22;%0D%0A%09%7D%0D%0A%0D%0A%09@Override%0D%0A%09protected void onInit() throws Exception %7B%0D%0A%09%09super.onInit();%0D%0A%09%09isTrue(this.initialized, this.getComponentName() + %22 %5B%22 + this.getComponentType() + %22%5D must be initialized%22);%0D%0A%09%09notNull(iqType, %22IQType must be set.%22);%0D%0A%09%09this.componentManager.addIQHandler(iqType, new IQHandler() %7B%0D%0A%09%09%09@Override%0D%0A%09%09%09public IQ handleIQ(IQ iq) %7B%0D%0A%09%09%09%09AbstractIntegrationMessageBuilder%3CIQ%3E messageBuilder = getMessageBuilderFactory().withPayload(iq);%0D%0A%09%09%09%09Message%3C?%3E reply = sendAndReceiveMessage(messageBuilder.build());%0D%0A%09%09%09%09return (IQ) reply.getPayload();%0D%0A%09%09%09%7D%0D%0A%09%09%7D);%0D%0A%09%7D%0D%0A%0D%0A%7D%0D%0A

add IQHandlerGateway