NetBeans Forums
| View previous topic :: View next topic |
| Author |
Message |
Fabrizio Giudici Posted via mailing list.
|
Posted: Mon May 14, 2012 9:48 pm Post subject: [platform-dev] Re: Agent-based Platform applications and module activation |
|
|
On Mon, 14 May 2012 23:42:18 +0200, Fabrizio Giudici
<address-removed> wrote:
Sorry: I meant to write ACTORS (but I'm not going to fix the subject of
the thread).
--
Fabrizio Giudici - Java Architect, Project Manager
Tidalwave s.a.s. - "We make Java work. Everywhere."
address-removed
http://tidalwave.it - http://fabriziogiudici.it |
|
| Back to top |
|
 |
Monezz
Joined: 18 Feb 2009 Posts: 254
|
Posted: Tue May 15, 2012 7:46 am Post subject: [platform-dev] Re: Agent-based Platform applications and module activation |
|
|
| Quote: | Is it the only way to declare all those modules as eager?
| I think declare them eager is the only way to make sure they are
loaded (regardless of loaded modules having a direct or indirect
dependency on them)
I think OSGI modules are always loaded when present, but I never tried that. |
|
| Back to top |
|
 |
Fabrizio Giudici Posted via mailing list.
|
Posted: Tue May 15, 2012 8:43 am Post subject: [platform-dev] Re: Agent-based Platform applications and module activation |
|
|
On Tue, 15 May 2012 09:46:12 +0200, Timon Veenstra <address-removed>
wrote:
| Quote: | | Quote: | Is it the only way to declare all those modules as eager?
| I think declare them eager is the only way to make sure they are
loaded (regardless of loaded modules having a direct or indirect
dependency on them)
I think OSGI modules are always loaded when present, but I never tried
that.
|
OSGi introduces another doubt. I'd like to have everything I'm doing
OSGified, but I'd also like to have my projects as a real-world example
for Platform developers. Thus I'd like to keep OSGi outside the door for
at least one project (I have two simple projects, one could be OSGified
and the other not). So, I need to find a solution that works everywhere
(or two specified solutions working on the two contexts).
--
Fabrizio Giudici - Java Architect, Project Manager
Tidalwave s.a.s. - "We make Java work. Everywhere."
address-removed
http://tidalwave.it - http://fabriziogiudici.it |
|
| Back to top |
|
 |
Fabrizio Giudici Posted via mailing list.
|
Posted: Tue May 15, 2012 10:41 am Post subject: [platform-dev] Re: Agent-based Platform applications and module activation |
|
|
On Tue, 15 May 2012 11:27:20 +0200, Timon Veenstra <address-removed>
wrote:
| Quote: | | Quote: | OSGi introduces another doubt. I'd like to have everything I'm doing
OSGified, but I'd also like to have my projects as a real-world example
for
Platform developers. Thus I'd like to keep OSGi outside the door for at
least one project (I have two simple projects, one could be OSGified
and the
other not). So, I need to find a solution that works everywhere (or two
specified solutions working on the two contexts).
| Perhaps create a @Agent or @Producer/@Consumer annotation for
registration and add the eager line in the module.xml in the
annotation processor?
|
Yes, I have annotations and I'm trying eager in module.xml
| Quote: |
I wonder though how much you would need modules to be eager.
For events triggers by user interaction, the producer module will be
loader because the triggering gui module will have a dependency on the
producer module (if they are even in separate modules at all).
Consumers which need to initiate some interaction are also very likely
to be loaded for the same reason.
|
No It's my current problem. I have a specific "actorified" action that
just sends out a message. Then the consumer for that message is in an
independent module and clearly NetBeans doesn't find a dependency. So, the
consumer might be disabled and the action does nothing, as the message is
fired and lost.
| Quote: | Remains the bridging modules, which should be eager loading by
definition.
I have been using a simple eventbus in netbeans platform applications,
but never needed to make a module eager loading solely for the reason
of having a producer or consumer loaded.
|
In my previous design I had an eventbus, but there was less decoupling
(and in any case I think I were using tokens).
The most elegant solution I'm thinking in the past two hours is a special
infrastructural module that:
1. Scans all the modules and finds out in their code what messages they
are listening to (by introspecting annotations).
2. Creates a map so it associates message type to consumers.
3. Listens to all the messages and whenever a message is found, it makes
sure that all the consumers are activated.
I see some potential and effective problems. First, speed: I fear that
there could be a "boot" lag the first time the user presses the button, as
some modules have to be activated. But it could be neglectable. Second,
async nature of messages. When the infrastructural module receives a
message, it can activate modules, but this means that new consumers are
activated in the middle of a message delivery. While at the moment I'm
running my own messaging infrastructure, I'm planning to move to Akka, so
I couldn't be able to do everything I want. Perhaps it can be solved by
resending the message, but then there are duplicated messages to avoid,
etc...
So, it's something I'm going to study, but in the meantime I need
something simpler.
--
Fabrizio Giudici - Java Architect, Project Manager
Tidalwave s.a.s. - "We make Java work. Everywhere."
address-removed
http://tidalwave.it - http://fabriziogiudici.it |
|
| Back to top |
|
 |
NeilCSmith
Joined: 08 Aug 2011 Posts: 19
|
Posted: Tue May 15, 2012 12:19 pm Post subject: [platform-dev] Re: Agent-based Platform applications and module activation |
|
|
Hi,
On 14 May 2012 22:42, Fabrizio Giudici <address-removed> wrote:
| Quote: | Tokens here don't help, since as far as I understand if a module
requires a token, the platform just makes sure that at least one module
providing it is enabled; not *all* the modules providing it.
|
Are you sure about that? I had a quick look through the bootstrap
code, and various comments suggest that all providers are enabled if a
token is required. Nice to know if that's right and guaranteed though
- I'd like to use for a different purpose.
Best wishes,
Neil
--
Neil C Smith
Artist : Technologist : Adviser
http://neilcsmith.net |
|
| Back to top |
|
 |
Fabrizio Giudici Posted via mailing list.
|
Posted: Tue May 15, 2012 12:28 pm Post subject: [platform-dev] Re: Agent-based Platform applications and module activation |
|
|
On Tue, 15 May 2012 14:19:16 +0200, Neil C Smith
<address-removed> wrote:
| Quote: | Hi,
On 14 May 2012 22:42, Fabrizio Giudici <address-removed>
wrote:
| Quote: | Tokens here don't help, since as far as I understand if a module
requires a token, the platform just makes sure that at least one module
providing it is enabled; not *all* the modules providing it.
|
Are you sure about that? I had a quick look through the bootstrap
code, and various comments suggest that all providers are enabled if a
token is required. Nice to know if that's right and guaranteed though
- I'd like to use for a different purpose.
|
Well, I'm not sure indeed. So, yes, I'm asking too for a clarification.
Thanks. Anybody?
--
Fabrizio Giudici - Java Architect, Project Manager
Tidalwave s.a.s. - "We make Java work. Everywhere."
address-removed
http://tidalwave.it - http://fabriziogiudici.it |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|