The Artima Developer Community
Sponsored Link

Java Buzz Forum
Hazelcast 1.1 released: Http Session clustering and more

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Talip Ozturk

Posts: 103
Nickname: talip
Registered: May, 2003

Talip Ozturk is founder of Hazelcast, distributed queue, set, map and lock implementation.
Hazelcast 1.1 released: Http Session clustering and more Posted: Aug 14, 2008 6:05 AM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Talip Ozturk.
Original Post: Hazelcast 1.1 released: Http Session clustering and more
Feed Title: Shared Memory
Feed URL: http://www.jroller.com/talipozturk/feed/entries/rss
Feed Description: about java, jcache, jini, javaspaces, distributed data structures and a little bit of me and life.
Latest Java Buzz Posts
Latest Java Buzz Posts by Talip Ozturk
Latest Posts From Shared Memory

Advertisement
After a successful 1.0 release, Hazelcast is now helping developers with new tools and features. What is new in 1.1 release:

  • Http session clustering with Hazelcast Webapp Manager (HazelcastWM)
  • Support for java.util.concurrent.ConcurrentMap api in distributed map.
  • Support for full TCP/IP based clustering. (multicast discovery is default but not required)
  • Better and nicer documentation.

Hazelcast Webapp Manager (HazelcastWM)

Hazelcast Webapp Manager is a http session clustering and monitoring tool for Java web applications. In short, Hazelcast takes .war (or ear) file and creates a clustered and monitorable version of it (clustered-.war). No more losing sessions after crashes. It is that simple. To learn what Hazelcast does behind the scenes, please check out the documentation.

Distributed ConcurrentMap

ConcurrentMap methods such as ConcurrentMap.putIfAbsent(key,value) and ConcurrentMap.replace(key,value) are now supported in Hazelcast distributed map. Here is sample code:

 
import com.hazelcast.core.Hazelcast;
import java.util.concurrent.ConcurrentMap;


Customer getCustomer (String id) {
	ConcurrentMap map = Hazelcast.getMap("customers");
	Customer customer = (Customer) map.get(id);
	if (customer == null) {
		customer = new Customer (id);
		customer = map.putIfAbsent(id, customer);
	}
	return customer;
}               


public boolean updateCustomer (Customer customer) {
	ConcurrentMap map = Hazelcast.getMap("customers");
	return (map.replace(customer.getId(), customer) != null);            
} 

public boolean removeCustomer (Customer customer) {
    ConcurrentMap map = Hazelcast.getMap("customers");
    return map.remove(customer.getId(), customer) );           
}

In my previous blog, I said next thing will be transaction support but I figured that distributed java.util.concurrent.ExecutorService will be a lot more useful. So get ready to execute your code on cluster. It won't take long as I am full-time on the project, coding night and day.

Read: Hazelcast 1.1 released: Http Session clustering and more

Topic: Watch JavaFX SDK Run---On Linux Previous Topic   Next Topic Topic: Try before you buy at the iPhone App Store?

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use