Monthly Archives: May 2013

JD-GUI Java decompiler

jd
Just a great software to decompile java classes!
http://java.decompiler.free.fr/

JMX vs JMS

To clarify the consepts JMX and JMS.

What Is the JMS?
jms-architecture

The Java Message Service is a Java API that allows applications to create, send, receive, and read messages.

What Is the JMX?
jmx-architecture

Java Management Extensions (JMX) is a Java technology that supplies tools for managing and monitoring applications, system objects, devices (e. g. printers) and service oriented networks.

See also,
http://en.wikipedia.org/wiki/Java_Management_Extensions
http://en.wikipedia.org/wiki/Java_Message_Service

http://docs.oracle.com/javaee/1.3/jms/tutorial/1_3_1-fcs/doc/jms_tutorialTOC.html
http://www.velocityreviews.com/forums/t137825-which-is-better-jms-or-jmx.html

Control Version System file structure proposals

cvs
Currently, i want to say a few words about CVS file structure.

If you have a number of projects, probably deal with the problem of right files organization.
In this case i mean projects are coupled with each other, i.e. dependencies presents.

Here is the default organization, in common way:

/-Project_1
     /-trunk
     /-branches
        /-branch_1
        /-branch_2
        /-branch_3
/-Project_2
     /-trunk
     /-branches
        /-branch_1
        /-branch_2
        /-branch_3
/-Project_3
     /-trunk
     /-branches
        /-branch_1
        /-branch_2
        /-branch_3

But this structure can be inconvenient to work with.
I propose use the next for coupled projects:

/-trunk
     /-Project_1
     /-Project_2
     /-Project_3
/-branches
     /-branch_1
          /-Project_1
          /-Project_2
          /-Project_3
     /-branch_2
          /-Project_1
          /-Project_2
          /-Project_3
     /-branch_3
          /-Project_1
          /-Project_2
          /-Project_3

This may seen some stupid, but you’ll have a pros in each time checkout process.
To get all you need you have to choose a branch and make checkout!
The file structure of all projects will be identical for each developer.

Print Path object in Ant

hor
To echo the path object use next:

<ivy:cachepath pathid="war.lib.id" conf="war" type="war" transitive="false" />

<pathconvert pathsep="${line.separator}" property="echo.classpath" 
  refid="war.lib.id" />
<echo message="The following classpath is associated with war.lib.id" />
<echo message="${echo.classpath}" />

Thanx to http://www.vogella.com/articles/ApacheAnt/article.html#classpath_print

Web

CSS column layout

equal-height-columns-problem
Cannot pass out away from this article. Just great info saved my time!
Thanx to author, http://matthewjamestaylor.com/blog/equal-height-columns-cross-browser-css-no-hacks

Method signature in Java

method_declaration
Are know about method signature?
That’s quite simple:

The method signature — the method’s name and the parameter types.

Noting more, return type or exceptions are not the part of signature.
See also, http://docs.oracle.com/javase/tutorial/java/javaOO/methods.html

Multiple interface implementation in JAVA

house
The main think of the post is: thrown exceptions in multiple interfaces implementation are intersected!
For ex, we’ve 3 interfaces:

public interface IfaceOne {
    void method() throws IOException;
}

public interface IfaceTwo {
    void method() throws IOException, IndexOutOfBoundsException;
}

public interface IfaceThree {
    void method() throws IOException, IndexOutOfBoundsException, RemoteException;
}

So, the implamentation is:

public class Impl implements IfaceOne, IfaceTwo, IfaceThree {
    @Override
    public void method() throws IOException{
    }
}

Only IOException would be in resulted throw declaration because of intersection exceptions!