Wednesday, 31 August 2011

What is not possible with JRebel?

What isn't possible in class reloading when you are using JRebel?
  • Replacing superclass
  • Adding and removing implemented interfaces
For more details take a look at: http://www.zeroturnaround.com/jrebel/features/

Tuesday, 30 August 2011

How to change classes in the running java application?

There are a few possibilities:
  • Hot deploy - Application is redeployed by application servers after the update of code. Usually after a few redeploys application server has to be restated because of possible memory leaks.
  • HotSwap - Allowed since Java 1.4. We can change the methods' definitions in classes during debug session. We cannot change class fields or add new methods, constructors or classes.
  • OSGI - Allows us to change modules of application. It is faster then Hot deploy, but we need to design our application to be OSGI modular, which requires more expensive and more difficult development process.
  • Throwaway class loaders - Many frameworks use components that are loaded in separate class loaders.The whole class loader is reloaded after the change, e.g. Tapestry, Seam, ...
  • Use JRebel - a tool updating class definitions. JRebel operates on class loaders.

Monday, 29 August 2011

java.util.Objects - new util class in Java 7

In Java 7 we have a new class java.util.Objects. It is a util class for shortening operations on Objects.

We have the following methods:

  • compare(T a, T b, Comparator c):int Returns 0 if the arguments are identical and c.compare(a, b) otherwise. Consequently, if both arguments are null 0 is returned
  • deepEquals(Object a, Object b):boolean Compares objects or Arrays
  • hash(Object... values):int Generates a hash code for a sequence of input values
  • T nonNull(T obj) If obj is not null, return obj else throw a NullPointerException

and other useful methods.

Look for more in javadoc: http://download.oracle.com/javase/7/docs/api/java/util/Objects.html

Sunday, 28 August 2011

AppDynamics Lite - measuring performance

AppDynamics company has changed its application portfolio. They have made a new free product - AppDynamics Lite. It is a product designed for troubleshooting java applications performance in production environments.
It has some limitations, e.g. limited number of monitoring transaction types, but you can easily start using it. I have successfully connected it to three different applications on different servers: ATG on Jboss, one based on Spring framework on Tomcat, and CQ Day CMS instance.

Try for yourself: http://www.appdynamics.com/lite.php

Friday, 26 August 2011

How to lead self career?

Recently I've read an article with some useful career tips:
  • Do not start to many things. Focus on a reasonable amount.
  • Share your knowledge and responsibilities, so that you have time to learn new things.
  • Think how to capitalize your knowledge, activities. Make a plan. Maybe you will profit from it in a few years' time.
  • Specialize in areas that will make you a more valuable employee.
  • Prepare a long-term strategy for your career and revise it regularly.

Wednesday, 24 August 2011

Compressed oops in the Hotspot JVM 7 - new optimization

What is Compressed oops in the Hotspot JVM? It's a pointer to an object. They are stored in the Java heap. Not all of them are pointers to objects, but also e.g. pointers to fields in objects. Before Java 6u23 pointers have size corresponding with platform (32 bites or 64 bites) by default.
So unfortunately, on a 64 bites platform, applications need bigger heap.

In Java 7 by default, for heap smaller than 32GB, pointers are saved as 32 bites offset from the address of heap beginning. For bigger heaps pointers are addressed with 64 bites.

Wednesday, 17 August 2011

Questions to the employer on an interview

Recently I have read a thread concerning a question not what we will be asked on an interview but on the other hand what we should ask as an interviewee.

Some of the suggestions:
  1. What time does work start and ends?
  2. Which IDE and CI are used?
  3. Are there any internal trainings?
  4. Is unit testing used?
  5. Is wiki used?
  6. Which libraries and frameworks are used?
  7. Are there many own libraries created?
  8. Which work methodologies are used?
  9. Why does previous employee quit?
  10. Does work concern more maintenance or new projects?
  11. What trainings are possible?
  12. Are there any overtime if so how are they paid?

There is also a question which to choose as we wouldn't have time for many of them.

For me three most important are: 3,6, 10.

Tuesday, 16 August 2011

Tools for drawing UML

I can recommend some tools for UML.

First an on-line website http://yuml.me/. It just create an image file with an UML diagram based on simple test instructions. Check it!

Other tools for creating UML based on textual notation:

Spring Roo 1.1.5 released

Spring Roo 1.1.5 has been released.

New release has 95 improvements and bug fixes.

More details on: http://www.springsource.org/node/3173

Monday, 15 August 2011

Apache Tomcat 5.5 end of support

Apache Tomcat 5.5 (released originally on August 31, 2004) will not be supported from October 1, 2012.

That means that after October 1, 2012 bugs and security issues will not be fixed for version 5.5.x.
After December 31, 2012 download pages will not be available any more.

Users of those tomcat version should proceed with migration to the newer version.

Sunday, 14 August 2011

JRebel for MyEclipse

New product has been released: JRebel for myEclipse.

This version will work only with this IDE. It is cheaper, so if you use only myEclipse or thinking of buying JRebel license for it you can save money.

Now it is 165$ a year. Full version costs from 200$.

More info on http://www.zeroturnaround.com/jrebel/myeclipse

Saturday, 13 August 2011

News from the JavaBlackBelt

Some changes have been delivered in the JavaBlackBelt, website well known for its tests on programming languages, technologies and tools. It allows users to pass exams, but also to be a part of community. We can create questions, precise them and create whole exams.

Everyone can test their knowledge now also in exams concerning Java 7, Android, Oracle SQL.

To see more go to http://www.blackbeltfactory.com