Determining jboss version programmatically between jboss 5 and 7

I am trying to find the best way to grammatically determine if my program is running on Jboss 5 or Jboss 7 (eap-6.1). The paths I have found so far are jboss 5 or jboss 7, which do not work, because the code should work in both. I tried both solutions from here: How to get the version programmatically in JBoss AS 5.1? and they didn’t work. One of them complained about org.jboss.Main, which did not exist in jboss 7, the other complained that it did not end with "jmx / rmi / RMIAdaptor".

The only way I can see is to get Class.forName to look for "org.jboss.Version" (should be found if jboss 5), and if that fails, run Class.forName "org.jboss.util.xml. catalog.Version "(jboss 7). But that seems like a terrible idea.

The reason I need to know if the war works on jboss 5 or 7 is because there are some user files that are in different places in both. So "if jboss 5, execute this piece of code if jboss 7 executes another.

+4
source share
2 answers

Ok, I just saw what the problem is.

I would suggest you think about the design / refactoring issues of your software.

, .

.

oppionen , . .

, - . () .

, .


.


, 4 6 - MBean JBoss - WarFile.

MBean - jmx- JBoss. WebApplication "-" "-" jmx-.

, jmx .

: , , , . :

http://www.theserverside.com/news/1364648/Using-JMX-to-Manage-Web-Applications

JBoss 7 , OSGI. .

, JEE, , . JNDI Lookup, JMX ManagedBean, Java Connector Archicture (JCA) ( )

+2

, ,

"", ejb, , , ejb.

- , .

- JMX Beans, Adminstratore JBoss. JMX Bean Context Mechansim. 4 JMX Managed Bean. JMX JBoss 3-6, JBoss.

, , 4 6.x 7.0, . 7.0 JMX .

+1

All Articles