토요일, 1월 11
Shadow

#034 Java EE 6 – EJB 3.1

미분류
Lab Exercises For the sake of the simplicity of the lab, most exercises are provided in the form of "ready-to-open-and-run" NetBeans projects.  (Many of them are borrowed from "glassfish-samples" and "Java EE 6 tutorial".)  Please feel free to create them from scratch if you want to. It is strongly encouraged, leveraging what is provided in this lab, you do your own experimentation meaning creating/adding your own code as much as you can. If you have written some code that might help everyone else, please feel free to share them on this codecamp email alias or directly send them to the instructors.  Your name will be recognized in this lab if your sample code is chosen to be included.  For the tasks that need to be done, please see the "Things to be done" section above.)   ...

#033 Java EE 6 – JPA 2.0

미분류
Lab Exercises For the sake of the simplicity of the lab, most exercises are provided in the form of "ready-to-open-and-run" NetBeans projects.  (Many of them are borrowed from "glassfish-samples" and "Java EE 6 tutorial".)  Please feel free to create them from scratch if you want to. It is strongly encouraged, leveraging what is provided in this lab, you do your own experimentation meaning creating/adding your own code as much as you can. If you have written some code that might help everyone else, please feel free to share them on this codecamp email alias or directly send them to the instructors.  Your name will be recognized in this lab if your sample code is chosen to be included.  For the tasks that need to be done, please see the "Things to be done" section above.) Exerc...

#032 Java EE 6: DI (JSR 330) and CDI (JSR 299)

미분류
  Lab Exercises For the sake of the simplicity of the lab, most exercises are provided in the form of "ready-to-open-and-run" NetBeans projects.  (Many of them are borrowed from "glassfish-samples" and "Java EE 6 tutorial".)  Please feel free to create them from scratch if you want to. It is strongly encouraged, leveraging what is provided in this lab, you do your own experimentation meaning creating/adding your own code as much as you can. If you have written some code that might help everyone else, please feel free to share them on this codecamp email alias or directly send them to the instructors.  Your name will be recognized in this lab if your sample code is chosen to be included.  For the tasks that need to be done, please see the "Things to be done" section above.) ...

#031 Servlet 3.0

미분류
Java Servlet 3.0 (JSR 315), which is part of Java EE 6, is a major revision of the Java Servlet technology, a widely accepted technology for building dynamic content for web-based applications, and includes changes to enable easy pluggability of popular open-source frameworks or libraries, ease of development leveraging annotation and making web.xml optional, support for async processing, which enables writing Comet applications in portable fashion, security enhancements, and other minor updates to the existing APIs. In this lab, you are going exercise all the newly introduced features of Servlet 3.0. Expected duration: 210 minutes (excluding homework)     Software Needed Before you begin, you need to install JDK 6 and NetBeans IDE 6.8.  You also need to downloa...

#030 Java EE 6 Overrview & Getting Java EE 6 sample codes

미분류
Lab Exercises Exercise 1: Get "glassfish-samples" examples from GlassFish v3 Update center Exercise 2: Get "Java EE 6 tutorial" examples from GlassFish v3 Update center Exercise 3: Check out "glassfish-samples" examples from java.net (Optional) Homework Exercise (for people who are taking Sang Shin's "Java EE Programming online course") Exercise 1: Get "glassfish-samples" examples from GlassFish v3 Update center In this exercise, you are going to get "glassfish-samples" examples from GlassFish v3 update center.  The "glassfish-samples" contains many Java EE 5 and Java EE 6 examples in the form of "ready-to-run" NetBeans projects. Start GlassFish v3 update center Get "Java EE Sample Applications" from the update center (1.1) Start GlassFish v3 update center ...

#029 J2SE 5.0 Concurrency

미분류
Lab Exercises Exercise 1: ThreadPool (30 minutes) Exercise 2: Executors (30 minutes) Exercise 3: Callable and Future (30 minutes) Exercise 4: Semaphore(30 minutes) Exercise 5: Blocking queue (30 minutes) Homework Exercise (for people who are taking Sang Shin's "Java Programming online course")   Exercise 1: ThreadPoolExecutor In this exercise, you will learn how to create a pool of threads using the ThreadPoolExecutor class. You also will learn how these pool of threads are used to execute tasks. Build and run a server that receives connection request (using ThreadPoolExecutor) Build and run two instances of clients (1.1) Build and run a server that receives connection request (using ThreadPoolExecutor) 0. Start NetBeans IDE if you have not done so y...

#028 J2SE 5.0 Annotations

미분류
Lab Exercises Exercise 1: Override annotation (20 minutes) Exercise 2: Single member annotation (20 minutes) Exercise 3: Multiple member annotation (20 minutes) Exercise 4: Complex annotation (20 minutes) Exercise 5: Meta annotation (20 minutes) Exercise 6: Reading annotations at runtime (20 minutes) Homework Exercise (for people who are taking Sang Shin's "Java Programming online course")   Exercise 1: Override annotation Programmers sometimes overload a method when they mean to override it; a classic example of this is the equals() method which is defined in the Object class.  AnnotatedClass.java contains a simple example of this: public boolean equals(String otherName) { int comparisson = name.compareTo(otherName); return (comparisson == 0); } ...

#027 J2SE 5.0 Generics

미분류
Lab Exercises Exercise 1: Use Generic classes (20 minutes) Exercise 2: Generics and Subtyping (20 minutes) Exercise 3: Wild card (20 minutes) Exercise 4: Define your own generic class (20 minutes) Exercise 5: Type erasure (20 minutes) Exercise 6: Interoperating with non-generic code (20 minutes) Homework Exercise (for people who are taking Sang Shin's "Java Programming online course")   Exercise 1: Use Generic classes with type parameters In this exercise, you will learn the basic concept of Generics by adding lines of code to the Main.java.  You will try to reason why some code work while others result in compilation errors.  Technical explanations are then followed. (1.1) Compile time type checking through Generics 0. Start NetBeans IDE if you have not don...

#026 J2SE 5.0 Language Features Enhancements

미분류
Lab Exercises Exercise 1: Autoboxing (20 minutes) Exercise 2: Enhanced For loop (20 minutes) Exercise 3: Static imports (20 minutes) Exercise 4: Variable arguments (20 minutes) Exercise 5: Type-safe enumerations (20 minutes) Homework Exercise (for people who are taking Sang Shin's "Java Programming online course") Exercise 1: Autoboxing As any Java programmer knows, you cannot put an int (or other primitive value) into a collection. Collections can only hold object references, so you have to box primitive values into the appropriate wrapper class (which is Integer in the case of int). When you take the object out of the collection, you get the Integer that you put in; if you need an int, you must unbox the Integer using the intValue method. All of this boxing and unbo...

#025 Java Threads

미분류
Lab Exercises Exercise 1: Extending Thread class (30 minutes) Exercise 2: Implementing Runnable interface (30 minutes) Exercise 3: ThreadGroup, ThreadPriority, View all threads (30 minutes) Exercise 4: Synchronization (30 minutes) Exercise 5: Inter-thread communication (30 minutes) Exercise 6: Timer and TimerTask (15 minutes) Homework Exercise (for people who are taking Sang Shin's "Java Programming online course")   Exercise 1: Extending Thread class In this exercise, you are going to learn how to create and start a thread execution by writing a class that extends Thread class.  You will learn how to start the thread either by not having the start() method in the constructor of the subclass or having it in the constructor method of the subclass. The start()...