[ 
http://issues.apache.org/jira/browse/GERONIMO-450?page=comments#action_60280 ]
     
David Jencks commented on GERONIMO-450:
---------------------------------------

This is a short explanation of how references can be constructed from a mailing 
list post.
I talked about this with Alan and Dain a bit and they have some additional 
points that I hopefully won't misrepresent too badly.

First of all everyone likes the first choice better, indicate the stuff to 
leave out and use wildcards for.

Dain suggested including the type in the reference object, set in the 
GBeanInfo.  I think this will work most of the time but I think there may be 
cases that involve multiple patterns that cannot be handled with a single type, 
so I think we need to keep an option to specify the type.  Perhaps this is only 
needed when you specify the literal name anyway.

Alan pointed out that the keys fall into two categories: implicit (derivable 
from the context) and explicit (not derivable from the context).  For jsr-77 
naming, implicit keys are domain, server, application, module, and type, 
whereas the only explicit key is name.

For implicit keys, if the key is not mentioned in the reference pattern, it 
should be included with the value from the context.
If it is mentioned with a value, it should be included with that value.
if it is mentioned with no value or * or some such marker, it should be omitted 
and the pattern includes *

For explicit keys, all explicit keys must be mentioned in the pattern
If the key is mentioned with a value, it should be included with that value
if the key is mentioned with * or some such it will be ommitted and the pattern 
include *.

if we allowed you to leave out an explicit key, it would have to mean the same 
as wildcarding it, and that could produce unexpectedly large numbers of matches.

So, lets try some new-style examples.

Remember the type is set in the GBeanInfo, so we don't need to specify it.

<reference name="ManagedConnectionFactories">
  <name>*</name>
</reference>
gets all MCF deployed in the current application

<reference name="ManagedConnectionFactories">
  <application>null</application>
  <module>*</module>   //or <module/>
  <name>*</name>
</reference>
gets all MCF deployed in a standalone, non-ear module.

<reference name="StatelessSessionBeans">
  <module>*</module>
  <name>bar</name>
</reference>
gets all stateless session beans in the current ear named "bar".  This would 
typically be used to resolve an ejb link. (see GERONIMO-552)

<reference name="ManagedConnectionFactories">
  <gbeanName>geronimo.server:name=foo,*</gbeanName>
</reference>
supplies the complete gbean name explicitly.

There's a question about whether the parts should be specified with elements or 
attributes.  I think elements will be clearer and provide more possibilities 
for validation, but I'm open to suggestions.  There's also potential for 
confusion between the reference name and the name key of the reference pattern.


Also, I'd like opinions on the choice of
<module>*</module>
or
<module/>
or something else to show that a key is left out of the query and the query 
becomes a wildcard.


> GBeans should use jsr-77 naming conventions and these names should have 
> mostly default components
> -------------------------------------------------------------------------------------------------
>
>          Key: GERONIMO-450
>          URL: http://issues.apache.org/jira/browse/GERONIMO-450
>      Project: Geronimo
>         Type: Improvement
>   Components: deployment
>     Versions: 1.0-M2
>     Reporter: David Jencks
>     Assignee: David Jencks
>      Fix For: 1.0-M4

>
> Currently the usage of object names for non-j2ee-wrapping gbeans is more or 
> less random and confusing.  We should adopt as much of jsr-77 naming as 
> possible for our gbeans.  Furthermore, as little as possible of the names 
> should be specified in the gbean xml descriptor.  Here's a proposal:
> 1. A service module that has no parent must specify domain and server name.  
> This domain and server name will be inherited by all children recursively.
> 2. All gbeans deployed from a service dd will have J2EEApplication=null and 
> GeronimoModule=<configId>
> 3. All gbeans deployed from a j2ee module or application will have 
> J2EEApplication set from the application and GeronimoModule=<configId>
> 4. A gbean xml descriptor will have attributes for j2eeType and name.  We 
> will invent more j2eeType names as needed and prefix them with Ger or 
> Geronimo.
> I'm inclined to remove the possibility of directly specifying the entire 
> object name.  If it is really needed I'd suggest the attribute be called 
> target-name in analogy to the usage in refs.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira

Reply via email to