Notizen
Java basic

Inhalt der Notizen (3)
Seite 1
Java threading
Thread:- Uint of process
Two ways of implementation on extending the Thread Class or implement the runnable interface.
wait():- wait for it's time to execute
notify():-ones one thread completed its work notify to other thread for their turn.
getName():- Obtain thread’s name
getPriority:- Obtain thread’s priority
isAlive():- Determine if a thread is still running
join():- Wait for a thread to terminate
run():- the entry point for the thread
sleep():- Suspend a thread for a while
start():- Start a thread by calling its run method
yield:() indicates that the thread is not doing anything particularly important and if any other threads or processes need to be run, they can. Otherwise, the current thread will continue to run.
Executor framework
ExecutorService is a framework provided by the JDK which simplifies the execution of tasks in asynchronous mode. Generally speaking, ExecutorService automatically provides a pool of threads and API for assigning tasks to it.
Benefits of Executor framework
The framework mainly separates task creation and execution. Task creation is mainly boilerplate code and is easily replaceable.
With an executor, we have to create tasks which implement either Runnable or Callable interface and send them to the executor.
Executor internally maintains a (configurable) thread pool to improve application performance by avoiding the continuous spawning of threads.
An executor is responsible for executing the tasks, running them with the necessary threads from the pool.
Callable and Future
Another important advantage of the Executor framework was the Callable interface. It’s similar to the Runnable interface with two benefits:
It’s call() method returns a result after the thread execution is complete.
When we send a Callable object to an executor, we get a Future object’s reference. We can use this object to query the status of thread and the result of the Callable object.
https://www.baeldung.com/java-executor-service-tutorial
https://howtodoinjava.com/java/multi-threading/executor-service-example/
Spring transaction isolation:-
https://www.byteslounge.com/tutorials/spring-transaction-isolation-tutorial
https://www.baeldung.com/transaction-configuration-with-jpa-and-spring
https://netjs.blogspot.com/2018/08/spring-transaction-attributes-propagation-isolation-settings.html
https://www.youtube.com/watch?v=l-YVzkQMLKg&list=PLlhM4lkb2sEhY6YLVcRp0YCkstitjw6AI&index=5
Seite 2
Lambda Expression
-- An interface that contains at most one abstract function.
-- Represent abstract concepts such as function, actions or predicates.
Predicate--
Take one argument, return a boolean.
Consumer--
Accepts a single argument with no return value.
Function--
Accepts one argument and produces a result.
Seite 3
Rest API interview
https://www.techbeamers.com/rest-api-interview-questions-answers/
https://www.youtube.com/watch?v=sSm2dRarhPo
Spring Transaction

Informationen
- Beschreibung
- Notiz am Java basic, erstellt von Himanshu Tiwari am 10/09/2019.
- Erstellt von
- Himanshu Tiwari
- Aufrufe
- 5
- Tags
- Bewertung