java Ä£ÄâselectorµÄ¸½´ø¹¦ÄÜ
package com.event;
import java.util.Map;
public interface EventListener {
void onEvent(Map event);
}
package com.socket;
import java.nio.ByteBuffer;
import java.util.HashMap;
import com.event.EventListener;
/*
* Ô¤´¦ÀíÀà
*/
public class BaseObject {
private boolean flag;
private ByteBuffer receivebuffer= ByteBuffer.allocate(20000);
public void print(){
System.out.println("hello!");
flag=true;
}
public boolean isFlag() {
return flag;
}
public void setFlag(boolean flag) {
this.flag = flag;
}
public ByteBuffer getReceivebuffer() {
return receivebuffer;
}
public void invoke(EventListener event){
System.out.println("BaseObject invoke");
HashMap<String, String> map=new HashMap<String, String>();
map.put("key", "wellcome here");
event.onEvent(map);
}
}
package com.socket;
public class Client{
/*
* ¶ÔÓ¦µÄÔ¶³Ì¿Í»§¶Ë
*/
public Client(){
}
public void run( ) {
System.out.println("client run");
}
}
package com.socket;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.nio.channels.ServerSocketChannel;
import java.nio.channels.SocketChannel;
public class Server {
private ServerSocketChannel channel;
private SocketController sc;
public Server() {
try {
sc = new SocketController();
sc.start();
channel = ServerSocketChannel.open();
channel.socket().bind(new InetSocketAddress(8080));
} catch (IOException e) {
e.printStackTrace();
}
}
private void start
Ïà¹ØÎĵµ£º
¡¡¡¡inkfish·Ò룬ÇëÎðÉÌÒµÐÔÖÊתÔØ£¬×ªÔØÇë×¢Ã÷À´Ô´£¨http://blog.csdn.net/inkfish
£©¡£±¾ÎÄÊÇÎÒѧϰJUELͬʱ£¬¶ÔÔÍøÕ¾½øÐеļòµ¥µÄ·Ò룬ÔÍøÕ¾µØÖ·£ºhttp://juel.sourceforge.net/guide/basic/index.html
¡£
»ù±¾ÀࣨBasic Classes£©
¡¡¡¡ÕâÒ»²¿·Ö¹ýÒ»ÏÂJUELÌṩµÄ¾ßÌåµÄһЩÀ࣬ÕâЩÀà×é³ÉÁ˼ÆËã¹ý³ÌµÄºËÐÄ£ºËü ......
¡¡¡¡inkfish·Ò룬ÇëÎðÉÌÒµÐÔÖÊתÔØ£¬×ªÔØÇë×¢Ã÷À´Ô´£¨http://blog.csdn.net/inkfish
£©¡£±¾ÎÄÊÇÎÒѧϰJUELͬʱ£¬¶ÔÔÍøÕ¾½øÐеļòµ¥µÄ·Ò룬ÔÍøÕ¾µØÖ·£ºhttp://juel.sourceforge.net/guide/basic/factory.html
¡£ËµÊµ»°£¬Õâƪ·ÒëµÄµÄÈ·²»ÔõÑù¡£
±í´ïʽ¹¤³§£¨Expression Factory£©
¡¡¡¡Èç¹ûҪʹÓÃEL
£¬¾Í±ØÐëÒªÓÐÒ ......
ÄÚ´æÒç³öÓëÊý¾Ý¿âËø±íµÄÎÊÌ⣬¿ÉÒÔ˵ÊÇ¿ª·¢ÈËÔ±µÄجÃΣ¬Ò»°ãµÄ³ÌÐòÒì³££¬×ÜÊÇ¿ÉÒÔÖªµÀÔÚʲôʱºò»òÊÇÔÚʲô²Ù×÷²½ÖèÉϳöÏÖÁËÒì³££¬¶øÇÒ¸ù¾Ý¶ÑÕ»ÐÅÏ¢Ò²ºÜÈÝÒ׶¨Î»µ½³ÌÐòÖÐÊÇij´¦³öÏÖÁËÎÊÌâ¡£ÄÚ´æÒç³öÓëËø±íÔò²»È»£¬Ò»°ãÏÖÏóÊDzÙ×÷Ò»°ãʱ¼äºóϵͳԽÀ´Ô½Âý£¬Ö±µ½ËÀ»ú£¬µ«²¢²»ÄÜÃ÷È·ÊÇÔÚʲô²Ù×÷ÉϳöÏֵģ¬·¢ÉúµÄʱ¼äµãҲûÓйæ ......
TimerλÓÚjava.utilÏÂÃ棬һ°ã½ÐËûjava¼ÆʱÆ÷¡£
javaAPIµÄ½âÊÍÈçÏÂ:
Ò»ÖÖÏß³ÌÉèÊ©£¬ÓÃÓÚ°²ÅÅÒÔºóÔÚºǫ́Ïß³ÌÖÐÖ´ÐеÄÈÎÎñ¡£¿É°²ÅÅÈÎÎñÖ´ÐÐÒ»´Î£¬»òÕ߶¨ÆÚÖظ´Ö´ÐС£
ÏÈÀ´¿´¿´Ð§¹û£º
1.Éè¼Æ¼ÆʱÆ÷
import java.io.IOException;
import java.util.Calendar;
import java.util.Timer;
public class TimerTest {
......
import java.sql.*;
public class ConnectAccess {
/**
* ³õѧÕßÇë×¢Ò⣺
* 1:ÏȽ¨Á¢Ò»¸öaccessÎļþa1.mdb,²¢·ÅÔÚD:\ÏÂ;
* 2:ÔÚÊý¾Ý¿âÎļþa1.mdbÖн¨Á¢Ò»¸ö±íTable1£»
* 3£ºÎªTable1Ìí¼ÓÒ»ÁУ¬²¢²åÈëÖÁÉÙÒ»Ìõ¼Ç¼£»
* 4£º±¾ÎÄÊÇÒ»¸öÍêÕûµÄÀֱ࣬½ÓÄÃÈ¥ÔËÐоͿÉÒÔ¡£
*/
public static void main(Stri ......