Scala / Java
摘要: DK1.5引入了新的類型——枚舉。在 Java 中它雖然算個“小”功能,卻給我的開發帶來了“大”方便。
閱讀全文
摘要: 根據程序上下文環境,Java關鍵字final有“這是無法改變的”或者“終態的”含義,它可以修飾非抽象類、非抽象類成員方法和變量。你可能出于兩種理解而需要阻止改變:設計或效率。
final類不能被繼承,沒有子類,final類中的方法默認是final的。 final方法不能被子類的方法覆蓋,但可以被繼承。 final成員變量表示常量,只能被賦值一次,賦值后值不再改變。 final不能用于修飾構造方法。 注意:父類的private成員方法是不能被子類方法覆蓋的,因此private類型的方法默認是final類型的。
閱讀全文
摘要: cron is a UNIX tool that has been around for a long time, so its scheduling capabilities are powerful and proven. TheCronTrigger class is based on the scheduling capabilities of cron.
CronTrigger uses "cron expressions", which are able to create firing schedules such as: "At 8:00am every Monday through Friday" or "At 1:30am every last Friday of the month".
Cron expressions are powerful, but can be pretty confusing. This tutorial aims to take some of the mystery out of creating a cron exp
閱讀全文
摘要: jps類似linux的ps命令,不同的是ps是用來顯示進程,而jps只顯示java進程,準確的說是當前用戶已啟動的部分java進程信息,信息包括進程號和簡短的進程command。
閱讀全文
摘要: Resource usage could prove critical at times for heavy-duty applications. Some famous Websites have shut down because of their inability to handle heavy loads. Most problems related to heavy loads can be handled, at a macro level, using clustering and load-balancing capabilities. Concerns remain at the application level with respect to excessive object creation and the availability of limited server resources like memory, CPU, threads, and database connections, which could represent potential bo
閱讀全文
摘要: Occurs when an exception is thrown in the contextInitialized method of a ServletContextListener
閱讀全文
摘要: When developing a https application, your test server often doesn't have a (valid) SSL certificate. This will cause the following exception to be thrown when connecting your client to the test server: "javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated".
閱讀全文
摘要: Java 操縱對象都是通過引用來實現的,所有的對象變量都是所指向的對象的引用,那也就是說所有對象變量的值并不是它所指向的對象本身,而是該對象的引用,這句話聽起來可能有點讓人犯暈,舉個例子來說,String str = new String("aaa"); 這條語句的意思是 new 了一個值為 "aaa" 的字符串對象,然后用一個名字叫 str 的對象變量來指向它,保存它的引用
閱讀全文
摘要: Log4j可以幫助調試(有時候debug是發揮不了作 用的)和分析,要下載和了解更詳細的內容.
閱讀全文
摘要: AOP技術即(面向切面編程)技術是在面向對象編程基礎上的發展,AOP技術是對所有對象或一類對象編程。核心是在不增加代碼的基礎上,還增加了新的功能。AOP編程在開發框架本身用的比較多,而實際項目中,用的比較少。它是將分散在各個業務邏輯代碼中的相同代碼抽取出來形成一個獨立的模塊。
閱讀全文
摘要: Need three artifacts to implement a JPA-compliant program:
An entity class
A persistence.xml file
A class through which you will insert, update, or find an entity
JPA is all about data persistence, so let's begin our examination of how it works with the data store design. Assume you have a CUSTOMER table, as in Table 1 below.
閱讀全文
摘要: The serialVersionUID is used as a version control in a Serializable class. If you do not explicitly declare a serialVersionUID, JVM will do it for you automatically, based on various aspects of your Serializable class, as described in the Java(TM) Object Serialization Specification.
閱讀全文
摘要: Executor就是Runnable和Callable的調度容器,Future就是對于具體的調度任務的執行結果進行查看,最為關鍵的是Future可以檢查對應的任務是否已經完成,也可以阻塞在get方法上一直等待任務返回結果。Runnable和Callable的差別就是Runnable是沒有結果可以返回的,就算是通過Future也看不到任務調度的結果的。
閱讀全文
Full Scala / Java Archive