Jersey Package dependencies

Dependencies:
Package: Server side support for Grizzly Containers
<dependency>
   <groupId>org.glassfish.jersey.containers</groupId>
   <artifactId>jersey-container-grizzly2-http</artifactId>
   <version>2.22.2</version>
</dependency>

Package: Server side support for JDK Containers
<dependency>
   <groupId>org.glassfish.jersey.containers</groupId>
   <artifactId>jersey-container-jdk-http</artifactId>
   <version>2.22.2</version>
</dependency>


Package: Server side support for Simple Containers
<dependency>
   <groupId>org.glassfish.jersey.containers</groupId>
   <artifactId>jersey-container-simple-http</artifactId>
   <version>2.22.2</version>
</dependency>

Package: Server side support for Jetty Containers
<dependency>
   <groupId>org.glassfish.jersey.containers</groupId>
   <artifactId>jersey-container-jetty-http</artifactId>
   <version>2.22.2</version>
</dependency>
<dependency>
   <groupId>org.glassfish.jersey.containers</groupId>
   <artifactId>jersey-container-jetty-servlet</artifactId>
   <version>2.22.2</version>
</dependency>

Package: Grizzly connector for Jersey Client
<dependency>
   <groupId>org.glassfish.jersey.connectors</groupId>
   <artifactId>jersey-grizzly-connector</artifactId>
   <version>2.22.2</version>
</dependency>
 

Package: Apache connector for Jersey Client
<dependency>
   <groupId>org.glassfish.jersey.connectors</groupId>
   <artifactId>jersey-apache-connector</artifactId>
   <version>2.22.2</version>
</dependency>

Package: Jetty connector for Jersey Client
<dependency>
   <groupId>org.glassfish.jersey.connectors</groupId>
   <artifactId>jersey-jetty-connector</artifactId>
   <version>2.22.2</version>
</dependency>


Package: Jersey
<dependency>
   <groupId>org.glassfish.jersey.containers</groupId>
   <artifactId>jersey-container-servlet</artifactId>
   <version>2.22.2</version>
   <scope>provided</scope>
</dependency>
<!-- if you are using Jersey client specific features without the server side -->
<dependency>
   <groupId>org.glassfish.jersey.core</groupId>
   <artifactId>jersey-client</artifactId>
   <version>2.22.2</version>
   <scope>provided</scope>
</dependency>

Package: JAX-RS API
<dependency>
   <groupId>javax.ws.rs</groupId>
   <artifactId>javax.ws.rs-api</artifactId>
   <version>2.0.1</version>
   <scope>provided</scope>
</dependency>

Apache Commons dependency
<!-- http://mvnrepository.com/artifact/org.apache.commons/commons-io -->
<dependency>
    <groupId>org.apache.commons</groupId>
    <artifactId>commons-io</artifactId>
    <version>1.3.2</version>
</dependency>


You might also like:
Java Concepts
Java String concepts
Immutable classes in Java
Remove duplicates from the array
Telephonic phone technical interview questions
Telephonic phone technical interview questions - Part 2
Serialization & Deserialization
Observable and Observer Interface
Servlet Filter
Servlet Client Request
Spring dependencies for Maven
Java String Operations

Observable and Observer interface


  1. Observable is a class.
  2. Observer is an interface.
  3. Observable class maintains a list of observers.
  4. If something changes in Observable then it will notify all its observers.

 
import java.util.Observable;
import java.util.Observer;

class NewPosts extends Observable {
  private String post;

  public String getPost() {
    return post;
  }

  public void updatePost(String post) {
    this.post = post;
    setChanged();
    notifyObservers(post);
  }

  public static void main(String[] args) {
    NewPosts posts = new NewPosts();
    User user1 = new User();
    User user2 = new User();
    posts.addObserver(user1);
    posts.addObserver(user2);
    board.updatePost("New Post is available");
  }
}

class User implements Observer {
  public void update(Observable o, Object arg) {
    System.out.println("New Post available: " + arg);
  }
}


In the above example, a user registers by adding himself to the list of observers. When a new post is available, the user will be notified. Similarly, when a new post is available the observable updates all the users in the observers list.

You might also like:
Java Concepts
Java String concepts
Immutable classes in Java
Remove duplicates from the array
Telephonic phone technical interview questions
Telephonic phone technical interview questions - Part 2
Serialization & Deserialization
Jersey Package Dependencies
Servlet Filter
Servlet Client Request
Spring dependencies for Maven
Java String Operations

NoSQL

This one is reviewed but I need to delete its copy from hubpages or somewhere NoSQL Data models: key-value  Aggregate model.  key or i...