`
zhangyu84849467
  • 浏览: 15404 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论
文章列表
最近读了下cglib 的源代码,分析了cglib 通过字节码生成的代理类。就用cglib源代码包中的例子吧. 1.首先eclipse中开启debug模式,如图 例子的代码如下 public static void main(String args[]) { Bean bean = (Bean)newInstance(Bean.class); bean.addPropertyChangeListener( new PropertyChangeListener() { public void propertyChange( ...
先上一个例子代码 public static void main( String[] args ) throws IOException { DynamicStringProperty stringProperty = DynamicPropertyFactory.getInstance().getStringProperty( "hello", "" ); System.out.println( stringProperty.get() ); ConfigurationManager.getConfigInstance(). ...
今天再看zuul2 源代码是看到这种 Lambda 表达式的写法, 记录一下 private static final Map< Class<?>, Function<String, Object> > PARSERS = new HashMap<>(); static { PARSERS.put( Boolean.class, Boolean::valueOf ); PARSERS.put( Boolean.TYPE, Boolean::valueOf ); PARSERS.put( Byte.class, B ...
@ConfigurationProperties 可以 将application.properties 以指定前缀的属性应用到指定的类。 @EnableConfigurationProperties 导入启用的属性类 以mybatis的自动导入的源代码为例: // 相当于<beans> @org.springframework.context.annotation.Configuration // 相当于 Class.forName("org.apache.ibatis.session.SqlSessionFactory") 有异常说明不存在 @C ...

mysql

mysql partition   查看sql版本是否支持分区 mysql> SELECT -> PLUGIN_NAME as Name, -> PLUGIN_VERSION as Version, -> PLUGIN_STATUS as Status -> FROM INFORMATION_SCHEMA.PLUGINS -> WHERE PLUGIN_TYPE='STORAGE ENGINE'; +--------------------+---------+--- ...

感谢

感谢从开始到今天所有善意的朋友
private transient int randomSeed; randomSeed = seedGenerator.nextInt() | 0x0100; private int randomLevel() { int x = randomSeed; x ^= x << 13; x ^= x >>> 17; randomSeed = x ^= x << 5; if ((x & 0x80000001) != 0) // test high ...
项目只依赖asm-all.jar 和zookeeper.jar.   项目的配置文是 default.conf.properties   配置ip地址, default是本机 socket.bind.address   端口 socket.bind.port=47048   服务端注解的路径扫描 rpc.service.path.scan=org.fantasy.example   客户端端注解的路径扫描 rpc.reference.path.scan=org.fantasy.example   zookeeper路径的配置 service.registry.addr ...
  import java.io.Serializable; public class Foo implements Serializable { private String str; public Foo(String str) { this.str = str; } }  Foo是一个可以序列化的实体类 public class FooTest { private static final ReflectionFactory REFLECTION_FACTORY = ReflectionFactory.getReflectionFactory(); ...
sun.misc.Unsafe 操作数组的例子, 参照 jdk 的 java.util.concurrent.ConcurrentHashMap的源代码 package org.fantasy.unsafe; public interface Array<T> { /** * 根据下标获取指定的元素 * @param index * @return */ public T getObject(int index); /** * 根据下标修改指定的元素 * @param index * @param element ...
import java.io.IOException; import java.lang.reflect.Method; import java.rmi.registry.LocateRegistry; import java.rmi.registry.Registry; import java.rmi.server.UnicastRemoteObject; import java.util.List; import java.util.Map; import java.util.Set; import java.util.concurrent.ConcurrentHashM ...
ssh 免登陆的配置 ssh-keygen -t rsa cd ~/.ssh [root@master .ssh]# ll 总用量 8 -rw------- 1 root root 1679 1月   2 21:04 id_rsa -rw-r--r-- 1 root root  393 1月   2 21:04 id_rsa.pub slave1 scp ~/.ssh/id_rsa.pub root@master:~/.ssh/id_rsa.pub_slave1 slave2 scp ~/.ssh/id_rsa.pub root@master:~/.ssh/id_rsa.pu ...
/** * Generator for Globally unique Strings. */ public class IdGenerator { private static final Logger LOG = LoggerFactory.getLogger(IdGenerator.class); private static final String UNIQUE_STUB; private static int instanceCount; private static String host ...
  入口在 org.apache.activemq.console.Main这个类   在main方法内最前面加入如下代码   // debug System.setProperty("activemq.base", "E:\\apache-activemq-5.10.2"); System.setProperty("activemq.home", "E:\\apache-activemq-5.10.2"); System.setProperty("org.apache.activemq ...
 <div class="iteye-blog-content-contain" style="font-size: 14px"></div>  
Global site tag (gtag.js) - Google Analytics