On Wednesday 23 November 2011 08:43 PM, Tom Mueller wrote:
>> b) Is there a notification system where one can send notifications
>> from one
>> server to other members of the cluster?
>
> There are two mechanisms related to this.
>
> 1. From an instance it is possible to use Shoal/GMS to communicate
> within a cluster.
> 2. On the DAS, there is a command replication mechanism that will
> replicate commands to a cluster. There is an API for defining your own
> commands that can extend GlassFish - see:
> http://docs.oracle.com/cd/E18930_01/html/821-2415/ghmrd.html#scrolltoc
>
In addition to the above techniques, you could also use Java Message
Service (JMS) as an event notification mechanism between your bundles.
Your code will be more portable and it will work irrespective of single
instance vs. multiple instance mode. GlassFish does allow OSGi bundles
to use JMS as described in "JMS Resource Service" in section #9.4 of
[1]. Look at [2] for an example of OSGi bundle using JMS.
[1]
http://glassfish.java.net/public/GF-OSGi-Features.pdf
[2]
http://java.net/projects/glassfish/sources/svn/show/trunk/fighterfish/test/testapp/test.app16.msgproducer