提交 | 用户 | 时间
|
1ac2bc
|
1 |
/** |
懒 |
2 |
* Copyright 2018-2020 stylefeng & fengshuonan (https://gitee.com/stylefeng) |
|
3 |
* <p> |
|
4 |
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
5 |
* you may not use this file except in compliance with the License. |
|
6 |
* You may obtain a copy of the License at |
|
7 |
* <p> |
|
8 |
* http://www.apache.org/licenses/LICENSE-2.0 |
|
9 |
* <p> |
|
10 |
* Unless required by applicable law or agreed to in writing, software |
|
11 |
* distributed under the License is distributed on an "AS IS" BASIS, |
|
12 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
13 |
* See the License for the specific language governing permissions and |
|
14 |
* limitations under the License. |
|
15 |
*/ |
|
16 |
package cn.stylefeng.guns.sys.core.log; |
|
17 |
|
|
18 |
import cn.stylefeng.roses.core.util.SpringContextHolder; |
|
19 |
import org.springframework.context.annotation.Scope; |
|
20 |
import org.springframework.stereotype.Component; |
|
21 |
import org.springframework.web.context.WebApplicationContext; |
|
22 |
|
|
23 |
import java.io.Serializable; |
|
24 |
|
|
25 |
/** |
|
26 |
* 被修改的bean临时存放的地方 |
|
27 |
* |
|
28 |
* @author fengshuonan |
|
29 |
* @date 2017-03-31 11:19 |
|
30 |
*/ |
|
31 |
@Component |
|
32 |
@Scope(scopeName = WebApplicationContext.SCOPE_SESSION) |
|
33 |
public class LogObjectHolder implements Serializable { |
|
34 |
|
|
35 |
private Object object = null; |
|
36 |
|
|
37 |
public void set(Object obj) { |
|
38 |
this.object = obj; |
|
39 |
} |
|
40 |
|
|
41 |
public Object get() { |
|
42 |
return object; |
|
43 |
} |
|
44 |
|
|
45 |
public static LogObjectHolder me() { |
|
46 |
return SpringContextHolder.getBean(LogObjectHolder.class); |
|
47 |
} |
|
48 |
} |