1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.shiro.samples.spring.config;
20
21 import org.apache.shiro.samples.spring.SampleManager;
22 import org.apache.shiro.spring.remoting.SecureRemoteInvocationExecutor;
23 import org.springframework.context.annotation.Bean;
24 import org.springframework.context.annotation.ComponentScan;
25 import org.springframework.context.annotation.Configuration;
26 import org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter;
27
28
29
30
31 @Configuration
32 @ComponentScan("org.apache.shiro.samples.spring")
33 public class RemotingServletConfig {
34
35 @Bean(name = "/sampleManager")
36 public HttpInvokerServiceExporter accountServiceExporter(SampleManager sampleManager,
37 SecureRemoteInvocationExecutor secureRemoteInvocationExecutor) {
38
39 HttpInvokerServiceExporter httpInvokerServiceExporter = new HttpInvokerServiceExporter();
40 httpInvokerServiceExporter.setService(sampleManager);
41 httpInvokerServiceExporter.setServiceInterface(SampleManager.class);
42 httpInvokerServiceExporter.setRemoteInvocationExecutor(secureRemoteInvocationExecutor);
43 return httpInvokerServiceExporter;
44 }
45 }