[jboss-dev-forums] [EJB3 Development] - Ejb3 MBeans External Configuration ?

Christian Leclerc do-not-reply at jboss.com
Fri Jan 20 22:36:36 EST 2012


Christian Leclerc [https://community.jboss.org/people/christian.leclerc] created the discussion

"Ejb3 MBeans External Configuration ?"

To view the discussion, visit: https://community.jboss.org/message/647985#647985

--------------------------------------------------------------
Hello guy's, im kind of new here so first of all I want to thank you for the any support that you will give to me.
Here is my question now, iv'e bean searching since 2 day's on and off .. 

I am an Jboss as 6 guy's and now im migrate to Jboss as 7.
I've got a MBeans that is called 

something-service.xml

Here is the detail : 

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE server PUBLIC "-//JBoss//DTD MBean Service 4.0//EN"
          "http://www.jboss.org/j2ee/dtd/jboss-service_4_0.dtd">
<server>
    <mbean code="org.jboss.naming.JNDIBindingServiceMgr" name="ca.s3s.identitygardens.config:service=identitygardens-config">
        <attribute name="BindingsConfig" serialDataType="jbxb">
            <jndi:bindings xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"
                xmlns:jndi="urn:jboss:jndi-binding-service:1.0"
                xs:schemaLocation="urn:jboss:jndi-binding-service:1.0 resource:jndi-binding-service_1_0.xsd">
                <jndi:binding name="conf/x500Properties">
                    <java:properties xmlns:java="urn:jboss:java-properties"
                        xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"
                        xs:schemaLocation="urn:jboss:java-properties resource:java-properties_1_0.xsd">
                        <java:property><java:key>Item A</java:key> <java:value>value A</java:value></java:property>
                        <java:property><java:key>Item b</java:key><java:value>Value b</java:value></java:property>
                        <java:property><java:key>Item C</java:key><java:value>Value C</java:value></java:property>            
                    </java:properties>
                </jndi:binding>
            </jndi:bindings>
        </attribute>
        <depends>jboss:service=Naming</depends>
    </mbean>
</server>

And in my ejb I inject the value with : 

 @Resource(mappedName = "conf/x500Properties")

Everything work's great and now I wonder how to do this in JBoss AS 7
It was very great because this way I was able to make the configuration out of my ear file.
The value is put in jndi at startup and the ejb go fetch this value by injection .. 

I know that I can possibly put a string in JNDI this way : 

 https://community.jboss.org/message/615368#615368 https://community.jboss.org/message/615368

But did I can make a complete properties file object on this way ? 

Thanks for any reply.



Christian Leclerc.
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/647985#647985]

Start a new discussion in EJB3 Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2030]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-dev-forums/attachments/20120120/fbb1d539/attachment.html 


More information about the jboss-dev-forums mailing list