Commit Graph

7083 Commits

Author SHA1 Message Date
Rossen Stoyanchev
a5143057ce Add configurability for underlying WebSocket engine
Issue: SPR-10844
2013-08-22 20:35:03 -04:00
Rossen Stoyanchev
ccaa101252 Fix typo 2013-08-22 16:09:32 -04:00
Gabriel Axel
d66206704e Fix NPE in ResourceHttpMessageConverter
ResourceHttpMessageConverter tries to use the filename to determine the
media type, but for Resource implementations such as ByteArrayResource
it is null, which causes NullPointerException. The fix checks whether
getFilename returns null before attempting to determine the media type
by it.

Issue: SPR-10848
2013-08-22 16:05:44 -04:00
Rossen Stoyanchev
a455217743 Modify how SpringConfigurator finds Endpoint singleton
First try the endpoint type name converted to property
Then try @Component value

Issue: SPR-10605
2013-08-22 16:05:44 -04:00
Rossen Stoyanchev
c211c98b40 Support placeholder values in Spring MVC Test
Issue: SPR-10825
2013-08-22 16:05:44 -04:00
Dmitry Katsubo
47d40053a4 Add Jackson serialization inclusion to FactoryBean
Issue: SPR-10810
2013-08-22 16:05:44 -04:00
Rossen Stoyanchev
08d36cf2e4 Allow custom expand algorithm in UriComponents
Issue: SPR-10647
2013-08-22 16:05:44 -04:00
Rossen Stoyanchev
1fd7bc3ee5 Make MediaType serializable
Issue: SPR-8738
2013-08-22 16:05:44 -04:00
Juergen Hoeller
88115212eb Consistent xsd header formatting 2013-08-22 19:37:42 +02:00
Juergen Hoeller
3d462b6dd9 Added missing spring.schemas entries for 4.0 xsds
Also fixing an old XmlBeanFactory test that relies on "ref local" which is gone in the 4.0 xsd now, redeclaring the affected file to an older xsd version.
2013-08-22 19:36:53 +02:00
Juergen Hoeller
eb98f1f084 Added missing spring-jdbc-4.0.xsd 2013-08-22 19:33:01 +02:00
Juergen Hoeller
4a9af233ae @Autowired/@Inject with array/List value gets sorted against Ordered/@Order
Issue: SPR-5574
2013-08-22 16:43:10 +02:00
Rossen Stoyanchev
486a56dc1f Update TomcatRequestUpgradeStrategy for 8.0 RC1
While RC2 is not yet out, we need to support RC1 as well.
This change introduces temporary code that can be removed
once RC2 becomes available to avoid having to use Tomcat
snapshots.
2013-08-21 12:00:11 -04:00
Rossen Stoyanchev
0dcc5c048b Adjust SockJS use of ServerHttpResponse close vs flush 2013-08-21 12:00:11 -04:00
Rossen Stoyanchev
13ce20b1ca Remove IOException from HandshakeHandler 2013-08-21 12:00:11 -04:00
Rossen Stoyanchev
2397b21096 Upgrade spring-websocket to Tyrus 1.2.1
This targets currently nightly snapshots and future release
of Glassfish 4.0.1.
2013-08-21 12:00:11 -04:00
Rossen Stoyanchev
e5406283c5 Polish DefaultHandshakeHandler
After this change the DefaultHandshakeHandler delegates to a
server-specific RequestUpgradeStrategy to update the HTTP response for
the handshake request and to begin the WebSocket interaction.

The DefaultHandshakeHandler however still retains the initial
validation of the WebSocket handshake including negotation of origin,
sub-protocol, etc. This allows sub-classes to override various
aspects of the negotiation independant of the WebSocket engine.
2013-08-21 12:00:11 -04:00
Rossen Stoyanchev
48996cf572 Update ServerEndpointRegistration
In addition to implementing ServerEndpointConfig, the
ServerEndpointRegistration now also extends
ServerEndpointConfig.Configurator making it easier to override
handshake customization methods without having to extend a separate
class.
2013-08-21 12:00:11 -04:00
Rossen Stoyanchev
64d45fe0a5 Make use of Tomcat's new WsServerContainer.doUpgrade
Tomcat now provides a method for initiating a WebSocket upgrade at
runtime vs relying on JSR-356 deployment at startup. This change
switches to use that latest feature. For more information on the
Tomcat change see:

https://issues.apache.org/bugzilla/show_bug.cgi?id=55314#c7
2013-08-21 12:00:11 -04:00
Juergen Hoeller
f2fb0ec9e7 Minor polishing of related files
Issue: SPR-10181
2013-08-21 17:37:06 +02:00
Juergen Hoeller
6d3649858e Allow meta-annotations to override attributes from their parent
Issue: SPR-10181
2013-08-21 17:35:56 +02:00
Juergen Hoeller
87c2d6fd12 Updated build instructions to refer to OpenJDK 8 build 100 2013-08-20 22:44:05 +02:00
Juergen Hoeller
5d3d3c111b Revised JSR-303 references to include JSR-349 (Bean Validation 1.1) as well
Issue: SPR-10813
2013-08-20 22:38:17 +02:00
Juergen Hoeller
ea6525f15f GenericTypeResolver properly handles bound parameterized type
Issue: SPR-10819
2013-08-20 19:36:57 +02:00
Juergen Hoeller
da0128f120 Javadoc cleanup for Hibernate 3.6+ 2013-08-20 19:16:44 +02:00
Juergen Hoeller
a65bc3851b Introduced local support for Hibernate 3.6 and 4.x exception translation to HibernateJpaDialect
Since Hibernate 3.6 and 4.x differ in exception handling now, this change makes HibernateJpaDialect independent from orm.hibernate3 now and avoids introducing a conditional dependency on orm.hibernate4.

Issue: SPR-10815
2013-08-20 19:10:39 +02:00
Juergen Hoeller
c762b83a76 Explicit support for Hibernate 4.0's QueryTimeoutException, PessimisticLockException, PessimisticEntityLockException and OptimisticEntityLockException
Issue: SPR-10815
2013-08-20 19:06:24 +02:00
Juergen Hoeller
3b211335c7 Explicit support for Hibernate 3.6's QueryTimeoutException, PessimisticLockException and OptimisticLockException
Issue: SPR-10815
2013-08-20 19:05:23 +02:00
Juergen Hoeller
f3b223034d Explicit support for JPA 2.0's QueryTimeoutException, LockTimeoutException and PessimisticLockException
Issue: SPR-10815
2013-08-20 19:02:02 +02:00
Rossen Stoyanchev
68c0df8305 Polish StompBrokerRelayMessageHandler 2013-08-19 21:16:00 -04:00
Rossen Stoyanchev
94fefec0f9 Add ActiveMQ-based STOMP relay integration tests 2013-08-19 21:16:00 -04:00
Andy Wilkinson
3fb5ff2654 Improve broker availability events
Use a single class for the broker availability event with a boolean
that indicates whether or not the broker is available, rather than one
event for an available broker and one event for an unavailable broker.

Publish broker availability events in SimpleBrokerMessageHandler so that
it can be used as a drop-in replacement for
StompBrokerRelayMessageHandler.
2013-08-19 21:16:00 -04:00
Andy Wilkinson
131b5de6f9 Add reconnect logic to the relay's system session
Upgrade to Reactor snapshot builds to take advantage of TcpClient's
reconnect support that was added post-M1. Now, the system relay session
will try every 5 seconds to establish a connection with the broker, both
when first connecting and in the event of subsequently becoming
disconnected.

A more sophisticated reconnection policy, including back off and
failover to different brokers, is possible with the Reactor API. We may
want to enhance the relay's reconnection policy in the future.

Typically, a broken connection is identified by the failure to forward
a message to the broker. As things stand, the message id then discarded.
Any further messages that are forwarded before the connection's been
re-established are queued for forwarding once the CONNECTED frame's been
received. We may want to consider also queueing the message that failed
to send, however we would then need to consider the possibility of the
message itself being what caused the broker to close the connection
and resending it would simply cause the connection to be closed again.
2013-08-19 21:15:59 -04:00
Andy Wilkinson
8b48d8f445 Publish events about broker's availability
Components that are using a StompBrokerRelayMessageHandler may want
to know whether or not the broker's unavailable. If they're sending
messages to the relay via an asynchronous channel there's currently
no way for them to find this out.

This commit enhances StompBrokerRelayMessageHandler to publish
application events when the broker's availability changes:
BrokerBecameAvailableEvent and BrokerBecameUnavailableEvent.
Irrespective of the number of relay sessions only a single event is
published for each change in the broker's availability.
2013-08-19 21:15:59 -04:00
Andy Wilkinson
be6dbe54a3 Integration tests for the broker relay 2013-08-19 21:15:59 -04:00
Rossen Stoyanchev
71dbd7bc1f Remove qetQueryParams from ServerHttpRequest 2013-08-14 11:43:37 -04:00
Rossen Stoyanchev
4c0490a070 Remove Cookie support from ServerHttpRequest
Although ServletHttpRequest provides access to Cookies, other
implementations may not. At the moment this was only needed
for SockJS to check the value of the JSESSIONID cookie. This
is now down by parsing the raw cookie values locally.

If comprehensive cookie support is to be added, we should
probably consider HttpHeaders as a potential candidate.
2013-08-14 10:15:02 -04:00
Dmitry Katsubo
b232dc9d2b Add canRead/Write to MarshallingHttpMessageConverter
Issue: SPR-10463
2013-08-13 18:48:20 -04:00
Arjen Poutsma
37861c3f90 Support 'empty' StreamSource in Jaxb2Marshaller
Added support for StreamSources that do not have a InputStream or
Reader, but do have a System ID.

Issue: 10828
2013-08-13 18:14:45 -04:00
Rossen Stoyanchev
319f18dddf Add HandshakeInterceptor
A HandshakeInterceptor can be used to intercept WebSocket handshakes
(or SockJS requests where a new session is created) in order to
inspect the request and response before and after the handshake
including the ability to pass attributes to the WebSocketHandler,
which the hander can access through
WebSocketSession.getHandshakeAttributes()

An HttpSessionHandshakeInterceptor is available that can copy
attributes from the HTTP session to make them available to the
WebSocket session.

Issue: SPR-10624
2013-08-13 17:28:01 -04:00
Rossen Stoyanchev
9925d8385f Fix configuration issues in DefaultSockJsService 2013-08-13 17:28:00 -04:00
Rossen Stoyanchev
01feae0ad5 Polish WebSocketSession
Update methods available on WebSocketSession interface.
Introduce DelegatingWebSocketSession interface.
2013-08-13 17:28:00 -04:00
Sam Brannen
14ac023e01 Avoid use of repeated @Scheduled in tests
Commented out severalFixedRatesWithRepeatedScheduledAnnotation() until
we have full Java 8 support in the IDEs (e.g., Eclipse).

Issue: SPR-10532
2013-08-12 23:32:35 +02:00
Phillip Webb
171b35815e Merge pull request #328 from lonre/typo-fix
# By Lonre Wang
* typo-fix:
  Fix typo in reference docs
2013-08-12 14:25:24 -07:00
Lonre Wang
5549bd909e Fix typo in reference docs 2013-08-12 14:24:58 -07:00
Arjen Poutsma
d9bfac393b Added reference to CatchAllConverter
Added reference to CatchAllConverter in both javadoc and reference docs.

Issue: SPR-10821
2013-08-12 12:26:34 +02:00
Sam Brannen
c3dd9ff342 Add test with @Schedules container annotation
Issue: SPR-10532
2013-08-11 00:05:36 +02:00
Arjen Poutsma
5311e84c64 Added XStream CatchAllConverter
Added XStream CatchAllConverter that supports all classes, but throws
exceptions for (un)marshalling.

Main purpose of this class is to register this converter as a catchall
last converter with a normal or higher priority in addition to
converters that explicitly  support the domain classes that should be
supported. As a result, default XStream  converters with lower
priorities and possible security vulnerabilities do not get invoked.
2013-08-09 08:43:29 -04:00
Juergen Hoeller
b27e240fdb Consistent use of varargs, consistent template method order 2013-08-09 11:43:20 +02:00
Juergen Hoeller
92e3c52a48 XStreamMarshaller exposes public marshal methods with DataHolder parameter
Also splitted buildXStream into constructXStream and configureXStream now.

Issue: SPR-10421
2013-08-09 11:41:52 +02:00