- Java software architecture, development, designing and refactoring
- Java Open-Source solutions consulting
- Web development (Wicket, Spring MVC, Tapestry, JSF, JSP, Struts, Javascript, Jquery, ...)
- Backends and complex integration systems (EDA, JMS, JMX, Clustering, SOA, Security, Hibernate, Spring, Google Guice, Mycila)
- Build management software (Maven, Ant, Hudson, Sonar, CruiseControl, …)
- Unit, integration and functional testing methods (Junit, Sélénium, Testatoo, …)
Sunday, March 7, 2010
This year I am searching for job opportunities in Montreal (in french or english). I would also be pleased to receive opportunities to work remotely from home.
Labels:
job
Thursday, February 25, 2010
I am working on the backend of a high performance clustered system involving JGroups, JMS, and other very cool technologies. To achieve best performance, the application is totally event-driven, by using a very cool library i Open-Sourced: Mycila Event. I needed an intra-process Event Dispatching System capable of handling million events in a few second, while having a totally customizable threading model. In this application, this event system is internally bridged with JMS and JGroups to provide access to both messaging systems from Mycila Event.
I firstly considered using Event-Bus, a well known intra-process event library largely used in Swing applications. But it miss a lot of things we needed: a very good annotation support, a pluggable API, threading model customization and better topic matching strategies. I also really considered using Esper. Esper is a very good CEP engine capable of processing events (aggregate, filter, ...) in addition to being a very good event dispatching system. But what we needed is to depend on a high level Event Dispatching API with a very good annotation support, with the possibility to plug any Event Dispacthing library. We also didn't need the processing features of Esper, but instead we needed a very high performance dispatcher, only working in-memory.
Thus, Mycila-Event stands between Event-Bus and Esper. It brings you a common Event Dispatching API with a very good annotation support, plus provides you with a default implementation with several threading models, and you can create your own ones. Its goal is not to be an event-processor system (event if it actually could be integrated with Esper with the common API we designed). Instead, its goal is to be the best customizable dispatching system.
Here are some of the features Mycila Event brings:
- High level Event API with annotation support
- High performance event dispatcher
- Customizable dispatching strategies
- Customizable threading model
- Asynchronous mode (publishing/subscribing)
- Synchronous mode (requesting/replying) with timeout support
- Mixed mode: requesting with asynchronous replies
- Topic matchers and composition functions (i.e. subscribe to all topics app/events/system/**)
- Exception handling is made possible to react upon subscriber errors
- Automatic generation of publishers
- Very good integration with Google Guice
- Possible and easier integration with Spring, Esper, Camel, JMS, ...
static abstract class DU {
@Request(topic = "system/mult")
abstract int mult(int p1, int p2);
@Answers(topics = "system/mult")
int multRequest(int p1, int p2) {
return p1 * p2;
}
}
Dispatcher dispatcher = Dispatchers.synchronousSafe(ErrorHandlers.rethrow());
AnnotationProcessor processor = AnnotationProcessors.create(dispatcher);
Du du = processor.proxy(DU.class);
assertEquals(30, du.mult(5, 6))
Without annotations, you can publish a message like this:
Dispatcher dispatcher = Dispatchers.synchronousUnsafe(ErrorHandlers.rethrow());
TopicMatcher matcher = only("app/events/swing/button").or(matching("app/events/swing/fields/**"));
dispatcher.subscribe(matcher, String.class, new Subscriber<String>() {
public void onEvent(Event<String> event) throws Exception {
System.out.println("Received: " + event.getSource());
}
});
dispatcher.publish(topic("app/events/swing/button"), "Hello !");
You can read the full documentation and download it on the project page at:
http://code.mycila.com/wiki/MycilaEvent
Mat'
Labels:
event-driven,
java,
mycila-event
Friday, January 29, 2010
This library is a useful tool which enabled you to detect used and unused classes, jars, classloaders at runtime.
It works like a java agent (but does not affect performance since does not enhance anything), and publish two MBeans accessible through any JMX Console like Visual VM.
From there you can analyze the classes, in example, when running on an application server, you can filter per webapp classloader and see what is used and unused.
Labels:
java,
mycila-ujd
Monday, January 25, 2010
They are many Media Servers enabling streaming video for DNLA devices; much are for Windows, and much does not support transcoding, a useful feature that enabled you to convert on the fly a video type into another video type. This blog entry shows many DLNA softwares, and i've tried Nero, Fuppes, Media Tomb, Mezzmo, MiniDLNA, PS3 Media Server, Twonkey and one that is not listed but looks very promising: Wild Media Server.
Since i needed transcoding features to stream some xvid videos into my TV, i eliminated a few of them plus those really complicated to setup like Media Tomb. After having tried them all, the only software capable of streaming divx files on my TV was Mezzmo and Wild Media Server. It is great, but since i run Linux and not Windows, I wanted a Linux solution.
MiniDLNA is very simple and easy to configure and works great with Sony TVs, and it works on LInux and Windows... As long as you only stream DVD files (since my Sony TV only accepts MPEG-2 videos)... MiniDLNA does not support transcoding, so I applied the same idea as Wild Media Server: before launching the Media Server, start the transcoding and stream the transcoded file. With FFMPEG, available on both Windows and Linux, you can transcode a video file. So the trick is to find good parameters so that the transcoding process is faster than the streaming, considering that the DLNA communication between my computer and my TV is wireless.
I finally made a Groovy Script working on Linux (and also can work on Windows too) which uses both FFMPEG and MiniDLNA.
The script requires that you have ffmpeg, minidla and Groovy installed and on your PATH.
You can launch the script like this:
dlna.sh /path/to/your/divx.avi
The script will compute the parameters for a 16:9 aspect ratio, adding padding on top and bottom if necessary. Then it will start the transcoding process to convert the movie to an MPEG-2 video with AC3 sound. Then the script will starts 5 seconds after the MiniDLNA server, pointing to the resulting video. You'll see something like this on the console after the startup:
kha@box:~/workspace/perso/mycila-ujd$ dlna.sh /media/lacie/My\ movie.avi
/media/lacie/My\ movie.avi:
- video bitrate: 1050 kb/s
- video size: 640x272 (40:17 => 2.3529413)
- audio freq: 48000 Hz
- audio bitrate: 163 kb/s
- padding top: 44 px
- padding bottom: 44 px
- dest size: 640x360 (16:9 => 1.7777777)
- threads: 2
Starting...
[minidlna, -d, -f, /unsafe/tmp/minidlna/minidlna.conf, -P, /unsafe/tmp/minidlna/minidlna.pid]
[ffmpeg, -i, /media/lacie/My\ movie.avi, -y, -threads, 2, -target, ntsc-dvd, -b, 4000k, -maxrate, 5000k, -bufsize, 2000k, -sameq, -qscale, 1, -s, 640x272, -aspect, 16:9, -padtop, 44, -padbottom, 44, -ac, 2, -ab, 192000, /unsafe/tmp/minidlna//media/lacie/My\ movie.avi.mpg]
DNLA started !
Press a key to exit...
You then just have to open your TV menu and open the movie !
Wednesday, January 20, 2010
With JQuery it is very easy to decompose page elements and make them draggable.
Just go to a website running JQuery UI, open you firebug console and paste & run the following code:
jQuery('body *:visible').draggable({opacity: 0.4}).hover(function(event) {
event.stopPropagation();
event.stopImmediatePropagation();
event.currentTarget.oldStyles = {
border: event.currentTarget.style.border,
cursor: event.currentTarget.style.cursor
};
event.currentTarget.style.border='1px solid blue';
event.currentTarget.style.cursor='pointer';
}, function(event) {
if(event.currentTarget.oldStyles) {
event.currentTarget.style.border=event.currentTarget.oldStyles.border;
event.currentTarget.style.cursor=event.currentTarget.oldStyles.cursor;
}
});
Click here to try it on my blog !
Labels:
javascript,
jquery
