Thoughts about java, ruby, agile and other every developer stuff.

Friday, March 30, 2007

week or two weeks off

Last week I was on vacation, and now another week off. Everything beacuse of because of man's stupid-ness.

I like Scoble's idea and will be taking the week off.

Good luck

Sunday, March 11, 2007

telnet-maven-plugin

Our project has ant magic telnet deployment. After project was moved too maven, we encounter a problem with telnet under maven. Firstly I googled a while to find something useful plugin, without success.

Everybody suggest use antrun, but if i moved to maven why i must still use ant. So i decided to write my own telnet-maven-plugin. It's very simple to write maven plugin, so if you need something write your own, don't ever use ant-run.
Now I convince that maven problem lies in antrun plugin, because if you can't do something, everybody suggest using antrun, bullshit.

The next step is to join mojo and make plugin public. This is more complicated than write it. You must follow rules, convention and finally vote for plugin to be released. I'm sure that I can do it. For now you can download telnet-maven-plugin from my site, put it into local maven repository.

Here is simple configuration:

<plugin>
<groupid>org.codehaus.mojo</groupid>
<artifactid>maven-telnet-plugin</artifactid>
<version>0.1-SNAPSHOT</version>

<executions>
<execution>
<phase>your_phase</phase>
<goals>
<goal>telnet</goal>
</goals>
</execution>
</executions>
<configuration>
<echo>false</echo>
<url>your_url</url>
<username>your_usser</username>
<password>your_pass</password>
<commands>
<command>your_command</command>
</commands>
</configuration>
</plugin>

Monday, March 05, 2007

OSGI - the future from the past

I don't know why, but sometimes great technology comes to early. And it must wait for its time. I think the same is with OSGi. Now we have forth edition. The first edition was released in May 2000. The situation was change after Eclipse foundation chooses OSGi specification in eclipse 3.2 as plugin system. Now it's main core eclipse library. This specification has three implementation

* Eclipse Equinox
* Apache Feli
* Knopflerfish

I think you can start here Getting started with OSGi. You can find also how to integrate maven with OSGi in Jacek Laskowski wiki (in polish).

I'll have many fun with Equinox implementation which I will describe in my wiki. Yep I've got a wiki system, and this is reason why i don't post in last time. But i promise to post more.

In simple word OSGi specification is describing portion independent part of software as a bundle. You can imagine that bundle is simple module of Java program (jar, plugin). It must be fully self-describing. If you have ever tried building plugin system, that you know, that java class loader is a problem. OSGi has something called activator. Activator is responsible for starting and stopping bundles. OSGi is highly dynamic that means that bundles may come and go at any time in application life cycle.

In next episode : The tutorial to build OSGi bundles with maven-bundle-plugin. And I also try to compare OSGi implementation


Technorati Tags: ,

Thursday, March 01, 2007

Choosing the right cache

My friend Piotr asks me about cache. Truly I can't suggest him any cache. So I decided to compare cache libraries.


Nomination in alphabetical order:

Cache4j

Cache4j is very simple cache. Its have three cache algorithms LFU, LRU, FIFO. It's fast and small. There is no English documentation (there is Russian one). There's no JMX. Configuration is simple (algorithm, idle time, max memory, time to live). In my opinion if you search simple cache maybe WhirlyCache be better one. For enterprise this one is unusable. Last version 0.4 from 2006.03.09 says for itself.

EhCache

Once oscache losing power, ehcache is stronger. Last version is from 26 February 2007. Once again "2007 February 26". There is JMX support for statistic and for configuration. Great! Ehcache has many configuration options, good performance. It has also very good site documentation, works with hibernate. It's good choice. Keep going

JCS (Java Caching System)

Ok, Jakarta project. Last distro was 5 months ago, not so bad. Version 1.2.9.2. Many configuration options, documentation is ok. This cache allows plugin. In distro we have memory, disk, lateral and remote plugin. No JMX but we have admin servlet. In my opinion we can forget about this cache mechanism now.

JBossCache

This one as Ehcache is also alive. Last version (2.0.0.ALPHA2) was released on 2007 January. Good professional support. There is perfect documentation. It is extremely configurable, it has
JMX support and there is POGO caching by annotation and AOP. In my opinion this is very good choice.

JCache

On the beginning it's not so good. Last version 1.0-beta6 released two year ago. Let's see performance page. Faster than hashmap, it's amazing, but after that of course 2005 so it's tested on java 1.4 (1.4.2_05-b04). What else, we see great milestones. For example in 1.2 there will be JMX support. Ok I think that this is enough, another dead cache system.


OSCache

This one includes jsp tag library for caching regions of web pages. As a cache it's rather slow. No JMX, and last version 2.3.2 from 07.23.2006, that’s minus. I think opensymphony are too busy (webwork and struts integration). It's ok, but a little bit old.

ShiftOne

Good cache system. We achieve FIFO, LRU, LFU algorithms. What is very important we have JMX with some statistics and also hibernate integration. From JMX you can get some statistics. But as many cache systems last update was three years ago, it's not so bad because of version 2.0, but you know world are changing.

SwarmCache

The most deadly project I have ever seen. In news section we read that 1.0RC2 was released at 10.25.2003. The one interesting think is that this cache is distributed. In my opinion it is scrap, no stable release for three and half a year.

WhirlyCache

It's very simple, fast in memory cache. It has a plugin for hibernate. It has plugin mechanism and one very interesting feature Cacheable key interface, which allows you to use as function hook on remove, store and retrieve action. Maybe it is not for enterprise but it is ok form home use. It's nearly dead project, version 1.0.1 released on May 2006.


In my opinion for serious use we should consider JBossCache or Ehcahe. For home made simple caches I suggest you WhirlyCache. If I forget about some cache system please post comment.

Regards



Technorati Tags: ,