Yesterday I got my notebook and today I am busy with it:)
or let's say enjoying it:)
nice notebook pretty notebook I'll format you delete all files, I'll setup lot of project nice notebook pretty notebook
And As you can guess I will be whole week event :)
what I have done up to now
jdk 6u2
idea 6.0.6
maven 2.0.7
postgres 8.2
tortoisesvn
firefox
and checkout my projects to test the performance :)
September 28, 2007
July 3, 2007
Multi-Tier Clusters
Today most of projects are build upon a composite structure that has multiple different APIs. Since many of them is unaware of the others and has its of implementation and dependency , every one of them should be have its own configuration which will make them work as a single application.
This is the hard point in fact "To bundle them in single application"
An Example:
in a sample medium size application like AppFuse would be using Hibernate/JPA, Acegi,SpringFramework,JasperReports, JSF, Tomcat/Jetty and so on. it is all good even perfect when you are run in a single JVM. but if you want to build a cluster for only a load balancing you should configure every one by one.
In other world you be building a multi tier cluster for each APIs , which would be harder rhan implemation for some old fashioned singleton type application (a type of application which has lots of static variable and caches)
your applcation would be looking like this.

what should be your success criteria
performance : cluster should not slow down the application in a critical point
transaction: any rollback should be noticed
failover: in case of any instance fail over any other one can replace it.
seamless: the cluster mode should be seamless. should be hidden behind proper interfaces
today most open and commercial API support clusters. but in most cases you would implement a yous own schema for your own needs . before start you should read some articles about "Distributed Application" , you can use any distributable caching, maps, or JMS bridges between your components
This is the hard point in fact "To bundle them in single application"
An Example:
in a sample medium size application like AppFuse would be using Hibernate/JPA, Acegi,SpringFramework,JasperReports, JSF, Tomcat/Jetty and so on. it is all good even perfect when you are run in a single JVM. but if you want to build a cluster for only a load balancing you should configure every one by one.
In other world you be building a multi tier cluster for each APIs , which would be harder rhan implemation for some old fashioned singleton type application (a type of application which has lots of static variable and caches)
your applcation would be looking like this.

what should be your success criteria
performance : cluster should not slow down the application in a critical point
transaction: any rollback should be noticed
failover: in case of any instance fail over any other one can replace it.
seamless: the cluster mode should be seamless. should be hidden behind proper interfaces
today most open and commercial API support clusters. but in most cases you would implement a yous own schema for your own needs . before start you should read some articles about "Distributed Application" , you can use any distributable caching, maps, or JMS bridges between your components
June 13, 2007
Clustering Acegi via JGroups (DistributedHashtable)
moved my blog to altuure.com
please click to continue
http://www.altuure.com/2007/12/23/clustering-acegi-via-jgroups-distributedhashtable/
please click to continue
http://www.altuure.com/2007/12/23/clustering-acegi-via-jgroups-distributedhashtable/
May 28, 2007
May 7, 2007
Rapid Java : Part I (Platform)
For rapid and non-painful development and products here's some java libraries (startup dependencies) I choose from bottom to top:
Module I: Core
It looks so complex at first sight and I'm sure it could be so painful to you but where All become one you would have quite clear Framework.
for how to integrate them look at appfuse.
What is missing?
your application specs you can need JMS (eg: activemq) ,networking (eg:jgroups) libs
Module I: Core
- postgresql / mysql / hsql depends on project's size if you don't large size of startup data try to use hsql
- log4j : logging (alternative commons-logging)
- hibernate: Simple and high quality open source ORM (alternative:)
- springframework: high quality IoC container and very good integration library (a framework to rule them all)
- quartz: scheduled task
- osworkflow: Simple workflow and state engine, to manage actions and states
- velocity: simple and useful template engine for formatted text/html/csv outputs (alternative freemarker)
- beanshell for providing business point (alternative groovy)
- acegi: Authentication and authorization
- jfreechart:for impressive charts
- jasperreport: for pdf reports
- mondrian: for BI
- jxls: for excel reports
- Struts : here, you have lots of choice from popular jsf to tapestry,spring mvc, I choose struts because of two reason simple life cycle and it is action based current I am STILL using struts 1.2.x but I will move to Struts2
- Prototype.js standard js for web 2.0
- script.aculo.us very useful js lib for effects and more
- DWR for extra js calls from client browser to your java codes
- displaytag: very useful jsp taglib
- jstl: standard jsp taglib
- tomcat/jetty: choose one that you are familiar
It looks so complex at first sight and I'm sure it could be so painful to you but where All become one you would have quite clear Framework.
for how to integrate them look at appfuse.
What is missing?
your application specs you can need JMS (eg: activemq) ,networking (eg:jgroups) libs
April 30, 2007
"Too many open files" but what are they?
java.io.FileNotFoundException: /opt/tb55/s3/conf/web.xml (Too many open files) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.<init>(FileInputStream.java:106)
solution: increase systems open file limit !!!
vi /etc/security/limits.conf
and edit the line to increase open file limit
* soft nofile 3072
* hard nofile 4048
this shows the open file limit has been reached.. you can check this by JMX
java.lang:type=OperatingSystem > OpenFileDescriptorCount
but what are these files ? you can see this by linux shell script
lsof -u tomcat solution: increase systems open file limit !!!
vi /etc/security/limits.conf
and edit the line to increase open file limit
* soft nofile 3072
* hard nofile 4048
April 12, 2007
Clustering Acegi
Acegi is a well known security framework. Some really good features:
Quick Fix:
replace the Maps in SessionRegistryImpl with your distributable caching mechanism (can be ehcache,oscache,vs) and reimplement it. Or you can use some JMS mechanism to fix this cap but it should be used only in complex architectures.
Acegi Concurrent Setup:
<bean id=" org.acegisecurity.concurrent.SessionRegistry" class="org.acegisecurity.concurrent.SessionRegistryImpl"/> <bean id="org.acegisecurity.concurrent.ConcurrentSessionController" class="org.acegisecurity.concurrent.ConcurrentSessionControllerImpl"> <property name="maximumSessions"> <value>1</value> </property> <property name="sessionRegistry"> <ref local="org.acegisecurity.concurrent.SessionRegistry"/> </property> <property name="sessionRegistry" ref="org.acegisecurity.concurrent.SessionRegistry"/> </bean> <bean id="org.acegisecurity.AuthenticationManager" class="org.acegisecurity.providers.ProviderManager "> <property name="providers"> <list> <ref local="org.acegisecurity.providers.dao.DaoAuthenticationProvider"/> <ref local="org.acegisecurity.providers.anonymous.AnonymousAuthenticationProvider"/> </list> </property> <property name="sessionController" ref="org.acegisecurity.concurrent.ConcurrentSessionController "/> </bean> <bean id="org.acegisecurity.concurrent.ConcurrentSessionFilter" class="org.acegisecurity.concurrent.ConcurrentSessionFilter "> <property name="sessionRegistry" ref="org.acegisecurity.concurrent.SessionRegistry"/> <property name="expiredUrl" value="/myself/"/> </bean>
And add org.acegisecurity.concurrent.ConcurrentSessionFilter to your filter list
PS:
check my new blog Clustering Acegi via JGroups (DistributedHashtable)
- method level based security configuration
- url level auth configuration
- easy login mechanism
- so on.
Quick Fix:
replace the Maps in SessionRegistryImpl with your distributable caching mechanism (can be ehcache,oscache,vs) and reimplement it. Or you can use some JMS mechanism to fix this cap but it should be used only in complex architectures.
Acegi Concurrent Setup:
<bean id=" org.acegisecurity.concurrent.SessionRegistry" class="org.acegisecurity.concurrent.SessionRegistryImpl"/> <bean id="org.acegisecurity.concurrent.ConcurrentSessionController" class="org.acegisecurity.concurrent.ConcurrentSessionControllerImpl"> <property name="maximumSessions"> <value>1</value> </property> <property name="sessionRegistry"> <ref local="org.acegisecurity.concurrent.SessionRegistry"/> </property> <property name="sessionRegistry" ref="org.acegisecurity.concurrent.SessionRegistry"/> </bean> <bean id="org.acegisecurity.AuthenticationManager" class="org.acegisecurity.providers.ProviderManager "> <property name="providers"> <list> <ref local="org.acegisecurity.providers.dao.DaoAuthenticationProvider"/> <ref local="org.acegisecurity.providers.anonymous.AnonymousAuthenticationProvider"/> </list> </property> <property name="sessionController" ref="org.acegisecurity.concurrent.ConcurrentSessionController "/> </bean> <bean id="org.acegisecurity.concurrent.ConcurrentSessionFilter" class="org.acegisecurity.concurrent.ConcurrentSessionFilter "> <property name="sessionRegistry" ref="org.acegisecurity.concurrent.SessionRegistry"/> <property name="expiredUrl" value="/myself/"/> </bean>
And add org.acegisecurity.concurrent.ConcurrentSessionFilter to your filter list
PS:
check my new blog Clustering Acegi via JGroups (DistributedHashtable)
Subscribe to:
Posts (Atom)