Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Advanced Java I

0 views

Published on

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Advanced Java I

  1. 1. Advanced Java IThread / IO Stream / Reflection
  2. 2. Agenda IThread IO Stream Muti-thread? What is “stream” Lock & PV Operation “synchronized” & “volatile” Input Stream / Output Stream wait() / notify() / notifyAll() Thread VS Runnable Reader / Writer sleep() Buffered xxx InterruptedException Decoration Pattern java.util.concurrent
  3. 3. Agenda II Reflection Class Loader static Class.forName() Class.newInstance() Class / Method Annotation Dynamic Proxy
  4. 4. Thread BasisThread? Process?Muti-ThreadCritical ResourcesLock & PV Operation
  5. 5. Thread in Java “synchronized” ~ method ~ block Synchronize WHAT? “volatile” wait() / notify() / notifyAll() “context”
  6. 6. java.lang.Thread / Runnable sleep() WHO.sleep()? InterruptedException interrupt() / interrupted() / isInterrupted() A “positive” Exception? pause / suspend
  7. 7. Thread in Action I Producer / Consumer Stop Watch
  8. 8. java.util.concurrent java.util.concurrent BlockingQueue BlockingDeque Executors java.util.concurrent.locks java.util.concurrent.locks.ReentrantLock java.util.concurrent.locks.ReentrantReadWriteLock java.util.concurrent.atomic
  9. 9. Thread in Action II Producer / Consumer again BlockingQueue Lottery Lock
  10. 10. Tea Break
  11. 11. IO StreamWhat is Stream?Input Stream / Output Stream java.io.XxxInputStream java.io.XxxOutputStreamReader / WriterBuffered xxx
  12. 12. How To Use Stream?Decoration PatternFile Capitalizer
  13. 13. Class LoaderHow JVM Loads a Class? DelegationHow to Load Our Own Classes? Class.forName() Class.newInstance() ClassLoader.loadClass() / findClass() ClassLoader.defineClass()
  14. 14. Reflection Why Reflecting? Benefits Issues How to Reflect? Class / Method / Constructor / Field Annotation Dynamic Proxy EJB (before 3.0)
  15. 15. Reflection in Action XUnit Class Loader Reflection Annotation Programming by Contract Dynamic Proxy Annotation Again
  16. 16. Q&A

×