-
1. Re: Any alternative for <application-managed-security/> in AS 7
sfcoy Jan 19, 2012 8:13 PM (in response to vinprabhuu)The portable way to do this has always been to declare it in a resource-ref:
<resource-ref> <res-ref-name>jdbc/myDataSource</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Application</res-auth> </resource-ref>
Your code would then be looking up
java:comp/env/jdbc/myDataSource
to access the connection.
-
2. Re: Any alternative for <application-managed-security/> in AS 7
vinprabhuu Jan 20, 2012 7:40 AM (in response to sfcoy)Hi Stephen,
Thanks for the suggestion. But <resource-ref> tag is not supported in standalone.xml.
This tag could have been used in any Web applications, which has we.xml file. But my applciation is a server and it doesnt have any such files.
https://docs.jboss.org/author/display/AS7/Resource+adapters
JBoss doc for Resource adapters says, it has such kind of support for having <application/> tag like
<security>
<application/>
</security>
But I could not use this in my datasource configuration.
Following is my datasource configuration in standalone.xml. I would like to know how can I relate
<res-auth>Application</res-auth>
with this configuration. How can I do that??
<subsystem xmlns="urn:jboss:domain:datasources:1.0">
<datasources>
<datasource jndi-name="java:jboss/mydatabase" pool-name="mypoolname" enabled="true" jta="true" use-java-context="true" spy="true" use-ccm="true">
<connection-url>
jdbc:oracle:thin:@mydburl:1234:mydbsid
</connection-url>
<driver>
oracle
</driver>
<pool>
<min-pool-size>
0
</min-pool-size>
<max-pool-size>
100
</max-pool-size>
<prefill>
false
</prefill>
<use-strict-min>
false
</use-strict-min>
<flush-strategy>
EntirePool
</flush-strategy>
</pool>
<timeout>
<blocking-timeout-millis>
30000
</blocking-timeout-millis>
<idle-timeout-minutes>
1
</idle-timeout-minutes>
</timeout>
</datasource>
</datasources>
Thanks alot in advance.
-
3. Re: Any alternative for <application-managed-security/> in AS 7
sfcoy Jan 20, 2012 8:04 AM (in response to vinprabhuu)Vin Prabhu wrote:
But my applciation is a server and it doesnt have any such files.
What kind of server?
How is it packaged?
-
4. Re: Any alternative for <application-managed-security/> in AS 7
vinprabhuu Jan 22, 2012 11:21 AM (in response to sfcoy)I have deployed ear in standalone/deployment/appname.ear and sar within this standalone/deployment/appname.ear/appname.sar with which all application specific jars and config files.
My server doesnt have EJB, Webservices etc.
My server is written in Core Java to handle login, get database Connections, execute transactions etc.
-
5. Re: Any alternative for <application-managed-security/> in AS 7
sfcoy Jan 22, 2012 6:08 PM (in response to vinprabhuu)I can't help with changes to the datasource configuration.
However, you might want to consider CDI enabling your jar(s) and then injecting your datasource with
@Resource(authenticationType = APPLICATION, lookup=..) private DataSource myDataSource;
CDI makes things really easy and you should check it out if you haven't already.
-
6. Re: Any alternative for <application-managed-security/> in AS 7
vinprabhuu Jan 23, 2012 1:10 PM (in response to sfcoy)@Resource(authenticationType = APPLICATION)
This is supported. This is new feature in Java6.
But I want to know more about @Resource annotation. Can you please explain about authenticationType?
How exactly authenticationType = APPLICATION affects on DataSource? How to verify this?
What is difference between AuthenticationType.APPLICATION and AuthenticationType.CONTAINER?
Any other configurations needed for @Resource to work for DataSource??
-
7. Re: Any alternative for <application-managed-security/> in AS 7
sfcoy Jan 23, 2012 7:37 PM (in response to vinprabhuu) -
8. Re: Any alternative for <application-managed-security/> in AS 7
vinprabhuu Mar 27, 2012 2:30 AM (in response to sfcoy)Is the same tag <application-managed-security> supported in AS7.1 ??