mbeanName = invoker.preRegister(server, regName); "preRegister() failed: " + "[ObjectName='" + regName + "', Class=" + invoker.getResource().getClass().getName() + " (" + invoker.getResource() + ")]" );
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); }
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); }
+ " on resource: " + invocation.getInvoker().getResource() + " objectName: " + invocation.getInvoker().getObjectName(); throw new ReflectionException(new NullPointerException(msg));
invoker.addOperationInterceptor((Interceptor)args[0]); return null; invoker.removeOperationInterceptor((Interceptor)args[0]); return null;
MBeanInfo info = invoker.getMBeanInfo(); verifyMBeanInfo(info, name); entry.setResourceClassName(info.getClassName()); (regName, entry.getResourceClassName(), delegate.getMBeanServerId()); persistIfRequired(invoker.getMBeanInfo(), regName); invoker.postRegister(new Boolean(registrationDone));
/** Return the MBeanInfo from the invocation MBeanInvoker * * @param invocation * @return the value * @throws Throwable for any error */ public Object invoke(Invocation invocation) throws Throwable { MBeanInvoker invoker = invocation.getInvoker(); return invoker.getMetaData(); } }
objectName = invocation.getInvoker().getObjectName();
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); if (result instanceof InstanceNotFoundException) throw (InstanceNotFoundException) result; if (result instanceof IntrospectionException) throw (IntrospectionException) result; if (result instanceof ReflectionException) throw (ReflectionException) result; throw new RuntimeException("Cannot obtain MBeanInfo " + name, result); } }
public void unregisterMBean(ObjectName name) throws InstanceNotFoundException, MBeanRegistrationException { name = qualifyName(name); 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(); try { // allow subclasses to perform their own pre- and post- pre-deregister logic handlePreDeregister (entry.getInvoker()); } catch (Exception e) { // don't double wrap MBeanRegistrationException if (e instanceof MBeanRegistrationException) throw (MBeanRegistrationException)e; throw new MBeanRegistrationException(e, "preDeregister"); } // Remove any classloader if (resource instanceof ClassLoader) loaderRepository.removeClassLoader((ClassLoader)resource); // It is no longer registered remove(name); sendUnRegistrationNotification (name); entry.getInvoker().postDeregister(); }
AttributeList list = mbean.getAttributes(attributes); SecurityManager sm = System.getSecurityManager(); if( sm != null )
+ " on resource: " + invocation.getInvoker().getResource() + " objectName: " + invocation.getInvoker().getObjectName(); throw new ReflectionException(new NullPointerException(msg));
invoker.addOperationInterceptor((Interceptor)args[0]); return null; invoker.removeOperationInterceptor((Interceptor)args[0]); return null;
MBeanInfo info = invoker.getMBeanInfo(); verifyMBeanInfo(info, name); entry.setResourceClassName(info.getClassName()); (regName, entry.getResourceClassName(), delegate.getMBeanServerId()); persistIfRequired(invoker.getMBeanInfo(), regName); invoker.postRegister(new Boolean(registrationDone));
/** Return the MBeanInfo from the invocation MBeanInvoker * * @param invocation * @return * @throws InvocationException */ public Object invoke(Invocation invocation) throws Throwable { MBeanInvoker invoker = invocation.getInvoker(); return invoker.getMetaData(); } }
objectName = invocation.getInvoker().getObjectName();
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); if (result instanceof InstanceNotFoundException) throw (InstanceNotFoundException) result; if (result instanceof IntrospectionException) throw (IntrospectionException) result; if (result instanceof ReflectionException) throw (ReflectionException) result; throw new RuntimeException("Cannot obtain MBeanInfo " + name, result); } }
public void unregisterMBean(ObjectName name) throws InstanceNotFoundException, MBeanRegistrationException { name = qualifyName(name); 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(); try { // allow subclasses to perform their own pre- and post- pre-deregister logic handlePreDeregister (entry.getInvoker()); } catch (Exception e) { // don't double wrap MBeanRegistrationException if (e instanceof MBeanRegistrationException) throw (MBeanRegistrationException)e; throw new MBeanRegistrationException(e, "preDeregister"); } // Remove any classloader if (resource instanceof ClassLoader) loaderRepository.removeClassLoader((ClassLoader)resource); // It is no longer registered remove(name); sendUnRegistrationNotification (name); entry.getInvoker().postDeregister(); }
AttributeList list = mbean.getAttributes(attributes); SecurityManager sm = System.getSecurityManager(); if( sm != null )
mbeanName = invoker.preRegister(server, regName); "preRegister() failed: " + "[ObjectName='" + regName + "', Class=" + invoker.getResource().getClass().getName() + " (" + invoker.getResource() + ")]" );