[ 
https://issues.apache.org/jira/browse/OPENEJB-1969?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13534533#comment-13534533
 ] 

Trevor Baker commented on OPENEJB-1969:
---------------------------------------

Taking latest from svn trunk. Tests not passing.

haha... this issue is morphing from supplying InstanceProducer<Context> to 
loading entries into java:global again.

Tried arquillian.xml and that loads into java:openejb.

Take a look at the spec about java:global (JSR 316: 
http://download.oracle.com/otndocs/jcp/javaee-6.0-fr-eval-oth-JSpec/).

Section EE.5.2.2: java:global is a namespace shared by all application. It's 
not limited to EJB.
Section EE.5.17: mentions a global datasource. Gives example of app datasource, 
though.

I've attached a sample unit test. There is a README on how to switch the tests 
to run against a JBoss 7, which passes all tests. In JBoss 7 they have a 
mechanism to load entries into the the JNDI tree (pre-configured in the 
standalone.xml) but can also bind entries to new InitialContext().

I'm trying to get a similar mechanism to load up entries into java:global 
before deployment so when EJBs are created they have the appropriate values in 
OpenEJB.

Please reconsider the "load values into any part of the jndi and use relative 
paths for resource lookup only" limitation. I haven't seen anything in the spec 
that suggests that, and by doing so it makes apps less portable with respect to 
accessing external resources outside of the java:comp, java:module, java:app 
(relative path) space. Not everything will be packaged into a EAR/WAR. For 
example, we compile a WAR once and that gets deployed to our dev, test, prod 
servers. No need to repackaging of the WAR is needed because all the external 
resources (such as a url to banking host) are outside of the WAR and can be 
accessed in the java:global space.
                
> OpenEJBDeployableContainer has InstanceProducer<Context>
> --------------------------------------------------------
>
>                 Key: OPENEJB-1969
>                 URL: https://issues.apache.org/jira/browse/OPENEJB-1969
>             Project: OpenEJB
>          Issue Type: Improvement
>          Components: arquillian
>    Affects Versions: 4.5.1
>            Reporter: Trevor Baker
>            Priority: Minor
>             Fix For: 4.5.2
>
>         Attachments: OPENEJB-1969.patch, OPENEJB-1969.zip
>
>
> Nice to have
> In OpenEJBDeployableContainer
> Change this:
>     private InitialContext initialContext;
> To this:
>     @Inject
>     @DeploymentScoped  // I'm assuming DeploymentScoped .. is there a better 
> one to use?
>     private InstanceProducer<Context> initialContext;
> So other Arquillian stuff can access the context with:
>     @Inject
>     private Instance<Context> ctx;
>   
> Instead of new InitialContext().

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to