hasan's blog (বল্গ)

work for fun!!!

Archive for July 2007

AsyncServlet (JSR-315) proposed by Greg

leave a comment »

Ajax based application is growing too fast, many frequent requests have to handle by application servers. this overhead is really one of the big concern to maintain ajax based application.

more over reading the instance reply is one of the biggest challenge. as all requests are asychronizely processed, so ajax based application send request to application server more frequent that it actually needs.

the good example can be a chat application or a system where we have frequent request to sync with our messaging or notification service.

thats what greg pointed to the JSR 315 proposal. if you already have heard about continuation i belief you have find some use case for using on your own ajax application.

the basic process in continuation is to send delay response. for example -

i had a ajax request, which is intended for receiving a bunch of incoming message from my application server. so my request won’t get disconnected unless they really have some data to notify me. in between this time my request thread will be in suspended mode. obviously you can apply certain timeout period.

following diagram show how a request cycle works -

http_contd_1

the following part shows the event model, which is used to wake up suspended request before it becomes dead and time out request.

http_contd_2

best wishes,

Written by nhm tanveer hossain khan

July 28, 2007 at 1:50 am

Huh!! – SparkWeb – how to install your trail license

leave a comment »

I belief, i am one of those dump users who didn’t find the direction where to put the enterprise license file. after giving  few minutes try i just went through my old style, decompile LicenseManager, and lets try to find where the “enterprise.license” file is going to be checked out.

i found the following code -

licenseFile = new File((new StringBuilder()).append(JiveGlobals.getHomeDirectory()).append(File.separator).append(“enterprise”).append(File.separator).append(“enterprise.license”).toString());

thats mean, it looks the “enterprise.license” file under the ${openfire.root}/enterprise/ directory.

damn, :) now my SparkWeb is working.

best wishes,

Written by nhm tanveer hossain khan

July 19, 2007 at 4:51 pm

Posted in SparkWeb, jabber, openfire

Delegation design pattern

with one comment

at our company (escenic bangladesh), we have some group learning process. learning or grilling design pattern is one of them.

last couple of weeks we had a lot of presentations on lot of design patterns.

today was my turn, i had the presentation on “Delegation pattern”, i have attached my slide with my blog post. hope you will enjoy.
presentation on delegation

screen1

best wishes,

Written by nhm tanveer hossain khan

July 19, 2007 at 12:10 am

Posted in Java, design pattern

My first impression “WoW!!”

with 5 comments

As you knew from my last post, you can guess where i was stucking for several days, yea, it was all about determining right jabber server. the pleasant news is i gotta out of my headache after getting in touch with openfire.

openfire is one of those rear projects which made me feel “Wow” on the first run.

as i have mentioned on my last post, i was seeking some way to intercept registration, authentication and authorization process. at least i could came up a solution.

openfire plugin architecture is very simple and much more agile. i have attached my first quick diarty java code which helped me to descide whether i should go with openfire or not.

i must congrats my honored reader and brother, mr. mozammel haque who helped me to find out this outstanding server.

my first experiment was just hooked itself with user registration event dispatcher, when someone register i get the notification and write down to a file which is hard coded to c:/out.txt

this was just 5 to 10 mins preparation to let’s dig inside the plugin architecture.

global-profile.zip

download instruction -

just download the “*.zip” file and extract to your “openfire/plugins/” directory. a new “global-profile.jar” will be created.

let’s look inside the code which made it possible to be notified during user registration process. source is bundled with in “src/” directory.
best wishes,

Written by nhm tanveer hossain khan

July 16, 2007 at 11:33 pm

Posted in Java, Java SE, jabber

Struggling with open source jabber server

with one comment

My on going project is based on jabber server. i was expecting following features from an open source jabber server implementation -

* Authentication, Authorization  and registration service must be taken from 3rd party. (here i am 3rd party)

* P2P and Group chatting

* HTTP Polling support (optionally  HTTP Binding support)

* Very scalable

* Very flexible user customization

* group messaging subscription

* group moderation role

also following features –  

* none blocking i/o

* optionally java based

* cluster support

thats all.

so after passing some hard time, i fought with “ejabberd”, the ERLang based jabber daemon. i must say this is the best open source implementation. (i didn’t test openfire).

the author really gave a lot of effort. i had a very bad time tough, i tried to invoke external authentication system. but i found php script but i couldn’t able to make it work.

anyway, still it didn’t full fill my requirement, i want to manage user A and A and Registration from my service.

secondly i gave a try Open-im, i show the source code and stuff, my first impression was very bad, i found it was stucking with an infinite loop. later traversing inside the code i found, it was because of the SSL socket initialization related code. code was seeking certificate to initiate a SSL socket. since i didn’t put any certificate it not suppose to do it.

anyway, after working with it i found, it is not complete even code were poorly written.

later i gave a try tigase, it seems very nice and very well written server. still i need my whole control over AA and Registration.

after stucking a lot, i am now cncerntrating on open-im, i am thinking to contribute on this project. first i will implement the following features -

1. move to spring framework

2. Refactor code base
2. move authentication based on JAAS

3. Support 3rd party profile service

4. Support none blocking I/O api

5. Support HTTP Pooling based on servlet container
thats all for now beside my other stuffs from my current project.

Written by nhm tanveer hossain khan

July 13, 2007 at 8:43 am

springmodule – lucene

with one comment

i was using lucene for indexing my textual content, when i removed all of my index files, i have been introduced with a strange “LuceneIndexAccessException(The index is locked)” exception. though my whole directory was empty. it was not suppose to show this kind of exception.
anyway, later i found there is a  property called “resolveLock” which is required to enable auto lock resolve option.

hope this will help to those who face such problem.

best wishes,

Written by nhm tanveer hossain khan

July 8, 2007 at 4:41 pm

Posted in Java, lucene