tags:

views:

64

answers:

1

I am using a single JBoss deploy directory for multiple J2EE projects that I'm working on. (Note, I'm not looking for answers that tell me that I shouldn't be doing this.) I have written a scheduler service mbean that lives in the deploy directory, e.g., an XML file containing

<server>
    ...
    <mbean code= ... >
        <attribute ... >
        ...
    </mbean>
</server>

That XML file only contains that one mbean tag in the server tag, so it would be sufficient to make JBoss ignore the entire XML file. That mbean is specific to one of my projects, so I'm looking for the simplest way to hide it from JBoss when I'm working on a different J2EE project.

Right now, I'm accomplishing this by commenting out the entire mbean tag inside of the file (manually). This is ugly. Other than moving the XML file out of the deploy directory, is there a better/cleaner/recommended way to do this?

A: 

The cleanest solution that I can think of would be to create two configurations where one contained the mbean and the other didn't. Then you could just:

./run.sh -c config_with_mbean

or

./run.sh -c config_without_mbean

JBoss Documentation on alternative configurations.

Lloyd Meinholz
Though I do know how to run JBoss in a shell, I usually just do it in Eclipse. Do you know of anything similar, aside from using a different "server configuration," as Eclipse calls it - which seems to be limited to using an entirely different folder in the `server` directory. At any rate, I might just take this route in the interest of moving along.
Matt Ball
I think multiple server configurations is the best solution to your question and I don't know of any other (easy) alternative. Your situation is exactly what server configurations are meant to address (which services are available to applications running in the configuration) and seem like a natural fit.
Lloyd Meinholz