Let's start with simple configuration.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | <? xml version = "1.0" encoding = "UTF-8" ?> xsi:schemaLocation=" < context:annotation-config /> < context:component-scan base-package = "org.example.flex" /> < flex:message-broker id = "_messageBroker" services-config-path = "/WEB-INF/flex/services-config.xml" > < flex:message-service default-channels = "default-amf, secure-amf" /> </ flex:message-broker > </ beans > |
Adobe BlazeDS configuration, referenced here as /WEB-INF/flex/services-config.xml is pretty standard. It includes bare minimum enough to run simple application.
- /WEB-INF/flex/services-config.xml
- /WEB-INF/flex/messaging-config.xml
- /WEB-INF/flex/remoting-config.xml
- /WEB-INF/flex/proxy-config.xml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | <? xml version = "1.0" encoding = "UTF-8" ?> < services-config > < services > < service-include file-path = "remoting-config.xml" /> < service-include file-path = "proxy-config.xml" /> < service-include file-path = "messaging-config.xml" /> < default-channels > < channel ref = "default-amf" /> </ default-channels > </ services > < channels > < channel-definition id = "default-amf" class = "mx.messaging.channels.AMFChannel" > < endpoint url = "http://{server.name}:{server.port}/{context.root}/messagebroker/amf/" class = "flex.messaging.endpoints.AMFEndpoint" /> </ channel-definition > < channel-definition id = "secure-amf" class = "mx.messaging.channels.SecureAMFChannel" > < endpoint url = "https://{server.name}:9400/{context.root}/messagebroker/amfsecure/" class = "flex.messaging.endpoints.SecureAMFEndpoint" /> </ channel-definition > </ channels > </ services-config > |
1 2 3 4 5 6 7 | <? xml version = "1.0" encoding = "UTF-8" ?> < service id = "message-service" class = "flex.messaging.services.MessageService" > < adapters > < adapter-definition id = "actionscript" class = "flex.messaging.services.messaging.adapters.ActionScriptAdapter" default = "true" /> < adapter-definition id = "jms" class = "flex.messaging.services.messaging.adapters.JMSAdapter" /> </ adapters > </ service > |
1 2 3 4 5 6 | <? xml version = "1.0" encoding = "UTF-8" ?> < service id = "remoting-service" class = "flex.messaging.services.RemotingService" > < adapters > < adapter-definition id = "java-object" class = "flex.messaging.services.remoting.adapters.JavaAdapter" default = "true" /> </ adapters > </ service > |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | <? xml version = "1.0" encoding = "UTF-8" ?> < service id = "proxy-service" class = "flex.messaging.services.HTTPProxyService" > < properties > < connection-manager > < max-total-connections >100</ max-total-connections > < default-max-connections-per-host >2</ default-max-connections-per-host > </ connection-manager > < allow-lax-ssl >true</ allow-lax-ssl > </ properties > < adapters > < adapter-definition id = "http-proxy" class = "flex.messaging.services.http.HTTPProxyAdapter" default = "true" /> < adapter-definition id = "soap-proxy" class = "flex.messaging.services.http.SOAPProxyAdapter" /> </ adapters > < destination id = "DefaultHTTP" > < properties > < url >/{context.root}/default.jsp</ url > </ properties > </ destination > </ service > |
1 2 3 4 5 6 7 8 9 10 11 12 | package org.example.flex; import org.springframework.flex.remoting.RemotingDestination; import org.springframework.stereotype.Service; @Service @RemotingDestination ( value = "simpleService" , channels = { "default-amf" , "secure-amf" } ) public class SimpleService { public Boolean test() { return Boolean.TRUE; } } |
Integrating Spring Security is again just a few configuration lines. Here is an example:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | <? xml version = "1.0" encoding = "UTF-8" ?> xsi:schemaLocation=" < context:annotation-config /> < context:component-scan base-package = "org.example.flex" /> < bean id = "authenticationProvider" class = "org.example.flex.CustomAuthenticationProvider" /> < security:authentication-manager alias = "authenticationManager" > < security:authentication-provider ref = "authenticationProvider" /> </ security:authentication-manager > < flex:message-broker id = "_messageBroker" services-config-path = "/WEB-INF/flex/services-config.xml" > < flex:message-service default-channels = "default-amf, secure-amf" /> < flex:secured authentication-manager = "authenticationManager" /> </ flex:message-broker > </ beans > |