Netty is an asynchronous event-driven network application framework
for rapid development of maintainable high performance protocol servers & clients.
Read more here : netty.io
Thursday, 21 February 2013
Thursday, 14 February 2013
StampedLock - new implementation for a lock
In java 8 we there will be a new implementation of Lock class. It will allow to have a lock for reading and writing. Possibly upgrading lock from read to write and some other features.
More to be read here: http://cr.openjdk.java.net/~chegar/8005697/ver.00/javadoc/StampedLock.html
More to be read here: http://cr.openjdk.java.net/~chegar/8005697/ver.00/javadoc/StampedLock.html
Monday, 4 February 2013
Testing Spring services that uses scoped objects
I have faced problem of testing Java Services that used Session Scoped objects (Same would by with f.e. Request Scope). My Scoped object was treated as a data, but contained simple operations managing its state. My service did some operation on this object changing it state. First I tried to mock this object and mocking its methods to verify correct behavior. But it was not easy due to complicated structure of mocking object. Then I decided to use a Spy object, but the only reason is to inject this object into my Service with annotation @InjectMocks. I did not change my object at all in the Spy, but used it just for dependency injection, as I did not want to have a setter method only for testing.
So the conclusion is: In Mockito Session/Request Scope Objects can be easily tested when defined as Spy objects injected by @InjectMocks
So the conclusion is: In Mockito Session/Request Scope Objects can be easily tested when defined as Spy objects injected by @InjectMocks
Wednesday, 30 January 2013
Cache is the performance killer for Web Application
An article, that describe potential web application performance improvement: http://highscalability.com/blog/2013/1/30/better-browser-caching-is-more-important-than-no-javascript.html
Wednesday, 23 January 2013
Tuesday, 8 January 2013
Java collections for primitive types
Java collections that save memory, when elements are primitive types:
http://trove.starlight-systems.com/overview
http://trove.starlight-systems.com/overview
Ease of creating immutable collection woth Guava
In case of need od creating immutable collections in java, that are nice created, safe and efficient look for guava implementations
Read examples here: http://code.google.com/p/guava-libraries/wiki/ImmutableCollectionsExplained
Read examples here: http://code.google.com/p/guava-libraries/wiki/ImmutableCollectionsExplained
Subscribe to:
Posts (Atom)