- Who is who
- Get familiar with course plan and rules
- Propose changes in course plan (if any)
- Configure Git
- Configure Maven
- Java threads
- Introduction, threads creation
- Data synchronization, critical sections
- Concurrent collections, advanced mechanisms
- Java Messaging System (JMS)
- JMS Message
- Topic/Queue
- Spring and JMS
- Transactions
- REST services as communication for MicroServices
- Expose REST API
- Consume REST API
- Actor model in Akka
- In-memory data grid - Hazelcast
There will be a project to implement at home after each section. There will be two weeks to implement the project. Final grade will be the mean of all grades.
There will be possibility to gain additional points (positive or negative) for being active or distracting during labs.
Presence will be verified. Student can miss two labs without giving a reason. However, he/she might be asked by tutor to deliver exercises that were solved on labs during his absence.
Students should work individually, however cooperation during labs is allowed and even desired. At the end of particular lab all students should have all exercises implemented.
Git is a distributed revision control and source code management system. It allows multiple users to work simultaneously on the same project. In contrast to client-server systems (like CVS, SVN) every Git working directory is a full-fledged repository with complete history.
GitHub is a web-based hosting service for Git repositories.
GitBash is a command line client for Git available on Windows.
- Go to https://github.com/ and create account
- Set up Git on your workstation using GitBash
- Get familiar with instructions at https://help.github.com/articles/set-up-git
- Set your full name using command
git config --global user.name "YOUR NAME" - Set your email address using command
git config --global user.email "YOUR EMAIL ADDRESS"
- Fork main repository https://github.com/bsodzik/distributed-java-intro
- Get familiar with instructions at https://help.github.com/articles/fork-a-repo
- Prepare your workstation
- Clone forked repository using command
git clone https://github.com/<your_login>/distributed-java-intro.git - Add upstream repository with
git remote add upstream https://github.com/bsodzik/distributed-java-intro.git
- Synchronize your fork with main repository
- Get familiar with instructions at https://help.github.com/articles/syncing-a-fork
- Remember to synchronize your fork before each labs with
git pull upstream master
- Get familiar with basic Git commands http://git-scm.com/docs
git clone- clone repositorygit status- check status of your projectgit pull- fetch changes from remote repository and merge them with your local repository (equivalent togit fetchplusgit merge)git add- add untracked files to commitgit commit -m "Your message"- commit tracked files to your local repositorygit push origin master- push commits to remote repository
- Change
README.mdfile (you may write some joke) and then commit your change to local repository and push it to remote repository - After your change is pushed, create a Pull Request on GitHub so that tutor can see your work.
- Maven is a
- building tool
- dependency management tool
- documentation tool
- Installation
- check installation: mvn --version
- Quick start
- mvn archetype:generate -DgroupId=com.mycompany.app -DartifactId=my-app -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false
- Archetype: In Maven, an archetype is a template of a project
- groupId: This element indicates the unique identifier of the organization or group that created the project
- artifactId: This element indicates the unique base name of the primary artifact being generated by this project.
- Standard project structure
my-app
|-- pom.xml
`-- src
|-- main
| `-- java
| `-- com
| `-- mycompany
| `-- app
| `-- App.java
`-- test
`-- java
`-- com
`-- mycompany
`-- app
`-- AppTest.java
- POM
- dependencies
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.2</version>
<scope>test</scope>
</dependency>
</dependencies>
- Commands
- mvn clean install
- Exercise: Add google guava
- Search for dependencies in: http://search.maven.org/ or http://mvnrepository.com/
- code example:
package com.mycompany.app;
import com.google.common.base.Function;
public class App {
public static void main(String[] args) {
System.out.println(HELLO_FUNCTION.apply("UAM"));
}
private final static Function<String, String> HELLO_FUNCTION = new Function<String, String>() {
@Override
public String apply(String name) {
return "Hello " + name;
}
};
}
- Q&A