3 Replies Latest reply on Sep 20, 2004 1:52 PM by rkadayam

    Clustering and dynamic AOP

    rkadayam

      I've basically built a customized tool that does a lot of dynamic AOP such as swap in/out interceptors, advice bindings, interceptor/advice stacks and modify default and method level meta-data on J2EE beans. The tool itself is exposed via a Session bean which essentially is a facade to the AspectManager singleton instance.

      I've not thought through much how this would play out in a clustered environment. Would it have to be architected in a way so that the facade bean notifies every other node in the cluster of any dynamic AOP changes ? Since the AspectManager is not an "external resource" such as some Database, it becomes a challenge in trying to keep all of the instances in every node in Synch.

      Any tips or strategies or comments greatly appreciated.

      Thanks
      Rajiv

        • 1. Re: Clustering and dynamic AOP
          bill.burke

          You may be able to use JBossCache. I'm not sure if you can register to listen for cache changes (so that you can update the aspectmanager), but you could use JBossCache and use JGroups to send a notification to the cluster to update the AspectManagers.

          What I"m REALLY interested in is a DEFAULTS repository for metadata and annotations that can be VM and cluster wide.

          Bill

          • 2. Re: Clustering and dynamic AOP
            bill.burke

            Bill Burke wrote:

            > Does JBoss cache have the ability to register for cache changes? I have an AOP user that is building a dynamic cluster-wide aspect manager. They need the ability to have a replicated shared cluster-wide structure, but need to be able to notify on changes so that they can be updated.
            >
            > BIll
            >

            Yes.

            public interface TreeCacheListener {
            /**
            * Called when a node is created
            * @param fqn
            */
            void nodeCreated(Fqn fqn);

            /**
            * Called when a node is removed.
            * @param fqn
            */
            void nodeRemoved(Fqn fqn);

            /**
            * Called when a node is loaded into memory via the CacheLoader. This is not the same
            * as {@link #nodeCreated(Fqn)}.
            */
            void nodeLoaded(Fqn fqn);


            /**
            * Called when a node is evicted (not the same as remove()).
            * @param fqn
            */
            void nodeEvicted(Fqn fqn);

            /**
            * Called when a node is modified, e.g., one (key, value) pair
            * in the internal map storage has been modified.
            * @param fqn
            */
            void nodeModified(Fqn fqn);

            /**
            * Called when a node is visisted, i.e., get().
            * @param fqn
            */
            void nodeVisited(Fqn fqn);

            /**
            * Called when the cache is started.
            * @param cache
            */
            void cacheStarted(TreeCache cache);

            /**
            * Called when the cache is stopped.
            * @param cache
            */
            void cacheStopped(TreeCache cache);

            void viewChange(View new_view); // might be MergeView after merging
            }


            --
            Bela Ban
            Lead JGroups / JBossCache
            callto://belaban

            • 3. Re: Clustering and dynamic AOP
              rkadayam

              Thanks for the tip. I had a feeling JGroups might come into play.