-
-
-
- 1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/docbkx/resources/xsl/pdf/fopdf.xsl b/src/docbkx/resources/xsl/pdf/fopdf.xsl
deleted file mode 100644
index 2905ee3c21..0000000000
--- a/src/docbkx/resources/xsl/pdf/fopdf.xsl
+++ /dev/null
@@ -1,518 +0,0 @@
-
-
-
-
-
-
-
- '1'
- @file.prefix@@dbf.xsl@/images/
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -5em
- -5em
-
-
-
-
-
- book toc,title
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- please define productname in your docbook file!
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 1
- 0
- 1
- 1
-
-
-
-
- 0
- 0
- 0
-
-
-
- false
-
-
- 11
- 8
-
-
- 1.4
-
-
-
- left
- bold
-
-
- pt
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 0.8em
- 0.8em
- 0.8em
-
-
- pt
-
- 0.1em
- 0.1em
- 0.1em
-
-
- 0.6em
- 0.6em
- 0.6em
-
-
- pt
-
- 0.1em
- 0.1em
- 0.1em
-
-
- 0.4em
- 0.4em
- 0.4em
-
-
- pt
-
- 0.1em
- 0.1em
- 0.1em
-
-
- 0.3em
- 0.3em
- 0.3em
-
-
- pt
-
- 0.1em
- 0.1em
- 0.1em
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 4pt
- 4pt
- 4pt
- 4pt
-
-
-
- 0.1pt
- 0.1pt
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- pt
-
-
-
-
- 1em
- 1em
- 1em
- 0.1em
- 0.1em
- 0.1em
-
- #444444
- solid
- 0.1pt
- 0.5em
- 0.5em
- 0.5em
- 0.5em
- 0.5em
- 0.5em
-
-
-
- 1
-
- #F0F0F0
-
-
-
- 0.1em
- 0.1em
- 0.1em
- 0.1em
- 0.1em
- 0.1em
-
-
-
- 0.5em
- 0.5em
- 0.5em
- 0.1em
- 0.1em
- 0.1em
- always
-
-
-
-
-
- normal
- italic
-
-
- pt
-
- false
- 0.1em
- 0.1em
- 0.1em
-
-
-
-
-
- 0
- 1
-
-
- 90
-
-
-
-
-
- figure after
- example after
- equation before
- table before
- procedure before
-
-
-
- 1
-
- 0pt
-
-
- 3
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/docbkx/resources/xsl/pdf/titlepage.xml b/src/docbkx/resources/xsl/pdf/titlepage.xml
deleted file mode 100644
index dc18e1e0de..0000000000
--- a/src/docbkx/resources/xsl/pdf/titlepage.xml
+++ /dev/null
@@ -1,101 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-]>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/docbkx/rmi.xml b/src/docbkx/rmi.xml
deleted file mode 100644
index 877dcfac5e..0000000000
--- a/src/docbkx/rmi.xml
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
-
- RMI Support
-
-
- Introduction
-
- This Chapter explains how to use RMI specific channel adapters to distribute a system over multiple JVMs. The first section will deal with sending messages over RMI. The second section shows how to receive messages over RMI. The last section shows how to define rmi channel adapters through the namespace support.
-
-
-
-
- Outbound RMI
-
- To send messages from a channel over RMI, simply define an RmiOutboundGateway. This gateway will use Spring's RmiProxyFactoryBean internally to create a proxy for a remote gateway. Note that to invoke a remote interface that doesn't use Spring Integration you should use a service activator in combination with Spring's RmiProxyFactoryBean.
-
-
- To configure the outbound gateway write a bean definition like this:
-
-
-
- ]]>
-
-
-
-
-
- Inbound RMI
-
- To receive messages over RMI you need to use a RmiInboundGateway. This gateway can be configured like this
-
-
- ]]>
-
-
-
-
-
- RMI namespace support
-
- To configure the inbound gateway you can choose to use the namespace support for it. The following code snippet shows the different configuration options that are supported.
-
-
-
-
-
-
-
-
- ]]>
-
-
- To configure the outbound gateway you can use the namespace support as well. The following code snippet shows the different configuration for an outbound rmi gateway.
- ]]>
-
-
-
-
\ No newline at end of file
diff --git a/src/docbkx/samples.xml b/src/docbkx/samples.xml
deleted file mode 100644
index 1992780cf7..0000000000
--- a/src/docbkx/samples.xml
+++ /dev/null
@@ -1,663 +0,0 @@
-
-
-
-
- Spring Integration Samples
-
-
- Introduction
-
- Starting with the current release of Spring Integration the samples are no longer included with
- Spring Integration distribution. Instead we've switched to a much simpler collaborative model that should promote
- better community participation and community contributions. Samples now have a dedicated Git SCM repository and a
- dedicated JIRA Issue Tracking system. Sample development will also have its own lifecycle which is not dependent on the
- lifecycle of the framework releases although the repository will still be tagged with each major release for compatibility
- reasons.
-
-
- The great benefit to the community is that we can now add more samples and make them available to you right away
- without waiting for the release to get them out to you. Having its own JIRA that is not tied up to the the actual
- framework is also a great benefit. You now have a dedicated place to suggest samples as well as report issues with existing
- samples. Or you may want to submit a sample to us as an attachment through the JIRA and if we believe your sample adds value we
- would be more then glad to add it to a samples repository properly crediting the author.
-
-
-
-
- Where to get Samples
-
- To monitor samples development and to get more information on the repository you can visit the following
- URL: http://git.springsource.org/spring-integration/samples
- Since we are using Git SCM we should use the proper terminology as well when it comes to the tasks you need to perform to make
- samples available locally on your machine. For more information on Git SCM please visit their
- website: http://git-scm.com/
-
-
- CLONE samples repository. (For those unfamiliar with Git, this is somewhat the equivalent of a checkout.)
-
-
- This is the first step you should go through. You must have Git installed on your machine. There are many GUI-based products
- available for many platforms. Simple Google search will let you find them.
- To clone samples repository from command line:
- mkdir spring-itegration-samples
-> cd spring-itegration-samples
-> git clone git://git.springsource.org/spring-integration/samples.git]]>
-
-
- That is all you need to do. Now you have cloned the entire samples repository. Since samples repository is a live
- repository, you might want to perform periodic updates to get new samples as well as updates to the existing samples.
- To get the updates use git PULL command:
- git pull]]>
-
-
- Submit samples or sample requests
-
-
- As mentioned earlier, Spring Integration samples have a dedicated JIRA Issue tracking system.
- To submit new sample request or to submit the actual sample (as an attachment) please visit our JIRA Issue Tracking system:
- https://jira.springframework.org/browse/INTSAMPLES
-
-
-
- Samples structure
-
- The structure of the samples changed as well. With plans for more samples we realized that some
- samples have different goals then others. While they all share the common goal of showing you how to apply and work with
- Spring Integration framework, they also defer in areas where some samples were meant to concentrate on a technical
- use case while others on the business use case and some samples are all about showcasing various techniques that
- could be applied to address certain scenarios (both technical and business). Categorization of samples will allow us
- better organize them based on the problem each sample addresses while giving you a simpler way of finding the right sample
-
-
- Currently there are 4 categories. Within the samples repository each category has its own directory which is named after the
- category name:
-
-
-
- BASIC (samples/basic)
-
-
- This is a good place to get started. The samples here are technically motivated and demonstrate the bare
- minimum with regard to configuration and code, to help you to get started quickly by introducing you to the basic concepts,
- API and configuration of Spring Integration as well as Enterprise Integration Patterns (EIP). For example; If your are
- looking for an answer on how to implement and wire Service Activator to a Channel
- or how to use Messaging Gateway to your message exchange or how to get started with using MAIL or
- TCP/UDP modules etc., this would be the right place to find a good sample. The bottom line is this is a good place
- to get started.
-
-
-
- INTERMEDIATE (samples/intermediate)
-
-
- This category targets developers who are already familiar with Spring Integration framework (past getting started),
- but need some more guidance while resolving a more advanced technical problems one might deal with
- once switch to a Messaging architecture.
- For example; If you are looking for an answer on how to handle errors in various message exchange
- scenarios or how to properly configure the Aggregator for the situations where some messages
- might not ever arrive for aggregation etc,. and any other issue that goes beyond a basic implementation and configuration
- of a particular component and addresses "what else you can do with it" type of problem this
- would be the right place to find these type of samples.
-
-
-
- ADVANCED (samples/advanced)
-
-
- This category targets develoopers who are very familiar with Spring Integration framework but looking to
- extend it to address a specific custom need by using Spring Integration public API.
- For example; if you are looking for samples showing you how to implement a custom Channel or
- Consumer (event-based or polling-based), or you trying to figure out what is the most appropriate
- way to implement custom Bean parser on top of Spring Integration Bean parsers hierarchy when implementing custom name space
- for a custom component, this would be the right place to look.
- Here you can also find samples that will help you with Adapter development. Spring Integration comes
- with an extensive library of adapters to allow you to connect remote systems with Spring Integration messaging framework.
- However you might have a need to integrate with system for which the core framework does not provide an adapter.
- So you have to implement your own. This category would include samples showing you how to do it.
-
-
-
-
- APPLICATIONS (samples/applications)
-
-
- This category targets developers and architects who have a good understanding of the Messaging architecture,
- EIP and above average understanding of Spring and Spring Integration frameworks and are looking for samples that
- address a particular business problem. In other words the emphasis of samples in this category
- is business use cases and how it could be solved via Messaging Architecture and Spring Integration
- in particular.
- For example; If you are interested to see how a Loan Broker or Travel Agent
- process could be implemented and automated via Spring Integration this would be the right place to find these types of samples.
-
-
-
-
- Remember! Spring Integration is a community driven framework, therefore community participation is IMPORTANT.
-That includes Samples, so if you can't find what you are looking for let us know.
-
-
-
-
-
- Samples
-
- Currently Spring Integration comes with quite a few samples and you can only expect more.
- To help you better navigate through them, each sample comes with its own readme.txt file which coveres
- sevaral details about the sample (e.g., what EIP patterns it addresses, what problem it is trying to solve, how to run sample etc.).
- However, certain samples require a more detailed and some times graphical explanation. In these section you'll
- find details on samples that we believe require special attention.
-
-
- Loan Broker
-
- In this section, we will review a Loan Broker sample application that is included in the
- Spring Integration samples. This sample is inspired by one of the samples featured in Gregor
- Hohpe's Ramblings.
-
- The diagram below represents the entire process
-
-
-
-
-
-
-
-
-
-
- Now lets look at this process in more details
-
- At the core of EIP architecture are the very simple yet powerful concepts of Pipes and Filters and Message. Endpoints (Filters) are
- connected with one another via Channels (Pipes). The producing endpoint sends Message to the Channel and the Message is retrieved
- by the Consuming endpoint. This architecture is meant to define various mechanisms that describe How information is exchanged between
- the endpoints, without any awareness of What those endpoints are or What information they are exchanging, thus providing for a very loosely
- coupled and flexible collaboration model while also, decoupling Integration concerns from Business concerns. EIP extends this architecture
- by further defining:
-
-
- The types of pipes (Point-to-Point Channel, Publish-Subscribe Channel, Channel Adapter, etc.)
-
-
-
- The core filters and patterns around how filters collaborate with pipes
- (Message Router, Splitters and Aggregators, various Message Transformation patterns, etc.)
-
-
-
-
- The details and variations of this use case are very nicely described in Chapter 9 of the EIP Book, but here is the brief summary;
- A Consumer while shopping for the best Loan Quote(s) subscribes to the services of a Loan Broker, which handles details such as:
-
-
- Consumer pre-screening (e.g., obtain and review the consumer's Credit history)
-
-
-
- Determine the most appropriate Banks (e.g., based on consumer's credit history/score)
-
-
-
- Send a Loan quote request to each selected Bank
-
-
- Collect responses from each Bank
-
-
- Filter responses and determine the best quote(s), based on consumer's requirements.
-
-
- Pass the Loan quote(s) back to the consumer.
-
-
-
-
- Obviously the real process of obtaining a loan quote is a bit more complex, but since our goal here is to demonstrate how
- Enterprise Integration Patterns are realized and implemented within SI, the use case has been simplified to concentrate only on
- the Integration aspects of the process. It is not an attempt to give you an advice in consumer finances.
-
-
- As you can see, by hiring a Loan Broker, the consumer is isolated from the details of the Loan Broker's operations, and each Loan Broker's
- operations may defer from one another to maintain competitive advantage, so whatever we assemble/implement must be flexible so any changes
- could be introduced quickly and painlessly.
- Speaking of change, the Loan Broker sample does not actually talk to any 'imaginary' Banks or Credit bureaus. Those services are stubbed out.
- Our goal here is to assemble, orchestrate and test the integration aspect of the process as a whole. Only then can we start thinking about
- wiring such process to the real services. At that time the assembled process and its configuration will not change regardless of the number
- of Banks a particular Loan Broker is dealing with, or the type of communication media (or protocols) used (JMS, WS, TCP, etc.)
- to communicate with these Banks.
-
- DESIGN
-
- As you analyze the 6 requirements above you'll quickly see that they all fall into the category of Integration concerns.
- For example, in the consumer pre-screening step we need to gather additional information about the consumer and the consumer's desires
- and enrich the loan request with additional meta information. We then have to filter such information to select the most appropriate list of
- Banks, and so on. Enrich, filter, select – these are all integration concerns for which EIP defines a solution in the form of patterns.
- SI provides an implementation of these patterns.
-
- Messaging Gateway
-
-
-
-
-
-
-
-
-
-
- The Messaging Gateway pattern provides a simple mechanism to access messaging systems, including our Loan Broker.
- In SI you define the Gateway as a Plain Old Java Interface (no need to provide an implementation), configure it via the
- XML <gateway&gr; element or via annotation and use it as any other Spring bean. SI will take care of
- delegating and mapping method invocations to the Messaging infrastructure by generating a Message (payload is mapped to an
- input parameter of the method) and sending it to the designated channel.
-
-
-
-
-]]>
-
-
- Our current Gateway provides two methods that could be invoked. One that will return the best single quote and another one that
- will return all quotes. Somehow downstream we need to know what type of reply the caller is looking for. The best way to achieve
- this in Messaging architecture is to enrich the content of the message with some meta-data describing your intentions.
- Content Enricher is one of the patterns that addresses this and although Spring Integration does provide a
- separate configuration element to enrich Message Headers with arbitrary data (we'll see it later), as a convenience, since
- Gateway element is responsible to construct the initial Message it provides embedded
- capability to enrich the newly created Message with arbitrary Message Headers. In our
- example we are adding header RESPONSE_TYPE with value 'BEST'' whenever the getBestQuote() method is invoked. For other method
- we are not adding any header. Now we can check downstream for an existence of this header and based on its presence and its value
- we can determine what type of reply the caller is looking for.
-
-
-
- Based on the use case we also know there are some pre-screening steps that needs to be performed such as getting and evaluating the consumer's
- credit score, simply because some premiere Banks will only typically accept quote requests from consumers that meet a minimum credit
- score requirement. So it would be nice if the Message would be enriched with such information before it is forwarded
- to the Banks. It would also be nice if when several processes needs to be completed to provide such meta-information, those
- processes could be grouped in a single unit. In our use case we need to determine credit score and based on the credit score and some
- rule select a list of Message Channels (Bank Channels) we will sent quote request to.
-
- Composed Message Processor
-
- The Composed Message Processor pattern describes rules around building endpoints that maintain control over message flow which
- consists of multiple message processors. In Sprig Integration Composed Message Processor pattern is implemented via
- <chain> element.
-
-
-
-
-
-
-
-
-
-
- As you can see from the above configuration we have a chain with inner header-enricher element which will further enrich the
- content of the Message with the header CREDIT_SCORE and value that will be determined by the call to a
- credit service (simple POJO spring bean identified by 'creditBureau' name) and then it will delegate to the Message Router
-
- Message Router
-
-
-
-
-
-
-
-
-
-
- There are several implementation of Message Routing pattern available in Spring Integration. Here we are using
- router that will determine a list of channels based on evaluating an expression (Spring Expression Language) which will look at
- the credit score that was determined is the previous step and will select the list of channels from the Map bean with id 'banks'
- whose values are 'premier' or 'secondary' based o the value of credit score. Once the list of Channels is selected, the
- Message will be routed to those Channels.
-
-
- Now, one last thing the Loan Broker needs to to is to receive the loan quotes form the banks, aggregate them by consumer
- (we don't want to show quotes from one consumer to another), assemble the response based on the consumer's selection criteria
- (single best quote or all quotes) and reply back to the consumer.
-
- Message Aggregator
-
-
-
-
-
-
-
-
-
-
-
- An Aggregator pattern describes an endpoint which groups related Messages into a single
- Message. Criteria and rules can be provided to determine an aggregation and correlation strategy.
- SI provides several implementations of the Aggregator pattern as well as a convenient name-space based configuration.
-
-
-]]>
-
-
-
- Our Loan Broker defines a 'quotesAggregator' bean via the <aggregator> element which provides a default
- aggregation and correlation strategy. The default correlation strategy correlates messages based on the $corelationId header
- (see Correlation Identifier pattern). What's interesting is that we never provided the value for this header.
- It was set earlier by the router automatically, when it generated a separate Message for each Bank channel.
-
-
- Once the Messages are correlated they are released to the actual Aggregator implementation.
- Although default Aggregator is provided by SI, its strategy (gather the list of payloads from all
- Messages and construct a new Message with this List as payload) does not satisfy our
- requirement. The reason is that our consumer might require a single best quote or all quotes. To communicate the consumer's
- intention, earlier in the process we set the RESPONSE_TYPE header. Now we have to evaluate this header and return either
- all the quotes (the default aggregation strategy would work) or the best quote (the default aggregation strategy will not work
- because we have to determine which loan quote is the best).
-
-
-
- Obviously selecting the best quote could be based on complex criteria and would influence the complexity of the aggregator implementation and
- configuration, but for now we are making it simple. If consumer wants the best quote we will select a quote with the lowest interest
- rate. To accomplish that the LoanQuoteAggregator.java will sort all the quotes and return the first one.
- The LoanQuote.java implements Comparable which compares quotes based on the rate attribute.
- Once the response Message is created it is sent to the default-reply-channel of the Messaging Gateway
- (thus the consumer) which started the process. Our consumer got the Loan Quote!
-
- Conclusion
-
- As you can see a rather complex process was assembled based on POJO (read existing, legacy), light weight, embeddable messaging
- framework (Sprig Integration) with a loosely coupled programming model intended to simplify integration of heterogeneous systems
- without requiring a heavy-weight ESB-like engine or proprietary development and deployment environment, becouse as a developer you
- should not be porting your Swing or console-based application to an ESB-like server or implementing proprietary interfaces just
- because you have an integration concern.
-
-
- This and other samples in this section are build on top of Enterprise Integration Patterns that meant to describe "building blocks"
- for YOUR solution but not to be solutions in of themselves. Integration concerns exist in all types of applications (server based and not)
- and should not require change in design, testing and deployment strategy if such applications need to integrate with one another.
-
-
-
-
-
-
-
- The Cafe Sample
-
- In this section, we will review a Cafe sample application that is included in the
- Spring Integration samples. This sample is inspired by another sample featured in Gregor
- Hohpe's Ramblings.
-
-
- The domain is that of a Cafe, and the basic flow is depicted in the following diagram:
-
-
-
-
-
-
-
-
-
-
-
-
- The Order object may contain multiple OrderItems. Once the order
- is placed, a Splitter will break the composite order message into a single message per
- drink. Each of these is then processed by a Router that determines whether the drink is hot
- or cold (checking the OrderItem object's 'isIced' property). The
- Barista prepares each drink, but hot and cold drink preparation are handled by two
- distinct methods: 'prepareHotDrink' and 'prepareColdDrink'. The prepared drinks are then sent to the Waiter where
- they are aggregated into a Delivery object.
-
-
- Here is the XML configuration:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ]]>
- As you can see, each Message Endpoint is connected to input and/or output channels. Each endpoint will manage
- its own Lifecycle (by default endpoints start automatically upon initialization - to prevent that add the
- "auto-startup" attribute with a value of "false"). Most importantly, notice that the objects are simple POJOs
- with strongly typed method arguments. For example, here is the Splitter:
- split(Order order) {
- return order.getItems();
- }
- }]]>
- In the case of the Router, the return value does not have to be a MessageChannel
- instance (although it can be). As you see in this example, a String-value representing the channel name is
- returned instead.
-
-
-
- Now turning back to the XML, you see that there are two <service-activator> elements. Each of these
- is delegating to the same Barista instance but different methods: 'prepareHotDrink'
- or 'prepareColdDrink' corresponding to the two channels where order items have been routed.
-
-
-
- As you can see from the code excerpt above, the barista methods have different delays (the hot drinks take 5
- times as long to prepare). This simulates work being completed at different rates. When the
- CafeDemo 'main' method runs, it will loop 100 times sending a single hot drink and a
- single cold drink each time. It actually sends the messages by invoking the 'placeOrder' method on the Cafe
- interface. Above, you will see that the <gateway> element is specified in the configuration file. This
- triggers the creation of a proxy that implements the given 'service-interface' and connects it to a channel.
- The channel name is provided on the @Gateway annotation of the Cafe interface.
- public interface Cafe {
-
- @Gateway(requestChannel="orders")
- void placeOrder(Order order);
-
- }
- Finally, have a look at the main() method of the CafeDemo itself.
- 0) {
- context = new FileSystemXmlApplicationContext(args);
- }
- else {
- context = new ClassPathXmlApplicationContext("cafeDemo.xml", CafeDemo.class);
- }
- Cafe cafe = (Cafe) context.getBean("cafe");
- for (int i = 1; i <= 100; i++) {
- Order order = new Order(i);
- order.addItem(DrinkType.LATTE, 2, false);
- order.addItem(DrinkType.MOCHA, 3, true);
- cafe.placeOrder(order);
- }
- }]]>
-
-
- To run this sample as well as 8 others, refer to the README.txt within the "samples" directory
- of the main distribution as described at the beginning of this chapter.
-
-
- When you run cafeDemo, you will see that the cold drinks are initially prepared more quickly than the hot drinks.
- Because there is an aggregator, the cold drinks are effectively limited by the rate of the hot drink preparation.
- This is to be expected based on their respective delays of 1000 and 5000 milliseconds. However, by configuring a
- poller with a concurrent task executor, you can dramatically change the results. For example, you could use a
- thread pool executor with 5 workers for the hot drink barista while keeping the cold drink barista as it is:
-
-
-
- ]]>
- ]]>
-
- ]]>]]>
-
-
- Also, notice that the worker thread name is displayed with each invocation. You will see that the hot drinks are
- prepared by the task-executor threads. If you provide a much shorter poller interval (such as 100 milliseconds),
- then you will notice that occasionally it throttles the input by forcing the task-scheduler (the caller) to invoke
- the operation.
-
-
- In addition to experimenting with the poller's concurrency settings, you can also add the 'transactional'
- sub-element and then refer to any PlatformTransactionManager instance within the context.
-
-
-
-
- The XML Messaging Sample
-
- The xml messaging sample in the org.springframework.integration.samples.xml illustrates how to use
- some of the provided components which deal with xml payloads. The sample uses the idea of processing an order for books
- represented as xml.
-
-
- First the order is split into a number of messages, each one representing a single order item using
- the XPath splitter component.
-
-
-
- ]]>
-
-
- A service activator is then used to pass the message into a stock checker POJO. The order item document is enriched with information
- from the stock checker about order item stock level. This enriched order item message is then used to route the message. In the
- case where the order item is in stock the message is routed to the warehouse. The XPath router makes use of a
- MapBasedChannelResolver which maps the XPath evaluation result to a channel reference.
-
-
-
-
-
-
-
-
-
- ]]>
-
-
- Where the order item is not in stock the message is transformed using
- xslt into a format suitable for sending to the supplier.
-
- ]]>
-
-
-
-
-
-
diff --git a/src/docbkx/security.xml b/src/docbkx/security.xml
deleted file mode 100644
index a614ebbc7c..0000000000
--- a/src/docbkx/security.xml
+++ /dev/null
@@ -1,64 +0,0 @@
-
-
-
- Security in Spring Integration
-
-
- Introduction
-
- Spring Integration provides integration with the
- Spring Security project
- to allow role based security checks to be applied to channel send and receive invocations.
-
-
-
-
- Securing channels
-
- Spring Integration provides the interceptor ChannelSecurityInterceptor, which extends
- AbstractSecurityInterceptor and intercepts send and receive calls on the channel. Access decisions
- are then made with reference to ChannelInvocationDefinitionSource which provides the definition of
- the send and receive security constraints. The interceptor requires that a valid SecurityContext
- has been established by authenticating with Spring Security, see the Spring Security reference documentation for details.
-
-
- Namespace support is provided to allow easy configuration of security constraints. This consists of the secured channels tag which allows
- definition of one or more channel name patterns in conjunction with a definition of the security configuration for send and receive. The pattern
- is a java.util.regexp.Pattern.
-
-
-
-
-
-
-]]>
-
-
- By default the secured-channels namespace element expects a bean named authenticationManager which implements
- AuthenticationManager and a bean named accessDecisionManager which implements
- AccessDecisionManager. Where this is not the case references to the appropriate beans can be configured
- as attributes of the secured-channels element as below.
-
-
-
-]]>
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/docbkx/stream.xml b/src/docbkx/stream.xml
deleted file mode 100644
index 7d263f059e..0000000000
--- a/src/docbkx/stream.xml
+++ /dev/null
@@ -1,91 +0,0 @@
-
-
-
- Stream Support
-
-
- Introduction
-
- In many cases application data is obtained from a stream. It is not recommended to send a reference to a Stream as a message payload to a consumer. Instead messages are created from data that is read from an input stream and message payloads are written to an output stream one by one.
-
-
-
-
- Reading from streams
-
- Spring Integration provides two adapters for streams. Both ByteStreamReadingMessageSource and
- CharacterStreamReadingMessageSource implement MessageSource.
- By configuring one of these within a channel-adapter element, the polling period can be configured,
- and the Message Bus can automatically detect and schedule them. The byte stream version requires an
- InputStream, and the character stream version requires a Reader as
- the single constructor argument. The ByteStreamReadingMessageSource also accepts the 'bytesPerMessage'
- property to determine how many bytes it will attempt to read into each Message. The
- default value is 1024
-
-
-
-
-
-
-
-]]>
-
-
-
-
-
- Writing to streams
-
- For target streams, there are also two implementations: ByteStreamWritingMessageHandler and
- CharacterStreamWritingMessageHandler. Each requires a single constructor argument -
- OutputStream for byte streams or Writer for character streams,
- and each provides a second constructor that adds the optional 'bufferSize'. Since both of these
- ultimately implement the MessageHandler interface, they can be referenced from a
- channel-adapter configuration as described in more detail in
- .
-
-
-
-
-
-
-
-]]>
-
-
-
-
-
-
-
- Stream namespace support
-
- To reduce the configuration needed for stream related channel adapters there is a namespace defined. The following schema locations are needed to use it.
-
-]]>
-
-
- To configure the inbound channel adapter the following code snippet shows the different configuration options that are supported.
-
-
-]]>
-
-
- To configure the outbound channel adapter you can use the namespace support as well. The following code snippet shows the different configuration for an outbound channel adapters.
-
-
-
-
-
-
-
- ]]>
-
-
-
\ No newline at end of file
diff --git a/src/docbkx/transactions.xml b/src/docbkx/transactions.xml
deleted file mode 100644
index b0f62405a4..0000000000
--- a/src/docbkx/transactions.xml
+++ /dev/null
@@ -1,175 +0,0 @@
-
-
-
- Transaction Support
-
-
- Understanding Transactions in Message flows
-
- Spring Integration exposes several hooks to address transactional needs of you message flows.
- But to better understand these hooks and how you can benefit from them we must first revisit the 6 mechanisms
- that could be used to initiate Message flows and see how transactional needs of these flows
- could be addressed within each of these mechanisms.
-
-
- Here are the 6 mechanisms to initiate a Message flow and their short summary (details for each are provided throughout this manual):
-
-
- Gateway Proxy - Your basic Messaging Gateway
-
-
- MessageChannel - Direct interactions with MessageChannel methods (e.g., channel.send(message))
-
-
- Message Publisher - the way to initiate message flow as a bi-product of method invocations on Spring beans
-
-
- Inbound Channel Adapters/Gateways - the way to initiate message flow based on connecting third-party
- system with Spring Integration messaging system(e.g., [JmsMessage] -> Jms Inbound Adapter[SI Message] -> SI Channel)
-
-
- Scheduler - the way to initiate message flow based on scheduling events distributed
- by a pre-configured Scheduler
-
-
- Poller - similar to the Scheduler and is the way to initiate message flow based on scheduling
- or interval-based events distributed by a pre-configured Poller
-
-
-
-
- These 6 cold be split in 2 general categories:
-
-
- Message flows initiated by a USER process - Example scenarios in this category
- would be invoking a Gateway method or explicitly sending a Message to a MessageChannel. In other words these message flows depend on third
- party process (e.g., some code that we wrote) to be initiated
-
-
- Message flows initiated by the DAEMON process - Example scenarios in this category would be a Poller
- polling for a Message queue to initiate a new Message flow with the polled Message or a Scheduler scheduling the
- process, by creating a new Message and initiating a message flow at a predefined time
-
-
-
-
- Clearly the Gateway Proxy, MessageChannel.send(..) and MessagePublisher are
- all belong to the 1st category and Inbound Adapters/Gateways, Scheduler and Poller belong to the 2nd.
-
-
- So, how do we address transactional needs in various scenarios within each category and is there a need for Spring Integration
- to provide something explicitly with regard to transaction for a particular scenario or Spring's Transaction Support could be leveraged instead?.
-
-
-
- First of all, the first and obvious goal is NOT to re-invent something that has already been invented unless you can provide a beter solution.
- In our case Spring itself provides a first class support for transaction management. So our goal here is not to provide something new but rather
- delegate/use Spring to benefit from the existing support for transactions. In other words as a framework we must expose hooks to the Transaction management functionality
- provided by Spring. But since Spring Integration configuration is based on Spring Configuration it is not always neccessery to expose these hooks as they already
- expposed via Spring natively. Remeber every Spring Integration component is a Spring Bean after all.
-
-
- With this goal in mind let's look at the two scenarios.
-
-
- If you think about it, Message flows that are initiated by the USER process (Category 1) and obviously configured in Spring Application Context,
- are subject to transactional configuration of such process and therefore don't need to be explicitly configured by Spring Integration to support transactions.
- The transaction could and should be initiated by such process through standard Transaction support provided by Spring and Spring Integration message flow will honor
- transactional semantics of the components naturally because it is Spring configured. For example; A Gateway or ServiceActivator methods could
- be annotated with @Transactional or TransactionInterceptor could be configured in XML configuration
- with point-cut expression pointing to specific methods that should be transactional.
- The bottom line you have full control over transaction configuration and boundaries in these scenarios.
-
-
-
- However, things are a bit different when it comes to Message flows initiated by the DAEMON process (Category 2).
- Although configured by the developer these flows do not directly involve human or some other process to be initiated. These are trigger-based flows
- that are initiated by a trigger process (DAEMON process) based on the configuration of such process. For example, we could have a Scheduler
- initiating a message flow every Friday night of every week. We can also configure a trigger that initiates a Message flow every second, etc.
- So, we obviously need the same way to let these trigger-based processes know of our intention to make these Message flows transactional so
- Transaction context could be created whenever a new Message flow is initiated. In other words we need to expose some Transaction configuration, but ONLY enough
- to delegate to Transaction support already provided by Spring (as we do in other scenarios).
-
-
-
- Spring Integration provides transactional support for Pollers. Pollers are a special case comoponents becouse
- we can call receive() within that poller task against a resource that is itself transactional thus including receive()
- call in the the boundaries of the Transaction allowing it to be rolled back in case of a task failure. If we were to add the same support
- for channels, the added transactions would affect all downstream components starting with that send() call. That is
- providing a rather wide scope for transaction demarcation without any strong reason especially when Spring already provides several way to
- address transactional needs of any component downstream. However the receive() method being included in a transaction
- boundary is the "strong reason" for pollers.
-
-
-
-
-
- Poller Transaction Support
-
- Any time you configure a Poller you can provide transactional configuration via transactional element and its attributes:
-
-
-]]>
- As you can see this configuration looks evry similar to native Spring transaction configuration. You must still provide reference to Transaction manager and specify
- transaction attributes or rely on defauls (e.g., if 'transaction-manager'' attribute is not specified then it will default to the bean with the name 'transactionManager').
- Internally the process would be wrapped in the Spring's native Transaction where TransactionInterceptor is responsible to handle transactions.
- For more information on how to configure Transaction Manager, the types of Transaction Managers (e.g., JTA, Datasource etc.) and other details related to
- transaction configuration please refer to Spring's Reference manual (Chapter 10 - Transaction Management).
-
-
- With the above configuration all Message flows initiated by this poller will be transactional. For more information and details on
- Poller's transactional configuration please refer to section - 21.1.1. Polling and Transactions.
-
-
-
- There times when besides transaction several more cross cutting concerns needs to be addressed when running Poller. To help with that,
- Poller element defines <advice-chain> sub-element which allows you to define a custom chain of Advices
- to be applied on the Poller. (see section 4.4 for more details)
- In Spring Integration 2.0 Poller went through the major refactoring effort and is now using proxy mechanism to address transactional
- concerns as well as other cross cutting concerns, one of the significant changes evolving from this effort is that we
- made <transactional> and <advice-chain> elements mutually exclusive.
- The rational behind this is; If you need more then one advice, and one of them is Transaction advice, then you can simply
- include it in the <advice-chain> with the same convenience as before but with much more control
- since you now have an option to position any advice in the desired order.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-]]>
-
-As yo can see from the example above, we have provided a very basic XML-based configuration of Spring Transaction advice - "txAdvice" and
-included it within the <advice-chain> defined by the Poller.
-
-And if you only need to address transactional concerns of the Poller, then you can still use <transactional> element
-as a convinience.
-
-
-
-
- Transaction Boundaries
-
- Another important factor that needs to be understood is the boundaries of the Transactions within the Message flow.
- When transaction is started, transaction context is bound to the current thread. So regardless of how many endpoints and channels you have in your
- Message flow you transaction context will be preserved as long as you are ensuring that the flow continues on the same thread.
- As soon as you break it by introducing a Pollable Channel or Executor Channel or initiate a new thread manually in some
- service, the Transactional boundary will be broken as well. Essentially the Transaction will END right there and if
- successfull hand of happened between the threads, the flow would be considered a success and COMMIT signal would be sent
- even though the flow might still result in the exception somewhere downstream. If such flow was synchronous the exception would be thrown back to the
- initiator of the Message flow who is also the initiator of the transactional context and transaction would result in a ROLLBACK.
-
-
-
\ No newline at end of file
diff --git a/src/docbkx/xml.xml b/src/docbkx/xml.xml
deleted file mode 100644
index 8a70c44701..0000000000
--- a/src/docbkx/xml.xml
+++ /dev/null
@@ -1,505 +0,0 @@
-
-
-
- XML Support - Dealing with XML Payloads
-
-
- Introduction
-
- Spring Integration's XML support extends the Spring Integration Core with
- implementations of splitter, transformer, selector and router designed
- to make working with xml messages in Spring Integration simple. The provided messaging
- components are designed to work with xml represented in a range of formats including
- instances of
- java.lang.String, org.w3c.dom.Document
- and javax.xml.transform.Source. It should be noted however that
- where a DOM representation is required, for example in order to evaluate an XPath expression,
- the String payload will be converted into the required type and then
- converted back again to String. Components that require an instance of
- DocumentBuilder will create a namespace aware instance if one is
- not provided. Where greater control of the document being created is required an appropriately
- configured instance of DocumentBuilder should be provided.
-
-
-
- Transforming xml payloads
-
- This section will explain the workings of
- UnmarshallingTransformer,
- MarshallingTransformer,
- XsltPayloadTransformer
- and how to configure them as
- beans. All of the provided xml transformers extend
- AbstractTransformer or AbstractPayloadTransformer
- and therefore implement Transformer. When configuring xml
- transformers as beans in Spring Integration you would normally configure the transformer
- in conjunction with either a MessageTransformingChannelInterceptor or a
- MessageTransformingHandler. This allows the transformer to be used as either an interceptor,
- which transforms the message as it is sent or received to the channel, or as an endpoint. Finally the
- namespace support will be discussed which allows for the simple configuration of the transformers as
- elements in XML.
-
-
- UnmarshallingTransformer allows an xml Source
- to be unmarshalled using implementations of Spring OXM Unmarshaller.
- Spring OXM provides several implementations supporting marshalling and unmarshalling using JAXB,
- Castor and JiBX amongst others. Since the unmarshaller requires an instance of
- Source where the message payload is not currently an instance of
- Source, conversion will be attempted. Currently String
- and org.w3c.dom.Document payloads are supported. Custom conversion to a
- Source is also supported by injecting an implementation of
- SourceFactory.
-
-
-
-
-
-
-]]>
-
-
- The MarshallingTransformer allows an object graph to be converted
- into xml using a Spring OXM Marshaller. By default the
- MarshallingTransformer will return a DomResult.
- However the type of result can be controlled by configuring an alternative ResultFactory
- such as StringResultFactory. In many cases it will be more convenient to transform
- the payload into an alternative xml format. To achieve this configure a
- ResultTransformer. Two implementations are provided, one which converts to
- String and another which converts to Document.
-
-
-
-
-
-
-
-
-
-]]>
-
-
- By default, the MarshallingTransformer will pass the payload Object
- to the Marshaller, but if its boolean "extractPayload" property
- is set to "false", the entire Message instance will be passed
- to the Marshaller instead. That may be useful for certain custom
- implementations of the Marshaller interface, but typically the
- payload is the appropriate source Object for marshalling when delegating to any of the various
- out-of-the-box Marshaller implementations.
-
-
- XsltPayloadTransformer transforms xml payloads using xsl.
- The transformer requires an instance of either Resource or
- Templates. Passing in a Templates instance
- allows for greater configuration of the TransformerFactory used to create
- the template instance. As in the case of XmlPayloadMarshallingTransformer
- by default XsltPayloadTransformer will create a message with a
- Result payload. This can be customised by providing a
- ResultFactory and/or a ResultTransformer.
-
-
-
-
-
-]]>
-
-
-
-
- Namespace support for xml transformers
-
- Namespace support for all xml transformers is provided in the Spring Integration xml namespace,
- a template for which can be seen below. The namespace support for transformers creates an instance of either
- EventDrivenConsumer or PollingConsumer
- according to the type of the provided input channel. The namespace support is designed
- to reduce the amount of xml configuration by allowing the creation of an endpoint and transformer
- using one element.
-
-
-]]>
- The namespace support for UnmarshallingTransformer is shown below.
- Since the namespace is now creating an endpoint instance rather than a transformer,
- a poller can also be nested within the element to control the polling of the input channel.
-
-
-
-
-
- ]]>
-
-
-
- The namespace support for the marshalling transformer requires an input channel, output channel and a
- reference to a marshaller. The optional result-type attribute can be used to control the type of result created,
- valid values are StringResult or DomResult (the default). Where the provided result types are not sufficient a
- reference to a custom implementation of ResultFactory can be provided as an alternative
- to setting the result-type attribute using the result-factory attribute. An optional result-transformer can also be
- specified in order to convert the created Result after marshalling.
-
-
-
-
-]]>
-
-
-
- Namespace support for the XsltPayloadTransformer allows either a resource to be passed in in order to create the
- Templates instance or alternatively a precreated Templates
- instance can be passed in as a reference. In common with the marshalling transformer the type of the result output can
- be controlled by specifying either the result-factory or result-type attribute. A result-transfomer attribute can also
- be used to reference an implementation of ResultTransfomer where conversion of the result
- is required before sending.
-
-]]>
-
-
- Very often to assist with transformation you may need to have access to Message data (e.g., Message Headers). For example; you may need to get access to certain Message Headers
- and pass them on as parameters to a transformer (e.g., transformer.setParameter(..)).
- Spring Integration provides two convenient ways to accomplish this. Just look at the following XML snippet.
-
-
-
-
-]]>
- If message header names match 1:1 to parameter names, you can simply use xslt-param-headers attribute. There you can also use wildcards for
- simple pattern matching which supports the following simple pattern styles: "xxx*", "*xxx", "*xxx*" and "xxx*yyy".
-
-
- You can also configure individual xslt parameters via xslt-param sub element. There you can use expression or value attribute.
- The expression attribute should be any valid SpEL expression with Message being the root object of the expression evaluation context.
- The value attribute just like any value in Spring beans allows you to specify simple scalar vallue. YOu can also use property placeholders (e.g., ${some.value})
- So as you can see, with the expression and value attribute xslt parameters could now be mapped to any accessible part of the Message as well as any literal value.
-
-
-
-
- Splitting xml messages
-
- XPathMessageSplitter supports messages with either
- String or Document payloads.
- The splitter uses the provided XPath expression to split the payload into a number of
- nodes. By default this will result in each Node instance
- becoming the payload of a new message. Where it is preferred that each message be a Document
- the createDocuments flag can be set. Where a String payload is passed
- in the payload will be converted then split before being converted back to a number of String
- messages. The XPath splitter implements MessageHandler and should
- therefore be configured in conjunction with an appropriate endpoint (see the namespace support below
- for a simpler configuration alternative).
-
-
-
-
-
-
-
-
-
-]]>
-
-
-
-
-
- Routing xml messages using XPath
-
- Two Router implementations based on XPath are provided XPathSingleChannelRouter and
- XPathMultiChannelRouter. The implementations differ in respect to how many channels
- any given message may be routed to, exactly one in the case of the single channel version
- or zero or more in the case of the multichannel router. Both evaluate an XPath
- expression against the xml payload of the message, supported payload types by default
- are Node, Document and
- String. For other payload types a custom implementation
- of XmlPayloadConverter can be provided. The router
- implementations use ChannelResolver to convert the
- result(s) of the XPath expression to a channel name. By default a
- BeanFactoryChannelResolver strategy will be used, this means that the string returned by the XPath
- evaluation should correspond directly to the name of a channel. Where this is not the case
- an alternative implementation of ChannelResolver can
- be used. Where there is a simple mapping from Xpath result to channel name
- the provided MapBasedChannelResolver can be used.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-]]>
-
-
-
-
- Selecting xml messages using XPath
-
- Two MessageSelector implementations are provided,
- BooleanTestXPathMessageSelector and StringValueTestXPathMessageSelector.
- BooleanTestXPathMessageSelector requires an XPathExpression which evaluates to a boolean,
- for example boolean(/one/two) which will only select messages which have an element named
- two which is a child of a root element named one. StringValueTestXPathMessageSelector
- evaluates any XPath expression as a String and compares the result with the provided value.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-]]>
-
-
-
- Transforming xml messages using XPath
-
- When it comes to message transformation XPath is a great way to transform Messages that have XML
- payloads by defining XPath transformers via xpath-transformer element.
-
-
- Simple XPath transformation
-
-
- Let's look at the following transformer configuration:
- ]]>
-
- . . . and Message
- message =
- MessageBuilder.withPayload("").build();]]>
- After sending this message to the 'inputChannel' the XPath transformer configured above will transform
- this XML Message to a simple Message with payload of 'John Doe' all based on
- the simple XPath Expression specified in the xpath-expression attribute.
-
-
- XPath also has capability to perform simple conversion of extracted elements
- to a desired type. Valid return types are defined in XPathConstants and follows
- the conversion rules specified by the XPath.
-
-
- The following constants are defined by the XPathConstants: BOOLEAN, DOM_OBJECT_MODEL, NODE, NODESET, NUMBER, STRING
-
-
- You can configure the desired type by simply using evaluation-type
- attribute of the xpath-transformer element.
-
-
-
-]]>
-
-
- Node Mappers
-
-
- If you need to provide custom mapping for the node extracted by the XPath expression simply provide a reference to the
- implementation of the org.springframework.xml.xpath.NodeMapper - an interface used by
- XPathOperations implementations for mapping Node objects on a per-node basis. To provide a
- reference to a NodeMapper simply use node-mapper attribute:
-
-]]>
-. . . and Sample NodeMapper implementation:
-
-
-
- XML Payload Converter
-
-
- You can also use implementation of the org.springframework.integration.xml.XmlPayloadConverter to
- provide more granular transformation:
-
-]]>
-. . . and Sample XmlPayloadConverter implementation:
-")));
- }
- catch (Exception e) {
- throw new IllegalStateException(e);
- }
- }
- //
- public Document convertToDocument(Object object) {
- throw new UnsupportedOperationException();
- }
-}]]>
-
-
- Combination of SpEL and XPath expressions
-
-
- You can also combine Spring Expression Language (SpEL) expressions with XPath expression and configure
- them using expression attribute:
- ]]>
- In the above case the overall result of the expression will be the result of the XPathe expression multiplied by 2.
-
-
-
-
-
- XPath components namespace support
- All XPath based components have namespace support allowing them to be configured as
- Message Endpoints with the exception of the XPath selectors which are not designed to act as
- endpoints. Each component allows the XPath to either be referenced at the top level or configured via a nested
- xpath-expression element. So the following configurations of an xpath-selector are all valid and represent the general
- form of XPath namespace support. All forms of XPath expression result in the creation of an
- XPathExpression using the Spring XPathExpressionFactory
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-]]>
-
-
- XPath splitter namespace support allows the creation of a Message Endpoint with an input channel and output channel.
-
-
-
-
-
-
-
-
-
-]]>
-
-
- XPath router namespace support allows for the creation of a Message Endpoint with an input channel but no output channel
- since the output channel is determined dynamically. The multi-channel attribute causes the creation of a multi channel router capable of
- routing a single message to many channels when true and a single channel router when false.
-
-
-
-
-
-
-
-
-
-]]>
-
-
-
-
\ No newline at end of file
diff --git a/src/main/resources/readme.txt b/src/main/resources/readme.txt
deleted file mode 100644
index 2b952f7e34..0000000000
--- a/src/main/resources/readme.txt
+++ /dev/null
@@ -1,27 +0,0 @@
-SPRING INTEGRATION 2.0.0 Milestone 7 (Sept 03, 2010)
-----------------------------------------------------
-
-To find out what has changed since version 1.0.x or 2.0 M6, see 'changelog.txt'
-
-Please consult the documentation located within the 'docs/reference' directory of this
-release and also visit the official Spring Integration home at:
-http://www.springsource.org/spring-integration
-
-There you will find links to the forum, issue tracker, and several other resources.
-
-To build and run the sample applications that are included with this distribution,
-view the README.txt file in the 'samples' directory.
-
-To checkout the project from the SVN head and build from source, do the following
-(NOTE: this requires Maven 2.2.x):
-
- svn co https://src.springsource.org/svn/spring-integration/trunk .
- mvn clean install
-
-To build the JavaDoc, run `mvn javadoc:aggregate` from within the root directory. The
-result will be available in 'target/site/apidocs'.
-
-The projects are Maven enabled, so you should be able to import them into any IDE that
-has support for Maven (2.2 or greater). The SpringSource Tool Suite (STS) ships with
-support for Maven projects, is free-of-charge and is the recommended IDE for use with
-Spring Integration (http://springsource.com/products/sts).