Compare commits

..

10 Commits

Author SHA1 Message Date
925755fa35 Reach milestone 1.25.0 2021-11-11 21:47:49 +02:00
89b2072131 fix: use double check to fix concurrent problem (#1909)
Co-authored-by: zhangwenhe <zhangwh@ehualu.com>
2021-11-11 19:46:24 +02:00
0a7b524bd1 docs: add harshalkh as a contributor for code (#1900)
* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2021-10-31 09:12:05 +02:00
36c6ce1df7 sonar fix: Update App.java (#1896)
* Update App.java

Sonar issue fix

* Update App.java
2021-10-31 09:10:58 +02:00
22ddd57146 sonar fix: Update App.java (#1898) 2021-10-31 09:08:49 +02:00
72bb189dc0 CI: Update Workflows (#1879)
* Update Workflows

#1875

* Updated requested changes
2021-10-27 21:44:00 +03:00
bee1283371 docs: updated example with lombok as per code (#1891) 2021-10-24 17:27:24 +03:00
785cbf42b7 docs: add Fiordy as a contributor for doc (#1890)
* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2021-10-24 09:51:18 +03:00
c51eb66c89 docs: abstract-factory - readme - corrected code description as per real file (#1887) 2021-10-24 09:49:52 +03:00
1eb74203fc docs: add uh-zz as a contributor for translation (#1889)
* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2021-10-24 09:41:49 +03:00
166 changed files with 265 additions and 205 deletions

View File

@ -1703,6 +1703,24 @@
"contributions": [
"translation"
]
},
{
"login": "Fiordy",
"name": "Fiordy",
"avatar_url": "https://avatars.githubusercontent.com/u/53420573?v=4",
"profile": "https://github.com/Fiordy",
"contributions": [
"doc"
]
},
{
"login": "harshalkh",
"name": "Harshal",
"avatar_url": "https://avatars.githubusercontent.com/u/37841724?v=4",
"profile": "https://github.com/harshalkh",
"contributions": [
"code"
]
}
],
"contributorsPerLine": 7,

View File

@ -24,6 +24,9 @@
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
# We are using two jobs here for testing our code on the latest JDK 11 build as well as a more satble build version of 11.0.3
# You can see the full discussion here https://github.com/iluwatar/java-design-patterns/pull/1868#issue-1029459688
name: Java CI
on:
@ -33,12 +36,11 @@ on:
jobs:
build:
# This Workflow Job will build this project and run Sonar analysis using JDK 11.0.3
build-and-analyze:
name: Build and Run Sonar analysis on JDK 11.0.3
runs-on: ubuntu-20.04
strategy:
matrix:
java-version: [ 11.0.3, 11 ]
steps:
- name: Checkout Code
@ -47,12 +49,14 @@ jobs:
# Disabling shallow clone for improving relevancy of SonarQube reporting
fetch-depth: 0
- name: Set up JDK ${{ matrix.java-version }}
- name: Set up JDK 11.0.3
uses: actions/setup-java@v2
with:
java-version: ${{ matrix.java-version }}
java-version: 11.0.3
distribution: 'zulu'
cache: 'maven'
# Cache Sonar packages which as used to run anaylysis and collect metrics
- name: Cache SonarCloud packages
uses: actions/cache@v2
with:
@ -60,14 +64,6 @@ jobs:
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache Maven dependencies
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
# Some tests need screen access
- name: Install xvfb
run: sudo apt-get install -y xvfb
@ -78,3 +74,28 @@ jobs:
# These two env variables are needed for sonar analysis
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
# This Workflow Job is going to build the project on the latest stable JDK 11
build:
name: Build and Test on JDK 11
runs-on: ubuntu-20.04
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Set up JDK 11 (Latest)
uses: actions/setup-java@v2
with:
java-version: 11
distribution: 'zulu'
cache: 'maven'
# Some tests need screen access
- name: Install xvfb
run: sudo apt-get install -y xvfb
- name: Build with Maven
run: xvfb-run ./mvnw clean verify

View File

@ -34,11 +34,13 @@ on:
jobs:
build:
name: Build JDP
runs-on: ubuntu-20.04
strategy:
matrix:
java-version: [ 11.0.3, 11 ]
steps:
- name: Checkout Code
uses: actions/checkout@v2
@ -47,14 +49,7 @@ jobs:
with:
java-version: ${{ matrix.java-version }}
distribution: 'zulu'
- name: Cache Maven Dependecies
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
cache: 'maven'
# Some tests need screen access
- name: Install xvfb

View File

@ -10,7 +10,7 @@
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=iluwatar_java-design-patterns&metric=coverage)](https://sonarcloud.io/dashboard?id=iluwatar_java-design-patterns)
[![Join the chat at https://gitter.im/iluwatar/java-design-patterns](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/iluwatar/java-design-patterns?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
[![All Contributors](https://img.shields.io/badge/all_contributors-187-orange.svg?style=flat-square)](#contributors-)
[![All Contributors](https://img.shields.io/badge/all_contributors-189-orange.svg?style=flat-square)](#contributors-)
<!-- ALL-CONTRIBUTORS-BADGE:END -->
<br/>
@ -315,6 +315,8 @@ This project is licensed under the terms of the MIT license.
<td align="center"><a href="https://github.com/ManviGoel26"><img src="https://avatars.githubusercontent.com/u/55682355?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Manvi Goel</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=ManviGoel26" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/blueberry404"><img src="https://avatars.githubusercontent.com/u/39243539?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Anum Amin</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=blueberry404" title="Documentation">📖</a></td>
<td align="center"><a href="https://uh-zz.github.io/blog/"><img src="https://avatars.githubusercontent.com/u/47747828?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Reo Uehara</b></sub></a><br /><a href="#translation-uh-zz" title="Translation">🌍</a></td>
<td align="center"><a href="https://github.com/Fiordy"><img src="https://avatars.githubusercontent.com/u/53420573?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Fiordy</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=Fiordy" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/harshalkh"><img src="https://avatars.githubusercontent.com/u/37841724?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Harshal</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=harshalkh" title="Code">💻</a></td>
</tr>
</table>

View File

@ -28,7 +28,7 @@
<parent>
<artifactId>java-design-patterns</artifactId>
<groupId>com.iluwatar</groupId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<artifactId>abstract-document</artifactId>
<dependencies>

View File

@ -87,24 +87,36 @@ public interface KingdomFactory {
}
public class ElfKingdomFactory implements KingdomFactory {
@Override
public Castle createCastle() {
return new ElfCastle();
}
@Override
public King createKing() {
return new ElfKing();
}
@Override
public Army createArmy() {
return new ElfArmy();
}
}
public class OrcKingdomFactory implements KingdomFactory {
@Override
public Castle createCastle() {
return new OrcCastle();
}
@Override
public King createKing() {
return new OrcKing();
}
@Override
public Army createArmy() {
return new OrcArmy();
}

View File

@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<artifactId>abstract-factory</artifactId>
<dependencies>

View File

@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<artifactId>active-object</artifactId>
<dependencies>

View File

@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<artifactId>acyclic-visitor</artifactId>
<properties>

View File

@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<artifactId>adapter</artifactId>
<dependencies>

View File

@ -27,7 +27,7 @@
<parent>
<artifactId>aggregator-microservices</artifactId>
<groupId>com.iluwatar</groupId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>aggregator-service</artifactId>

View File

@ -27,7 +27,7 @@
<parent>
<artifactId>aggregator-microservices</artifactId>
<groupId>com.iluwatar</groupId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>information-microservice</artifactId>

View File

@ -27,7 +27,7 @@
<parent>
<artifactId>aggregator-microservices</artifactId>
<groupId>com.iluwatar</groupId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>inventory-microservice</artifactId>

View File

@ -27,7 +27,7 @@
<parent>
<artifactId>java-design-patterns</artifactId>
<groupId>com.iluwatar</groupId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>aggregator-microservices</artifactId>

View File

@ -27,7 +27,7 @@
<parent>
<artifactId>java-design-patterns</artifactId>
<groupId>com.iluwatar</groupId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>ambassador</artifactId>

View File

@ -27,7 +27,7 @@
<parent>
<artifactId>api-gateway</artifactId>
<groupId>com.iluwatar</groupId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>api-gateway-service</artifactId>

View File

@ -27,7 +27,7 @@
<parent>
<artifactId>api-gateway</artifactId>
<groupId>com.iluwatar</groupId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>image-microservice</artifactId>

View File

@ -27,7 +27,7 @@
<parent>
<artifactId>java-design-patterns</artifactId>
<groupId>com.iluwatar</groupId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>api-gateway</artifactId>

View File

@ -27,7 +27,7 @@
<parent>
<artifactId>api-gateway</artifactId>
<groupId>com.iluwatar</groupId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>price-microservice</artifactId>

View File

@ -27,7 +27,7 @@
<parent>
<artifactId>java-design-patterns</artifactId>
<groupId>com.iluwatar</groupId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>arrange-act-assert</artifactId>

View File

@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<artifactId>async-method-invocation</artifactId>
<dependencies>

View File

@ -27,7 +27,7 @@
<parent>
<artifactId>java-design-patterns</artifactId>
<groupId>com.iluwatar</groupId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>balking</artifactId>

View File

@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<artifactId>bridge</artifactId>
<dependencies>

View File

@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<artifactId>builder</artifactId>
<dependencies>

View File

@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<artifactId>business-delegate</artifactId>
<dependencies>

View File

@ -27,7 +27,7 @@
<parent>
<artifactId>java-design-patterns</artifactId>
<groupId>com.iluwatar</groupId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>bytecode</artifactId>

View File

@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<artifactId>caching</artifactId>
<dependencies>

View File

@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<artifactId>callback</artifactId>
<dependencies>

View File

@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<artifactId>chain-of-responsibility</artifactId>
<dependencies>

View File

@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<artifactId>circuit-breaker</artifactId>
<dependencies>

View File

@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<artifactId>collection-pipeline</artifactId>
<dependencies>

View File

@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<artifactId>combinator</artifactId>
<dependencies>

View File

@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<artifactId>command</artifactId>
<dependencies>

View File

@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<artifactId>commander</artifactId>
<dependencies>

View File

@ -27,7 +27,7 @@
<parent>
<artifactId>java-design-patterns</artifactId>
<groupId>com.iluwatar</groupId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>composite-entity</artifactId>

View File

@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<artifactId>composite</artifactId>
<dependencies>

View File

@ -27,7 +27,7 @@
<parent>
<artifactId>java-design-patterns</artifactId>
<groupId>com.iluwatar</groupId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<artifactId>converter</artifactId>
<modelVersion>4.0.0</modelVersion>

View File

@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<artifactId>cqrs</artifactId>
<dependencies>

View File

@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<artifactId>dao</artifactId>
<dependencies>

View File

@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<artifactId>data-bus</artifactId>
<dependencies>

View File

@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<artifactId>data-locality</artifactId>
<dependencies>

View File

@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<artifactId>data-mapper</artifactId>
<dependencies>

View File

@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<artifactId>data-transfer-object</artifactId>
<dependencies>

View File

@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<artifactId>decorator</artifactId>
<dependencies>

View File

@ -27,7 +27,7 @@
<parent>
<artifactId>java-design-patterns</artifactId>
<groupId>com.iluwatar</groupId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>delegation</artifactId>

View File

@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<artifactId>dependency-injection</artifactId>
<dependencies>

View File

@ -28,10 +28,10 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<artifactId>dirty-flag</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
<name>dirty-flag</name>
<url>http://maven.apache.org</url>
<properties>

View File

@ -27,7 +27,7 @@
<parent>
<artifactId>java-design-patterns</artifactId>
<groupId>com.iluwatar</groupId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>domain-model</artifactId>

View File

@ -27,7 +27,7 @@
<parent>
<artifactId>java-design-patterns</artifactId>
<groupId>com.iluwatar</groupId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>double-buffer</artifactId>

View File

@ -27,7 +27,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<artifactId>double-checked-locking</artifactId>
<dependencies>

View File

@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<artifactId>double-dispatch</artifactId>
<dependencies>

View File

@ -29,7 +29,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<dependencies>
<dependency>

View File

@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<artifactId>eip-message-channel</artifactId>
<dependencies>

View File

@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<artifactId>eip-publish-subscribe</artifactId>
<dependencies>

View File

@ -29,7 +29,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<dependencies>
<dependency>

View File

@ -29,7 +29,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<dependencies>
<dependency>

View File

@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<artifactId>event-aggregator</artifactId>
<dependencies>

View File

@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<artifactId>event-asynchronous</artifactId>
<dependencies>

View File

@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<artifactId>event-driven-architecture</artifactId>
<dependencies>

View File

@ -28,7 +28,7 @@
<parent>
<artifactId>java-design-patterns</artifactId>
<groupId>com.iluwatar</groupId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<artifactId>event-queue</artifactId>
<dependencies>

View File

@ -28,7 +28,7 @@
<parent>
<artifactId>java-design-patterns</artifactId>
<groupId>com.iluwatar</groupId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<artifactId>event-sourcing</artifactId>
<dependencies>

View File

@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<artifactId>execute-around</artifactId>
<dependencies>

View File

@ -27,7 +27,7 @@
<parent>
<artifactId>java-design-patterns</artifactId>
<groupId>com.iluwatar</groupId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>extension-objects</artifactId>

View File

@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<artifactId>facade</artifactId>
<dependencies>

View File

@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<artifactId>factory-kit</artifactId>
<dependencies>

View File

@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<artifactId>factory-method</artifactId>
<dependencies>

View File

@ -41,6 +41,8 @@ import lombok.extern.slf4j.Slf4j;
@Slf4j
public class App {
private static final String MANUFACTURED = "{} manufactured {}";
/**
* Program entry point.
* @param args command line args
@ -49,14 +51,14 @@ public class App {
Blacksmith blacksmith = new OrcBlacksmith();
Weapon weapon = blacksmith.manufactureWeapon(WeaponType.SPEAR);
LOGGER.info("{} manufactured {}", blacksmith, weapon);
LOGGER.info(MANUFACTURED, blacksmith, weapon);
weapon = blacksmith.manufactureWeapon(WeaponType.AXE);
LOGGER.info("{} manufactured {}", blacksmith, weapon);
LOGGER.info(MANUFACTURED, blacksmith, weapon);
blacksmith = new ElfBlacksmith();
weapon = blacksmith.manufactureWeapon(WeaponType.SPEAR);
LOGGER.info("{} manufactured {}", blacksmith, weapon);
LOGGER.info(MANUFACTURED, blacksmith, weapon);
weapon = blacksmith.manufactureWeapon(WeaponType.AXE);
LOGGER.info("{} manufactured {}", blacksmith, weapon);
LOGGER.info(MANUFACTURED, blacksmith, weapon);
}
}

View File

@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<artifactId>factory</artifactId>
<dependencies>

View File

@ -31,7 +31,7 @@
<parent>
<artifactId>java-design-patterns</artifactId>
<groupId>com.iluwatar</groupId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>fanout-fanin</artifactId>

View File

@ -27,7 +27,7 @@
<parent>
<artifactId>java-design-patterns</artifactId>
<groupId>com.iluwatar</groupId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>feature-toggle</artifactId>

View File

@ -27,7 +27,7 @@
<parent>
<artifactId>java-design-patterns</artifactId>
<groupId>com.iluwatar</groupId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>filterer</artifactId>

View File

@ -27,7 +27,7 @@
<parent>
<artifactId>java-design-patterns</artifactId>
<groupId>com.iluwatar</groupId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>fluentinterface</artifactId>

View File

@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<artifactId>flux</artifactId>
<dependencies>

View File

@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<artifactId>flyweight</artifactId>
<dependencies>

View File

@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<artifactId>front-controller</artifactId>
<dependencies>

View File

@ -27,7 +27,7 @@
<parent>
<artifactId>java-design-patterns</artifactId>
<groupId>com.iluwatar</groupId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>game-loop</artifactId>

View File

@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<packaging>jar</packaging>
<artifactId>guarded-suspension</artifactId>

View File

@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<artifactId>half-sync-half-async</artifactId>
<dependencies>

View File

@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<artifactId>hexagonal</artifactId>
<dependencies>

View File

@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<artifactId>intercepting-filter</artifactId>
<dependencies>

View File

@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<artifactId>interpreter</artifactId>
<dependencies>

View File

@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<artifactId>iterator</artifactId>
<dependencies>

View File

@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<groupId>com.iluwatar.layers</groupId>
<artifactId>layers</artifactId>

View File

@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<artifactId>lazy-loading</artifactId>
<dependencies>

View File

@ -28,7 +28,7 @@
<parent>
<artifactId>java-design-patterns</artifactId>
<groupId>com.iluwatar</groupId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<artifactId>leader-election</artifactId>
<dependencies>

View File

@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<artifactId>leader-followers</artifactId>
<dependencies>

View File

@ -57,9 +57,11 @@ public class Worker implements Runnable {
try {
if (workCenter.getLeader() != null && !workCenter.getLeader().equals(this)) {
synchronized (workCenter) {
workCenter.wait();
if (workCenter.getLeader() != null && !workCenter.getLeader().equals(this)) {
workCenter.wait();
continue;
}
}
continue;
}
final Task task = taskSet.getTask();
synchronized (workCenter) {

View File

@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<artifactId>lockable-object</artifactId>
<dependencies>

View File

@ -27,7 +27,7 @@
<parent>
<artifactId>java-design-patterns</artifactId>
<groupId>com.iluwatar</groupId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>marker</artifactId>

View File

@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<artifactId>master-worker-pattern</artifactId>
<dependencies>

View File

@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<artifactId>mediator</artifactId>
<dependencies>

View File

@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<artifactId>memento</artifactId>
<dependencies>

View File

@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<artifactId>model-view-controller</artifactId>
<dependencies>

View File

@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<artifactId>model-view-presenter</artifactId>
<name>model-view-presenter</name>

View File

@ -32,11 +32,11 @@
<parent>
<artifactId>java-design-patterns</artifactId>
<groupId>com.iluwatar</groupId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<groupId>com.iluwatar</groupId>
<artifactId>model-view-viewmodel</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
<properties>
<zk.version>9.0.0</zk.version>
<guava.version>19.0</guava.version>

View File

@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<artifactId>module</artifactId>
<dependencies>

View File

@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<artifactId>monad</artifactId>
<dependencies>

View File

@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<artifactId>monostate</artifactId>
<dependencies>

View File

@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<artifactId>multiton</artifactId>
<dependencies>

View File

@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.25.0</version>
</parent>
<artifactId>mute-idiom</artifactId>
<dependencies>

Some files were not shown because too many files have changed in this diff Show More