Home » Java » Page 692

Java

How does JVM handle locks

As we are talking about the latest version of Sun Hotspot Java Virtual Machine 1.6 there’re the following three types of locks performed by JVM when you try to acquire lock from java.util.concurrent.locks.Lock implementation or enter synchronized block: biased: sometimes even in concurrent systems there’s no contention and JVM shouldn’t borrow mutex from OS for perform locking in this case. ...

Read More »

Google App Engine: Host application in your own domain

When you create a new application in Google App Engine, you’ll get a domain name “yourapp.appspot.com”. But, who’ll want to host their app with such a suffix (unless you like it!)? To improve your app branding, the best thing to do is to host your app in “www.yourapp.com“. So, how to do this in App Engine? There are two ways. ...

Read More »

How to Avoid ConcurrentModificationException when using an Iterator

Java Collection classes are fail-fast which means that if the Collection will be changed while some thread is traversing over it using iterator, the iterator.next() will throw a ConcurrentModificationException. This situation can come in case of multithreaded as well as single threaded environment. Lets explore this scenario with the following example: import java.util.*; public class IteratorExample { public static void ...

Read More »

App Engine Java Development with Netbeans

If you just started with App engine development, you might be having a feeling that Eclipse is the preferred IDE. And, Google also has offered its official plug-in to Eclipse IDE alone. But what about the people who are not using Eclipse? Of course, you can always do a command line development but who does that these days!? For Netbeans ...

Read More »

RabbitMQ Module for Play! Framework

RabbitMQ offers a highly available, scalable and portable messaging system with predictable and consistent throughput and latency. RabbitMQ is the leading implementation of AMQP, the open standard for business messaging, and, through adapters, supports XMPP, SMTP, STOMP and HTTP for lightweight web messaging. This new module allows you to consume and produce messages on a RabbitMQ instance from your Play! ...

Read More »

Google App Engine Java Capabilities and Namespaces API

Capabilities API With the Capabilities API, your application can detect outages and scheduled downtime for specific API capabilities. You can use this API to reduce downtime in your application by detecting when a capability is unavailable and then bypassing it. How do we handle this, what’s the tradeoff? 1. Elegantly: create an aspect that cross cuts all data store writes, ...

Read More »

Java Generics Quick Tutorial

Generics is a Java feature that was introduced with Java SE 5.0 and, few years after its release, I swear that every Java programmer out there not only heard about it, but used it. There are plenty of both free and commercial resources about Java generics and the best sources I used are: The Java Tutorial Java Generics and Collections, ...

Read More »

Erlang vs Java memory architecture

I read a really, really interesting article on memory management strategies for the Erlang VM. It was written as a thesis by Jesper Wilhelmsson I thought it might be nice to discuss the differences between Erlang‘s memory setup and Oracle’s Java VM. As a real short introduction for those who have never heard of Erlang; it is a functional language ...

Read More »

Spring MVC3 Hibernate CRUD Sample Application

spring-interview-questions-answers

To learn any web framework starting with a HelloWorld application is a good idea. Once we get familiarity with the framework configuration it would be better to do a CRUD (Create,Read,Update,Delete) application which covers various aspects of a web framework like Validations, Request URL Mappings, Request Parameter Binding, Pre-populating forms etc. Now I am going to explain how to write ...

Read More »