This week's book giveaway is in the General Computing forum.
We're giving away four copies of Emmy in the Key of Code and have Aimee Lucido on-line!
See this thread for details.
Win a copy of Emmy in the Key of Code this week in the General Computing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

Dynamically building web content using XML file(s)

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All!

I was recently tasked with a project to design a monitoring web application for our "in-house" built web applications. There is a certain set of modules and parameters that we need to monitor: GSLB --> Web Tier --> App Tier --> Database.

Almost all (80%) of our applications share the same parameters that need to be monitored, but there are about a hundred of them. So here is what I'm thinking of doing....

1. Create an XML document for each application (An example layout is included at the end of this post) and save it in the Applications directory.
2. Setup a Spring project, and create code to dynamically go through the Applications directory and kick-off the monitoring logic for each <application/> item. Basically, the code will just traverse through all of the xml files (I might even create just 1 xml file with all of the <application/> items in it), read the "metadata" for each application, and start the backend processing, as well as display the data in a dynamically-generated web GUI (based on the XML structure and data).

Again, most of our applications (80%) have the same modules/parameters, therefore adding an application would only require us adding another <application/> element to the already-existing xml document (or adding an additional XML document). The code would do the rest...In regards to the rest 20% of applications, I would create a customize XML document with additional metadata (the code, in that case, would be able to handle the additional metadata).

So here are my questions:

1. What do you think of the idea itself? I'm sure that I'm not the only one who's thought of this, so are there any best-practices in this regard?
2. The reason I thought of using Spring is that it is XML-based (there are many reasons for me using Spring actually -- Security, ORM integration, etc), and it might facilitate my efforts. I'm thinking that even if reading through the Applications directory isn't such a good idea, I can somehow utilize Spring's dependency injection & AOS to create the appropriate solution. Have anybody tried this before and willing to share ideas, implementation approach, etc?
3. Other than Spring, what might help me accomplish this task?
4. Is this feasible (from a time and effort stand-point), or should I just do it the old-fashioned way?

Thanks in advance!
Vladimir

I'm including a sample XML document (very rough-draft) in this post:

<applications>
<application name="Remote Application">
<vip>somethingUNIQUE.mycompany.com</vip>
<sys-level>LAB</sys-level>
<lb-type>GTM</lb-type>
<farms>
<farm name="Farm 1" id="1">
<member-name>sslname.mycompany</member-name>
<ip-address>34.34.24.242</ip-address>
<application-servers>
<application-server name="Some Name1">
<ip-address>
34.983.238.32
</ip-address>
</application-server>
<application-server name="Some Name 2222">
<ip-address>
34.343.248.32
</ip-address>
</application-server>
<application-server name="Some Name 3425">
<ip-address>
34.343.248.32
</ip-address>
</application-server>
</application-servers>
<web-servers>
<web-server name="Some Name1">
<ip-address>
34.983.238.32
</ip-address>
</web-server>
<web-server name="Some Name 2222">
<ip-address>
34.343.248.32
</ip-address>
</web-server>
<web-server name="Some Name 3425">
<ip-address>
34.343.248.32
</ip-address>
</web-server>
</web-servers>
</farm>
<farm name="Farm 2" id="2">
<member-name>sslvpn01.downingtown</member-name>
<ip-address>34.34.24.250</ip-address>
<application-servers>
<application-server name="Some Name 3425">
<ip-address>
34.343.248.32
</ip-address>
</application-server>
</application-servers>
<web-servers>
<web-server name="Some Name1">
<ip-address>
34.983.238.32
</ip-address>
</web-server>
<web-server name="Some Name 3425">
<ip-address>
34.343.248.32
</ip-address>
</web-server>
</web-servers>
</farm>
</farms>
</application>
<application name="Tech Tools">
<vip>technicalUNIQUE.tools.mycompany.com</vip>
<sys-level>LAB</sys-level>
<lb-type>GTM</lb-type>
<farms>
<farm name="Farm 1" id="1">
<member-name>tools.tech</member-name>
<ip-address>34.34.24.214</ip-address>
<application-servers>
<application-server name="Some Name 2222">
<ip-address>
34.343.248.32
</ip-address>
</application-server>
<application-server name="Some Name 3425">
<ip-address>
34.343.248.32
</ip-address>
</application-server>
</application-servers>
<web-servers>
<web-server name="Some Name1">
<ip-address>
34.983.238.32
</ip-address>
</web-server>
<web-server name="Some Name 2222">
<ip-address>
34.343.248.32
</ip-address>
</web-server>
</web-servers>
</farm>
<farm name="Farm 2" id="2">
<member-name>tools.tech222</member-name>
<ip-address>34.34.24.415</ip-address>
<application-servers>
<application-server name="Some Name1">
<ip-address>
34.983.238.32
</ip-address>
</application-server>
<application-server name="Some Name 2222">
<ip-address>
34.343.248.32
</ip-address>
</application-server>
<application-server name="Some Name 3425">
<ip-address>
34.343.248.32
</ip-address>
</application-server>
</application-servers>
<web-servers>
<web-server name="Some Name1">
<ip-address>
34.983.238.32
</ip-address>
</web-server>
<web-server name="Some Name 2222">
<ip-address>
34.343.248.32
</ip-address>
</web-server>
<web-server name="Some Name 3425">
<ip-address>
34.343.248.32
</ip-address>
</web-server>
</web-servers>
</farm>
</farms>
</application>
</applications>
 
ranger
Posts: 17344
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, you lost me quickly in your solution, which means it is a bit overkill in my opinion.

Why not use Spring JMX, and create simple Pojo classes that do the management work. No need to read/write to xml. It is very simple to expose a POJO class as an MBean, then you can use any JMX console app that is out there. JConsole comes with Java 5+, to see how that looks, run jconsole from the command line and connect to itselt, you can see graphs and operations and values, and change values, fire operations.

Hope that helps

Mark
 
This tiny ad is wafer thin:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!