User: squirest
  Date: 02/03/07 16:41:37

  Modified:    src/main/org/jboss/mx/server/registry
                        BasicMBeanRegistry.java
  Log:
  added interceptor to route ModelMBean invocations to a dispatcher
  removed all irrelevant code not compatible with accepted strategy for interceptors
  
  Revision  Changes    Path
  1.8       +18 -18    
jmx/src/main/org/jboss/mx/server/registry/BasicMBeanRegistry.java
  
  Index: BasicMBeanRegistry.java
  ===================================================================
  RCS file: 
/cvsroot/jboss/jmx/src/main/org/jboss/mx/server/registry/BasicMBeanRegistry.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- BasicMBeanRegistry.java   1 Mar 2002 19:25:57 -0000       1.7
  +++ BasicMBeanRegistry.java   8 Mar 2002 00:41:37 -0000       1.8
  @@ -55,7 +55,7 @@
    * @author  <a href="mailto:[EMAIL PROTECTED]";>Juha Lindfors</a>.
    * @author  <a href="mailto:[EMAIL PROTECTED]";>Trevor Squires</a>.
    * @author  <a href="mailto:[EMAIL PROTECTED]";>Adrian Brock</a>.
  - * @version $Revision: 1.7 $
  + * @version $Revision: 1.8 $
    */
   public class BasicMBeanRegistry
      implements MBeanRegistry, BasicMBeanRegistryMBean
  @@ -73,12 +73,12 @@
       * The default domain for this registry
       */
      private String defaultDomain;
  -   
  +
      /**
       * The MBeanServer for which we are the registry.
       */
      private MBeanServer server = null;
  -   
  +
      /**
       * Direct reference to the mandatory MBean server delegate MBean.
       */
  @@ -88,12 +88,12 @@
       * The loader repository for loading classes
       */
      private LoaderRepository loaderRepository  = 
LoaderRepository.getDefaultLoaderRepository();
  -   
  +
      /**
  -    * Sequence number for the MBean server registration notifications. 
  +    * Sequence number for the MBean server registration notifications.
       */
      private long registrationNotificationSequence = 1;
  -   
  +
      /**
       * Sequence number for the MBean server unregistration notifications.
       */
  @@ -124,7 +124,7 @@
         try
         {
            this.delegate = new MBeanServerDelegate();
  -         registerMBean(delegate, new ObjectName(MBEAN_SERVER_DELEGATE), 
  +         registerMBean(delegate, new ObjectName(MBEAN_SERVER_DELEGATE),
                          null, JMI_DOMAIN);
         }
         catch (MalformedObjectNameException e)
  @@ -171,10 +171,10 @@
   
      // MBeanRegistry Implementation ----------------------------------
   
  -   public ObjectInstance registerMBean(Object object, ObjectName name, 
  +   public ObjectInstance registerMBean(Object object, ObjectName name,
                                          ClassLoader cl, Object magicToken)
  -      throws InstanceAlreadyExistsException, 
  -             MBeanRegistrationException, 
  +      throws InstanceAlreadyExistsException,
  +             MBeanRegistrationException,
                NotCompliantMBeanException
      {
         boolean registrationDone = true;
  @@ -230,7 +230,7 @@
               if (mbcap.getMBeanType() == MBeanCapability.STANDARD_MBEAN)
                  invoker = DispatcherFactory.create(mbcap.getStandardMBeanInfo(), 
object);
               else
  -               invoker = DispatcherFactory.create((DynamicMBean)object);
  +               invoker = (DynamicMBean) object;
   
               MBeanEntry entry = new MBeanEntry(regName, invoker, object, cl);
               add(entry);
  @@ -317,7 +317,7 @@
         if (name.getDomain().equals(JMI_DOMAIN))
            throw new RuntimeOperationsException(new IllegalArgumentException(
               "Not allowed to unregister: " + name.toString()));
  - 
  +
         MBeanEntry entry = get(name);
         Object resource = entry.getResourceInstance();
   
  @@ -386,7 +386,7 @@
         if (!contains(name))
            throw new InstanceNotFoundException(name + " not registered.");
   
  -      return new ServerObjectInstance(qualifyName(name), 
  +      return new ServerObjectInstance(qualifyName(name),
            get(name).getResourceClassName(), delegate.getMBeanServerId());
      }
   
  @@ -602,7 +602,7 @@
       * @exception InstanceAlreadyExistsException when the MBean's object name
       *            is already registered
       */
  -   protected synchronized void add(MBeanEntry entry) 
  +   protected synchronized void add(MBeanEntry entry)
         throws InstanceAlreadyExistsException
      {
         // Determine the MBean's name and properties
  @@ -662,7 +662,7 @@
       * @param magicToken used to get access to the reserved domain
       * @return the original name or the name prepended with the default domain
       *         if no domain is specified.
  -    * @exception RuntimeOperationException containing an 
  +    * @exception RuntimeOperationException containing an
       *            IllegalArgumentException for a problem with the name
       */
      protected ObjectName validateAndQualifyName(ObjectName name,
  @@ -677,7 +677,7 @@
                  new IllegalArgumentException("Object name is a pattern:" + name));
   
         // Check for reserved domain
  -      if (magicToken != JMI_DOMAIN && 
  +      if (magicToken != JMI_DOMAIN &&
             result.getDomain().equals(JMI_DOMAIN))
            throw new RuntimeOperationsException(new IllegalArgumentException(
                        "Domain " + JMI_DOMAIN + " is reserved"));
  @@ -694,7 +694,7 @@
       * @param name the name to qualify
       * @return the original name or the name prepended with the default domain
       *         if no domain is specified.
  -    * @exception RuntimeOperationException containing an 
  +    * @exception RuntimeOperationException containing an
       *            IllegalArgumentException when there is a problem
       */
      protected ObjectName qualifyName(ObjectName name)
  @@ -705,7 +705,7 @@
         try
         {
            if (name.getDomain().length() == 0)
  -            return new ObjectName(defaultDomain + ":" + 
  +            return new ObjectName(defaultDomain + ":" +
                                     name.getCanonicalKeyPropertyListString());
            else
               return name;
  
  
  

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to