background preloader


Facebook Twitter

What Does java.util.concurrent.Future Hold? We Recommend These Resources Let’s be sure of what the Future holds Future, which is a part of the Java concurrency Task execution framework, is the result of your computation as the javadoc claims.

What Does java.util.concurrent.Future Hold?

And more. When you are executing a task in a different thread, there is a lot of information you would need from it soon after you submit it to the pool. What can the Future give? Result : If you are spawning multiple threads and you are interested in the consolidated/incremental result, obviously you wanted a way to get it. Interesting fact : The Future.get() method waits for the result forever until the result gets returned. 1.V get(long timeout, TimeUnit unit) Fun Fact : If you are just spawning a single thread in your Executor and calling the Future.get() (the one which waits forever), you are actually mimicking a Thread.join() call on a spawned single thread by the main thread.

Further reading : Alex Miller’s amazing blog Alex Miller’s concurrency gotchas. 7 new cool features in Java 7 @ The evolution of the Java language and VM continues!

7 new cool features in Java 7 @

Mark Reinhold (Chief Architect of the Java Platform Group) announced yesterday that the first release candidate for Java 7 is available for download, he confirms that the final released date is planned for July 28. For a good overview of the new features and what’s coming next in Java 8, I recommend this video on the Oracle Media Network, which features Adam Messinger, Mark Reinhold, John Rose and Joe Darcy. I think Mark sums up Java 7 very well when describing it as an evolutionary release, with good number “smaller” changes that make for a great update to the language and platform. I had a chance to play a bit with the release candidate (made easier by the Netbeans 7 JDK 7 support!) , and decided to list 7 features (full list is here) I’m particularly excited about. 1.

Cogitations and Speculations: Java Development Posts of Interest - 9 April 2011. I ran across several articles and blog posts this past week that I believe deserve specific mention.

Cogitations and Speculations: Java Development Posts of Interest - 9 April 2011

In this post, I reference these resources and provide a quick summary of what I found interesting about them. The referenced posts and articles are largely Java-focused, but cover topics such as cloud computing, Scala, Java 7, polyglot programming, and consultants versus internal developers. Twitter Changes: Lucene and Java The post Twitter Search is Now 3x Faster discusses how Twitter's new search architecture uses Lucene and a Java/Netty-based server called Blender.

This post is interesting for a variety of reasons. A second reason this post is interesting to me is that the migration discussed in this post is from two most favored open source products (Ruby on Rails and MySQL). Software Developers: Big Leagues and Minor Leagues The best developers I've known are a mix of consultants and internal developers.

Open Source License Flow Chart The Well-Grounded Java Developer. Netty - the Java NIO Client Server Socket Framework. Remote debugging Tomcat with Eclipse - NewInstance. Today I tried to use remote debugging with Eclipse and Tomcat.

Remote debugging Tomcat with Eclipse - NewInstance

I usually use a Tomcat Sysdeo Plugin to run Tomcat inside Eclipse, but today I faced remote debugging. To run tomcat in remote debugging you can start it with commandcatalina jpda start But this will start remote debugging using shared memory, and Eclipse, as far as I know, does not support shared memory as transport for deubugging. The alternative is to use a socket as transport for JPDA. You simply set some enviroment variable that will be checked by catalina startup script, as in following example: set JPDA_TRANSPORT=dt_socket set JPDA_ADDRESS=5050 ... then you can run ... This tells catalina script to use socket transport for debugging and to listen on port 5050. Now it's time to connect to that socket using Eclipse: see following picture. On "Connection Properties" you can configure a remote VM that you want to debug. One thing that you cannot do running programs inside Eclipse under Windows is to get a Thread dump.

Java HotSpot VM Options. Please note that this page only applies to JDK 7 and earlier releases.

Java HotSpot VM Options

For JDK 8 please see the Windows, Solaris, Linux and Mac OS X reference pages. This document provides information on typical command-line options and environment variables that can affect the performance characteristics of the Java HotSpot Virtual Machine. Unless otherwise noted, all information in this document pertains to both the Java HotSpot Client VM and the Java HotSpot Server VM.

Categories of Java HotSpot VM Options Standard options recognized by the Java HotSpot VM are described on the Java Application Launcher reference pages for Windows and Solaris & Linux. Options that begin with -X are non-standard (not guaranteed to be supported on all VM implementations), and are subject to change without notice in subsequent releases of the JDK.

Some Useful -XX Options Default values are listed for Java SE 6 for Solaris Sparc with -server. The options below are loosely grouped into categories.