0

We are going to develop large scale application by using J2EE. The application has contains many number of modules and few modules are not directly communicate with the client.(ie it will be processing in separate thread like SNMP Listener, job scheduling, polling, etc).

So we are planed to split the application into module based application and run it on different servers and integrate with main j2ee application to show the result to users.

Can any one help me that how to create module based application and run the application which can run it on different server?

Murali
  • 341
  • 2
  • 7
  • 24

1 Answers1

1
First thing you have to do is you should have a clear logical idea about hierarchical view of the modules. For example consider you will be having a security based module which should be always on top, other core featuring module will depend on the higher level modules.In such a way you must have a clear view about the level of modules. 

Have a building script like ANT for each module separately to build/jar that module, have a global level ANT to call all the individual modules as per the order.

Here, we have a similar architecture which has more than 10o different modules (both dependent on others and independent). Having these kind of structure you can able to skip any module that you don't wish, in a very simple manner.

Sample Global Ant script
--------------------------

<target name="build.projects">
    <ant dir="${security.module}" antfile="build.xml" target="build.project" />
    <ant dir="${core.module}" antfile="build.xml" target="build.project" />
    <ant dir="${Resource.module}" antfile="build.xml" target="build.project" />
    <ant dir="${SNMP.module}" antfile="build.xml" target="build.project" />
    <ant dir="${util.module}" antfile="build.xml" target="build.project" />
</target>

and the Individual one..

<project name="security.module" default="all" basedir=".">
    <target name="build.project" depends="-Properties, create.output, compile, jars" />
</project>
Sankarganesh Eswaran
  • 10,076
  • 3
  • 23
  • 24
  • Yes I know that maven and ant provides module based application. My question is How to communicate b/w the modules if every modules run on seperate server – Murali Jun 05 '14 at 05:49
  • Use JMX MBean based communications. Refer http://docs.oracle.com/javase/7/docs/technotes/guides/jmx/overview/connectors.html. Let me know for more help. – Sankarganesh Eswaran Jun 05 '14 at 05:54
  • Thank you for your valuable information. I just heard that Apache cxf with osgi is also good to use for this situation. May i konw which one is best? – Murali Jun 05 '14 at 07:27
  • It depends upon the number of cases/times you require to communicate across the different servers. If its minimal and just like req/response then Mbeans would save your most of time. more over Apache CXF (go for it if you have large list) can also be used across java and .net servers (cross platform) based on Webservice (SOAP/XML format). Finally its all upto the design and requirement to rely on what. – Sankarganesh Eswaran Jun 06 '14 at 07:22