5 Replies Latest reply on Feb 8, 2011 11:02 AM by robert.greene
      • 1. Re: How do I invoke a method on an EJB or execute some code on a specific node of a JBoss Cluster ?
        welle

        One solution could be to make sure that the EJB isn't clustered (may be done by deploying a non-clustered variant in parallell with the clustered one) and point the jndi lookup to the local jndi of that specifc node.

        • 2. Re: How do I invoke a method on an EJB or execute some code on a specific node of a JBoss Cluster ?
          welle

          Hmm... read your question again and perhaps a singleton service can be what you seek. (A service that only executes on one node in the cluster.)

          • 3. How do I invoke a method on an EJB or execute some code on a specific node of a JBoss Cluster ?
            robert.greene

            I should have been more specific. I want to perform per node specific configuration of the underlying operation system on a specific node of the cluster.

             

            Suppose a Web UI passing some node specific id/or info invokes some method on an SLSB ejb with node specific id/or info (general invocation of code on cluster) this then invokes a specific method on a class on the SPECIFIED NODE that is a part of the cluster (ejb or not I don't care, you tell me) that then (And I know this next part is wrong.... but...)  then modifies the file system for that specific node and or invokes a perl module or runs a bash script etc.

             

            While I would love specifics and examples, I am asking this from a high level point of view... What is the right way to do this? What are my options, and how have others solved this issue?

             

            Do I use JMX in some way? JNDI ? Some Jboss specific partition method call? Something entirely different ?

            • 4. How do I invoke a method on an EJB or execute some code on a specific node of a JBoss Cluster ?
              welle

              Ok, some alternatives...

               

              1.) Deploy a non-clustered EJB that you call from a client on a specific node (not using ha-jndi)

              2.) A webapplication that you access directly on the node

              3.) A JMX bean that you either call remote or using then JMX console to invoke,

              4.) Using the RCP funtctionality of JGroups to call a method on a specific node in the cluster

               

              I would go for 3 and use JMX. It's basically indended for stuff like this.

              Is the actual call invoked by human or computers?

               

              Anyone else has more! Please fill in!

              • 5. How do I invoke a method on an EJB or execute some code on a specific node of a JBoss Cluster ?
                robert.greene

                Is the actual call invoked by human or computers?

                 

                Both. The web UI has the ability to configure some os and hardware specific stuff. i.e. Enable and disable network interfaces, set the time, enter per node license info, etc. The Application running on the application server also runs cron jobs (actual cron job in crontab on the linux platform) and Quartz jobs as well. Some of these jobs (configured in either place) actually run (sigh... I know this is wrong but...) bash scripts, perl scripts, modifies files on the file system, etc. All the stuff the EJB spec says you can't do but we do anyway....

                 

                 

                I thought JMX was the way to go, but I will investigate the JGroups api as well.