geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Jencks <david_jen...@yahoo.com>
Subject Constructing reference patterns
Date Sun, 06 Feb 2005 20:13:47 GMT
Currently specifying gbean reference patterns in plans is nearly  
impossible without referring to geronimo.log, finding the actual name  
of the intended target, and copying it back into the plan, and then  
testing to see if you got it right and your referencing gbean actually  
starts or if there is some other pattern gotcha waiting nearby to jump  
out and force your gbean back into waiting forever.

(As a side note, just to distract you from the main subject of this  
note, it would be handy to have a service that attempts to start all  
non-started gbeans and tells you why they wont start.  Perhaps this  
could be exposed as a command line tool or from the debug-tool.)

I think this could be helped considerably by a better syntax for  
specifying the pattern, not requiring you to write a whole object name  
yourself.

In general, there are:
1) keys you want to specify the value of (typically j2eeType or name)
2) keys you want to inherit from your current context (typically  
J2EEServer, sometimes J2EEApplication and/or various module types)
3) keys you want to leave out and wildcard.

There's a bit of an issue with references to e.g. application gbeans  
that don't have so many keys as regular component/gbean names.  Since  
there are very few if any of these currently, and the names are  
simpler, I think it would be acceptable to require that these patterns  
be completely and explicitly specified.

Here's a proposal for each of the categories above

1) specify the value explicitly in an element
2) do not mention the key
3) mention the key with an "omit" attribute or with an element content  
of "*"

Here are some examples:

<reference name="Foo">
   <application>null</application>
   <module>*</module>
   <type>JCAManagedConnectionFactory</type>
   <name>*</name>
</reference>
gets all MCF deployed in a standalone module.

<reference name="Foo">
   <module>*</module>
   <type>StatelessSessionBean</type>
   <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)

Alternatively these rules:

1) specify the value explicitly in an element
2) specify inherit, perhaps by an empty element
3) omit the key

the same examples:

<reference name="Foo">
   <domain/>
   <server/>
   <application>null</application>
   <type>JCAManagedConnectionFactory</type>
</reference>
gets all MCF deployed in a standalone module.

<reference name="Foo">
   <domain/>
   <server/>
   <application/>
   <type>StatelessSessionBean</type>
   <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)

For explicitly specifying an entire object name we should introduce an  
enclosing element to avoid mixed content:

<reference  
name="Foo"><gbeanName>geronimo.server: 
J2EEServer=geronimo,J2EEApplication=null,WebModule=org/foo/ 
bar,j2eeType=Servlet,*</gbeanName></reference>

Comments?

thanks
david jencks





Mime
View raw message