You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by David Jencks <dj...@apache.org> on 2004/10/28 07:48:06 UTC
Proposal for more uniform gbean naming, similar to jsr-77 names.
Currently there is a more or less uniform naming scheme for j2ee
components specified by jsr-77, whereas the naming of other gbeans is
totally random and unpredictable, depending on the whims of the
developer as they strive for literary greatness... well, at least they
are all over the map.
Some aspects of uniformity from the jsr-77 scheme could easily be
applied to regular gbeans:
domain name and server name are specified in the EARConfigBuilder.
Similarly, they could be specified in the ServiceConfigBuilder for
uniformity across all gbeans.
Application name and/or module name are specified by the configId or
explicit application-name element, or by the relative location of a
module within an ear.
Similarly, we could supply a module name for gbeans from the configId
or an explicit module-name attribute.
j2eeType is perhaps not appropriate for non-j2ee component gbeans.
However some standard type name would be desirable, perhaps
serviceType.
As with j2ee components, a name property is needed.
So, a resulting gbean name might look like:
geronimo.server:
J2EEServer=geronimo,ServiceModule=foo,serviceType=3ProngedChuckActuator,
name=default
Of these, the domain and J2EEServer would be set in the
ServiceConfigBuilder,
ServiceModule set by
<service configId="a/b/c" parentId="base" module-name="foo">
and the gbean itself would only need
<gbean type="3ProngedChuckActuator" name="default"
class="com.bar.foo.Illusion">
or
<gbean properties="ServiceType=3ProngedChuckActuator,name=default"
class="com.bar.foo.Illusion">
or the first with optional additional properties.
Thoughts? Flames?
many thanks,
david jencks
Re: Proposal for more uniform gbean naming, similar to jsr-77 names.
Posted by Dain Sundstrom <ds...@gluecode.com>.
I have been thinking about this for a while, and yesterday I came up
with an idea...
On Oct 28, 2004, at 9:28 AM, Dain Sundstrom wrote:
> On Oct 27, 2004, at 10:48 PM, David Jencks wrote:
>
>> <gbean type="3ProngedChuckActuator" name="default"
>> class="com.bar.foo.Illusion">
>
> +1 maybe it should be serviceType to match the objectName
>
>> <gbean properties="ServiceType=3ProngedChuckActuator,name=default"
>> class="com.bar.foo.Illusion">
>
> This brings up the issue where I want to have a name that is a logical
> child of a GBean. For example:
>
> <gbean serviceType="Component" name="funk" class="x.y.z">
> geronimo.server:
> J2EEServer=geronimo,ServiceModule=foo,serviceType=Component,name=funk
>
> <gbean serviceType="ComponentPool" Component="funk" name="fpool"
> class="a.b.c">
> geronimo.server:
> J2EEServer=geronimo,ServiceModule=foo,Component=funk,serviceType=Pool,n
> ame=fpool
>
> Maybe we can construct the object name from the attributes, except for
> the class one?
Yesterday, it occurred to me that we could construct object names, just
like 77 does. This means that each component has a logical parent.
For example:
foo:j2eeType=J2EEApplication,name=MyApp,J2EEServer=MyServer
foo:
j2eeType=EJBModule,name=MyEJBModule,J2EEApplication=MyApp,J2EEServer=MyS
erver
foo:
j2eeType=EntityBean,name=MyBean,EJBModule=MyEJBModule,J2EEApplication=My
App,J2EEServer=MyServer
To achieve this style of name building we, just need to add a
parentType and parentName attributes. For the above names we would
have the following xml:
<gbean type="J2EEApplication" name="MyApp" class="...">
<gbean type="EJBModule" name="MyEJBModule" parentType="J2EEApplication"
parentName="MyApp" class="...">
<gbean type="EntityBean" name="MyBean" parentType ="EJBModule"
parentName ="MyEJBModule" class="...">
In most cases, we you would not have the parentType and parentName, as
the default parent would be module in which the gbean xml snippet is
contained.
The only weird thing about this proposal, is it would require the
parent be *visible* from the deployment code. This would mean it would
have to be in the same deployment unit, or possible in a parent
configuration. To reduce this problem, I propose that we allow a gbean
to explicitly set its exact ObjectName (GBeanName).
-dain
Re: Proposal for more uniform gbean naming, similar to jsr-77 names.
Posted by Dain Sundstrom <ds...@gluecode.com>.
+1 Good idea.
On Oct 27, 2004, at 10:48 PM, David Jencks wrote:
> So, a resulting gbean name might look like:
>
> geronimo.server:
> J2EEServer=geronimo,ServiceModule=foo,serviceType=3ProngedChuckActuator
> ,name=default
> <service configId="a/b/c" parentId="base" module-name="foo">
I like this. Would the module-name default to configId?
> <gbean type="3ProngedChuckActuator" name="default"
> class="com.bar.foo.Illusion">
+1 maybe it should be serviceType to match the objectName
> <gbean properties="ServiceType=3ProngedChuckActuator,name=default"
> class="com.bar.foo.Illusion">
This brings up the issue where I want to have a name that is a logical
child of a GBean. For example:
<gbean serviceType="Component" name="funk" class="x.y.z">
geronimo.server:
J2EEServer=geronimo,ServiceModule=foo,serviceType=Component,name=funk
<gbean serviceType="ComponentPool" Component="funk" name="fpool"
class="a.b.c">
geronimo.server:
J2EEServer=geronimo,ServiceModule=foo,Component=funk,serviceType=Pool,na
me=fpool
Maybe we can construct the object name from the attributes, except for
the class one?
Also, do we want components to be able override the name?
-dain