java
文章平均质量分 68
有间猫
这个作者很懒,什么都没留下…
展开
-
浅析:AOP的使用
示例代码import org.aspectj.lang.JoinPoint;import org.aspectj.lang.ProceedingJoinPoint;import org.aspectj.lang.annotation.*;import org.junit.runner.RunWith;import org.springframework.aop.aspectj.annotation.AspectJProxyFactory;import org.springframework.bo原创 2021-06-23 21:33:50 · 133 阅读 · 0 评论 -
浅析:AOP的advice和advisor创建过程
@Aspectclass AopAdviceConfig { @Before("execution(* *.*(..))") public void beforeAdvice(JoinPoint joinPoint) { System.out.println(joinPoint.getTarget()); System.out.println("前置通知...."); }}//定义一个接口interface AspectJService {原创 2021-06-21 22:44:13 · 389 阅读 · 0 评论 -
Shiro浅析:Shiro的登录验证过程
Shiro浅析:Shiro的登录验证过程shiro的登录验证是从Subject.login开始的Subject subject = SecurityUtils.getSubject();UsernamePasswordToken token = new UsernamePassword(username, password [, remenberme]);subject.login(token);下面来看看Subject的实现类org.apache.shiro.subject.support.D原创 2021-06-15 17:50:45 · 368 阅读 · 0 评论 -
LinkedHashMap浅析-有序性
LinkedHashMap浅析LinkedHashMap的插入有序性LinkedHashMap是HashMap的一个子类。有很多的方法多是直接继承父类。最主要的区别是LinkedHashMap实现了一个继承HashMap.Node的内部类Entrystatic class Entry<K,V> extends HashMap.Node<K,V> { Entry<K,V> before, after; Entry(int hash, K key, V原创 2021-04-21 17:27:01 · 288 阅读 · 0 评论 -
浅谈Java:Volatile浅析
Volatile浅析volatile关键字介绍volatile关键字只能修饰类变量和实例变量,对于方法参数,局部变量以及实例常量,类常量多不能进行修饰。不如下面代码中MAX变量就无法使用volatile进行修饰。我们先来看一个简单的程序public class VolatileFoo { final static int MAX = 5; static int value = 0; public static void main(String[] args){原创 2021-03-23 22:12:03 · 266 阅读 · 2 评论