Skip to content

Commit

Permalink
Adding JavaEE and Spring Batch Projects
Browse files Browse the repository at this point in the history
  • Loading branch information
Pankaj Kumar committed Jan 3, 2019
1 parent 5019408 commit aa425ad
Show file tree
Hide file tree
Showing 96 changed files with 3,212 additions and 0 deletions.
3 changes: 3 additions & 0 deletions JavaEE/JAX-RS-HelloWorld/WebContent/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Manifest-Version: 1.0
Class-Path:

21 changes: 21 additions & 0 deletions JavaEE/JAX-RS-HelloWorld/WebContent/WEB-INF/web.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
id="WebApp_ID" version="3.1">
<display-name>JAX-RS-HelloWorld</display-name>

<servlet>
<servlet-name>Jersey REST Service</servlet-name>
<servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
<init-param>
<param-name>com.sun.jersey.config.property.packages</param-name>
<param-value>com.journaldev.jaxrs.service</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Jersey REST Service</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
</web-app>
43 changes: 43 additions & 0 deletions JavaEE/JAX-RS-HelloWorld/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>JAX-RS-HelloWorld</groupId>
<artifactId>JAX-RS-HelloWorld</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>

<dependencies>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-server</artifactId>
<version>1.19</version>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-servlet</artifactId>
<version>1.19</version>
</dependency>
</dependencies>

<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.6</version>
<configuration>
<warSourceDirectory>WebContent</warSourceDirectory>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.journaldev.jaxrs.service;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;

@Path("/test")
public class TestService {

@GET
@Path("/hello/{msg}")
public String sayHello(@PathParam(value="msg") String msg){
return "Hello "+msg;
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@

package com.journaldev.jaxws.service;

import javax.xml.bind.annotation.XmlRegistry;


/**
* This object contains factory methods for each
* Java content interface and Java element interface
* generated in the com.journaldev.jaxws.service package.
* <p>An ObjectFactory allows you to programatically
* construct new instances of the Java representation
* for XML content. The Java representation of XML
* content can consist of schema derived interfaces
* and classes representing the binding of schema
* type definitions, element declarations and model
* groups. Factory methods for each of these are
* provided in this class.
*
*/
@XmlRegistry
public class ObjectFactory {


/**
* Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: com.journaldev.jaxws.service
*
*/
public ObjectFactory() {
}

/**
* Create an instance of {@link Person }
*
*/
public Person createPerson() {
return new Person();
}

/**
* Create an instance of {@link PersonArray }
*
*/
public PersonArray createPersonArray() {
return new PersonArray();
}

}
Binary file not shown.
98 changes: 98 additions & 0 deletions JavaEE/JAX-WS-Client/src/com/journaldev/jaxws/service/Person.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@

package com.journaldev.jaxws.service;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;


/**
* <p>Java class for person complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="person">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="age" type="{http://www.w3.org/2001/XMLSchema}int"/>
* &lt;element name="id" type="{http://www.w3.org/2001/XMLSchema}int"/>
* &lt;element name="name" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "person", propOrder = {
"age",
"id",
"name"
})
public class Person {

protected int age;
protected int id;
protected String name;

/**
* Gets the value of the age property.
*
*/
public int getAge() {
return age;
}

/**
* Sets the value of the age property.
*
*/
public void setAge(int value) {
this.age = value;
}

/**
* Gets the value of the id property.
*
*/
public int getId() {
return id;
}

/**
* Sets the value of the id property.
*
*/
public void setId(int value) {
this.id = value;
}

/**
* Gets the value of the name property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getName() {
return name;
}

/**
* Sets the value of the name property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setName(String value) {
this.name = value;
}

}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@

package com.journaldev.jaxws.service;

import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;


/**
* <p>Java class for personArray complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="personArray">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="item" type="{http://service.jaxws.journaldev.com/}person" maxOccurs="unbounded" minOccurs="0"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "personArray", propOrder = {
"item"
})
public class PersonArray {

@XmlElement(nillable = true)
protected List<Person> item;

/**
* Gets the value of the item property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the item property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getItem().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link Person }
*
*
*/
public List<Person> getItem() {
if (item == null) {
item = new ArrayList<Person>();
}
return this.item;
}

}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@

package com.journaldev.jaxws.service;

import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebResult;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.ws.Action;


/**
* This class was generated by the JAX-WS RI.
* JAX-WS RI 2.2.4-b01
* Generated source version: 2.2
*
*/
@WebService(name = "PersonService", targetNamespace = "http://service.jaxws.journaldev.com/")
@SOAPBinding(style = SOAPBinding.Style.RPC)
@XmlSeeAlso({
ObjectFactory.class
})
public interface PersonService {


/**
*
* @param arg0
* @return
* returns boolean
*/
@WebMethod
@WebResult(partName = "return")
@Action(input = "http://service.jaxws.journaldev.com/PersonService/addPersonRequest", output = "http://service.jaxws.journaldev.com/PersonService/addPersonResponse")
public boolean addPerson(
@WebParam(name = "arg0", partName = "arg0")
Person arg0);

/**
*
* @param arg0
* @return
* returns boolean
*/
@WebMethod
@WebResult(partName = "return")
@Action(input = "http://service.jaxws.journaldev.com/PersonService/deletePersonRequest", output = "http://service.jaxws.journaldev.com/PersonService/deletePersonResponse")
public boolean deletePerson(
@WebParam(name = "arg0", partName = "arg0")
int arg0);

/**
*
* @param arg0
* @return
* returns com.journaldev.jaxws.service.Person
*/
@WebMethod
@WebResult(partName = "return")
@Action(input = "http://service.jaxws.journaldev.com/PersonService/getPersonRequest", output = "http://service.jaxws.journaldev.com/PersonService/getPersonResponse")
public Person getPerson(
@WebParam(name = "arg0", partName = "arg0")
int arg0);

/**
*
* @return
* returns com.journaldev.jaxws.service.PersonArray
*/
@WebMethod
@WebResult(partName = "return")
@Action(input = "http://service.jaxws.journaldev.com/PersonService/getAllPersonsRequest", output = "http://service.jaxws.journaldev.com/PersonService/getAllPersonsResponse")
public PersonArray getAllPersons();

}
Binary file not shown.
Loading

0 comments on commit aa425ad

Please sign in to comment.