baeldung-articlesBAEL-553 Intro to Spring Remoting with HTTP Invokers (#1034)

* First test with log4j rolling appenders

* small fix

* Log4j rolling appender

* First set up with rolling file on log4j 2

* Added logback code.

* log4j2 more detailed example

* log4j2 more detailed example

* Improved names and examples

* Fixed configurations

* improved configs

* formatted

* Final fix

* fixed formatting

* Formatting fix

* Fix sample apps to avoid try / catch

* Fix request to replace files

* Fix end lines

* Log4j2 logger is shot down at the end.

* Initial commit, the server starts launched from maven

* made room for client and server projects

* made room for client and server projects

* base example works

* poms restructured

* packages restructured

* packages restructured

* Some renaming and a proper formatting string

* Small renamings

* Small renamings

* Fixed invoked URL in client through fixing bean name

* java.time.* instead of java.util.Date

* java.time.* instead of java.util.Date

* Removed log on file, kepts log on console

* Updated Spring and Logback version to latest release.

* Exception removed from run()

* Code simplification.
- Interfaces and objects simplified.
- Spring Boot instead of plain Spring
- No need for Tomcat plug in anymore.

* Small updates to poms.

* Unused classes removed.

* Unused classes removed.
This commit is contained in:
Daniele Demichelis
2017-01-24 05:00:58 +01:00
committed by KevinGilmore
parent 9220584528
commit 673faede4c
15 changed files with 68 additions and 331 deletions
@@ -1,26 +0,0 @@
package com.baeldung.api;
import java.io.Serializable;
public class Address implements Serializable{
private String address;
private String countryCode;
public Address(String address, String countryCode) {
this.address = address;
this.countryCode = countryCode;
}
public String getAddress() {
return address;
}
public String getCountryCode() {
return countryCode;
}
@Override public String toString() {
return address + " (" + countryCode + ")";
}
}
@@ -1,52 +1,17 @@
package com.baeldung.api;
import java.io.Serializable;
import java.time.LocalDateTime;
import static java.lang.String.format;
public class Booking implements Serializable {
private int costInCent;
private int etaInSeconds;
private String bookingCode;
private LocalDateTime pickUptime;
private Address pickUpAddress;
private Address dropOffAddress;
public Booking(Address pickUpAddress, LocalDateTime pickUptime, Address dropOffAddress, int costInCent, int etaInSeconds, String bookingCode) {
this.costInCent = costInCent;
this.etaInSeconds = etaInSeconds;
this.bookingCode = bookingCode;
this.pickUptime = pickUptime;
this.pickUpAddress = pickUpAddress;
this.dropOffAddress = dropOffAddress;
}
public int getCostInCent() {
return costInCent;
}
public int getEtaInSeconds() {
return etaInSeconds;
}
public String getBookingCode() {
return bookingCode;
}
public LocalDateTime getPickUptime() {
return pickUptime;
}
public Address getDropOffAddress() {
return dropOffAddress;
}
@Override public String toString() {
return String.format("Booking: pick up @ %tr in %s, drop down in %s after %d minutes, %.2f $.", pickUptime, pickUpAddress, dropOffAddress, etaInSeconds / 60, costInCent / 100.0);
return format("Ride confirmed: code '%s'.", bookingCode);
}
public static void main(String[] args) throws InterruptedException {
System.out.println(new Booking(new Address("a", "b"),
LocalDateTime.now(), new Address("c", "d"), 123_00, 600, "abc"));
public Booking(String bookingCode) {
this.bookingCode = bookingCode;
}
}
@@ -1,5 +1,5 @@
package com.baeldung.api;
public interface CabBookingService {
Booking bookPickUp(Address pickUpLocation, Address dropOffLocation, int pax) throws BookingException;
Booking bookRide(String pickUpLocation) throws BookingException;
}