Package org.jboss.mx.server.registry

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


/*      */   }
/*      */
/*      */   public AttributeList setAttributes(ObjectName name, AttributeList attributes)
/*      */     throws InstanceNotFoundException, ReflectionException
/*      */   {
/*  623 */     MBeanEntry entry = this.registry.get(name);
/*      */
/*  625 */     String className = entry.getResourceClassName();
/*      */
/*  630 */     checkMBeanPermission(className, null, name, "setAttribute");
/*      */
/*  632 */     MBeanInvoker mbean = entry.getInvoker();
/*  633 */     AttributeList list = mbean.setAttributes(attributes);
/*  634 */     SecurityManager sm = System.getSecurityManager();
/*  635 */     if (sm != null)
/*      */     {
/*  638 */       Iterator iter = list.iterator();
View Full Code Here


/*      */   }
/*      */
/*      */   public Object invoke(ObjectName name, String operationName, Object[] params, String[] signature)
/*      */     throws InstanceNotFoundException, MBeanException, ReflectionException
/*      */   {
/*  662 */     MBeanEntry entry = this.registry.get(name);
/*  663 */     checkMBeanPermission(entry.getResourceClassName(), operationName, name, "invoke");
/*      */
/*  666 */     MBeanInvoker mbean = entry.getInvoker();
/*      */
/*  668 */     return mbean.invoke(operationName, params, signature);
/*      */   }
View Full Code Here

/*      */
/*  668 */     return mbean.invoke(operationName, params, signature);
/*      */   }
/*      */
/*      */   public MBeanInfo getMBeanInfo(ObjectName name) throws InstanceNotFoundException, IntrospectionException, ReflectionException {
/*  675 */     MBeanEntry entry = this.registry.get(name);
/*  676 */     checkMBeanPermission(entry.getResourceClassName(), null, name, "getMBeanInfo");
/*      */     JMException result;
/*      */     try {
/*  680 */       MBeanInvoker invoker = entry.getInvoker();
/*  681 */       return invoker.getMBeanInfo();
/*      */     }
/*      */     catch (Exception e)
/*      */     {
/*  685 */       result = ExceptionHandler.handleException(e);
View Full Code Here

/*      */   }
/*      */
/*      */   public void addNotificationListener(ObjectName name, NotificationListener listener, NotificationFilter filter, Object handback)
/*      */     throws InstanceNotFoundException
/*      */   {
/*  746 */     MBeanEntry entry = this.registry.get(name);
/*  747 */     if (!NotificationBroadcaster.class.isInstance(entry.getResourceInstance())) {
/*  748 */       throw new RuntimeOperationsException(new IllegalArgumentException("The MBean " + name + " exists but does not implement the NotificationBroadcaster interface."));
/*      */     }
/*  750 */     if (listener == null) {
/*  751 */       throw new RuntimeOperationsException(new IllegalArgumentException("Cannot add null listener"));
/*      */     }
/*  753 */     checkMBeanPermission(entry.getResourceClassName(), null, name, "addNotificationListener");
/*      */
/*  756 */     ClassLoader newTCL = entry.getClassLoader();
/*  757 */     NotificationBroadcaster broadcaster = entry.getInvoker();
/*      */
/*  759 */     ClassLoader oldTCL = TCLAction.UTIL.getContextClassLoader();
/*  760 */     boolean setCl = (newTCL != oldTCL) && (newTCL != null);
/*      */     try
/*      */     {
/*  763 */       if (setCl) {
/*  764 */         TCLAction.UTIL.setContextClassLoader(newTCL);
/*      */       }
/*  766 */       this.listeners.add(entry.getObjectName(), broadcaster, listener, filter, handback);
/*      */     }
/*      */     finally
/*      */     {
/*  770 */       if (setCl)
/*  771 */         TCLAction.UTIL.setContextClassLoader(oldTCL);
View Full Code Here

/*      */   }
/*      */
/*      */   public void addNotificationListener(ObjectName name, ObjectName listener, NotificationFilter filter, Object handback)
/*      */     throws InstanceNotFoundException
/*      */   {
/*  788 */     MBeanEntry entry = this.registry.get(name);
/*  789 */     if (!NotificationBroadcaster.class.isInstance(entry.getResourceInstance())) {
/*  790 */       throw new RuntimeOperationsException(new IllegalArgumentException("The MBean " + name + " exists but does not implement the NotificationBroadcaster interface."));
/*      */     }
/*  792 */     MBeanEntry listenerEntry = this.registry.get(listener);
/*  793 */     if (!NotificationListener.class.isInstance(listenerEntry.getResourceInstance())) {
/*  794 */       throw new RuntimeOperationsException(new IllegalArgumentException("The MBean " + listener + " exists but does not implement the NotificationListener interface."));
/*      */     }
/*  796 */     checkMBeanPermission(entry.getResourceClassName(), null, name, "addNotificationListener");
/*      */
/*  799 */     ClassLoader newTCL = entry.getClassLoader();
View Full Code Here

/*      */   }
/*      */
/*      */   public void removeNotificationListener(ObjectName name, NotificationListener listener)
/*      */     throws InstanceNotFoundException, ListenerNotFoundException
/*      */   {
/*  828 */     MBeanEntry entry = this.registry.get(name);
/*  829 */     if (!NotificationBroadcaster.class.isInstance(entry.getResourceInstance())) {
/*  830 */       throw new RuntimeOperationsException(new IllegalArgumentException("The MBean " + name + " exists but does not implement the NotificationBroadcaster interface."));
/*      */     }
/*  832 */     checkMBeanPermission(entry.getResourceClassName(), null, name, "removeNotificationListener");
/*      */
/*  835 */     ClassLoader newTCL = entry.getClassLoader();
/*      */
/*  837 */     ClassLoader oldTCL = TCLAction.UTIL.getContextClassLoader();
/*  838 */     boolean setCl = (newTCL != oldTCL) && (newTCL != null);
/*      */     try
/*      */     {
/*  841 */       if (setCl) {
/*  842 */         TCLAction.UTIL.setContextClassLoader(newTCL);
/*      */       }
/*  844 */       this.listeners.remove(entry.getObjectName(), listener);
/*      */     }
/*      */     finally
/*      */     {
/*  848 */       if (setCl)
/*  849 */         TCLAction.UTIL.setContextClassLoader(oldTCL);
View Full Code Here

TOP

Related Classes of org.jboss.mx.server.registry.MBeanEntry

Copyright © 2018 www.massapicom. 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.