public abstract class AbstractAmfConversionServiceConfigProcessor extends Object implements MessageBrokerConfigProcessor, InitializingBean
MessageBrokerConfigProcessor implementation that installs an alternative PropertyProxy implementation for
enhanced serialization and deserialization of specific types. The alternative implementation uses Sping's ConversionService
to allow specialized conversion of certain property types and is more flexible in the types it can handle.
The installed SpringPropertyProxy instances may be configured to use field-based property access (instead of requiring getters and setters) by
setting the useDirectFieldAccess property to true. Additionally,
types that do not have a default no-arg constructur can be handled, as long as they provide a constructor annotated with AmfCreator.
Subclasses are expected to supply their own mechanisms for determining the list of types to register and may apply additional configuration of the
ConversionService, such as provisioning additional custom Converters.
SpringPropertyProxy| Modifier and Type | Field and Description |
|---|---|
protected org.apache.commons.logging.Log |
log |
| Constructor and Description |
|---|
AbstractAmfConversionServiceConfigProcessor() |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
protected void |
configureConverters(ConverterRegistry registry)
Template method to allow subclasses to configure their own set of
Converter instances. |
protected abstract Set<Class<?>> |
findTypesToRegister()
Returns the set of types for which
SpringPropertyProxy instances should be registered. |
flex.messaging.MessageBroker |
processAfterStartup(flex.messaging.MessageBroker broker)
Apply this config processor to the newly created
MessageBroker after it and all of its services have been
started but before it is available for use. |
flex.messaging.MessageBroker |
processBeforeStartup(flex.messaging.MessageBroker broker)
Apply this config processor to the newly created
MessageBroker after its intial configuration settings
have been parsed from the BlazeDS XML configuration, but before it has actually been started. |
protected void |
registerAmfProxies(ConversionService conversionService,
boolean useDirectFieldAccess)
Called during initialization, the default implementation configures and registers a
SpringPropertyProxy instance
for each type returned by findTypesToRegister. |
protected void |
registerPropertyProxy(SpringPropertyProxy proxy)
Registers the given
SpringPropertyProxy with the BlazeDS PropertyProxyRegistry. |
void |
setConversionService(ConversionService conversionService)
Sets the
ConversionService implementation to be used by all registered SpringPropertyProxy instances. |
void |
setUseDirectFieldAccess(boolean useDirectFieldAccess)
When true, configures the registered
SpringPropertyProxy instances to access fields directly, rather than
requiring strict JavaBean compliance. |
public AbstractAmfConversionServiceConfigProcessor()
public void afterPropertiesSet()
throws Exception
afterPropertiesSet in interface InitializingBeanExceptionpublic final flex.messaging.MessageBroker processAfterStartup(flex.messaging.MessageBroker broker)
MessageBroker after it and all of its services have been
started but before it is available for use.processAfterStartup in interface MessageBrokerConfigProcessorbroker - the started MessageBroker instanceMessageBrokerpublic final flex.messaging.MessageBroker processBeforeStartup(flex.messaging.MessageBroker broker)
MessageBroker after its intial configuration settings
have been parsed from the BlazeDS XML configuration, but before it has actually been started.processBeforeStartup in interface MessageBrokerConfigProcessorbroker - the new MessageBroker instanceMessageBrokerpublic void setConversionService(ConversionService conversionService)
ConversionService implementation to be used by all registered SpringPropertyProxy instances.conversionService - the conversion service to be usedpublic void setUseDirectFieldAccess(boolean useDirectFieldAccess)
SpringPropertyProxy instances to access fields directly, rather than
requiring strict JavaBean compliance. Defaults to false.useDirectFieldAccess - determines whether fields should be accessed directly.protected void registerAmfProxies(ConversionService conversionService, boolean useDirectFieldAccess)
SpringPropertyProxy instance
for each type returned by findTypesToRegister.conversionService - the conversion service to be used for property conversionuseDirectFieldAccess - determines whether fields should be accessed directlyprotected void registerPropertyProxy(SpringPropertyProxy proxy)
SpringPropertyProxy with the BlazeDS PropertyProxyRegistry.proxy - the property proxy to registerprotected abstract Set<Class<?>> findTypesToRegister()
SpringPropertyProxy instances should be registered.protected void configureConverters(ConverterRegistry registry)
Converter instances. This is a
convenient alternative to supplying a completely custom-configured ConversionService instance.
The default implementation does not register any additional Converters, thus subclasses do not need to delegate to it.
registry - - the converter registry used by the ConversionServiceCopyright © 2014. All rights reserved.