Java

TwitterFacebook
Get flash to fully experience Pearltrees
Build

public int order() { return ordinal()+ 1 ; } Each Enum Instance a different sub-class You can override the behaviour of an instance. This effectively give the instance a different sub-class of the enum with its own implementation. In this short example, a parser state machine processes raw XML from a ByteBuffer. Each state has its own process method and if there is not enough data available, the state machine can return to retrieve more data. Each transition between states is well defined and the code for all states is together in one enum . http://www.javacodegeeks.com/2011/07/java-secret-using-enum-to-build-state.html

Java Secret: Using an enum to build a State machine - Java Code Geeks

Programmatically Restart a Java Application | Javalobby

http://java.dzone.com/articles/programmatically-restart-java Today I'll talk about a famous problem : restarting a Java application. It is especially useful when changing the language of a GUI application, so that we need to restart it to reload the internationalized messages in the new language. Some look and feel also require to relaunch the application to be properly applied. This indeed basically works, but this answer that does not convince me for several reasons : 1) What about VM and program arguments ? (this one is secondary in fact, because can be solve it quite easily). 2) What if the main is not a jar (which is usually the case when launching from an IDE) ? 3) Most of all, what about the cleaning of the closing application ?
http://zeroturnaround.com/blog/updating-java-ee-in-production-a-report-in-three-acts-including-a-foreword-and-an-afterword/

Updating Java EE in Production: A Report in Three Acts Including a Foreword and an Afterword | ZeroTurnaround.com

Foreword A few weeks ago I ran a survey asking a dozen or so questions about Java EE production update. I’d like to thank the 607 individuals who took some time from their busy life to help me out. Today, I’ll return the favor by analyzing the resulting data for your pleasure. If for some reason you don’t trust me, feel free to check the calculations on the original data in this spreadsheet . I’m sorry I couldn’t do this before, but life was too busy to do a proper analysis in the meantime.
If the procedure takes one second (wall-clock time) to complete, then it is going to take one thousand seconds (over 16½ minutes) to complete this task. That would take one hundred seconds (just over 1½ minutes), one tenth of the original time. The more CPU's available, the faster the result. This is what scientific computing is all about — simultaneously processing humongous amounts of data on as many CPU’s as available. This abstraction closely resembles the standard scientific model of Divide-and-Conquer. http://www.coopsoft.com/ar/ForkJoinArticle.html

Fork-Join Development in Java SE

Does Java Have to be Extended? There is a lot of discussion in the Java community which language features should be added to the Java language and how they should be integrated. What seems to be missing is a discussion about the question if Java needs to be extended at all. Moreover, there should be a discussion about language features that have been added to Java and C# in the past and how they improved our productivity and the quality of our programs. http://www.jroller.com/sebastianKuebeck/entry/does_java_have_to_be

Sebastian Kübeck's Weblog : Weblog

We Recommend These Resources Last week I read an announcement about Chronon , a time travelling debugger. It sounds very appealling - if you're like me, you've often missed that spot where you should have had a breakpoint. http://java.dzone.com/articles/introducing-chronon-time

Introducing Chronon: The Time Travelling Debugger for Java | Javalobby

Java Performance Tuning, Profiling, and Memory Management | Java

We Recommend These Resources Java application performance is an abstract word until you face its real implications. It may vary depending on your interpretation of the word 'performance'. This article is meant to give the developer a perspective of the various aspects of the JVM internals, the controls and switches that can be altered to optimal effects that suit your application. There is no single size that can fits all. You need to customize to suit your application. http://java.dzone.com/articles/java-performance-tuning

Better Java Web Frameworks | Javalobby

We Recommend These Resources I have been doing web application framework development for a long time. In my first experience, we developed a “Web Application Framework“, to ease development so that even a business user could write an application. As the years passed, I never saw any business user writing applications because of the fact that this job belongs to programmers. Today some 4GL or DSL tools are still on the search of the same promise. Before writing our own framework, we had used WebObjects development tools, for Java web development. http://java.dzone.com/news/better-java-web-frameworks
When we say a program is "too slow," we are generally referring to one of two performance attributes -- latency or scalability. Latency describes how long it takes for a given task to complete, whereas scalability describes how a program's performance varies under increasing load or given increased computing resources. A high degree of contention is bad for both latency and scalability. Why contention is such a problem Contended synchronizations are slow because they involve multiple thread switches and system calls. When multiple threads contend for the same monitor, the JVM has to maintain a queue of threads waiting for that monitor (and this queue must be synchronized across processors), which means more time spent in the JVM or OS code and less time spent in your program code. http://www.ibm.com/developerworks/java/library/j-threads2/index.html

Threading lightly, Part 2: Reducing contention

http://en.wikipedia.org/wiki/Fallacies_of_Distributed_Computing

Fallacies of Distributed Computing - Wikipedia, the free encyclo

The Fallacies of Distributed Computing are a set of assumptions that Peter Deutsch and others at Sun Microsystems originally asserted programmers new to distributed applications invariably make. These assumptions ultimately prove false, resulting either in the failure of the system, a substantial reduction in system scope, or in large, unplanned expenses required to redesign the system to meet its original goals. [ citation needed ] Ignorance of network latency, and of the packet loss it can cause, induces application- and transport-layer developers to allow unbounded traffic, greatly increasing dropped packets and wasting bandwidth. Complacency regarding network security results in being blindsided by malicious users and programs that continually adapt to security measures. [ 2 ] Multiple administrators, as with subnets for rival companies, may institute conflicting policies of which senders of network traffic must be aware in order to complete their desired paths.

The network bites. Never forget it. by alexis Oct 6

Blog Xebia France - Chroniques de la performance :

J’ai été, il y a peu, confronté à un problème de performances que l’on peut qualifier d’ intéressant – dans la bouche d’un expert technique, ce mot a généralement tendance à provoquer une bouffée de panique chez les plus chevronnés des managers. Je vous explique. Le programme consiste à appliquer massivement un traitement identique à un volume important de données – bref, c’est un batch. Objectif opérationnel : assurer la capacité du système à traiter 50000 dossiers par heure. L’architecture d’exécution de ce batch est relativement classique : un contrôleur est chargé d’obtenir auprès d’un service métier une liste de dossiers à traiter, de segmenter cette liste en lots, puis de soumettre les lots à un pool de threads qui vont réaliser les traitements en parallèle – chaque lot est traité dans une transaction distincte. Le traitement unitaire d’un dossier est relativement long, de l’ordre de 2 secondes ; les lots sont donc petits – 4 dossiers – pour limiter la durée des transactions.
Java bookmarks

Tomcat

Annotation processing

JVM tuning

Proposed Asynchronous Servlet API

With Java NIO, you can theoretically manage 10,000 read, write and read/write connections with a total of one thread. Yes, but it's not clear to me how you can manage this under the Servlet API. With a custom non-servlet server, then sure, assuming the request processing for each channel is lightweight enough. Note that the Servlet API extensions that Jetty has implemented could be standardised so that standard Servlets could work nicely with an NIO server efficiently like Jetty already has done. See the title of this thread :)

EU Rejects Snoracle - Larry Vows to Fight! | Javalobby

We Recommend These Resources Oracle and the EU are escalating their legal battle over the Sun acquisition. The EU took the first step towards blocking the merger Monday with a formal Statement of Objections . Oracle immediately responded with a statement of its own, saying the EU has a "profound misunderstanding" about competition in the database market and "open source dynamics". Sources expected the objection to come soon after Oracle, led by CEO, Larry Ellison, refused to give up the MySQL database in the merger.
Joe Darcy has opened up a call for methods to add to the core JDK 7 lang/util package. The idea is to add methods that are "commonly-written utility methods". JDK 7 utility methods There is lots of prior art in the field of general utility method libraries for Java. Perhaps the best known is Apache Commons Lang .

Stephen Colebourne's Weblog

The Myth of the Secure Network If there is one initiative that is routinely misinterpreted it is the Jericho Forum . The general believe is that the Jericho Forum Members want everyone to remove the firewalls from our networks.

Sebastian K beck's Weblog : Weblog

java

Eclipse