- 博客(8)
- 收藏
- 关注
翻译 Java Configuration and Form Login
protected void configure(HttpSecurity http) throws Exception { http .authorizeRequests() .anyRequest().authenticated() .and() .formLogin(
2017-02-02 12:08:23 263
原创 锁优化
减小锁持有时间 对于使用锁进行并发控制的应用,锁竞争过程中,单个线程对锁的持有时间与系统性能有着直接的关系。下面代码中:public synchronized void syncMethod() { othercodel(); mutextMethod(); othercode2(); }假设只有 mutex
2017-01-04 09:36:25 288
原创 高并发编程四
线程池 一种最为简单的线程创建和回收的方法类:new Thread(new Runable() { public void run() { //do sth} }).start();在 run() 方法结束后,自动回收改线程。在简单的应用系统中,这段代码并没有太多问题。但是在真实生产环境中,系统由于真实环境需要,可能会开启很多线程来支撑其应用。在实际生产环境中,线程的
2017-01-03 15:06:50 1448 1
原创 高并发编程三
重入锁 重入锁可以完全替代 synchronized. JDK 5.0,重入锁性能好于 synchronized. JDK 6.0 开始,两者差距不大。重入锁使用 java.util.concurrent.locks.ReenitrantLock 实现。public class ReentrantLockTest implements Runnable { static
2016-12-30 17:20:17 402
原创 高并发编程二
分门类的管理:线程组public class ThreadGroupTest implements Runnable{ @Override public void run() { String groupName = Thread.currentThread().getThreadGroup().getName() + "-" + T
2016-12-28 14:39:07 232
原创 高并发设置一
等待(wait) 和通知(notify)这两个方法并不在 Thread 类中,而是输出 Object 类。public final void wait() throws InterruptedException public final native void notify()当线程 A 中调用 obj.wait(), A 就会转为等待状态。直到其他线程调用了 obj.notif
2016-12-27 17:07:12 216
翻译 HttpSecurity
WebSecurityConfigurerAdapter 在 configure(HttpSecurity http) 提供一个默认的配置: protected void configure(HttpSecurity http) throws Exception { http .authorizeRequests() .a
2016-12-08 10:26:45 426
翻译 spring security java configuration
hello web security java configuration第一步创建 Spring Security Java 配置文件。 这个配置创建一个 springSecurityFilterChain 过滤器负责所有安全。 (保护URLs,验证用户名和密码,重定向表单提交)import org.springframework.beans.factory.annotation.Autow
2016-12-08 10:16:28 274
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人