You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by Kenji Nakamura <ke...@clazzsoft.com> on 2005/12/10 01:03:55 UTC

GBean references

Hi,

I'm transforming our desktop app to run on server, and I'd like to
make custom GBeans out of the modules.

I'm stuck with the configuration of GBean reference.
I took a look at the plans in doc directory, and noticed there are
three ways to define reference.

I created a GBean named "Dispatcher" in configId
"com/example/Dispatcher". Then I created another plan
"com/example/Workspace" whose parentId is "com/example/Dispatcher". In
the plan, I'd like to inject Dispatcher into a GBean "Workspace".

I tried both format 1) and 2).

1)
 <reference name="Dispatcher">
            <gbean-name>geronimo.server:j2eeType=GBean,J2EEModule=com/example/Dispatcher,name=Dispatcher</gbean-name>
 </reference>

2)
<reference name="Dispatcher">
            <module>com/example/Dispatcher</module>
            <type>GBean</type>
            <name>Dispatcher</name>
 </reference>

In either case, console output seems to be normal...

15:34:43,907 INFO  [LocalConfigStore:config-store] Loaded
Configuration geronimo.config:name="com/example/Workspace"
15:34:43,990 INFO  [Configuration] Started configuration com/example/Workspace

However, doStart() method of Workspace GBean WAS NOT called, and I
noticed the following debug message.

15:34:44,456 DEBUG [GBeanSingleReference] Waiting to start
geronimo.server:J2EEApplication=null,J2EEModule=com/example/Workspace,J2EEServer=geronimo,j2eeType=GBean,name=Workspace
because no targets are running for reference Dispatcher matching the
patterns geronimo.server:J2EEModule=com/example/Dispatcher,j2eeType=GBean,name=Dispatcher

Here is the output of deploy list-modules.
(...snip...)
+ org/apache/geronimo/SystemDatabase
  + org/apache/geronimo/applications/Welcome/Jetty @
http://omega.intranet.palamida.com:8083/
  + com/example/Dispatcher
  + com/example/Workspace
  + org/apache/geronimo/SystemJMS
(...snip...)

The output of list-targets is as following;
Available Targets:
  geronimo.server:J2EEApplication=null,J2EEModule=org/apache/geronimo/System,J2EEServer=geronimo,j2eeType=ConfigurationStore,name=Local

doStart() is invoked if I comment out the reference to Dispatcher.

Workspace GBean also has the reference to ServerInfo, which is defined
in format 2) and successfully retrieved and doStart() is kicked off. I
don't understand where the behavior difference comes from. Do I need
to something special to expose GBean to others?

I also want to know the criteria to choose reference element format 1)
and 2) described above. Are they just syntax variations to support
JSR-77 style and Geronimo native configId?

Thanks in advance,

---
Kenji Nakamura