List of usage examples for org.springframework.integration.gateway GatewayProxyFactoryBean GatewayProxyFactoryBean
public GatewayProxyFactoryBean()
From source file:org.acme.echo.module.ModuleGatewayRequestExchanger.java
@Override public void afterPropertiesSet() throws Exception { GatewayProxyFactoryBean gatewayFactory = new GatewayProxyFactoryBean(); String requestChannel = "echoStartChannel"; // we might want to get from some module.properties file String replyChannel = "echoEndChannel"; gatewayFactory.setDefaultRequestChannel(moduleContext.getBean(requestChannel, MessageChannel.class)); gatewayFactory.setDefaultReplyChannel(moduleContext.getBean(replyChannel, MessageChannel.class)); gatewayFactory.afterPropertiesSet(); requestReplyExchanger = (RequestReplyExchanger) gatewayFactory.getObject(); }
From source file:com.acmemotors.batch.LoaderJobConfiguration.java
@Bean public GatewayProxyFactoryBean gatewayProxyFactoryBean() { GatewayProxyFactoryBean gatewayProxyFactoryBean = new GatewayProxyFactoryBean(); gatewayProxyFactoryBean.setServiceInterface(RequestGateway.class); gatewayProxyFactoryBean.setDefaultRequestChannel(requestChannel()); gatewayProxyFactoryBean.setDefaultReplyTimeout(5000l); return gatewayProxyFactoryBean; }
From source file:org.springframework.integration.handler.MethodInvokingMessageProcessorTests.java
@Test public void gatewayTest() throws Exception { GatewayProxyFactoryBean gwFactoryBean = new GatewayProxyFactoryBean(); gwFactoryBean.afterPropertiesSet();//w ww . jav a 2s . co m Object target = gwFactoryBean.getObject(); // just instantiate a helper with a simple target; we're going to invoke getTargetClass with reflection MessagingMethodInvokerHelper helper = new MessagingMethodInvokerHelper(new TestErrorService(), "error", true); Method method = MessagingMethodInvokerHelper.class.getDeclaredMethod("getTargetClass", Object.class); method.setAccessible(true); Object result = method.invoke(helper, target); assertSame(RequestReplyExchanger.class, result); }