Spring BlazeDS Integration简介与入门
2009-09-28 00:00:00 来源:WEB开发网以上配置保护了匹配于**/protected/messagebroker/**路径的URL。在本示例中,这包括了my-protected- amf(该通道监听/gorilla/protected/messagebroker/amf)与my-protected-by-id-amf通道。
接下来,我们定义端点拦截器与异常解析器以将所有配置连接在一起:
<bean id="endpointInterceptor"
class="org.springframework.flex.messaging.security.EndpointServiceMessagePointcutAdvisor">
<constructor-arg>
<bean class="org.springframework.flex.messaging.security.EndpointInterceptor">
<property name="accessDecisionManager" ref="_accessManager"/>
<property name="authenticationManager" ref="_authenticationManager"/>
<property name="objectDefinitionSource" ref="endpointSource"/>
</bean>
</constructor-arg>
</bean>
<bean id="exceptionTranslator" class="org.springframework.flex.messaging.security.EndpointServiceMessagePointcutAdvisor">
<constructor-arg>
<bean class="org.springframework.flex.messaging.security.SecurityExceptionTranslationAdvice"/>
</constructor-arg>
</bean>
上面的代码配置了端点拦截器以将访问与认证管理器应用到端点源上。
最后,我们修改Spring管理的Message Broker的定义来应用这些配置处理器:
<bean id="mySpringManagedMessageBroker"
class="org.springframework.flex.messaging.MessageBrokerFactoryBean">
<property name="configProcessors">
<set>
<ref bean="loginCommand"/>
<ref bean="securityConfigProcessor"/>
</set>
</property>
</bean>
Tags:Spring BlazeDS Integration
编辑录入:爽爽 [复制链接] [打 印]更多精彩
赞助商链接