Home » Java » Enterprise Java » Page 330

Enterprise Java

Akka STM – Playing PingPong with STM Refs and Agents

PingPong is a classic example where 2 players (or threads) access a shared resource – PingPong Table and pass the Ball (state variable) between each other. With any shared resource, unless we synchronize the access, the threads can run into potential deadlock situation. The PingPong algorithm is very simple if my turn { update whose turn is next ping/pong -log ...

Read More »

REST CXF for Spring JPA2 backend

spring-interview-questions-answers

In this demo, we will generate a REST/CXF application with spring/jpa2 backend. This demo presents the track REST-CXF of minuteproject. The model from demo 2 remains the same. The enrichment stays the same. But the tracks changes What is added are 2 layers: a DAO layer with spring integration on top of JPA2 a REST-CXF layer with JAX-RS annotation The ...

Read More »

Dynamic Property Management in Spring

spring-interview-questions-answers

Static and Dynamic Properties are very important for both operational management and changing the behavior of the system at the production level. Specially, dynamic parameters reduces interruption of the service. This article shows how to manage dynamic properties in Spring Applications by using Quartz. Multi-Job Scheduling Service by using Spring and Quartz article is offered for Spring and Quartz Integration. ...

Read More »

TeamCity artifacts: HTTP, Ant, Gradle and Maven

In how many ways can you retrieve TeamCity artifacts? I say plenty to choose from! If you’re in a world of Java build tools then you can use plain HTTP request, Ant + Ivy, Gradle and Maven to download and use binaries produced by TeamCity build configurations. How? Read on. Build Configuration “id” Before you retrieve artifacts of any build ...

Read More »

Load or Save Image using Hibernate – MySQL

This tutorial will walk you throughout how to save and load an image from database (MySQL) using Hibernate. Requirements For this sampel project, we are going to use: Eclipse IDE (you can use your favorite IDE); MySQL(you can use any other database, make sure to change the column type if required); Hibernate jars and dependencies (you can download the sample ...

Read More »

Spring & JSF integration: Pagination

When working with large datasets you often need to present data in a paged format. Pagination is an interesting problem because it tends to cut across all layers of your application, from the view tier though application services down to the raw calls to your database. When it comes to fetching paged data there are some pretty good solutions available. ...

Read More »

Spring Testing Support with TestNG

spring-interview-questions-answers

TestNG is a test framework which is designed to cover all categories of tests: unit, functional, end-to-end, integration, (etc). It includes a lot of features such as flexible test configuration, support for data-driven testing (with @DataProvider), powerful execution model (no more TestSuite) (etc). Spring testing support covers very useful and important features for unit and integration testing of spring based ...

Read More »

Implementing Master Slave / Grid Computing Pattern in Akka

Master Slave pattern is a prime example of fault tolerance and parallel computation. The idea behind the pattern is to partition the work into identical sub tasks which are then delegated to Slaves. These slave node or instances will process the work task and send back the result to the master. The master will then compile the resultsreceivedfrom all the ...

Read More »