diff --git a/spring-framework-reference/src/cci.xml b/spring-framework-reference/src/cci.xml
index 4dcdad0c4d6..94528573a00 100644
--- a/spring-framework-reference/src/cci.xml
+++ b/spring-framework-reference/src/cci.xml
@@ -94,7 +94,7 @@
In a managed mode, you access a ConnectionFactory
from JNDI; its properties will be configured in the application server.
-
+
]]>
@@ -105,7 +105,7 @@
implementation of your connector, exposing the application-level
CCI ConnectionFactory.
-
+
@@ -142,7 +142,7 @@
in the application server (in managed mode) or on the corresponding local
ManagedConnectionFactory implementation.
- getConnection variant without argument,
else the one with the ConnectionSpec argument.
-
@@ -190,7 +190,7 @@
proxies that behave accordingly, all sharing the same underlying physical
connection.
-
@@ -235,7 +235,7 @@
developer can use a dedicated implementation of the
RecordCreator interface.
-
@@ -249,7 +249,7 @@
shows how to use the RecordCreator interface
and indexed/mapped records.
- CciTemplate for extracting data from the output
Record.
- The following sample shows how to use the RecordExtractor interface.
- Interaction
interface provides two execute method signatures:
- Interaction interface.
- CciTemplate methods are the
following:
- CciTemplate.execute(..) methods.
- ConnectionFactory, exposing
it to concrete data access implementations in subclasses.
- CciTemplate.
This could be done in the application code like so:
-
+ Or (recommended) in the Spring configuration, if the CciTemplate
is configured as a dedicated bean instance:
-
+
@@ -593,7 +593,7 @@
can be useful for example to get an associated RecordFactory
instance and create indexed/mapped records, for example.
- ConnectionFactory.
- InteractionSpec must be done to specify which CICS
program to access and how to interact with it.
- Then the program can use CCI via Spring's template and specify
mappings between custom objects and CCI Records.
- As discussed previously, callbacks can be used to work
directly on CCI connections or interactions.
- Interaction will be managed and closed by the
CciTemplate in this case.
- For the examples above, the corresponding configuration of the
involved Spring beans could look like this in non-managed mode:
-
+
@@ -732,7 +732,7 @@ interactionSpec.setInteractionVerb(ECIInteractionSpec.SYNC_SEND_RECEIVE);]]>In managed mode (that is, in a J2EE environment), the configuration
could look as follows:
-
+
@@ -781,7 +781,7 @@ interactionSpec.setInteractionVerb(ECIInteractionSpec.SYNC_SEND_RECEIVE);]]>Here are the signatures of these methods:
-
- InteractionSpec:
-
@@ -827,7 +827,7 @@ MyMappingRecordOperation eisOperation = new MyMappingRecordOperation(getConnecti
convert an input object into an input COMMAREA and the output COMMAREA
into an output object.
- Person class.
-
- The corresponding configuration of Spring beans could look
as follows in non-managed mode:
-
@@ -990,7 +990,7 @@ MyMappingRecordOperation eisOperation = new MyMappingRecordOperation(getConnecti
In managed mode (that is, in a J2EE environment), the configuration
could look as follows:
-
+
@@ -1021,7 +1021,7 @@ MyMappingRecordOperation eisOperation = new MyMappingRecordOperation(getConnecti
initialized to specify which CICS program to access and how to interact
with it.
- Records.
- The corresponding configuration of Spring beans could look
as follows in non-managed mode:
-
+
@@ -1086,7 +1086,7 @@ MyMappingRecordOperation eisOperation = new MyMappingRecordOperation(getConnecti
In managed mode (that is, in a J2EE environment), the configuration
could look as follows:
-
+
@@ -1106,7 +1106,7 @@ MyMappingRecordOperation eisOperation = new MyMappingRecordOperation(getConnecti
example with a CICS ECI connector), global transactions (for example with an
IMS connector).
-
+
@@ -1131,7 +1131,7 @@ MyMappingRecordOperation eisOperation = new MyMappingRecordOperation(getConnecti
executes such local CCI transactions, fully compliant with Spring's generic
PlatformTransactionManager abstraction.
-
+
diff --git a/spring-framework-reference/src/dtd.xml b/spring-framework-reference/src/dtd.xml
index 1108904986e..15444146978 100644
--- a/spring-framework-reference/src/dtd.xml
+++ b/spring-framework-reference/src/dtd.xml
@@ -2,7 +2,7 @@
spring-beans-2.0.dtd
- <!--
+ <!--
Spring XML Beans DTD, version 2.0
Authors: Rod Johnson, Juergen Hoeller, Alef Arendsen, Colin Sampaleanu, Rob Harrop
diff --git a/spring-framework-reference/src/dynamic-languages.xml b/spring-framework-reference/src/dynamic-languages.xml
index e03c62bca3b..1522b6218fc 100644
--- a/spring-framework-reference/src/dynamic-languages.xml
+++ b/spring-framework-reference/src/dynamic-languages.xml
@@ -119,7 +119,7 @@ class GroovyMessenger implements Messenger {
For more information on schema-based configuration, see .
-
+
]]><!-- this bean is now 'refreshable' due to the presence of the 'refresh-check-delay' attribute -->
-
+
package org.springframework.scripting.groovy;
@@ -433,7 +433,7 @@ class GroovyMessenger implements Messenger {
characters to denote a '<' character. In such a case
surrounding the inline source in a <![CDATA[]]> region might be better.)
-
+
require 'java'
@@ -484,7 +484,7 @@ class GroovyMessenger implements Messenger {
String anotherMessage
}]]>
-
]]>
<!-- this next constructor argument will *not* be injected into the GroovyMessenger -->
@@ -579,7 +579,7 @@ RubyMessenger.new]]>
And here is the Spring XML that defines an instance of the
RubyMessenger JRuby bean.
-
@@ -683,7 +683,7 @@ class GroovyCalculator implements Calculator {
x + y
}
}]]>
- <-- from the file 'beans.xml' --><-- from the file 'beans.xml' -->
]]>
@@ -765,7 +765,7 @@ public class Main {
Actually making use of a GroovyObjectCustomizer
is easy if you are using the Spring 2.0 namespace support.
- <!-- define the GroovyObjectCustomizer just like any other bean -->
+ <!-- define the GroovyObjectCustomizer just like any other bean -->
]]><!-- ... and plug it into the desired Groovy bean via the 'customizer-ref' attribute -->GroovyObjectCustomizer functionality.
-
+
]]><!-- define the GroovyObjectCustomizer (as an inner bean) -->
@@ -857,7 +857,7 @@ void setMessage(String aMessage) {
And here is the Spring XML that defines an 'instance' of the above 'class'
(again, the term is used very loosely here).
-
@@ -935,7 +935,7 @@ class FortuneController implements Controller {
return new ModelAndView("tell", "fortune", this.fortuneService.tellFortune())
}
}]]>
-
@@ -1037,7 +1037,7 @@ class TestBeanValidator implements Validator {
to define a Groovy bean scoped as a
prototype.
-
+
@@ -105,7 +105,7 @@
on the controller. This will save the reference as an instance variable in the
controller:
- myComponent property of the controller is done
with a configuration entry such as:
-
@@ -148,7 +148,7 @@ public void setMyComponent(MyComponent myComponent) {
consider using the <jee:local-slsb>
configuration element in Spring's "jee" namespace:
-
@@ -278,19 +278,19 @@ public void setMyComponent(MyComponent myComponent) {
Consider an example Stateless Session bean which actually delegates
the implementation to a plain java service object. We have the business interface:
- We also have the plain Java implementation object:
- And finally the Stateless Session Bean itself:
-
- businessApplicationContext.xml contains the bean definitions for all business
service POJOs):
-
+
@@ -376,7 +376,7 @@ public void setMyComponent(MyComponent myComponent) {
In the above example, the ServicesConstants.PRIMARY_CONTEXT_ID constant
would be defined as follows:
-
+
Please see the respective Javadocs for the BeanFactoryLocator and
ContextSingletonBeanFactoryLocator classes for more information on
@@ -395,7 +395,7 @@ public void setMyComponent(MyComponent myComponent) {
in the EJB component class, or through an interceptor-binding
XML element in the EJB deployment descriptor.
-
- java.util.Map is converted to a message.
- Below is a simple implementation of an MDP:
- Find below an example of how to define and configure one of the message listener
containers that ships with Spring (in this case the
DefaultMessageListenerContainer).
- <!-- this is the Message Driven POJO (MDP) -->
+ <!-- this is the Message Driven POJO (MDP) -->
]]><!-- and this is the message listener container -->MessageListener interface, but also provides
the message handling method with access to the JMS Session
from which the Message was received.
- contents of the various Message
types that they can receive and handle.
-
- // implementation elided for clarity...In particular, note how the above implementation of the MessageDelegate
interface (the above DefaultMessageDelegate class) has
no JMS dependencies at all. It truly is a POJO that we will
make into an MDP via the following configuration.
- <!-- this is the Message Driven POJO (MDP) -->
+ <!-- this is the Message Driven POJO (MDP) -->
@@ -646,16 +646,16 @@ public interface SessionAwareMessageListener {
'handleMessage'), but it is configurable (as you will see below).
Notice also how the 'receive(..)' method is strongly typed to
receive and respond only to JMS TextMessage messages.
-
- // implementation elided for clarity...The configuration of the attendant MessageListenerAdapter would
look like this:
-
+
@@ -673,12 +673,12 @@ public interface SessionAwareMessageListener {
class is the ability to automatically send back a response Message
if a handler method returns a non-void value.
Consider the interface and class:
- // notice the return type...
- // implementation elided for clarity...If the above DefaultResponsiveTextMessageDelegate is used in
@@ -714,7 +714,7 @@ public interface SessionAwareMessageListener {
implementation, covering the case where database processing has
committed but message processing failed to commit.
-
+
@@ -736,13 +736,13 @@ public interface SessionAwareMessageListener {
part of the same transaction (with unified commit semantics,
at the expense of XA transaction log overhead).
-
+
]]>Then you just need to add it to our earlier container configuration. The
container will take care of the rest.
-
+
@@ -763,7 +763,7 @@ public interface SessionAwareMessageListener {
JmsActivationSpecConfig as shown in the following example.
-
+
@@ -778,7 +778,7 @@ public interface SessionAwareMessageListener {
ActivationSpec object may also come
from a JNDI lookup (using <jee:jndi-lookup>).
-
+
@@ -793,7 +793,7 @@ public interface SessionAwareMessageListener {
the target ResourceAdapter may be
configured locally as depicted in the following example.
-
+
@@ -846,7 +846,7 @@ public interface SessionAwareMessageListener {
Spring 2.5 introduces an XML namespace for simplifying JMS configuration. To use the
JMS namespace elements you will need to reference the JMS schema:
-
+ xmlns:jms="http://www.springframework.org/schema/jms"<listener/> child elements. Here is an example of a basic configuration
for two listeners.
-
+
@@ -956,7 +956,7 @@ http://www.springframework.org/schema/beans http://www.springframework.org/schem
highly-customized listener containers while still benefiting from the convenience of the
namespace.
- Configuring a JCA-based listener container with the "jms" schema support is very similar.
-
diff --git a/spring-framework-reference/src/jmx.xml b/spring-framework-reference/src/jmx.xml
index de53abc63ba..7d992c2022b 100644
--- a/spring-framework-reference/src/jmx.xml
+++ b/spring-framework-reference/src/jmx.xml
@@ -60,7 +60,7 @@
MBeanServer. For example, consider the following
class:
- MBeanExporter class in your configuration file and
pass in the bean as shown below:
-
+
]]><!-- this bean must not be lazily initialized if the exporting is to happen -->MBeanServer value returned by an
MBeanServerFactoryBean; for example:
-
+
@@ -204,7 +204,7 @@ public class JmxTestBean implements IJmxTestBean {
cases, one should use the MBeanServeragentId to indicate which instance to be used:
-
+
]]><!-- indicate to first look for a server -->
@@ -222,7 +222,7 @@ public class JmxTestBean implements IJmxTestBean {
has a dynamic (or unknown) agentId which is retrieved through lookup
methods, one should use factory-method:
-
+
]]><!-- Custom MBeanServerLocator -->MBeanExporter by setting the
autodetect property to true:
-
+
@@ -369,7 +369,7 @@ public class JmxTestBean implements IJmxTestBean {
default registration behavior to the
REGISTRATION_REPLACE_EXISTING behavior:
-
+
@@ -455,7 +455,7 @@ public class JmxTestBean implements IJmxTestBean {
class that you saw earlier marked with Commons Attributes
metadata:
- MBeanExporter to use the
MetadataMBeanInfoAssembler:
-
+
@@ -592,7 +592,7 @@ public class JmxTestBean implements IJmxTestBean {
The example below shows a bean where the management interface is defined
by the presence of JDK 5.0 annotation types:
- As you can see little has changed, other than the basic syntax of
the metadata definitions.
-
+
@@ -910,7 +910,7 @@ public class AnnotationTestBean implements IJmxTestBean {
ObjectName which results in a configuration like
this:
-
+
]]><!-- notice how no 'beans' are explicitly configured here -->JmxTestBean class that you saw
earlier:
-
-
+
@@ -1055,7 +1055,7 @@ public class AnnotationTestBean implements IJmxTestBean {
as attributes and operations. The code below shows a sample
configuration for this:
-
+ ]]>
@@ -1369,7 +1369,7 @@ public class AnnotationTestBean implements IJmxTestBean {
proxy for an MBean running in a local
MBeanServer:
-
+ ]]>
@@ -1391,7 +1391,7 @@ public class AnnotationTestBean implements IJmxTestBean {
pointing to a remote MBeanServer to cater for
proxies pointing to remote MBeans:
-
@@ -1429,7 +1429,7 @@ public class AnnotationTestBean implements IJmxTestBean {
would like to be informed (via a Notification)
each and every time an attribute of a target MBean changes.
-
-
+
@@ -1486,7 +1486,7 @@ public class ConsoleLoggingNotificationListener
You can also use straight bean names as the link between exported beans
and listeners:
-
+
@@ -1516,7 +1516,7 @@ public class ConsoleLoggingNotificationListener
as the key for an entry in the notificationListenerMappings
property map; for example:
-
+ pass validation.
-
+
]]><!-- whoops, no MovieFinder is set (and this property is @Required) -->]]>
@@ -213,7 +213,7 @@ public void echoException(Exception ex) throws Exception {
to configure; simply drop the following bean definition into your Spring
XML configuration.
- ]]>
+ ]]>
Finally, one can configure an instance of the
RequiredAnnotationBeanPostProcessor class to look
@@ -229,7 +229,7 @@ public void echoException(Exception ex) throws Exception {
You can make a RequiredAnnotationBeanPostProcessor
instance @Mandatory-aware like so:
-
+ ]]>
@@ -238,7 +238,7 @@ public void echoException(Exception ex) throws Exception {
is itself annotated with appropriate annotations for its target
and runtime retention policy.
-
- ]]>
+ ]]>
3. Next, define an attribute compilation task, which will use the
Commons Attributes attribute-compiler task to "compile" the attributes in
@@ -359,7 +359,7 @@ public @interface Mandatory {
to a location specified by the destdir attribute. Here we show the use of
a temporary directory for storing the generated files:
-
+
@@ -397,7 +397,7 @@ public @interface Mandatory {
create an index of all the attributes defined on your sources, for
efficient lookup at runtime. The step looks like this:
-
+
@@ -432,7 +432,7 @@ public @interface Mandatory {
This builds on the Spring AOP autoproxy functionality.
Configuration might look like this:
-
+
diff --git a/spring-framework-reference/src/remoting.xml b/spring-framework-reference/src/remoting.xml
index 7e95763ed92..103747bc073 100644
--- a/spring-framework-reference/src/remoting.xml
+++ b/spring-framework-reference/src/remoting.xml
@@ -54,7 +54,7 @@
While discussing the remoting capabilities of Spring, we'll use the following domain
model and corresponding services:
-
-
-
- // the implementation doing nothing at the moment// the implementation doing nothing at the momentOf course, we first have to set up our service in the Spring container:
-
+
]]><!-- any additional properties, maybe a DAO? -->]]>Next we'll have to expose our service using the RmiServiceExporter:
-
+
]]><!-- does not necessarily have to be the same name as the bean to be exported -->
@@ -138,7 +138,7 @@ public class AccountServiceImpl implements AccountService {
Linking in the service at the clientOur client is a simple object using the AccountService
to manage accounts:
- To link in the service on the client, we'll create a separate Spring container,
containing the simple object and the service linking configuration bits:
-
+
@@ -176,7 +176,7 @@ public class AccountServiceImpl implements AccountService {
from Spring Web MVC usage, you can easily wire up such a servlet exposing
your services. First we'll have to create a new servlet in your application
(this an excerpt from 'web.xml'):
-
+ remotingorg.springframework.web.servlet.DispatcherServlet1
@@ -203,7 +203,7 @@ public class AccountServiceImpl implements AccountService {
Exposing your beans by using the HessianServiceExporterIn the newly created application context called remoting-servlet.xml,
we'll create a HessianServiceExporter exporting your services:
-
+
]]><!-- any additional properties, maybe a DAO? -->
@@ -219,7 +219,7 @@ public class AccountServiceImpl implements AccountService {
Alternatively, create a HessianServiceExporter in your
root application context (e.g. in 'WEB-INF/applicationContext.xml'):
-
+ ]]>
@@ -227,7 +227,7 @@ public class AccountServiceImpl implements AccountService {
in 'web.xml', with the same end result: The exporter
getting mapped to the request path /remoting/AccountService.
Note that the servlet name needs to match the bean name of the target exporter.
-
+ accountExporterorg.springframework.web.context.support.HttpRequestHandlerServlet
@@ -245,7 +245,7 @@ public class AccountServiceImpl implements AccountService {
a separate bean factory or application context and mention the following beans
where the SimpleObject is using the
AccountService to manage accounts:
-
+
@@ -271,7 +271,7 @@ public class AccountServiceImpl implements AccountService {
features, for example. Usually, you don't use per-user security credentials here, but
rather shared credentials defined at the Hessian/BurlapProxyFactoryBean level
(similar to a JDBC DataSource).
-
+
@@ -315,7 +315,7 @@ public class AccountServiceImpl implements AccountService {
To expose the AccountService (mentioned above) within a
Spring Web MVC DispatcherServlet, the following configuration
needs to be in place in the dispatcher's application context:
-
+
@@ -325,14 +325,14 @@ public class AccountServiceImpl implements AccountService {
as explained in the section on Hessian.
Alternatively, create an HttpInvokerServiceExporter in your
root application context (e.g. in 'WEB-INF/applicationContext.xml'):
-
+
]]>In addition, define a corresponding servlet for this exporter in
'web.xml', with the servlet name matching the bean
name of the target exporter:
-
+ accountExporterorg.springframework.web.context.support.HttpRequestHandlerServlet
@@ -349,7 +349,7 @@ public class AccountServiceImpl implements AccountService {
do it when using Hessian or Burlap. Using a proxy, Spring will be able to
translate your calls to HTTP POST requests to the URL pointing to the exported
service.
-
+
@@ -358,7 +358,7 @@ public class AccountServiceImpl implements AccountService {
By default, the HttpInvokerProxy uses the J2SE HTTP functionality, but
you can also use the Commons HttpClient by setting the
httpInvokerRequestExecutor property:
-
+
]]>
@@ -404,7 +404,7 @@ public class AccountServiceImpl implements AccountService {
AccountService we extend Spring's
ServletEndpointSupport class and implement our business
logic here, usually delegating the call to the business layer.
- /**
+ /**
* JAX-RPC compliant RemoteAccountService implementation that simply delegates
* to the AccountService implementation in the root web application context.
*
@@ -455,7 +455,7 @@ public class AccountServiceEndpoint extends ServletEndpointSupport implements Re
in the previous section. You will see that Spring has great support for web services
requiring little coding efforts - most of the setup is done in the Spring configuration
file as usual:
-
+
@@ -470,13 +470,13 @@ public class AccountServiceEndpoint extends ServletEndpointSupport implements Re
Accessing the web service is now very easy as we have a bean factory for it that will expose it
as RemoteAccountService interface. We can wire this up in Spring:
-
+
...
]]>From the client code we can access the web service just as if it
was a normal class, except that it throws RemoteException.
-RemoteException. This requires that we provide a non-RMI
interface also. Our configuration is now:
-
+
]]>Where serviceInterface is changed to our non RMI interface. Our RMI
interface is now defined using the property portInterface. Our client
code can now avoid handling java.rmi.RemoteException:
- We will use Axis to register bean mappings on the client side. To do this we need to
register the bean mappings programmatically:
- Handler is a callback interface. There is a convenience
base class provided in jaxrpc.jar, namely
javax.rpc.xml.handler.GenericHandler that we will extend:
- postProcessJaxRpcService(..) method that is designed for
this:
- The last thing we must remember to do is to change the Spring configuration to use our
factory bean:
-
+
...
]]>
@@ -615,7 +615,7 @@ public class AccountServiceEndpoint extends ServletEndpointSupport implements Re
logic here, usually delegating the call to the business layer.
We'll simply use Spring 2.5's @Autowired
annotation for expressing such dependencies on Spring-managed beans.
- /**
+ /**
* JAX-WS compliant AccountService implementation that simply delegates
* to the AccountService implementation in the root web application context.
*
@@ -669,7 +669,7 @@ public class AccountServiceEndpoint extends SpringBeanAutowiringSupport {
Of course, annotation-driven injection through @Autowired
will work as well.
-
+
@@ -684,7 +684,7 @@ public class AccountServiceEndpoint extends SpringBeanAutowiringSupport {
This means that the endpoint implementation may look like as follows,
without any superclass declared - and Spring's @Autowired
configuration annotation still being honored:
- AccountService endpoint (again):
-
+
@@ -745,13 +745,13 @@ public class AccountServiceEndpoint {
Accessing the web service is now very easy as we have a bean factory for it that will expose it
as AccountService interface. We can wire this up in Spring:
-
+
...
]]>From the client code we can access the web service just as if it
was a normal class:
- DispatcherServlet with a corresponding
WebApplicationContext containing the services you will be
exposing:
-
+ xfireorg.springframework.web.servlet.DispatcherServlet
]]>
@@ -788,7 +788,7 @@ public class AccountServiceEndpoint {
file to the contextConfigLocations context parameter picked up by the
ContextLoaderListener (or ContextLoaderServlet
for that matter).
-
+ contextConfigLocationclasspath:org/codehaus/xfire/spring/xfire.xml
@@ -801,7 +801,7 @@ public class AccountServiceEndpoint {
declared above) you only have to add one extra bean to expose the service using XFire.
Add for example the following configuration in your 'xfire-servlet.xml'
file:
-
+
@@ -828,14 +828,14 @@ public class AccountServiceEndpoint {
same non-transactionalSession, and as
such throughput will be very implementation dependent.
The following interface is used on both the server and the client side.
- The following simple implementation of the above interface is used on the server-side.
- This configuration file contains the JMS-infrastructure beans that are shared on both
the client and server.
-
+
+
-
+ JobDetail more of an actual JavaBean
with sensible defaults. Let's have a look at an example:
-
@@ -50,7 +50,7 @@
So in this case, if the ExampleJob contains a property
named timeout, the JobDetailBean will
automatically apply it:
- Using the MethodInvokingJobDetailFactoryBeanOften you just need to invoke a method on a specific object. Using the
MethodInvokingJobDetailFactoryBean you can do exactly this:
-
+ ]]>The above example will result in the doIt method being called on the
exampleBusinessObject method (see below):
- // properties and collaborators
- ]]>Using the MethodInvokingJobDetailFactoryBean, you don't need to
create one-line jobs that just invoke a method, and you only need to create the actual
@@ -106,7 +106,7 @@ public class ExampleJob extends QuartzJobBean {
will not start before the first one has finished. To make jobs resulting from the
MethodInvokingJobDetailFactoryBean non-concurrent, set the
concurrent flag to false.
-
@@ -132,7 +132,7 @@ public class ExampleJob extends QuartzJobBean {
schedules the actual jobs with those triggers.
Find below a couple of examples:
-
+
@@ -149,7 +149,7 @@ public class ExampleJob extends QuartzJobBean {
Now we've set up two triggers, one running every 50 seconds with a starting delay of
10 seconds and one every morning at 6 AM. To finalize everything, we need to set up the
SchedulerFactoryBean:
-
+
@@ -180,7 +180,7 @@ public class ExampleJob extends QuartzJobBean {
Using the TimerTask you can create customer
timer tasks, similar to Quartz jobs:
-
Wiring it up is simple:
-
+ test@springframework.org
@@ -225,7 +225,7 @@ public class ExampleJob extends QuartzJobBean {
Similar to the Quartz support, the Timer support also features
a component that allows you to periodically invoke a method:
-
+
]]>
@@ -233,7 +233,7 @@ public class ExampleJob extends QuartzJobBean {
The above example will result in the doIt method being called on the
exampleBusinessObject (see below):
- // properties and collaboratorsTimerFactoryBean
sets up an actual Timer and schedules the tasks it has
references to. You can specify whether or not daemon threads should be used.
-
+
]]><!-- see the example above -->ThreadPoolTaskExecutor
to asynchronously print out a set of messages.
- To configure the rules that the TaskExecutor
will use, simple bean properties have been exposed.
-
+
diff --git a/spring-framework-reference/src/transaction.xml b/spring-framework-reference/src/transaction.xml
index 64a8e86ecc6..d136205e51d 100644
--- a/spring-framework-reference/src/transaction.xml
+++ b/spring-framework-reference/src/transaction.xml
@@ -1015,6 +1015,7 @@ Exception in thread "main" java.lang.UnsupportedOperationException
+
diff --git a/spring-framework-reference/src/xml-custom.xml b/spring-framework-reference/src/xml-custom.xml
index 96755e91bec..0936a8a1529 100644
--- a/spring-framework-reference/src/xml-custom.xml
+++ b/spring-framework-reference/src/xml-custom.xml
@@ -37,7 +37,7 @@
SimpleDateFormat (from the java.text package)
in an easy manner. When we are done, we will be able to define bean definitions of type
SimpleDateFormat like this:
-
]]>
@@ -51,7 +51,7 @@
starts with authoring an XML Schema to describe the extension. What follows
is the schema we'll use to configure SimpleDateFormat
objects.
- <!-- myns.xsd (inside package org/springframework/samples/xml) --><!-- myns.xsd (inside package org/springframework/samples/xml) -->The above schema will be used to configure SimpleDateFormat
objects, directly in an XML application context file using the
<myns:dateformat/> element.
-
]]>
@@ -92,7 +92,7 @@
we're just creating a bean in the container, identified by the name
'dateFormat' of type SimpleDateFormat, with a
couple of properties set.
-
+
]]>
@@ -142,7 +142,7 @@
results in a single SimpleDateFormat bean definition).
Spring features a number of convenience classes that support this scenario.
In this example, we'll make use the NamespaceHandlerSupport class:
- one distinct top-level XML element defined in the
schema. In the parser, we'll have access to the XML element (and thus its subelements too)
so that we can parse our custom XML content, as can be seen in the following example:
- <dateformat/> element developed in the
previous steps in a Spring XML configuration file.
-
+ Nesting custom tags within custom tags
This example illustrates how you might go about writing the various artifacts
required to satisfy a target of the following configuration:
-
+ 'components' property; this makes it hard
(or rather impossible) to configure a bean definition for the Component
class using setter injection.
- The typical solution to this issue is to create a custom FactoryBean
that exposes a setter property for the 'components' property.
- the steps described
previously, we'll start off by creating the XSD schema to define the structure of
our custom tag.
-
+
]]>We'll then create a custom NamespaceHandler.
- Next up is the custom BeanDefinitionParser. Remember
that what we are creating is a BeanDefinition describing
a ComponentFactoryBean.
- JCache, and you want to ensure that
the named JCache instance is eagerly started within the surrounding cluster:
- jcache:cache-name="checking.account"><!-- other dependencies here... -->]]>
@@ -481,7 +481,7 @@ http\://www.foo.com/schema/component/component.xsd=com/foo/component.xsd]]>BeanDefinition for the
'checkingAccountService' so that it will have a dependency on this
new JCache-initializing BeanDefinition.
- Now onto the custom extension. Firstly, the authoring of the XSD schema describing the
custom attribute (quite easy in this case).
-
+
]]>Next, the associated NamespaceHandler.
- Next, the parser. Note that in this case, because we are going to be parsing an XML
attribute, we write a BeanDefinitionDecorator rather than a
BeanDefinitionParser.
- Referencing the schemas
To switch over from the DTD-style to the new XML Schema-style, you need
to make the following change.
-
+
@@ -60,7 +60,7 @@
]]>The equivalent file in the XML Schema-style would be...
-
+ util namespace are available to you.
-
+ xmlns:util="http://www.springframework.org/schema/util"<util:constant/>Before...
-
+
@@ -129,7 +129,7 @@ http://www.springframework.org/schema/beans http://www.springframework.org/schem
and clearly expresses the developer's intent ('inject this constant
value'), and it just reads better.
-
+
@@ -149,13 +149,13 @@ http://www.springframework.org/schema/beans http://www.springframework.org/schem
using the staticField
property:
-
]]>There is also a convenience usage form where the static
field is specified as the bean name:
- ]]>
This does mean that there is no longer any choice in what the bean id is (so
@@ -164,7 +164,7 @@ http://www.springframework.org/schema/beans http://www.springframework.org/schem
inner bean since the id doesn't have to be specified for the bean
reference:
-
+
@@ -183,7 +183,7 @@ http://www.springframework.org/schema/beans http://www.springframework.org/schem
as the FieldRetrievingFactoryBean). Let's look at an example
to see how easy injecting an enum value is; consider this JDK 5 enum:
- Now consider a setter of type PersistenceContextType:
- .. and the corresponding bean definition:
-
+
]]>
@@ -216,7 +216,7 @@ public class Client {
<util:property-path/>Before...
- <!-- target bean to be referenced by name --><!-- target bean to be referenced by name -->
@@ -235,7 +235,7 @@ public class Client {
property of the 'testBean' bean.
After...
- <!-- target bean to be referenced by name --><!-- target bean to be referenced by name -->
@@ -257,7 +257,7 @@ public class Client {
name. This value may then be used in another bean definition as a property
value or constructor argument.
Here's an example where a path is used against another bean, by name:
-
@@ -274,7 +274,7 @@ public class Client {
]]>In this example, a path is evaluated against an inner bean:
- <!-- will result in 12, which is the value of property 'age' of the inner bean --><!-- will result in 12, which is the value of property 'age' of the inner bean -->
@@ -285,14 +285,14 @@ public class Client {
]]>There is also a shortcut form, where the bean name is the property path.
- <!-- will result in 10, which is the value of property 'age' of bean 'person' --><!-- will result in 10, which is the value of property 'age' of bean 'person' -->]]>This form does mean that there is no choice in the name of the bean.
Any reference to it will also have to use the same id, which is the path.
Of course, if used as an inner bean, there is no need to refer to it at
all:
-
+
@@ -306,7 +306,7 @@ public class Client {
<util:properties/>Before...
- <!-- creates a java.util.Properties instance with values loaded from the supplied location --><!-- creates a java.util.Properties instance with values loaded from the supplied location -->
]]>
@@ -316,13 +316,13 @@ public class Client {
the supplied Resource location).
After...
- <!-- creates a java.util.Properties instance with values loaded from the supplied location --><!-- creates a java.util.Properties instance with values loaded from the supplied location -->]]><util:list/>Before...
- <!-- creates a java.util.List instance with values loaded from the supplied 'sourceList' --><!-- creates a java.util.List instance with values loaded from the supplied 'sourceList' -->
@@ -339,7 +339,7 @@ public class Client {
with values taken from the supplied 'sourceList'.
After...
- <!-- creates a java.util.List instance with values loaded from the supplied 'sourceList' --><!-- creates a java.util.List instance with values loaded from the supplied 'sourceList' -->pechorin@hero.orgraskolnikov@slums.org
@@ -351,7 +351,7 @@ public class Client {
attribute on the <util:list/> element. For example, if we
really need a java.util.LinkedList to be instantiated, we could
use the following configuration:
-
+ jackshaftoe@vagabond.orgeliza@thinkingmanscrumpet.orgvanhoek@pirate.org
@@ -367,7 +367,7 @@ public class Client {
<util:map/>Before...
- <!-- creates a java.util.Map instance with values loaded from the supplied 'sourceMap' --><!-- creates a java.util.Map instance with values loaded from the supplied 'sourceMap' -->