Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB
ÈÈÃűêÇ©£º c c# c++ asp asp.net linux php jsp java vb Python Ruby mysql sql access Sqlite sqlserver delphi javascript Oracle ajax wap mssql html css flash flex dreamweaver xml
 ×îÐÂÎÄÕ : java

OSGiÊÇʲô£ºJavaÓïÑԵĶ¯Ì¬Ä£¿éϵͳ

֮ǰ51CTOÔø·¢¹ýһƪÎÄÕ½Ð×ö¡¶OSGiΪʲôÖØÒª£ºÏòÄ£¿é»¯×ªÒƵÄÖ÷¹¥ÊÖ
¡·£¬ÀïÃæ¶ÔÓÚOSGiµÄÓÅÊƽøÐÐÁË·ÖÎö¡£²»¹ý£¬¶ÔÓÚ
¾¿¾¹Ê²Ã´ÊÇOSGi£¬ºÜ¶àÈËÈÔȻֻÓÐÒ»¸öÄ£ºýµÄ¸ÅÄî¡£±¾ÏµÁУ¨ÄãºÃ£¬OSGi
£©´Ó»ù´¡¿ª
ʼ½éÉÜÁËOSGi¡£±¾²¿·Ö½éÉÜOSGiÊÇʲô£¬ÒÔ¼°OSGiÈÝÆ÷µÄһЩÏÖ×´¡££¨×¢£º±¾ÎÄÓ¢ÎÄÔ­ÎÄÓÚ08Äê3Ô·¢²¼ÔÚJavaWorldÍøÕ¾£©
51CTO±à¼­ÍƼö£º
OSGiÈëÃÅÓëʵ¼ùÈ«¹¥ÂÔ
OSGiÊÇʲô
OSGiÒà³Æ×öJavaÓïÑԵĶ¯Ì¬Ä£¿éϵͳ£¬ËüΪģ¿é»¯Ó¦ÓõĿª·¢¶¨ÒåÁËÒ»¸ö»ù´¡¼Ü¹¹¡£OSGiÈÝÆ÷ÒÑÓжà¼Ò¿ªÔ´ÊµÏÖ£¬±ÈÈç
Knoflerfish¡¢EquinoxºÍApacheµÄFelix¡£Äú¿ÉÒÔͨ¹ýÕâЩÈÝÆ÷£¬°ÑÄúµÄÓ¦ÓóÌÐòÅü·ÖΪ¶à¸öÄ£¿éµ¥Ôª£¬ÕâÑù£¬Äú¾Í¿ÉÒÔ¸üÈÝÒ׵عÜ
ÀíÕâЩģ¿éµ¥ÔªÖ®¼äµÄ½»²æÒÀÀµ¹Øϵ¡£
OSGi¹æ·¶ºÍServlet¹æ·¶¼°EJB¹æ·¶ÀàËÆ£¬¸Ã¹æ·¶¶¨ÒåÁËÁ½ÖÖ¶ÔÏó£¬Ò»ÊÇÈÝÆ÷¶ÔÍâÌṩµÄ·þÎñ¶ÔÏó£¬ÁíÒ»¸öÊÇÈÝÆ÷ºÍÄúµÄÓ¦ÓóÌÐòÖ®¼ä±ØÐë×ñÊØ
µÄÆõÔ¼£¬ÆäÖУ¬·þÎñ¶ÔÏóÊÇÈÝÆ÷ҪʵÏֵġ£ÄúÈç¹ûÏëÒªÔÚOSGiƽ̨ÉϽøÐпª·¢£¬Ê×ÏÈ£¬Äú±ØÐëҪʹÓÃOSGi
APIÀ´´´½¨ÄúµÄÓ¦Óã¬È»ºó½«Ö®²¿Êðµ½OSGiÈÝÆ÷ÖС£´Ó¿ª·¢ÕߵĽǶȿ´£¬OSGi¾ßÓÐÒÔÏÂÓŵ㣺
a) Äú¿ÉÒÔÔÚ²»ÖØÆôÈÝÆ÷µÄÇé¿öÏ£¬¶¯Ì¬µØ°²×°¡¢Ð¶ÔØ¡¢Æô¶¯ºÍÍ£Ö¹ÄúµÄÓ¦ÓóÌÐòÖеIJ»Í¬Ä£¿é£» ......

java³£ÓÃÈÕÆÚ´¦Àí

package com.hefeng.test;  
  
  
import java.text.DateFormat;  
import java.text.ParsePosition;  
import java.text.SimpleDateFormat;  
import java.util.Calendar;  
import java.util.Date;  
import java.util.GregorianCalendar;  
  
public class TimeTest {  
    //ÓÃÀ´È«¾Ö¿ØÖÆ ÉÏÒ»ÖÜ£¬±¾ÖÜ£¬ÏÂÒ»ÖܵÄÖÜÊý±ä»¯  
    private  int weeks = 0;  
    private int MaxDate;//Ò»ÔÂ×î´óÌìÊý  
    private int MaxYear;//Ò»Äê×î´óÌìÊý  
      
      
    /**
      * @param args
      */  
    public static void main(String[] args) {  
    &nbs ......

Java NIO APIÏê½â

ת×Ô£ºhttp://blog.csdn.net/daijialin/archive/2004/12/27/231384.aspx
ÔÚJDK 1.4ÒÔÇ°£¬JavaµÄIO²Ù×÷¼¯ÖÐÔÚjava.ioÕâ¸ö°üÖУ¬ÊÇ»ùÓÚÁ÷µÄ×èÈû£¨blocking£©API¡£¶ÔÓÚ´ó¶àÊýÓ¦ÓÃÀ´Ëµ£¬ÕâÑùµÄAPIʹÓúܷ½±ã£¬È»¶ø£¬Ò»Ð©¶ÔÐÔÄÜÒªÇó½Ï¸ßµÄÓ¦Óã¬ÓÈÆäÊÇ·þÎñ¶ËÓ¦Óã¬ÍùÍùÐèÒªÒ»¸ö¸üΪÓÐЧµÄ·½Ê½À´´¦ÀíIO¡£´ÓJDK 1.4Æð£¬NIO API×÷Ϊһ¸ö»ùÓÚ»º³åÇø£¬²¢ÄÜÌṩ·Ç×èÈû(non-blocking)IO²Ù×÷µÄAPI±»ÒýÈë¡£±¾ÎĶÔÆä½øÐÐÉîÈëµÄ½éÉÜ¡£
NIO APIÖ÷Òª¼¯ÖÐÔÚjava.nioºÍËüµÄsubpackagesÖУº
java.nio
¶¨ÒåÁËBuffer¼°ÆäÊý¾ÝÀàÐÍÏà¹ØµÄ×ÓÀà¡£ÆäÖб»java.nio.channelsÖеÄÀàÓÃÀ´½øÐÐIO²Ù×÷µÄByteBufferµÄ×÷Ó÷dz£ÖØÒª¡£
java.nio.channels
¶¨ÒåÁËһϵÁд¦ÀíIOµÄChannel½Ó¿ÚÒÔ¼°ÕâЩ½Ó¿ÚÔÚÎļþϵͳºÍÍøÂçͨѶÉϵÄʵÏÖ¡£Í¨¹ýSelectorÕâ¸öÀ࣬»¹ÌṩÁ˽øÐзÇ×èÈûIO²Ù×÷µÄ°ì·¨¡£Õâ¸ö°ü¿ÉÒÔ˵ÊÇNIO APIµÄºËÐÄ¡£
java.nio.channels.spi
¶¨ÒåÁË¿ÉÓÃÀ´ÊµÏÖchannelºÍselector APIµÄ³éÏóÀà¡£
java.nio.charset
       ¶¨ÒåÁË´¦Àí×Ö·û±àÂëºÍ½âÂëµÄÀà¡£
java.nio.charset.spi
       ¶¨ÒåÁË¿ÉÓÃÀ´ÊµÏÖcharset APIµÄ³éÏóÀà¡£
java.nio.ch ......

javaµÄ¶¨Ê±Æ÷ʹÓ÷½·¨

  java¶¨Ê±Æ÷µÄʹÓÃ
¶¨Ê±Æ÷ÀàTimerÔÚjava.util°üÖС£Ê¹ÓÃʱ£¬ÏÈʵÀý»¯£¬È»ºóʹÓÃʵÀýµÄschedule(TimerTask task, long delay)·½·¨£¬É趨ָ¶¨µÄÈÎÎñtaskÔÚÖ¸¶¨µÄÑÓ³ÙdelayºóÖ´ÐС£¶¨Ê±Æ÷ÈÎÎñÀàTimerTaskÊdzéÏóÀ࣬¼Ì³Ð²¢ÖØдÆärun()·½·¨£¬¿ÉʵÏÖ¾ßÌåÈÎÎñ¡£
schedule(TimerTask task, Date time)É趨ָ¶¨ÈÎÎñtaskÔÚÖ¸¶¨Ê±¼ätimeÖ´ÐС£
cancel()·½·¨½áÊøÕâ¸ö¶¨Ê±Æ÷¡£
schedule(TimerTask task, long delay, long period)·½·¨É趨ָ¶¨ÈÎÎñtaskÔÚÖ¸¶¨ÑÓ³Ùdelayºó½øÐй̶¨ÑÓ³ÙperoidµÄÖ´ÐС£
scheduleAtFixedRate(TimerTask task, long delay, long period)·½·¨É趨ָ¶¨ÈÎÎñtaskÔÚÖ¸¶¨ÑÓ³Ùdelayºó½øÐй̶¨ÆµÂÊperoidµÄÖ´ÐС£
ҪʵÏÖÒ»¸ö¶¨Ê±ÈÎÎñ£¬ÔËÓÃjavaÖеÄTimerºÍTimerTaskÀà¿ÉÒԷdz£ÈÝÒ×ʵÏÖʵʱµ÷Óô¦Àíº¯Êý¡£ÕâÁ½¸öÀàʹÓÃÆðÀ´·Ç³£·½±ã£¬¿ÉÒÔÍê³ÉÎÒÃǶԶ¨Ê±Æ÷µÄ¾ø´ó¶àÊýÐèÒª¡£
¿´¸ö¼òµ¥µÄÀý×Ó:
import java.io.IOException;
import java.util.Timer;
public class TimerTest {
public static void main(String[] args){
Timer timer = new Timer();
//Ò²¿ÉÒÔ×Ô¶¨Òåʱ¼ä£º
//µÚÒ»¸ö±íʾִÐеÄʱ¼ä£¬µÚ¶þ¸ö±íʾ¸ô¶à³¤Ê±¼äÖ´ÐС£
timer.schedule(new My ......

java¼¯ºÏ¿ò¼Ü


¼ò»¯Í¼£º
Javaƽ̨ÌṩÁËÒ»¸öȫеļ¯ºÏ¿ò¼Ü¡£“¼¯ºÏ¿ò¼Ü”Ö÷ÒªÓÉÒ»×éÓÃÀ´²Ù×÷¶ÔÏóµÄ½Ó¿Ú×é³É¡£²»Í¬½Ó¿ÚÃèÊöÒ»×鲻ͬÊý¾ÝÀàÐÍ¡£
Java 2¼¯ºÏ¿ò¼Üͼ
¼¯ºÏ½Ó¿Ú£º6¸ö½Ó¿Ú£¨¶ÌÐéÏß±íʾ£©£¬±íʾ²»Í¬¼¯ºÏÀàÐÍ£¬ÊǼ¯ºÏ¿ò¼ÜµÄ»ù´¡¡£
³éÏóÀࣺ5¸ö³éÏóÀࣨ³¤ÐéÏß±íʾ£©£¬¶Ô¼¯ºÏ½Ó¿ÚµÄ²¿·ÖʵÏÖ¡£¿ÉÀ©Õ¹Îª×Ô¶¨Ò弯ºÏÀà¡£
ʵÏÖÀࣺ8¸öʵÏÖÀࣨʵÏß±íʾ£©£¬¶Ô½Ó¿ÚµÄ¾ßÌåʵÏÖ¡£
Ôںܴó³Ì¶ÈÉÏ£¬Ò»µ©ÄúÀí½âÁ˽ӿڣ¬Äú¾ÍÀí½âÁË¿ò¼Ü¡£ËäÈ»Äú×ÜÒª´´½¨½Ó¿ÚÌض¨µÄʵÏÖ£¬µ«·ÃÎÊʵ¼Ê¼¯ºÏµÄ·½·¨Ó¦¸ÃÏÞÖÆÔÚ½Ó¿Ú·½·¨µÄʹÓÃÉÏ£»Òò´Ë£¬ÔÊÐíÄú¸ü¸Ä»ù
±¾µÄÊý¾Ý½á¹¹¶ø²»±Ø¸Ä±äÆäËü´úÂë¡£
· Collection ½Ó¿ÚÊÇÒ»×éÔÊÐíÖظ´µÄ¶ÔÏó¡£
· Set ½Ó¿Ú¼Ì³Ð Collection£¬µ«²»ÔÊÐíÖظ´£¬Ê¹ÓÃ×Ô¼ºÄÚ²¿µÄÒ»¸öÅÅÁлúÖÆ¡£
· List ½Ó¿Ú¼Ì³Ð Collection£¬ÔÊÐíÖظ´£¬ÒÔÔªËØ°²²åµÄ´ÎÐòÀ´·ÅÖÃÔªËØ£¬²»»áÖØÐÂÅÅÁС£
· Map½Ó¿ÚÊÇÒ»×é³É¶ÔµÄ¼ü£­Öµ¶ÔÏ󣬼´Ëù³ÖÓеÄÊÇkey-value pairs¡£MapÖв»ÄÜÓÐÖظ´µÄkey¡£ÓµÓÐ×Ô¼ºµÄÄÚ²¿ÅÅÁлúÖÆ¡£
· ÈÝÆ÷ÖеÄÔªËØÀàÐͶ¼ÎªObject¡£´ÓÈÝÆ÷È¡µÃÔªËØʱ£¬±ØÐë°ÑËüת»»³ÉÔ­À´µÄÀàÐÍ¡£
Java 2¼ò»¯¼¯ºÏ¿ò¼Üͼ
¼¯ºÏ½Ó¿Ú
1.Collection ½Ó¿Ú
Ó ......

JavaÓëActionScriptµÄSocket(1)

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package cn.vicky.socket;
import java.io.IOException;
import java.io.PrintWriter;
import java.net.Socket;
import java.util.Vector;
/**
*
* @author Vicky
* ¹ã²¥Àà
*/
public class BManager extends Vector<Socket> {
/**
* ¶ÔËùÓÐÒѾ­Á¬½ÓÉϵÄsocket·¢ËÍÏûÏ¢
* @param msg
* @throws IOException
*/
public synchronized void sendToAll(String msg) throws IOException {
Socket socket = null;
PrintWriter writer = null;
for (int i = 0; i < size(); i++) {
socket = get(i);
if (socket != null) {
writer = new PrintWriter(socket.getOutputStream(),true);
if (writer != null) {
writer.println(msg);
}
}
}
}
/**
* Ïòij¸öÈË·¢ËÍÏûÏ¢
* @param msg
* @param socket
* @throws IOExcepti ......
×ܼǼÊý:6386; ×ÜÒ³Êý:1065; ÿҳ6 Ìõ; Ê×Ò³ ÉÏÒ»Ò³ [8] [9] [10] [11] 12 [13] [14] [15] [16] [17]  ÏÂÒ»Ò³ βҳ
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ