public String getObjectNameBasis() { if (_managed != null && _managed instanceof ServletMapping) { ServletMapping mapping = (ServletMapping)_managed; String name = mapping.getServletName(); if (name != null) return name; } return super.getObjectNameBasis(); } }
public AttributeList getAttributes(String[] names) { AttributeList results = new AttributeList(names.length); for (int i = 0; i < names.length; i++) { try { results.add(new Attribute(names[i], getAttribute(names[i]))); } catch (Exception e) { LOG.warn(Log.EXCEPTION, e); } } return results; }
private static Object findInfluences(Object influences, Class aClass) { if (aClass!=null) { // This class is an influence influences=LazyList.add(influences,aClass); // So are the super classes influences=findInfluences(influences,aClass.getSuperclass()); // So are the interfaces Class[] ifs = aClass.getInterfaces(); for (int i=0;ifs!=null && i<ifs.length;i++) influences=findInfluences(influences,ifs[i]); } return influences; }
Object mbean = ObjectMBean.mbeanFor(obj); if (mbean == null) return; if (mbean instanceof ObjectMBean) ((ObjectMBean)mbean).setMBeanContainer(this); oname = ((ObjectMBean)mbean).getObjectName(); String context = (mbean instanceof ObjectMBean)?makeName(((ObjectMBean)mbean).getObjectContextBasis()):null; if (context==null && pname!=null) context=pname.getKeyProperty("context"); String name = (mbean instanceof ObjectMBean)?makeName(((ObjectMBean)mbean).getObjectNameBasis()):context; if (name != null && name.length()>1) buf.append(",").append("name=").append(name);
oname = ((ObjectMBean)mbean).getObjectName(); type = type.substring(dot + 1); String context = (mbean instanceof ObjectMBean)?makeName(((ObjectMBean)mbean).getObjectContextBasis()):null; String name = (mbean instanceof ObjectMBean)?makeName(((ObjectMBean)mbean).getObjectNameBasis()):null;
@Override public String getObjectContextBasis() { if (_managed != null ) { String basis = null; if (_managed instanceof ContextHandler) { return null; } else if (_managed instanceof AbstractHandler) { AbstractHandler handler = (AbstractHandler)_managed; Server server = handler.getServer(); if (server != null) { ContextHandler context = AbstractHandlerContainer.findContainerOf(server, ContextHandler.class, handler); if (context != null) basis = getContextName(context); } } if (basis != null) return basis; } return super.getObjectContextBasis(); }
List<Class<?>> influences = findInfluences(new ArrayList<Class<?>>(), _managed.getClass()); MBeanAttributeInfo mai = defineAttribute(method,methodAttributeAnnotation); if ( mai != null ) MBeanOperationInfo oi = defineOperation(method,methodOperationAnnotation);
public AttributeList setAttributes(AttributeList attrs) { LOG.debug("setAttributes"); AttributeList results = new AttributeList(attrs.size()); Iterator<Object> iter = attrs.iterator(); while (iter.hasNext()) { try { Attribute attr = (Attribute) iter.next(); setAttribute(attr); results.add(new Attribute(attr.getName(), getAttribute(attr.getName()))); } catch (Exception e) { LOG.warn(Log.EXCEPTION, e); } } return results; }
static Object mbeanFor(MBeanContainer container, Object o) { if (o == null) return null; Object mbean = findMetaData(container, o.getClass()).newInstance(o); if (mbean instanceof ObjectMBean) ((ObjectMBean)mbean).setMBeanContainer(container); if (LOG.isDebugEnabled()) { LOG.debug("MBean for {} is {}", o, mbean); if (mbean instanceof ObjectMBean) { MBeanInfo info = ((ObjectMBean)mbean).getMBeanInfo(); for (Object a : info.getAttributes()) LOG.debug(" {}", a); for (Object a : info.getOperations()) LOG.debug(" {}", a); } } return mbean; }
Object mbean = ObjectMBean.mbeanFor(obj); if (mbean == null) return; if (mbean instanceof ObjectMBean) ((ObjectMBean)mbean).setMBeanContainer(this); oname = ((ObjectMBean)mbean).getObjectName(); String context = (mbean instanceof ObjectMBean)?makeName(((ObjectMBean)mbean).getObjectContextBasis()):null; if (context==null && pname!=null) context=pname.getKeyProperty("context"); String name = (mbean instanceof ObjectMBean)?makeName(((ObjectMBean)mbean).getObjectNameBasis()):context; if (name != null && name.length()>1) buf.append(",").append("name=").append(name);
if (mbean instanceof ObjectMBean) objectName = ((ObjectMBean)mbean).getObjectName(); String context = (mbean instanceof ObjectMBean) ? makeName(((ObjectMBean)mbean).getObjectContextBasis()) : null; if (context == null && parentObjectName != null) context = parentObjectName.getKeyProperty("context"); String name = (mbean instanceof ObjectMBean) ? makeName(((ObjectMBean)mbean).getObjectNameBasis()) : context; if (name != null && name.length() > 1) buf.append(",").append("name=").append(name);
@Override public String getObjectContextBasis() { if (_managed != null ) { String basis = null; if (_managed instanceof ContextHandler) { return null; } else if (_managed instanceof AbstractHandler) { AbstractHandler handler = (AbstractHandler)_managed; Server server = handler.getServer(); if (server != null) { ContextHandler context = AbstractHandlerContainer.findContainerOf(server, ContextHandler.class, handler); if (context != null) basis = getContextName(context); } } if (basis != null) return basis; } return super.getObjectContextBasis(); }
List<Class<?>> influences = findInfluences(new ArrayList<Class<?>>(), _managed.getClass()); MBeanAttributeInfo mai = defineAttribute(method,methodAttributeAnnotation); if ( mai != null ) MBeanOperationInfo oi = defineOperation(method,methodOperationAnnotation);
public AttributeList setAttributes(AttributeList attrs) { LOG.debug("setAttributes"); AttributeList results = new AttributeList(attrs.size()); Iterator<Object> iter = attrs.iterator(); while (iter.hasNext()) { try { Attribute attr = (Attribute) iter.next(); setAttribute(attr); results.add(new Attribute(attr.getName(), getAttribute(attr.getName()))); } catch (Exception e) { LOG.warn(Log.EXCEPTION, e); } } return results; }
return; Object mbean = ObjectMBean.mbeanFor(obj); if (mbean == null) return; if (mbean instanceof ObjectMBean) ((ObjectMBean)mbean).setMBeanContainer(this); oname = ((ObjectMBean)mbean).getObjectName(); if (mbean instanceof ObjectMBean) context = makeName(((ObjectMBean)mbean).getObjectContextBasis()); if (mbean instanceof ObjectMBean) name = makeName(((ObjectMBean)mbean).getObjectNameBasis());
public String getObjectNameBasis() { if (_managed!=null && _managed instanceof Holder) { Holder holder = (Holder)_managed; String name = holder.getName(); if (name!=null) return name; } return super.getObjectNameBasis(); } }
@Override public String getObjectContextBasis() { if (_managed != null ) { String basis = null; if (_managed instanceof ContextHandler) { return null; } else if (_managed instanceof AbstractHandler) { AbstractHandler handler = (AbstractHandler)_managed; Server server = handler.getServer(); if (server != null) { ContextHandler context = AbstractHandlerContainer.findContainerOf(server, ContextHandler.class, handler); if (context != null) basis = getContextName(context); } } if (basis != null) return basis; } return super.getObjectContextBasis(); }
List<Class<?>> influences = new ArrayList<>(); influences.add(this.getClass()); // always add MBean itself influences = findInfluences(influences, _managed.getClass()); MBeanAttributeInfo mai = defineAttribute(method, methodAttributeAnnotation); if (mai != null) attributes.add(mai); MBeanOperationInfo oi = defineOperation(method, methodOperationAnnotation); if (oi != null) operations.add(oi);
public AttributeList setAttributes(AttributeList attrs) { LOG.debug("setAttributes"); AttributeList results = new AttributeList(attrs.size()); Iterator iter = attrs.iterator(); while (iter.hasNext()) { try { Attribute attr = (Attribute) iter.next(); setAttribute(attr); results.add(new Attribute(attr.getName(), getAttribute(attr.getName()))); } catch (Exception e) { LOG.warn(Log.EXCEPTION, e); } } return results; }
public AttributeList getAttributes(String[] names) { AttributeList results = new AttributeList(names.length); for (int i = 0; i < names.length; i++) { try { results.add(new Attribute(names[i], getAttribute(names[i]))); } catch (Exception e) { LOG.warn(Log.EXCEPTION, e); } } return results; }