Java Code Geeks http://www.javacodegeeks.com/ Java 2 Java Developers Resource Center Fri, 27 Feb 2015 11:00:11 +0000 en-US hourly 1 http://wordpress.org/?v=4.1.1 Joining Strings in JDK 8http://www.javacodegeeks.com/2015/02/joining-strings-in-jdk-8.html http://www.javacodegeeks.com/2015/02/joining-strings-in-jdk-8.html#comments Fri, 27 Feb 2015 11:00:11 +0000 http://www.javacodegeeks.com/?p=37462 JDK 8 introduced language features such as lambda expressions, streams, and even the new Date/Time API that will change the way we write Java applications. However, there are also several new APIs and features that might be less “game changing,” but still bring greater convenience and expressiveness to the Java programming language. In this post, […]

 

]]>
http://www.javacodegeeks.com/2015/02/joining-strings-in-jdk-8.html/feed/ 0
Do Primitives Need To Go?http://www.javacodegeeks.com/2015/02/do-primitives-need-to-go.html http://www.javacodegeeks.com/2015/02/do-primitives-need-to-go.html#comments Fri, 27 Feb 2015 08:00:36 +0000 http://www.javacodegeeks.com/?p=37461 I am currently working on an enterprise application using JSF as the view technology and JPA for the persistence layer. It may have been something in a backing bean or service method, but it struck me: Is there a good reason to use primitives anymore in enterprise applications? When I started programming with Java around […]

 

]]>
http://www.javacodegeeks.com/2015/02/do-primitives-need-to-go.html/feed/ 0
Very fast Camels and Cloud Messaginghttp://www.javacodegeeks.com/2015/02/very-fast-camels-and-cloud-messaging.html http://www.javacodegeeks.com/2015/02/very-fast-camels-and-cloud-messaging.html#comments Fri, 27 Feb 2015 05:00:55 +0000 http://www.javacodegeeks.com/?p=37460 Apache Camel is a popular, mature, open-source integration library. It implements the Enterprise Integration Patterns which is a set of patterns that often come up when integrating distributed systems. I’ve written a lot about Camel in the past, including why I like it better than Spring Integration, how the routing engine works, how to use […]

 

]]>
http://www.javacodegeeks.com/2015/02/very-fast-camels-and-cloud-messaging.html/feed/ 0
Hibernate Locking Patterns – How does PESSIMISTIC_READ and PESSIMISTIC_WRITE workhttp://www.javacodegeeks.com/2015/02/hibernate-locking-patterns-how-does-pessimistic_read-and-pessimistic_write-work.html http://www.javacodegeeks.com/2015/02/hibernate-locking-patterns-how-does-pessimistic_read-and-pessimistic_write-work.html#comments Thu, 26 Feb 2015 23:00:02 +0000 http://www.javacodegeeks.com/?p=37459 Introduction Java Persistence API comes with a thorough concurrency control mechanism, supporting both implicit and explicit locking. The implicit locking mechanism is straightforward and it relies on: Optimistic locking: Entity state changes can trigger a version incrementation Row-level locking: Based on the current running transaction isolation level, the INSERT/UPDATE/DELETE statements may acquire exclusive row locks […]

 

]]>
http://www.javacodegeeks.com/2015/02/hibernate-locking-patterns-how-does-pessimistic_read-and-pessimistic_write-work.html/feed/ 0
Fetching List of message codes from message.propertieshttp://www.javacodegeeks.com/2015/02/fetching-list-of-message-codes-from-message-properties.html http://www.javacodegeeks.com/2015/02/fetching-list-of-message-codes-from-message-properties.html#comments Thu, 26 Feb 2015 20:00:21 +0000 http://www.javacodegeeks.com/?p=37552 Normally messages from message properties are fetched via, key i.e. message code, What if we want to select more than one message property, like a list. To get a list of select message codes from message.properties, we need to customize messageSource bean. To do that, lets create a class ‘CustomisedPluginAwareResourceBundleMessageSource’ which should extend class ‘PluginAwareResourceBundleMessageSource’. […]

 

]]>
http://www.javacodegeeks.com/2015/02/fetching-list-of-message-codes-from-message-properties.html/feed/ 0
Thoughts about TDD and how to use it for untested legacy codehttp://www.javacodegeeks.com/2015/02/thoughts-about-tdd-and-how-to-use-it-for-untested-legacy-code.html http://www.javacodegeeks.com/2015/02/thoughts-about-tdd-and-how-to-use-it-for-untested-legacy-code.html#comments Thu, 26 Feb 2015 17:00:18 +0000 http://www.javacodegeeks.com/?p=37544 Prologue My personal experiences with TDD mostly match with the others on the internet, in short, TDD is good. It helps you to write better code, create a clean and nicely tested architecture, make refactoring and design changes easier. It leads your design decisions, helps to think through every possible cases which you need to […]

 

]]>
http://www.javacodegeeks.com/2015/02/thoughts-about-tdd-and-how-to-use-it-for-untested-legacy-code.html/feed/ 0
RESTful Charts with JAX-RS and PrimeFaceshttp://www.javacodegeeks.com/2015/02/restful-charts-with-jax-rs-and-primefaces.html http://www.javacodegeeks.com/2015/02/restful-charts-with-jax-rs-and-primefaces.html#comments Thu, 26 Feb 2015 14:00:13 +0000 http://www.javacodegeeks.com/?p=37444 Oftentimes, it is useful to utilize a chart for providing a visual representation of your data. PrimeFaces supplies charting solutions that make it easy to add visual representations of your data into web and mobile applications. If we couple the use of PrimeFaces charting components with RESTful web service data, we can create custom charts […]

 

]]>
http://www.javacodegeeks.com/2015/02/restful-charts-with-jax-rs-and-primefaces.html/feed/ 0
Async abstractions using rx-javahttp://www.javacodegeeks.com/2015/02/async-abstractions-using-rx-java.html http://www.javacodegeeks.com/2015/02/async-abstractions-using-rx-java.html#comments Thu, 26 Feb 2015 11:00:11 +0000 http://www.javacodegeeks.com/?p=37443 One of the big benefits in using Rx-java for me has been the way the code looks exactly the same whether the underlying calls are synchronous or asynchronous and hence the title of this entry. Consider a very simple use case of a client code making three slow running calls and combines the results into […]

 

]]>
http://www.javacodegeeks.com/2015/02/async-abstractions-using-rx-java.html/feed/ 0
Dropwizard, MongoDB and Gradle Experimentinghttp://www.javacodegeeks.com/2015/02/dropwizard-mongodb-and-gradle-experimenting.html http://www.javacodegeeks.com/2015/02/dropwizard-mongodb-and-gradle-experimenting.html#comments Thu, 26 Feb 2015 08:00:54 +0000 http://www.javacodegeeks.com/?p=37442 Introduction I created a small project using Dropwizard, MongoDB and Gradle. It actually started as an experimenting Guava cache as buffer for sending counters to MongoDB (or any other DB). I wanted to try Gradle with MongoDB plugin as well. Next, I wanted to create some kind of interface to check this framework and I […]

 

]]>
http://www.javacodegeeks.com/2015/02/dropwizard-mongodb-and-gradle-experimenting.html/feed/ 0
Resolve coreference using Stanford CoreNLPhttp://www.javacodegeeks.com/2015/02/resolve-coreference-using-stanford-corenlp.html http://www.javacodegeeks.com/2015/02/resolve-coreference-using-stanford-corenlp.html#comments Thu, 26 Feb 2015 05:00:54 +0000 http://www.javacodegeeks.com/?p=37441 Coreference resolution is the task of finding all expressions that refer to the same entity in a text. Stanford CoreNLP coreference resolution system is the state-of-the-art system to resolve coreference in the text. To use the system, we usually create a pipeline, which requires tokenization, sentence splitting, part-of-speech tagging, lemmarization, named entity recoginition, and parsing. […]

 

]]>
http://www.javacodegeeks.com/2015/02/resolve-coreference-using-stanford-corenlp.html/feed/ 0