Examples of MBeanEntry


Examples of org.jboss.mx.server.registry.MBeanEntry

    * this method will remove all those registrations.
    */
   public void removeNotificationListener(ObjectName name, ObjectName listener)
           throws InstanceNotFoundException, ListenerNotFoundException
   {
      MBeanEntry entry = registry.get(name);
      if (NotificationBroadcaster.class.isInstance(entry.getResourceInstance()) == false)
         throw new RuntimeOperationsException(new IllegalArgumentException("The MBean " + name + " exists but does not implement the NotificationBroadcaster interface."));

      MBeanEntry listenerEntry = registry.get(listener);
      if (NotificationListener.class.isInstance(listenerEntry.getResourceInstance()) == false)
         throw new RuntimeOperationsException(new IllegalArgumentException("The MBean " + listener + " exists but does not implement the NotificationListener interface."));

      checkMBeanPermission(entry.getResourceClassName(), null, name,
         "removeNotificationListener");

View Full Code Here

Examples of org.jboss.mx.server.registry.MBeanEntry

    */
   public void removeNotificationListener(ObjectName name,
      NotificationListener listener, NotificationFilter filter, Object handback)
      throws InstanceNotFoundException, ListenerNotFoundException
   {
      MBeanEntry entry = registry.get(name);
      if (NotificationBroadcaster.class.isInstance(entry.getResourceInstance()) == false)
         throw new RuntimeOperationsException(new IllegalArgumentException("The MBean " + name + " exists but does not implement the NotificationBroadcaster interface."));

      checkMBeanPermission(entry.getResourceClassName(), null, name,
         "removeNotificationListener");

      ClassLoader newTCL = entry.getClassLoader();

      ClassLoader oldTCL = TCLAction.UTIL.getContextClassLoader();
      final boolean setCl = newTCL != oldTCL && newTCL != null;
      try
      {
         if (setCl)
            TCLAction.UTIL.setContextClassLoader(newTCL);

         listeners.remove(entry.getObjectName(), listener, filter, handback);
      }
      finally
      {
         if (setCl)
            TCLAction.UTIL.setContextClassLoader(oldTCL);
View Full Code Here

Examples of org.jboss.mx.server.registry.MBeanEntry

    */
   public void removeNotificationListener(ObjectName name, ObjectName listener,
      NotificationFilter filter, Object handback)
      throws InstanceNotFoundException, ListenerNotFoundException
   {
      MBeanEntry entry = registry.get(name);
      if (NotificationBroadcaster.class.isInstance(entry.getResourceInstance()) == false)
         throw new RuntimeOperationsException(new IllegalArgumentException("The MBean " + name + " exists but does not implement the NotificationBroadcaster interface."));

      MBeanEntry listenerEntry = registry.get(listener);
      if (NotificationListener.class.isInstance(listenerEntry.getResourceInstance()) == false)
         throw new RuntimeOperationsException(new IllegalArgumentException("The MBean " + listener + " exists but does not implement the NotificationListener interface."));

      checkMBeanPermission(entry.getResourceClassName(), null, name,
         "removeNotificationListener");

View Full Code Here

Examples of org.jboss.mx.server.registry.MBeanEntry

   public boolean isInstanceOf(ObjectName name, String className)
           throws InstanceNotFoundException
   {
      // Get the MBean's class name
      MBeanEntry entry = registry.get(name);
      String mbeanClassName = entry.getResourceClassName();
      checkMBeanPermission(mbeanClassName, null, name, "isInstanceOf");

      // The names are the same
      if (className.equals(mbeanClassName))
         return true;
View Full Code Here

Examples of org.jboss.mx.server.registry.MBeanEntry

   }

   public ClassLoader getClassLoaderFor(ObjectName name)
           throws InstanceNotFoundException
   {
      MBeanEntry entry = registry.get(name);
      checkMBeanPermission(entry.getResourceClassName(), null, name,
         "getClassLoaderFor");
     
      ClassLoader cl = entry.getClassLoader();
      if (cl == null)
         cl = entry.getResourceInstance().getClass().getClassLoader();
      if (cl == null)
         cl = ClassLoader.getSystemClassLoader();
      return cl;
   }
View Full Code Here

Examples of org.jboss.mx.server.registry.MBeanEntry

         if (loader == null)
            loader = ClassLoader.getSystemClassLoader();
      }
      else
      {
         MBeanEntry entry = registry.get(name);
         checkMBeanPermission(entry.getResourceClassName(), null, name,
            "getClassLoader");
         loader = entry.getResourceInstance();
      }

      if ((loader instanceof ClassLoader) == false)
         throw new InstanceNotFoundException("Not a classloader " + name);
      return (ClassLoader) loader;
View Full Code Here

Examples of org.jboss.mx.server.registry.MBeanEntry

                                                   objectName,
                                                   loaderName,
                                                   constructor.getParameters(loader),
                                                   constructor.getSignature());

      MBeanEntry entry = (MBeanEntry) server.invoke(MBEAN_REGISTRY, "get", new Object[] { objectName }, new String[] { ObjectName.class.getName() });
      Object resource = entry.getResourceInstance();
      return new ServiceInstance(instance, resource);
   }
View Full Code Here

Examples of org.jboss.mx.server.registry.MBeanEntry

/* 193 */     ServiceConstructorMetaData constructor = metaData.getConstructor();
/*     */
/* 196 */     log.debug("About to create bean: " + objectName + " with code: " + code);
/* 197 */     ObjectInstance instance = server.createMBean(code, objectName, loaderName, constructor.getParameters(loader), constructor.getSignature());
/*     */
/* 203 */     MBeanEntry entry = (MBeanEntry)server.invoke(MBEAN_REGISTRY, "get", new Object[] { objectName }, new String[] { ObjectName.class.getName() });
/* 204 */     Object resource = entry.getResourceInstance();
/* 205 */     return new ServiceInstance(instance, resource);
/*     */   }
View Full Code Here

Examples of org.jboss.mx.server.registry.MBeanEntry

/*      */   }
/*      */
/*      */   public void removeNotificationListener(ObjectName name, ObjectName listener)
/*      */     throws InstanceNotFoundException, ListenerNotFoundException
/*      */   {
/*  862 */     MBeanEntry entry = this.registry.get(name);
/*  863 */     if (!NotificationBroadcaster.class.isInstance(entry.getResourceInstance())) {
/*  864 */       throw new RuntimeOperationsException(new IllegalArgumentException("The MBean " + name + " exists but does not implement the NotificationBroadcaster interface."));
/*      */     }
/*  866 */     MBeanEntry listenerEntry = this.registry.get(listener);
/*  867 */     if (!NotificationListener.class.isInstance(listenerEntry.getResourceInstance())) {
/*  868 */       throw new RuntimeOperationsException(new IllegalArgumentException("The MBean " + listener + " exists but does not implement the NotificationListener interface."));
/*      */     }
/*  870 */     checkMBeanPermission(entry.getResourceClassName(), null, name, "removeNotificationListener");
/*      */
/*  873 */     ClassLoader newTCL = entry.getClassLoader();
View Full Code Here

Examples of org.jboss.mx.server.registry.MBeanEntry

/*      */   }
/*      */
/*      */   public void removeNotificationListener(ObjectName name, NotificationListener listener, NotificationFilter filter, Object handback)
/*      */     throws InstanceNotFoundException, ListenerNotFoundException
/*      */   {
/*  903 */     MBeanEntry entry = this.registry.get(name);
/*  904 */     if (!NotificationBroadcaster.class.isInstance(entry.getResourceInstance())) {
/*  905 */       throw new RuntimeOperationsException(new IllegalArgumentException("The MBean " + name + " exists but does not implement the NotificationBroadcaster interface."));
/*      */     }
/*  907 */     checkMBeanPermission(entry.getResourceClassName(), null, name, "removeNotificationListener");
/*      */
/*  910 */     ClassLoader newTCL = entry.getClassLoader();
/*      */
/*  912 */     ClassLoader oldTCL = TCLAction.UTIL.getContextClassLoader();
/*  913 */     boolean setCl = (newTCL != oldTCL) && (newTCL != null);
/*      */     try
/*      */     {
/*  916 */       if (setCl) {
/*  917 */         TCLAction.UTIL.setContextClassLoader(newTCL);
/*      */       }
/*  919 */       this.listeners.remove(entry.getObjectName(), listener, filter, handback);
/*      */     }
/*      */     finally
/*      */     {
/*  923 */       if (setCl)
/*  924 */         TCLAction.UTIL.setContextClassLoader(oldTCL);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.