Java Reference
In-Depth Information
Most of the code is boilerplate_exposed for configuration. Of note is one method, called
tweet(Tweet) . As you've seen in other places, you're relying on Spring Integration to unbundle the
payload from the Message<T> coming in on a channel and to pass the payload as a parameter to this
method.
The configuration inside the XML application context is strikingly similar to the configuration for
the outbound adapter:
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans
xmlns=" http://www.springframework.org/schema/integration"
xmlns:beans=" http://www.springframework.org/schema/beans"
xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance"
xmlns:p=" http://www.springframework.org/schema/p"
xmlns:context=" http://www.springframework.org/schema/context"
xmlns:util=" http://www.springframework.org/schema/util"
xmlns:tool=" http://www.springframework.org/schema/tool"
xmlns:lang=" http://www.springframework.org/schema/lang"
xsi:schemaLocation=" http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/
spring-beans.xsd
http://www.springframework.org/schema/integration
http://www.springframework.org/schema/integration/
spring-integration-1.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util-3.0.xsd
http://www.springframework.org/schema/tool
http://www.springframework.org/schema/tool/spring-tool-3.0.xsd
http://www.springframework.org/schema/lang
http://www.springframework.org/schema/lang/spring-lang-3.0.xsd">
<beans:bean class="org.springframework.beans.factory.
config.PropertyPlaceholderConfigurer"
p:location="solution031.properties"
p:ignoreUnresolvablePlaceholders="true" />
<beans:bean id="twitterMessageProducer"
class="com.apress.springenterpriserecipes.springintegration.
twitter.TwitterMessageProducer"
p:password="${twitter.password}"
p:userId="${twitter.userId}"
/>
<channel id="outboundTweets" />
<outbound-channel-adapter ref="twitterMessageProducer"
method="tweet"
channel="outboundTweets" />
</beans:beans>
Search WWH ::




Custom Search