java¶¯Ì¬´úÀíÓ¦ÓÃÓÚRMI
¶¯Ì¬´úÀíÊÇÖ¸¿Í»§Í¨¹ý´úÀíÀàÀ´µ÷ÓÃÆäËü¶ÔÏóµÄ·½·¨
¶¯Ì¬´úÀíʹÓó¡ºÏ:
•Ô¶³Ì·½·¨µ÷ÓÃ(RMI)
•
1.´´½¨Ò»¸öʵÏÖ½Ó¿ÚInvocationHandlerµÄÀ࣬Ëü±ØÐëʵÏÖinvoke·½·¨
2.´´½¨±»´úÀíµÄÀàÒÔ¼°½Ó¿Ú
3.ͨ¹ýProxyµÄ¾²Ì¬·½·¨
newProxyInstance(ClassLoader loader, Class[] interfaces, InvocationHandler h) ´´½¨Ò»¸ö´úÀí
4.ͨ¹ý´úÀíµ÷Ó÷½·¨
²Î¼û³ÌÐòVectorProxy.java
view plaincopy to clipboardprint?
package com.langsin.dynamicproxy;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.util.List;
import java.util.Vector;
public class VectorProxy implements InvocationHandler
{
private Object proxyobj;
public VectorProxy(Object obj)
{
proxyobj = obj;
}
public static Object factory(Object obj)
{
Class<?> cls = obj.getClass();
return Proxy.newProxyInstance(cls.getClassLoader(),
cls.getInterfaces(), new VectorProxy(obj));
}
public Object invoke(Object proxy, Method method, Object[] args)
throws Throwable
{
System.out.println("before calling " + method);
if (args != null) 
Ïà¹ØÎĵµ£º
ÇëÌṩһ¸ö¶ÔiµÄÉùÃ÷£¬½«ÏÂÃæµÄÑ»·×ª±äΪһ¸öÎÞÏÞÑ»·£º
while (i != i + 0) {
}
ÓëÇ°Ò»¸öÃÕÌⲻͬ£¬Äã±ØÐëÔÚÄãµÄ´ð°¸Öв»Ê¹Óø¡µãÊý¡£»»¾ä»°Ëµ£¬Äã²»ÄÜ°ÑiÉùÃ÷Ϊdouble»òfloatÀàÐ͵ġ£
ÓëÇ°Ò»¸öÃÕÌâÒ»Ñù£¬Õâ¸öÃÕÌâ³õ¿´ÆðÀ´ÊDz»¿ÉÄÜʵÏֵġ£±Ï¾¹£¬Ò»¸öÊý×Ö×ÜÊǵÈÓÚËü×ÔÉí¼ÓÉÏ0£¬Äã±»½ûֹʹÓø¡µãÊý£¬Òò´Ë²»ÄÜʹÓÃNaN ......
ÓÃJAVAʵÏÖ»º³å¶àÏß³ÌÎÞ×èÈû¶ÁÈ¡Ô¶³ÌÎļþ
http://ajava.org/course/java/10688.html
ʹÓÃFileChannelºÍByteBuffer
http://www.java2s.com/CN/Code/Java/File-Input-Output/useFileChannelandByteBuffer.htm
java.nio.Buffer»º³åÇø»ù´¡
http://zcdxzsz.javaeye.com/blog/310917
Java NIO Ó¦Óà -- ʹÓÃÄÚ´æÓ³ÉäÎļþʵÏÖ ......
1. ¼Ä´æÆ÷£¨register£©¡£ÕâÊÇ×î¿ìµÄ´æ´¢Çø£¬ÒòΪËüλÓÚ´¦ÀíÆ÷ÄÚ²¿¡£µ«Äã²»ÄÜÖ±½Ó¿ØÖÆ£¬Ò²²»ÄÜÔÚ³ÌÐòÖиоõµ½¼Ä´æÆ÷´æÔÚµÄÈκμ£Ïó¡£
2. ¶ÑÕ»£¨stack£©¡£Î»ÓÚͨÓÃRAMÖУ¬¶ÑÕ»Ö¸ÕëÈôÏòÏÂÒƶ¯£¬Ôò·ÖÅäеÄÄڴ棻ÈôÏòÉÏÒƶ¯£¬ÔòÊÍ·ÅÄÇЩÄÚ´æ¡£ÕâÊÇÒ»ÖÖ¿ìËÙÓÐЧµÄ·ÖÅä´æ´¢·½·¨£¬½ö´ÎÓڼĴæÆ÷¡£´´½¨³ÌÐòʱºò£¬JAVA±àÒëÆ÷±ØÐëÖªµ ......