文档库 最新最全的文档下载
当前位置:文档库 › spring-blazeds-reference

spring-blazeds-reference

spring-blazeds-reference
spring-blazeds-reference

Spring BlazeDS Integration Reference Guide

Version1.5.2.RELEASE

November2011

Jeremy Grelle(SpringSource)

Copyright?2010-2011

Copies of this document may be made for your own use and for distribution to others,provided that you do not charge any fee for such copies and further provided that each copy contains this Copyright Notice,whether

distributed in print or electronically.

1.Spring BlazeDS Integration Overview (1)

1.1.Background (1)

1.2.Minimum major dependency versions Spring BlazeDS Integration1.5requires to run (1)

1.3.Minimum major dependency versions required by optional features (1)

1.4.Where to get support (1)

2.Configuring and Using the BlazeDS MessageBroker with Spring (2)

2.1.Introduction (2)

2.2.Configuring the Spring DispatcherServlet (2)

2.3.Configuring the MessageBroker in Spring (2)

2.4.Mapping Requests to the MessageBroker (3)

https://www.wendangku.net/doc/4614737767.html,ing Flex clients alongside Spring MVC Controllers (4)

https://www.wendangku.net/doc/4614737767.html,ing Spring-managed Destinations from the Flex Client (6)

2.7.Advanced MessageBroker Customization (6)

https://www.wendangku.net/doc/4614737767.html,ing Custom Exception Translators (7)

https://www.wendangku.net/doc/4614737767.html,ing Custom Message Interceptors (7)

2.9.1.Resource Handling with Custom Message Interceptors (8)

2.9.2.Customizing the Message Interceptor Chain (8)

2.10.Providing Custom Service Adapters (9)

3.Exporting Spring Beans for Flex Remoting (10)

3.1.Introduction (10)

3.2.Configuring the Remoting Service (10)

https://www.wendangku.net/doc/4614737767.html,ing the remoting-destination Tag (11)

3.4.Exporting Beans for Remoting with@RemotingDestination (12)

3.4.1.Supplying Externalized Channel Ids (12)

https://www.wendangku.net/doc/4614737767.html,municating with RESTful Spring MVC Endpoints using AMF (14)

4.1.Introduction (14)

https://www.wendangku.net/doc/4614737767.html,ing AmfView (14)

https://www.wendangku.net/doc/4614737767.html,ing AmfHttpMessageConverter (15)

4.4.Interacting with RESTful AMF Endpoints from the Flex Client (16)

5.Enhanced AMF Support (17)

5.1.Customizing AMF Conversion (17)

5.1.1.Configuring AMF Type Conversion (17)

5.2.Working with Hibernate (21)

5.2.1.Configuring Hibernate Entity Serialization/Deserialization Support (21)

https://www.wendangku.net/doc/4614737767.html,ing Classpath Scanning for AMF Configuration (21)

6.Securing BlazeDS Destinations with Spring Security (23)

6.1.Introduction (23)

6.1.1.A simple Spring Security3configuration (23)

6.1.2.Enabling the Spring Security filter chain in web.xml (24)

6.2.Configuring the Spring Security Integration (24)

https://www.wendangku.net/doc/4614737767.html,ing a Custom LoginCommand (25)

6.2.2.Accessing User Details (25)

6.2.3.Security Exception Translation (25)

6.2.4.secured Configuration Attributes (26)

6.3.Configuring Endpoint and Destination Security (26)

6.3.1.Securing Specific BlazeDS Channels (26)

6.3.2.Securing BlazeDS Channels by Endpoint URL Path (27)

6.3.3.Securing Exported Spring Services (27)

7.Integration with the BlazeDS Message Service (29)

7.1.Introduction (29)

Spring BlazeDS Integration

https://www.wendangku.net/doc/4614737767.html,ing JMS Message Destinations (31)

https://www.wendangku.net/doc/4614737767.html,ing Spring Integration Message Destinations (31)

7.6.Sending AMF Messages with the MessageTemplate (31)

8.Building and Running the Spring BlazeDS Integration Samples (33)

8.1.Introduction (33)

8.1.1.Maven Setup (33)

8.1.2.Building and Running the Test Drive (33)

https://www.wendangku.net/doc/4614737767.html,ing BlazeDS4with Maven (33)

8.1.4.Download the Pre-packaged Test Drive (34)

8.1.5.Importing and Running the Test Drive in Eclipse (34)

Chapter1.Spring BlazeDS Integration Overview

1.1.Background

Spring has always aimed to be agnostic to the client technologies being used to access its core services, intentionally leaving options open and letting the community drive the demand for any new first-class integration solutions to be added to the Spring project portfolio.Spring BlazeDS Integration is an answer to the commmunity demand for a top-level solution for building Spring-powered Rich Internet Applications using Adobe Flex for the client-side technology.

BlazeDS is an open source project from Adobe that provides the remoting and messaging foundation for connecting a Flex-based front-end to Java back-end services.Though it has previously been possible to use BlazeDS to connect to Spring-managed services,it has not been in a way that feels"natural"to a Spring developer,requiring the extra burden of having to maintain a separate BlazeDS xml configuration.Spring BlazeDS Integration turns the tables by making the BlazeDS MessageBroker a Spring-managed object,opening up the pathways to a more extensive integration that follows"the Spring way".

1.2.Minimum major dependency versions Spring BlazeDS Integration1.5requires to run

Java5

Spring3.0

Adobe BlazeDS4.0

1.3.Minimum major dependency versions required by optional features

Spring Security3.0

Spring Integration2.0

Hibernate3.5

1.4.Where to get support

Professional from-the-source support on Spring BlazeDS Integration is available from SpringSource,the company behind Spring.

Chapter2.Configuring and Using the BlazeDS MessageBroker with Spring

2.1.Introduction

The central component that must be configured to use Spring BlazeDS Integration is the MessageBroker.HTTP messages from the Flex client will be routed through the Spring DispatcherServlet to the Spring-managed MessageBroker.There is no need to configure the BlazeDS MessageBrokerServlet when using the Spring-managed MessageBroker.

2.2.Configuring the Spring DispatcherServlet

The DispatcherServlet must be configured as normal in web.xml to bootstrap a Spring WebApplicationContext.For example:

2.3.Configuring the MessageBroker in Spring

A simplified Spring XML config namespace is provided for configuring the MessageBroker in your WebApplicationContext.To use the namespace support you must add the schema location in your Spring XML config files.A typical config will look something like the following:

This makes the Spring BlazeDS Integration configuration tags available under the flex namespace in your configuration files.The above setup will be assumed for the rest of the configuration examples to follow.For the full detail of every attribute and tag available in the config namespace,be sure to refer to the

Configuring and Using the BlazeDS MessageBroker with

At a minimum,the MessageBrokerFactoryBean must be configured as a bean in your Spring WebApplicationContext in order to bootstrap the MessageBroker,along with a MessageBrokerHandlerAdapter and an appropriate HandlerMapping(usually a SimpleUrlHandlerMapping)to route incoming requests to the Spring-managed MessageBroker.

These beans will be registered automatically by using the provided message-broker tag in your bean definition file.For example,in its simplest

form:

classpath:

may be used.For example,to load the configuration from the application's

be:

The equivalent MessageBrokerFactoryBean definition using vanilla Spring configuration would Array Note especially that with the message-broker tag,it is not necessary to assign a custom id to the MessageBroker,and it is in fact discouraged so that you won't have to continually reference it later.The only reason you would ever need to provide a custom id is if you were bootstrapping more than one MessageBroker in the same WebApplicationContext.

2.4.Mapping Requests to the MessageBroker

To properly route incoming requests to the Spring-managed MessageBroker,request mapping must be configured in three places:

1.DispatcherServlet mapping in web.xml

2.HandlerMapping in the Spring WebApplicationContext

3.Channel definitions in the BlazeDS services-config.xml

The simplest request mapping scenario is when the Flex front-end is the only client type for the application.In this case you can just map/messagebroker as the top-level path for requests.The mapping in web.xml would be:

Spring

When using the message-broker config tag,a SimpleUrlHandlerMapping is installed that by default maps all incoming DispatcherServlet requests to the Spring-managed MessageBroker using a/*path pattern.The default mapping can be overridden by providing one or more mapping child elements.If you want to provide your own HandlerMapping bean configuration,you can disable the default using the disable-default-mapping attribute of the message-broker tag.The order of the installed SimpleUrlHandlerMapping can be set(for complex scenarios where multiple handler mapping types are installed in the same context)using the mapping-order attribute.

The SimpleUrlHandlerMapping in the Spring WebApplicationContext maps all requests to the Spring-managed MessageBroker via the MessageBrokerHandlerAdapter.The default setup installed by the message-broker

definitions:

config tag is equivalent to the following bean

to set up a typical AMF channel in BlazeDS that matches the above mapping

strategy:

https://www.wendangku.net/doc/4614737767.html,ing Flex clients alongside Spring MVC Controllers

It could often be the case that your application needs to serve more than just Flex-based clients.For example, you may be constructing a RESTful architecture that is meant to serve multiple client-types.You could potentially even be consuming RESTful endpoints using the Flex HTTPService component.Spring MVC's controller model provides a simple,flexible means to create such RESTful endpoints.In these sorts of hybrid web application secenarios,you will need to consider an alternate mapping strategy.

The simplest approach is to use a hierarchical application context with multiple DispatcherServlets.In this approach,you configure your main application layer(services,security,supporting infrastructure,etc)in a

child DispatcherServlet context.This approach could look as follows in

web.xml:

Here the parent application context is being assembled from a group of files ending in -context.xml contained in the /WEB-INF/spring/directory.The child context for the Flex-specific setup would be built (by convention)from /WEB-INF/flex-servlet.xml ,and the context for the Spring MVC controllers would be built from /WEB-INF/spring-mvc-servlet.xml .This approach provides a nice separation of concerns and will allow Spring 2.5+annotated controllers to work using their default configuration.

An alternate approach is to keep things consolidated under one DispatcherServlet context.The down-side to this approach is that it requires some additional manual configuration,and you have to modify your mapping approach accordingly,such as mapping /spring/*to the DispatcherServlet ,mapping /messagebroker/*to the Spring-managed MessageBroker via the mapping XML namespace config tag,and modifying any BlazeDS channel definitions accordingly.You would override the default mapping strategy of the message-broker tag as

follows:

and you would have to account for the /spring/*mapping in your BlazeDS channel definitions.For

example:Configuring and Using the BlazeDS MessageBroker with

Spring

In addition to setting up the consolidated mapping strategy,you will also have to manually enable the correct HandlerMapping and HandlerAdapter for your Spring MVC controllers as described in the Spring MVC documentation,due to the fact that alternate HandlerMapping and HandlerAdapter beans are configured

automatically when using the message-broker tag.

https://www.wendangku.net/doc/4614737767.html,ing Spring-managed Destinations from the Flex Client Explicit channel definition is a requirement when using dynamic destinations(meaning any destination that is

added programmatically and not defined in the BlazeDS services-config.xml,i.e.the destinations created by the remoting-destination tag and the various*-message-destination tags).See Adobe's documentation for more detail.

The only way you don't have to explicitly define the ChannelSet on the client is if

1.you are using explicitly defined destinations in services-config.xml(i.e,not dynamic destinations)AND you

compile your flex client against that file

2.your destination is using the application-wide default channel AND you compile your flex client against that

file

Even if you weren't using dynamically created destinations it is debatable whether it is a good idea to ever compile your client against services-config.xml,thus coupling your client to your server configuration.It is often desirable to keep your flex client and your server side code as two distinct modules,but compiling against services-config.xml blurs the lines between those modules.

Our recommendation is that it is generally cleaner to keep the client-side configuration of ChannelSets explicitly contained within the client module.An excellent way to do this without having to hard-code the URLs in your client code is to use an ActionScript DI framework such as Spring ActionScript(a Spring Extensions project,formerly known as Prana).

If you choose to go the route of compiling your client against services-config.xml,note that you can at least keep the URL information out of the client code by using ServerConfig.getChannel as described in the referenced BlazeDS documentation.

2.7.Advanced MessageBroker Customization

The initialization of the MessageBroker by the MessageBrokerFactoryBean logically consists of two phases:

1.Parsing the BlazeDS XML configuration files and applying their settings to a newly created MessageBroker

2.Starting the MessageBroker and its services

A special MessageBrokerConfigProcessor callback interface is provided that allows custom processing to be done on the newly created MessageBroker after each phase,before it is made available for request processing. This interface is used internally by Spring BlazeDS Integration,but is also available for general use in advanced programmatic introspection and customization of the MessageBroker.A custom MessageBrokerConfigProcessor can be configured as a Spring bean and then registered with the MessageBrokerFactoryBean via the config-processor tag.For example,given a trivial implementation to log

Configuring and Using the BlazeDS MessageBroker with

follows:

This class could be configured and registered with the MessageBroker as

https://www.wendangku.net/doc/4614737767.html,ing Custom Exception Translators

In order to propagate useful information back to the Flex client when an exception occurs on the server,the original exception must be translated into an instance of flex.messaging.MessageException.If special translation logic is not applied,a generic"Server.Processing"error will propagate to the client that doesn't give the client the chance to reason on the real cause of the error to take appropriate action.Special exception translators are configured by default for transforming Spring Security exceptions into an appropriate MessageException,but it could also be useful to provide custom translation for your own application-level exceptions.

Custom exception translation logic can be provided through implementations of the org.springframework.flex.core.ExceptionTranslator interface.These implementations must be

follows:

configured as Spring beans and then registered through the XML configuration namespace as

Spring

messages in their de-serialized Java form.For example,an interceptor can be used to inspect the contents of the incoming message,or to add extra information to the outgoing message.

Custom message processing logic is provided through implementations of the

org.springframework.flex.core.MessageInterceptor interface.These implementations must be configured

follows:

as Spring beans and then registered through the XML configuration namespace as

For housekeeping purposes,an additional

org.springframework.flex.core.ResourceHandlingMessageInterceptor interface is available to use. Interceptors that implement this extended interface receive an additional guaranteed callback after message processing is completed,whether processing was successful or failed due to an exception being thrown by the Endpoint.This allows the interceptor to clean up any resources that it may have been using.This interface extends the basic MessageInterceptor interface,thus it is configured the same way using the message-interceptor tag.

2.9.2.Customizing the Message Interceptor Chain

The framework installs a number of predefined MessageInterceptors that are automatically configured through the use of the configuration namespace.These interceptors are configured in a specific order,and any custom interceptors are by default added to the beginning of the chain,in the order that their message-interceptor elements appear.It is possible to specify an explicit order via the position,before,and

after attributes.The position attribute allows the user to*override*the framework-supplied interceptor at

that position,or to simply specify that the interceptor should be at the beginning or end of the chain by using

the FIRST and LAST values respectively.The before and after attributes allow specifying position*relative to*

the framework-supplied filters.

The ordering and implementation of the framework-supplied filters is shown in the table below.

Table2.1.Standard Interceptor Aliases and Ordering

Alias MessageInterceptor Class Namespace

Element or

Attribute

PER_CLIENT_AUTH_INTERCEPTOR PerClientAuthenticationInterceptor message-broker/

secured@

per-client-authentication

LOGIN_MESSAGE_INTERCEPTOR LoginMessageInterceptor message-broker/

secured

Alias MessageInterceptor Class Namespace

Element or

Attribute

secured-endpoint-path

or message-broker

/secured /

secured-channel

2.10.Providing Custom Service Adapters

Using the XML config namespace

automatically installs the needed implementations of flex.messaging.services.ServiceAdapter for use with the Remoting and Message services.Third-party adapters (such as those provided by the dpHibernate or Gilead projects)can be configured using the org.springframework.flex.core.ManageableComponentFactoryBean .This factory bean implementation is able to process arbitrarily complex configuration metadata supplied in JSON format (instead of arbitrarily complex XML as in the native BlazeDS configuration)and honors the lifecycle semantics (such as proper invocation of the initialize method)of the ManageableComponent.These custom adapters may be used by Spring-managed Remoting and Message destinations by either setting its id as the default for the Remoting or Message service,or by setting the service-adapter attribute for a specific destination (see the Remoting and Messaging chapters for further detail).

For example,to use the special adapter provided by dpHibernate as the default adapter with the Remoting service,the configuration would

be similar to the following:

Configuring and Using the BlazeDS MessageBroker with

Chapter3.Exporting Spring Beans for Flex Remoting

3.1.Introduction

Using a Spring-managed MessageBroker enables Spring beans to be easily exported for direct remoting calls from a Flex client.This approach is quite similar to that taken with other remoting technologies in the core Spring Framework.Remoting is applied to existing Spring-managed beans as an external configuration concern.The MessageBroker transparently handles the process of serialization and deserialization between the Flex AMF data format and Java.

3.2.Configuring the Remoting Service

The BlazeDS RemotingService has traditionally been configured by the inclusion of a remoting-config.xml file in the BlazeDS XML configuration.When using only Spring-managed remoting destinations,this config file can be left out completely as the inclusion of the message-broker tag in your Spring configuration will cause the RemotingService to be configured with sensible defaults if none already exists at startup time.The end result is essentially equivalent to including the following minimal remoting-config.xml in your BlazeDS configuration:

Note that this assumes that there is already an equivalent application-wide default-channels configuration.It is recommended that you set the desired service-specific channels(see example below)if not relying on an application-wide default setup.If no application-wide defaults exist,a best guess will be made by configuring the first available channel from the MessageBroker that uses an AMFEndpoint as the default for the RemotingService.

If you wish to have more explicit control over the defaults that will be set on the RemotingService,you can customize them via the remoting-service child element of the message-broker tag.For example:

RemotingDestinationExporter will be able to work transparently with it,allowing you to gradually migrate to all Spring-managed remoting destinations.

https://www.wendangku.net/doc/4614737767.html,ing the remoting-destination Tag

The remoting-destination configuration tag can be used to export existing Spring-managed services for direct remoting from a Flex client.Given the following Spring bean definition for a productService bean:

and assuming the existance of a Spring-managed MessageBroker configured via the message-broker tag,the following top-level remoting-destination tag will expose the service for remoting to the Flex client as a remote service destination named productService:

By default,the remote service destination exposed to the Flex client will use bean name of the bean being exported as the service id of the destination,but this may be overridden using the destination-id attribute on the remoting-destination tag.

An alternate way of using the remoting-destination tag is as a child element of an top-level bean definition. This is even more concise and works well if you don't have a need to keep your domain-layer bean definitions separate from infrastructure concerns such as Flex remoting.(Keep in mind that keeping them separate can lead to easier testability of the core domain layer.)The following achieves the equivalent result to the previous example:

The methods that are exposed to be called by the Flex client can be more tightly controlled through use of the include-methods and exclude-methods attributes of the remoting-destination tag.The BlazeDS channels over which the destination is exposed can also be controlled using the channels attribute.(These attributes are available whether using the top-level or the nested version.)A more extensively customized example would look something like:

The remoting-destination tag is transparently configuring a RemotingDestinationExporter bean instance for each bean being exported.The equivalent full bean syntax without the namespace support would be:

3.4.Exporting Beans for Remoting with

@RemotingDestination

The@RemotingDestination annotation may be used as an alternative to the XML remoting-destination tag when using annotation-based Spring configuration.@RemotingDestination is used at the type level to indicate the class being exported.@RemotingInclude and@RemotingExclude are used at the method level to mark the methods that should be included and excluded for remoting.

The following example illustrates the productService bean configured exclusively through annotations:

3.4.1.Supplying Externalized Channel Ids

One potential drawback of the@RemotingDestination approach is the potential need to hard-code AMF channel ids in multiple classes throughout your codebase.The specification of the channels property is optional(if not specified,the defaults for the RemotingService will be used),but in cases where they do need to be specified,one shouldn't need to edit all instances of@RemotingDestination any time the channel identifiers change.To support this need,the channels attribute is able to resolve values supplied in the ApplicationContext through a PropertyPlaceholderConfigurer.For example,the previous hardcoded example could be replaced with:

assuming you have a PropertyPlaceholderConfigurer provided along the lines of:

https://www.wendangku.net/doc/4614737767.html,municating with RESTful Spring MVC Endpoints using AMF

4.1.Introduction

Spring MVC3introduced support for building RESTful services using the@Controller programming model. This allows for serving multiple representations of the same content based on what the client has requested.For example,a single RESTful endpoint could be configured to serve HTML,XML,or JSON all from a single request handling Java method on the@Controller class.This approach allows a single service implementation to support a variety of different client types,automatically providing the representation that a particular client desires.In order to better support Flex as one of those client types,Spring BlazeDS Integration adds the necessary support to be able to support an AMF representation of a given RESTful resource.

AmfView and AmfHttpMessageConverter provide the foundation necessary to use AMF with Spring MVC @Controllers.The implementations are quite similar to MappingJacksonJsonView and MappingJacksonHttpMessageConverter which provide Spring's out-of-the-box JSON support.The basics of configuring these classes are shown throughout the rest of this chapter.

https://www.wendangku.net/doc/4614737767.html,ing AmfView

AmfView is a Spring MVC View implementation that is intended to be used in conjunction with Spring MVC's ContentNegotiatingViewResolver.In particular,it is expected that it will be configured as a"default"singleton view implementation that can render any MVC model as AMF,rather than needing to have a unique instance per logical view name.

The following example shows a simple configuration of ContentNegotiatingViewResolver to support both JSON and AMF representations:

The above example includes setting the mediaTypes property to map file extensions to media types.This is helpful for clients(such as Flex)that aren't always able to set an appropriate Accept header.So given the above configuration,and a simple controller such as the following:

an HTTP GET request issued to either http://localhost/myapp/contacts.amf without an appropriate Accept header or to http://localhost/myapp/contacts with an accept header of application/x-amf will return the list of contacts as an AMF message that may then be deserialized to an ArrayCollection of ActionScript objects on the Flex client.

https://www.wendangku.net/doc/4614737767.html,ing AmfHttpMessageConverter

AmfHttpMessageConverter

is a HttpMessageConverter implementation that can convert to and from AMF.In

order to be able to convert HTTP POST and PUT request message bodies from AMF to Java objects to be passed as a @RequestBody arguments to @Controller methods,it must be added to the converters used by Spring MVC's AnnotationMethodHandlerAdapter .In order to add AMF support while also leaving the framework's default HttpMessageConverters in place,a simple BeanPostProcessor such as the following example can be

used:With this configuration in place,and a controller such as the

following:

Communicating with RESTful Spring MVC Endpoints using

AMF

the Flex client can send an HTTP POST request with an ActionScript Contact serialized to AMF in the message body to http://localhost/myapp/contacts in order to persist that contact to the database.

4.4.Interacting with RESTful AMF Endpoints from the Flex Client

Effectively interacting with a RESTful service from the Flex client using AMF is generally a matter of dropping down to some lower-level Flash APIs such as https://www.wendangku.net/doc/4614737767.html,.URLRequest and https://www.wendangku.net/doc/4614737767.html,.URLStream. There are some limitations to how a Flash/Flex application can interact with a REST service from within the browser.These limitations are generally imposed by the host browser,and are similar to the limitations imposed on HTML pages.Fortunately,Spring MVC already accounts for such browser limitations and provides useable workarounds.

The first major limitation is that the Flash player is typically not able to set the Accept header for the request to application/x-amf when using URLRequest.Spring supports mapping file extensions to media types as an alternative(see the example Section4.2,“Using AmfView”configuration for how this is achieved).

The second major limitation is the inability to properly send HTTP PUT and DELETE requests.Spring provides the HiddenHttpMethodFilter to help cope with this.With the filter configured,a DELETE request(for example) could be simulated by sending a POST request to a URL such as http://localhost/myapp/contacts/1.amf?_method=DELETE.

A complete insync-rest example of interacting with a Spring MVC@Controller is now provided in the Test Drive.This sample duplicates the full functionality of the complete inSync application that was originally built using BlazeDS Remoting.It shows in detail how to work around Flash player's limitations to use AMF to interact with a RESTful service that supports it.

Chapter5.Enhanced AMF Support

5.1.Customizing AMF Conversion

While BlazeDS provides excellent support for serialization/deserialization between Java beans and AMF,there are certain limitations in the types of objects that can be handled out-of-the-box.For example,objects to be converted to/from AMF must have getter and setter methods and must have a public no-arg constructor.In order to allow for a more flexible approach,we have provided an extension mechanism for easily customizing the AMF type conversion process through Spring configuration.

5.1.1.Configuring AMF Type Conversion

A special Spring-aware PropertyProxy(a BlazeDS-specific interface for customizing serialization)is provided that uses Spring's PropertyAccessor interface for type introspection and delegates to the Spring3+ ConversionService to allow for additional property conversion logic to be plugged in during the serialization/deserialization process.This enhanced PropertyProxy optionally supports:

?Direct field access for properties(instead of requiring getters and setters)

?Use of an alternate constructor annotated with@AmfCreator for deserialization(instead of a public no-arg constructor)

?Ignoring certain properties during serialization and/or deserialization when marked with@AmfIgnore or @AmfIgnoreField

To take advantage of the enhanced AMF support,an instance of SpringPropertyProxy must be registered for each individual type that could potentially be converted to/from AMF.A specialized set of MessageBrokerConfigProcessors are provided that take varied approaches to locating the types to be registered:

Table5.1.AMF Handling MessageBrokerConfigProcessors

Class Implementation

org.springframework.flex.core.io. HibernateConfigProcessor Uses the Hibernate metadata API to locate mapped Hibernate types to register for AMF conversion and configures specialized Hibernate Converters.See Section5.2,“Working with Hibernate”

org.springframework.flex.core.io. JpaHibernateConfigProcessor Uses the Hibernate metadata API to locate mapped Hibernate JPA types to register for AMF conversion and configures specialized Hibernate Converters. See Section5.2,“Working with Hibernate”

org.springframework.flex.core.io. ClassPathScanningAmfConversionService ConfigProcessor Uses classpath scanning to locate types to register for AMF conversion.See Section5.3,“Using Classpath Scanning for AMF Configuration”

相关文档