2 Replies Latest reply on Jul 26, 2005 12:18 PM by Simon Parkin

    Dynamically-Reconfigurable Interceptor Core with Remote Acce

    Simon Parkin Newbie

      Hi,

      I'm trying to develop a dynamically-reconfigurable class which is to be used within JBoss by my own custom EJB Interceptors and Axis Handlers. I'm also wanting to create the class in such a way that it can have its internal configuration objects updated from a remote location. Having read through the forums/docs I'm under the impression that one way to dynamically update such an Interceptor would be to expose a suitable management interface through an MBean - or even a simple session bean - with the necessary update methods, but I'm unclear as to how to link such an interface to the core logic within my Interceptors/Handlers. For instance, part of the core will rely on, say, a HashMap of configuration parameters, and if further entries are to be dynamically added to this HashMap via a Service MBean/EJB method, is it a simple task to have this HashMap shared between both the Bean and the Interceptor/Handler core? Would the relevant configuration objects need to be shared/accessed across JNDI or something similar?
      I imagine another approach is to simply create an RMI service within the Interceptor's core logic, and have the remote system communicate directly with that. However, having used JBoss for a few years now something tells me that this would perhaps not be the best approach with respect to the various layers of management etc. ... am I right in thinking this?


      If anyone can simply steer me in the right direction it would be very much appreciated,

      Simon


      P.S. At this time I have no security/transaction requirements etc. with respect to remote access, I simply want a means to communicate updates to the developed system as a proof of concept. Also, I'm not tied to any version of JBoss.

        • 1. Re: Dynamically-Reconfigurable Interceptor Core with Remote
          Simon Parkin Newbie

          Just as an update, I've got an XMBean deployed, but I'm still having trouble sharing objects between this Bean and the Interceptors/Handlers. I thought I could share a custom static configuration object between them all (since the Interceptors and Handlers already share a static processing core between them), but this hasn't worked for some reason (despite the fact that the JBoss startup sequence suggests that the new static object *is* being shared correctly). Essentially I need a direct means of communicating data from the XMBean when a method is called so that the Interceptors and Handlers are immediately aware of any new data - a data sharing/notification framework would be ideal, but I can't find anything that works. Is there a way of hooking a non-MBean object into the XMBean notification framework? Is there any reason why a static instance of a custom object can't be shared across different classes within the JBoss server?


          Again, any help would be appreciated,
          Simon

          • 2. Re: Dynamically-Reconfigurable Interceptor Core with Remote
            Simon Parkin Newbie

            Heheh, okay, problem solved! I hadn't configured the shared static object correctly (*it* was static, but its shared internal data structures weren't) ...

            So, for anyone else wanting to try this, I developed a means of configuring the behaviour of request interception mechanisms remotely through an XMBean interface, by sharing a static configuration class between the XMBean and any applicable interceptor classes (which in this case are EJB Interceptors and Axis SOAP Handlers), and exposing methods for altering this configuration core through the XMBean.