Ravi Srinivasan
2018-09-14 a37070c239d87ec5f0b0a0544351a57ed06f489b
Fixes for Chap 6 on REST
4 files deleted
1 files added
2 files modified
270 ■■■■■ changed files
labs/hello-rest/src/main/java/com/redhat/training/messaging/JMSUtil.java 28 ●●●●● patch | view | raw | blame | history
labs/hello-rest/src/main/java/com/redhat/training/messaging/QueueListener.java 59 ●●●●● patch | view | raw | blame | history
labs/hello-rest/src/main/java/com/redhat/training/rest/PersonService.java 7 ●●●●● patch | view | raw | blame | history
solutions/hello-rest/src/main/java/com/redhat/training/messaging/JMSUtil.java 28 ●●●●● patch | view | raw | blame | history
solutions/hello-rest/src/main/java/com/redhat/training/messaging/QueueListener.java 59 ●●●●● patch | view | raw | blame | history
solutions/hello-rest/src/main/java/com/redhat/training/rest/PersonService.java 7 ●●●●● patch | view | raw | blame | history
solutions/pom.xml 82 ●●●●● patch | view | raw | blame | history
labs/hello-rest/src/main/java/com/redhat/training/messaging/JMSUtil.java
File was deleted
labs/hello-rest/src/main/java/com/redhat/training/messaging/QueueListener.java
File was deleted
labs/hello-rest/src/main/java/com/redhat/training/rest/PersonService.java
@@ -25,7 +25,6 @@
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.ResponseBuilder;
import com.redhat.training.messaging.JMSUtil;
import com.redhat.training.model.Person;
//TODO Add the stateless annotation
@@ -45,9 +44,6 @@
    @Resource
    UserTransaction tx;
    @Inject
    JMSUtil jmsUtil;
    // Simple non-RESTy method for JSF bean invocation
    public String hello(String name) {
        try {
@@ -66,9 +62,6 @@
                Person p = new Person();
                p.setName(name);
                entityManager.persist(p);
                // Send a JMS message to the 'helloWorldQueue'
                jmsUtil.sendMessage("Said Hello to " + name.toUpperCase() + " at " + fdate);
                // respond back with Hello and convert the name to UPPERCASE. Also, send the
                // current time on the server.
solutions/hello-rest/src/main/java/com/redhat/training/messaging/JMSUtil.java
File was deleted
solutions/hello-rest/src/main/java/com/redhat/training/messaging/QueueListener.java
File was deleted
solutions/hello-rest/src/main/java/com/redhat/training/rest/PersonService.java
@@ -25,7 +25,6 @@
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.ResponseBuilder;
import com.redhat.training.messaging.JMSUtil;
import com.redhat.training.model.Person;
@Stateless
@@ -40,9 +39,6 @@
    @Resource
    UserTransaction tx;
    @Inject
    JMSUtil jmsUtil;
    // Simple non-RESTy method for JSF bean invocation
    public String hello(String name) {
@@ -62,9 +58,6 @@
                Person p = new Person();
                p.setName(name);
                entityManager.persist(p);
                // Send a JMS message to the 'helloWorldQueue'
                jmsUtil.sendMessage("Said Hello to " + name.toUpperCase() + " at " + fdate);
                // respond back with Hello and convert the name to UPPERCASE. Also, send the
                // current time on the server.
solutions/pom.xml
New file
@@ -0,0 +1,82 @@
<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>com.redhat.training</groupId>
    <artifactId>parent-pom</artifactId>
    <version>1.0</version>
    <packaging>pom</packaging>
    <name>JB125 Parent Project</name>
    <description>This is the parent project</description>
    <properties>
        <!-- Explicitly declaring the source encoding eliminates the following
            message: -->
        <!-- [WARNING] Using platform encoding (UTF-8 actually) to copy filtered
            resources, i.e. build is platform dependent! -->
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <!-- JBoss dependency versions -->
        <version.wildfly.maven.plugin>1.0.2.Final</version.wildfly.maven.plugin>
        <!-- Define the version of the JBoss BOMs we want to import to specify tested stacks. -->
        <version.jboss.bom.eap>7.0.2.GA</version.jboss.bom.eap>
        <!-- other plug-in versions -->
        <version.surefire.plugin>2.10</version.surefire.plugin>
        <version.war.plugin>2.1.1</version.war.plugin>
        <!-- maven-compiler-plugin -->
        <maven.compiler.target>1.8</maven.compiler.target>
        <maven.compiler.source>1.8</maven.compiler.source>
    </properties>
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.jboss.bom</groupId>
                <artifactId>jboss-eap-javaee7-with-tools</artifactId>
                <version>${version.jboss.bom.eap}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.jboss.eap</groupId>
                <artifactId>wildfly-ejb-client-bom</artifactId>
                <version>7.0.2.GA-redhat-1</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>
    <build>
        <finalName>${project.artifactId}</finalName>
        <plugins>
            <plugin>
                <artifactId>maven-war-plugin</artifactId>
                <version>${version.war.plugin}</version>
                <configuration>
                    <!-- Java EE doesn't require web.xml, Maven needs to catch
                        up! -->
                    <failOnMissingWebXml>false</failOnMissingWebXml>
                </configuration>
            </plugin>
            <!-- Surefire plug-in is responsible for running tests
                as part of project build -->
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${version.surefire.plugin}</version>
            </plugin>
            <!-- The WildFly plug-in deploys the WAR to a local JBoss EAP container -->
            <!-- To use, run: mvn package wildfly:deploy -->
            <plugin>
                <groupId>org.wildfly.plugins</groupId>
                <artifactId>wildfly-maven-plugin</artifactId>
                <version>${version.wildfly.maven.plugin}</version>
            </plugin>
        </plugins>
    </build>
</project>