# JavaDemo
**Repository Path**: NOW_GO/ShiroDemo
## Basic Information
- **Project Name**: JavaDemo
- **Description**: 简单测试一下shiro 认证与授权 数据库 用Navicat Premium 自带的 shrio
- **Primary Language**: Unknown
- **License**: Not specified
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 2
- **Forks**: 0
- **Created**: 2018-04-26
- **Last Updated**: 2020-12-19
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# ssm-server
极简的ssm
## shiro 集成
## 2018-05-04 aop
1 在spring-mvc 中添加:
2 aop 包中 Operator 切面类
## 2018-05-07 ehcache
1.pom
```$xslt
net.sf.ehcache
ehcache
2.10.2
```
2.ehcache.xml
```$xslt
```
3.让spring 管理
```$xslt
```
4 .EhcacheService 实现 EhcacheService 接口
```$xslt
@Override
@Cacheable(value = "cacheTest", key = "#param")
public String getTimestamp(String param) {
Long timestamp = System.currentTimeMillis();
return timestamp.toString();
}
```
5 测试
```$xslt
@ContextConfiguration(locations = { "classpath:spring-application.xml" })
//使用标准的JUnit @RunWith注释来告诉JUnit使用Spring TestRunner
@RunWith(SpringJUnit4ClassRunner.class)
public class testOne extends AbstractJUnit4SpringContextTests {
@Autowired
private EhcacheService ehCacheTestService;
@Test
public void getTimestampTest() throws InterruptedException{
System.out.println("第一次调用:" + ehCacheTestService.getTimestamp("param"));
Thread.sleep(2000);
System.out.println("2秒之后调用:" + ehCacheTestService.getTimestamp("param"));
Thread.sleep(2000);
System.out.println("4秒之后调用:" + ehCacheTestService.getTimestamp("param"));
Thread.sleep(11000);
System.out.println("再过15秒之后调用:" + ehCacheTestService.getTimestamp("param"));
}
}
```
## 2018-05-09 activitymq demo
1 jar 包
```
org.apache.xbean
xbean-spring
3.16
org.apache.activemq
activemq-all
5.9.0
org.apache.activemq
activemq-pool
5.12.1
org.springframework
spring-jms
4.1.8.RELEASE
```
2 spring-activemq.xml
注意:
```
contextConfigLocation
classpath*:spring-*.xml
```
3 code
全部代码在
MessageController
activitymq