Examples of MBeanEntry


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

      List entries = registry.findEntries(name);
      Iterator iterator = entries.iterator();
      while (iterator.hasNext())
      {
         // Check each MBean against the query
         MBeanEntry entry = (MBeanEntry) iterator.next();
         ObjectName objectName = entry.getObjectName();
         // The permission check must be done before the query is applied
         if( sm != null )
         {
            try
            {
               checkMBeanPermission(entry.getResourceClassName(), null,
                  objectName, "queryNames");
            }
            catch(SecurityException e)
            {
               if( log.isTraceEnabled() )
View Full Code Here

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

   }

   public Object getAttribute(ObjectName name, String attribute)
           throws MBeanException, AttributeNotFoundException, InstanceNotFoundException, ReflectionException
   {
      MBeanEntry entry = registry.get(name);
      checkMBeanPermission(entry.getResourceClassName(), attribute, name,
         "getAttribute");

      MBeanInvoker mbean = entry.getInvoker();

      return mbean.getAttribute(attribute);
   }
View Full Code Here

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

   }

   public AttributeList getAttributes(ObjectName name, String[] attributes)
           throws InstanceNotFoundException, ReflectionException
   {
      MBeanEntry entry = registry.get(name);
      String className = entry.getResourceClassName();
      /* Access to an attribute is required and this check will fail only
      if access to no attributes are allowed and will result in a security
      exception rather than an empty list.
      */
      checkMBeanPermission(className, null, name, "getAttribute");
     
      MBeanInvoker mbean = entry.getInvoker();
      AttributeList list = mbean.getAttributes(attributes);
      SecurityManager sm = System.getSecurityManager();
      if( sm != null )
      {
         // Remove any attributes that are not allowed
View Full Code Here

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

   }

   public void setAttribute(ObjectName name, Attribute attribute)
           throws InstanceNotFoundException, AttributeNotFoundException, InvalidAttributeValueException, MBeanException, ReflectionException
   {
      MBeanEntry entry = registry.get(name);
      String attributeName = null;
      if (attribute != null)
         attributeName = attribute.getName();
      checkMBeanPermission(entry.getResourceClassName(), attributeName,
         name, "setAttribute");

      MBeanInvoker mbean = entry.getInvoker();

      mbean.setAttribute(attribute);
   }
View Full Code Here

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

   }

   public AttributeList setAttributes(ObjectName name, AttributeList attributes)
           throws InstanceNotFoundException, ReflectionException
   {
      MBeanEntry entry = registry.get(name);

      String className = entry.getResourceClassName();
      /* Access to an attribute is required and this check will fail only
      if access to no attributes are allowed and will result in a security
      exception rather than an empty list.
      */
      checkMBeanPermission(className, null, name, "setAttribute");

      MBeanInvoker mbean = entry.getInvoker();
      AttributeList list = mbean.setAttributes(attributes);
      SecurityManager sm = System.getSecurityManager();
      if( sm != null )
      {
         // Remove any attributes that are not allowed
View Full Code Here

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

   public Object invoke(ObjectName name, String operationName, Object[] params,
      String[] signature)
      throws InstanceNotFoundException, MBeanException, ReflectionException
   {
      MBeanEntry entry = registry.get(name);
      checkMBeanPermission(entry.getResourceClassName(), operationName, name,
         "invoke");

      MBeanInvoker mbean = entry.getInvoker();

      return mbean.invoke(operationName, params, signature);
   }
View Full Code Here

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

   public MBeanInfo getMBeanInfo(ObjectName name)
      throws InstanceNotFoundException, IntrospectionException,
      ReflectionException
   {
      MBeanEntry entry = registry.get(name);
      checkMBeanPermission(entry.getResourceClassName(), null, name,
         "getMBeanInfo");
      try
      {
         MBeanInvoker invoker = entry.getInvoker();
         return invoker.getMBeanInfo();
      }
      catch (Exception e)
      {
         JMException result = ExceptionHandler.handleException(e);
View Full Code Here

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

    * it by the MBean's ObjectName. Otherwise the source is unchanged.
    */
   public void addNotificationListener(ObjectName name, NotificationListener listener, NotificationFilter filter, Object handback)
           throws InstanceNotFoundException
   {
      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."));

      if (listener == null)
         throw new RuntimeOperationsException(new IllegalArgumentException("Cannot add null listener"));

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

      ClassLoader newTCL = entry.getClassLoader();
      NotificationBroadcaster broadcaster = entry.getInvoker();

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

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

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

    * method is called. Even if it is subsequently unregistered, it will continue to receive notifications.
    */
   public void addNotificationListener(ObjectName name, ObjectName listener, NotificationFilter filter, Object handback)
           throws InstanceNotFoundException
   {
      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,
         "addNotificationListener");

View Full Code Here

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

    * this method will remove all those registrations.
    */
   public void removeNotificationListener(ObjectName name, NotificationListener 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."));

      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);
      }
      finally
      {
         if (setCl)
            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.