jboss - How to do Application specific Configuration for a Framwork -


I want to write the Java EE framework for a common type of applications. I will handle application specific config values ​​in my profile. I'm looking for a way.

To illustrate: One component provides a stateless session beans that is firmly handled and I want to configure the name of the data source used in a config file in my application (eg. For the app in the ear web-flutter folder).

Now I have X> 1 application that wants to configure x different datasets for X specific data management.

How can someone give me an example?

Greetings, Alexander

You should use a JDI provider that is available for the container Has been bundled with. One of your goals is that the use of resources, in your case, a data source, in highly dynamic fashion.

For Jbis, the data source is included in the following steps:

  1. Deploy a * -ds.xml configuration file in the Deploying Directory of the webserver server . It defines the global JnDI name of resources. There should be a lot of examples for many databases available on the Internet.
  2. Add a resource-ref to jboss.xml of any EJB jar for jboss-web.xml of any war or anybody who needs the resource to name this global JNDI name to the local / component JNDI name Defines mapping.
  3. Add a resource-referee by using the web.exam or any EJB's ejb-jar.xml using the local JNDI name

    Once Things are in place, you can do JNDI lookup to access configured resources.

    You can do this to configure many data sources in JBoss and then make one or more data sources available for web applications and EJB.

    HH

Comments