Commit Graph

7873 Commits

Author SHA1 Message Date
Rossen Stoyanchev
d4a0e628d5 Add initial cut of expanded resource handling
Issue: SPR-10933, SPR-10310
2013-09-27 21:09:53 -04:00
Rossen Stoyanchev
5a2e30c18b Refactor Resource URL generation and Servlet Filter
Renamed ResourceUrlMapper to ResourceUrlGenerator and refactored it
to be configured with Resource-serving HandlerMappings as opposed to
having them detected in the ApplicationContext through the
BeanPostProcessor contact.

Renamed and polished ResourceUrlEncodingFilter to ResourceUrlFilter
and added tests.
2013-09-27 21:07:31 -04:00
Rossen Stoyanchev
3c48b42106 Refactor ResourceResolverChain + resolver class names
This change splits out resource transformation out from the
ResourceResolverChain so that chain is focused entirely on resource
resolution (as its name suggests). The invocation of transformers
is left as a separate step, it uses a different (recursive)
algorithm in any case and iterates over a different set of objects.

Also ResourceResolverChain is now limited strictly to methods that
a ResourceResolver should be able to use to delegate to remaining
resolvers.

Furthermore, ResourceResolverChain now maintains an internal index
of the "current" resolver so that resolvers don't have to pass the
chain when invoking it much like a (Servlet API) FilterChain works.
If the last resolver calls the chain again, a null value is returned.
2013-09-27 21:07:31 -04:00
Rossen Stoyanchev
0e58125b15 Polish 2013-09-27 21:07:31 -04:00
Jeremy Grelle
61e61bd5fd Asset pipeline proposal. 2013-09-27 21:07:31 -04:00
Phillip Webb
8abe949734 Fix ArrayStoreException reading subclassed enums
Fix ASM AnnotationAttributesReadingVisitor to correctly deal with
subclasses enums.

Issue: SPR-10914
2013-09-27 11:25:57 -07:00
Rossen Stoyanchev
f3611e767e Merge pull request #364 from mikesir87/ws-glassfish4-support
* mikesir87-ws-glassfish4-support:
  Added websocket upgrade support for GlassFish 4.0
2013-09-27 08:57:38 -04:00
Michael Irwin
f1e929f38d Added websocket upgrade support for GlassFish 4.0
Commit 2397b21096 changed websocket
support to use GlassFish 4.0.1 nightlies, but broke support for 4.0. In
GlassFish 4.0.1, the package that TyrusEndpoint is located in changed.
This commit provides an abstract handler that does all required
GlassFish setup, but delegates to version specific upgrade handlers to
create the final TyrusEndpoint.

GlassFish 4.0 handler uses reflection to create its endpoint to prevent
dependency issues of depending on different versions of
tyrus-websocket-core and tyrus-container-servlet
2013-09-27 08:54:43 -04:00
Rossen Stoyanchev
c06ea3b437 Polish logging 2013-09-26 21:27:11 -04:00
Phillip Webb
6ca8346ebd Remove unused snapshot repository definition 2013-09-26 15:44:30 -07:00
Rossen Stoyanchev
d5dfd1b4ad Merge multiple pull requests from wilkinsona
* broker-relay:
  Polish
  Improve handling of missed heartbeats
  Upgrade to Reactor 1.0.0.M3
  Add heart-beat support to STOMP broker relay
  Remove CONNECT-related message buffer from STOMP relay
  Add StompCodec
2013-09-26 16:09:01 -04:00
Rossen Stoyanchev
469aaa8754 Polish 2013-09-26 16:06:35 -04:00
Andy Wilkinson
6679feb77b Improve handling of missed heartbeats
Previously, when a broker heartbeat was mnissed, the STOMP connection
would be left in a semi-disconnected state such that, for example, the
read and write idle callbacks would still be active, even though
the underlying TCP connection had been nulled out.

As part of disconnecting the STOMP connection, this commit closes the
underlying TCP connection when a heartbeat's missed which cancels the
read and write idle callbacks. It also now copes with the underlying
TCP connection being null when sending a heartbeat to the broker. This
protects again a race condition between the write idle callback being
fired, such that a heartbeat needs to be sent, and the connection
being nulled out due to it being closed.
2013-09-26 16:06:35 -04:00
Andy Wilkinson
bae9134a6e Upgrade to Reactor 1.0.0.M3 2013-09-26 16:06:35 -04:00
Andy Wilkinson
496d8321c3 Add heart-beat support to STOMP broker relay
Previously, the STOMP broker relay did not support heart-beats. It sent
0,0 in the heart-beats header for its own CONNECTED message, and set the
heart-beats header to 0,0 when it was forwarding a CONNECTED from from a
client to the broker.

The broker relay now supports heart-beats for the system relay session.
It will send heart-beats at the send interval that's been negotiated
with the broker and will also expect to receive heart-beats at the
receive interval that's been negotiated with the broker. The receive
interval is multiplied by a factor of three to satisfy the STOMP spec's
suggestion of lenience and ActiveMQ 5.8.0's heart-beat behaviour (see
AMQ-4710).

The broker relay also supports heart-beats between clients and the
broker. For any given client's relay session, any heart-beats received
from the client are forwarded on to the broker and any heart-beats
received from the broker are sent back to the client.

Internally, a heart-beat is represented as a Message with a byte array
payload containing the single byte of new line ('\n') character and
'empty' headers. SubscriptionMethodReturnValueHandler has been updated
to default the message type to SimpMessageType.MESSAGE. This eases
the distinction between a heartbeat and a message that's been created
from a return value from application code.
2013-09-26 16:06:35 -04:00
Andy Wilkinson
8d2a376b0f Remove CONNECT-related message buffer from STOMP relay
Before this change, the StompProtocolHandler always responded to
clients with a CONNECTED frame, while the STOMP broker relay
independantly forwarded the client CONNECT to the broker and waited
for the CONNECTED frame back. That meant the relay had to buffer
client messages until it received the CONNECTED response from
the message broker.

This change ensures that clients wait for a CONNECTED frame from
the message broker. The broker relay forwards the CONNECT frame to
the broker. The broker responds with a CONNECTED frame, which the
relay then forwards to the client. As a result, a (well-written)
client will not send any messages to the relay until the connection
to the broker is fully established.

The StompProtcolHandler can now be configured whether to send CONNECTED
frame back. By default that is off. So when using the simple broker,
the StompProtocolHandler can still respond with CONNECTED frames.

The relay's handling of a connection being dropped has also been
improved. When a connection for a client relay session is dropped
an ERROR frame will be sent back to the client. If a connection is
closed as part of a DISCONNECT frame being sent, no ERROR frame
is sent back to the client. When the connection for the system relay
session is dropped, an event is published indicating that the broker
is unavailable. Reactor's TcpClient will then attempt to re-restablish
the connection.
2013-09-26 16:06:35 -04:00
Andy Wilkinson
a489c2cf38 Add StompCodec
Previously, the broker relay's TCP client used Reactor's built in
delimited codec as part of its parsing of STOMP frames. \0 was used as
the delimiter. This worked for most STOMP frames but, crucially,
not for frames with a body that contained \0: when such a frame was
received it would be truncated.

This commit adds a custom codec that parses STOMP frames more
intelligently. It honours the content-length header allowing it to
correctly parse frames with a body that contains \0. The codec largely
delegates to two new classes: StompEncoder and StompDecoder. For
consistency, code that previously used StompMessageConverter has been
reworked to use these new encoder and decoder classes.

Issue: SPR-10818
2013-09-26 16:06:34 -04:00
Juergen Hoeller
f705ec1a46 Added ASPECTJ and REGEX constants to FilterType, along with a corresponding 'pattern' attribute on ComponentScan.Filter
Issue: SPR-10593
2013-09-26 21:16:46 +02:00
Juergen Hoeller
11d20e337d Silently swallow IllegalStateException on commit if the JMS transaction is based on a JDBC transaction
This fine-tuned change restores the original Spring 3.0 behavior for Oracle AQ, and also allows for other ConnectionFactory types to comply with the "getDataSource()" pattern.

Issue: SPR-10829
2013-09-26 20:27:46 +02:00
Juergen Hoeller
d3f063d0f9 After-returning advice strictly follows AspectJ's rules for return value matching
Issue: SPR-10834
2013-09-26 20:27:45 +02:00
Rossen Stoyanchev
77fa8698b3 Enable cookie_needed by default in SockJS service
Issue: SPR-10939
2013-09-26 12:52:59 -04:00
Sam Brannen
e756ef5923 Merge pull request #363 from mikesir87/STS-url-fix
Fixed URLs in import-into-eclipse scripts
2013-09-26 03:48:41 -07:00
Michael Irwin
27820bfc8a Fixed URLs in import-into-eclipse scripts 2013-09-25 16:56:10 -04:00
Rossen Stoyanchev
a64441e129 Merge pull request #359 from bclozel/SPR-10481
* bclozel-SPR-10481:
  Add NoHandlerFoundException to DispatcherServlet
2013-09-25 14:12:48 -04:00
Brian Clozel
62d6a43c61 Add NoHandlerFoundException to DispatcherServlet
Prior to this commit, the DispatcherServlet would send an error
response using the HttpServlet API when no Handler was found to
handle this request.

Now the DispatcherServlet can be configured to throw a
NoHandlerFoundException, when the throwExceptionIfNoHandlerFound
property is set to "true".
Those exceptions can be later on caught by default or custom
HandlerExceptionResolvers/ExceptionHandlers.

Issue: SPR-10481
2013-09-25 14:11:01 -04:00
Rossen Stoyanchev
4ef490621f Merge pull request #358 from bclozel/SPR-10539
* bclozel-SPR-10539:
  Polish
  Add IPv6 support in RestTemplate
2013-09-25 13:58:53 -04:00
Phillip Webb
b409ba0076 Remove accidentally committed test case 2013-09-25 10:43:23 -07:00
Rossen Stoyanchev
92795f463a Polish
Issue: SPR-10539
2013-09-25 12:47:50 -04:00
Brian Clozel
2dd4480103 Add IPv6 support in RestTemplate
Prior to this commit, RestTemplate would not would
not accept IPv6 raw addresses in URLs because UriComponentsBuilder
would not parse/encode the Host part correctly.

The UriComponentsBuilder now parses and encode raw IPv6 addresses
in the "[1abc:2abc:3abc::5ABC:6abc]" format and also supports the
use of IPv6 scope_ids (see JDK8 java.net.Inet6Address),
like "[1abc:2abc:3abc::5ABC:6abc%eth0]".

Issue: SPR-10539
2013-09-25 16:28:12 +02:00
Juergen Hoeller
beaf6992b2 Fixed BadSqlGrammarException usage in transaction test suite
Issue: SPR-10902
(cherry picked from commit ef66708)
2013-09-25 14:11:10 +02:00
Juergen Hoeller
5e88fe5842 Clarified Spring 4.0's dependency on JAX-WS 2.1+ / JAXB 2.1+ in javadoc 2013-09-25 12:54:25 +02:00
Juergen Hoeller
7b63745e04 Ignore setAliasesByType tests since they fail on OpenJDK 8 b108
Probably an XStream-internal problem: fails to marshal the flightNumber element.
2013-09-25 12:34:53 +02:00
Juergen Hoeller
d9b620381e Removed S0 from BadSqlGrammarException codes
S0 doesn't seem to be universally used for SQL grammar problems: see MS SQL Server's RAISERROR. This was reported years back; not sure why the fix didn't actually appear in the codebase back then.

Issue: SPR-10902
2013-09-25 12:30:01 +02:00
Juergen Hoeller
7bc3e3b3f8 Fixed handling of @Resource's shareable value
Issue: SPR-10931
2013-09-25 12:27:17 +02:00
Phillip Webb
783871a42a Restore 'maven.java.net' repository
Restore 'maven.java.net' repository accidentally removed in commit
2337e763.
2013-09-25 11:21:55 +02:00
Fedor Bobin
dac6aaecc8 Allow cursor returns from SQL functions
Update CallMetaDataContext to use the metaDataProvider
createDefaultOutParameter method when creating a SqlOutParameter as
a result of a SQL function call.

This change allows Spring to support Oracle cursor types when returned
from functions.

Issue: SPR-10606
2013-09-24 16:18:09 -07:00
Phillip Webb
b1b355289b Restore 'maven.java.net' repository
Restore 'maven.java.net' repository accidentally removed in commit
2337e763.
2013-09-24 16:18:02 -07:00
Phillip Webb
371d255581 Fix typo in MVC reference documentation
Fix ContentNeogitatingViewResolver typo in MVC reference documentation.

Issue: SPR-10927
2013-09-23 16:05:00 -07:00
Phillip Webb
4abe4e9999 Add IssueManagement declaration to POMs
Update POM generation to include an issueManagement section.

Issue: SPR-10929
2013-09-23 15:59:28 -07:00
Phillip Webb
05072e1762 Expand var-args before passing to KeyGenerator
Update `CacheAspectSupport` to expand any var-arg parameters before
calling `KeyGenerator` implementations. Prior to this commit var-args
would be passed to `KeyGenerator` implementations as a nested array,
often causing the same key to be generated regardless of the arguments.

Issue: SPR-10870
2013-09-23 15:14:58 -07:00
Phillip Webb
2337e763d0 Fix tomcat maven repo location and use spring.io
Fix the maven repo used for tomcat 8 release candidates and update
spring repos from springsource.org to spring.io.
2013-09-23 15:10:37 -07:00
Rossen Stoyanchev
a5c7018e8d Switch spring-websocket/messaging to Tomcat 8 RC3 2013-09-23 13:14:44 -04:00
Phillip Webb
17d59c5621 Merge pull request #357 from clemp6r/patch-2
# By Clément Plantier
* patch-2:
  Fix "Problem locating method" SpEL error message
2013-09-20 11:39:38 -07:00
Clément Plantier
824ac535d2 Fix "Problem locating method" SpEL error message
Replace "Problem locating method {0} cannot on type {1}" with
"Problem locating method {0} on type {1}".

Issue: SPR-10928
2013-09-20 11:38:51 -07:00
Juergen Hoeller
55f250afbc Fixed javadoc references 2013-09-14 07:33:49 +02:00
Juergen Hoeller
a3df311bb5 EhCacheFactoryBean calls addCache after listener registration
Issue: SPR-10904
2013-09-14 07:33:48 +02:00
Juergen Hoeller
e213561dac AbstractBeanFactory removes alreadyCreated entry after bean creation failure
Issue: SPR-10896
2013-09-14 07:33:47 +02:00
Rob Winch
0ee910c61a Add test for StandardReflectionParameterNameDiscoverer
Added test to StandardReflectionParameterNameDiscoverer that
demonstrates discovering of parameter names on an interface.

Issue: SPR-9643
2013-09-13 21:23:44 -07:00
Phillip Webb
c9ce7aac37 Merge pull request #327 from olivergierke/SPR-10594
# By Oliver Gierke
* SPR-10594:
  Add support for Objenesis proxy creation.
2013-09-12 16:32:34 -07:00
Oliver Gierke
1f9e8f68d4 Add support for Objenesis proxy creation.
Extended DefaultAopProxyFactory to create Objenesis based proxies if the
library is on the classpath. This allows classes without a default
constructor being CGLib proxied. We're now falling back to original CGLib
based behavior in case the proxy creation using Objenesis fails.

Objenesis 2.0 is now inlined into spring-core to avoid interfering with
other Objenesis versions on the classpath.

Issue: SPR-10594
2013-09-12 16:32:27 -07:00