/** Constructor. Will add default attributes. * */ public ManagedBean() { AttributeInfo ai=new AttributeInfo(); ai.setName("modelerType"); ai.setDescription("Type of the modeled resource. Can be set only once"); ai.setType("java.lang.String"); ai.setWriteable(false); addAttribute(ai); }
/** * Create and return a <code>ModelMBeanAttributeInfo</code> object that * corresponds to the attribute described by this instance. */ MBeanAttributeInfo createAttributeInfo() { // Return our cached information (if any) if (info == null) { info = new MBeanAttributeInfo(getName(), getType(), getDescription(), isReadable(), isWriteable(), false); } return (MBeanAttributeInfo)info; }
/** * The name of the property getter method, if non-standard. */ public String getGetMethod() { if(getMethod == null) getMethod = getMethodName(getName(), true, isIs()); return (this.getMethod); }
/** * The name of the property setter method, if non-standard. */ public String getSetMethod() { if( setMethod == null ) setMethod = getMethodName(getName(), false, false); return (this.setMethod); }
EnumName e = EnumName.One; AttributeInfo attrInfo = new AttributeInfo(); attrInfo.setName(e.name()); attrInfo.setValue(e.value); //For a value of Two | Four attrInfo.setType(EnumName.class); soapObj.addAttribute(attrInfo);
while( en.hasMoreElements() ) { String name=(String)en.nextElement(); AttributeInfo ai=new AttributeInfo(); ai.setName( name ); Method gm=(Method)getAttMap.get(name); if( gm!=null ) { ai.setGetMethod( gm.getName()); Class t=gm.getReturnType(); if( t!=null ) ai.setType( t.getName() ); ai.setType( t.getName()); ai.setSetMethod( sm.getName()); ai.setDescription("Introspected attribute " + name); if( log.isDebugEnabled()) log.debug("Introspected attribute " + name + " " + gm + " " + sm); if( gm==null ) ai.setReadable(false); if( sm==null ) ai.setWriteable(false); if( sm!=null || gm!=null ) mbean.addAttribute(ai);
String setMethod = attrInfo.getSetMethod(); String argType=attrInfo.getType();
descN = DomUtil.getNext( descN )) AttributeInfo ci=new AttributeInfo(); DomUtil.setAttributes(ci, descN); managed.addAttribute( ci );
/** * Add a new attribute to the set of attributes for this MBean. * * @param attribute The new attribute descriptor */ public void addAttribute(AttributeInfo attribute) { attributes.put(attribute.getName(), attribute); }
throw new AttributeNotFoundException(" Cannot find attribute " + aname + " for " + resource); String getMethod = attrInfo.getGetMethod(); if (getMethod == null) throw new AttributeNotFoundException("Cannot find attribute " + aname + " get method name");
new MBeanAttributeInfo[attrs.length]; for (int i = 0; i < attrs.length; i++) attributes[i] = attrs[i].createAttributeInfo();
for (int i = 0; i < o.getAttributeCount(); i++) AttributeInfo ai = new AttributeInfo(); o.getAttributeInfo(i, ai); ai.setValue(o.getAttribute(i)); addAttribute(ai);
while( en.hasMoreElements() ) { String name = en.nextElement(); AttributeInfo ai=new AttributeInfo(); ai.setName( name ); Method gm = getAttMap.get(name); if( gm!=null ) { ai.setGetMethod( gm.getName()); Class<?> t=gm.getReturnType(); if( t!=null ) ai.setType( t.getName() ); ai.setType( t.getName()); ai.setSetMethod( sm.getName()); ai.setDescription("Introspected attribute " + name); if( log.isDebugEnabled()) log.debug("Introspected attribute " + name + " " + gm + " " + sm); if( gm==null ) ai.setReadable(false); if( sm==null ) ai.setWriteable(false); if( sm!=null || gm!=null ) mbean.addAttribute(ai);
/** * The name of the property setter method, if non-standard. */ public String getSetMethod() { if( setMethod == null ) setMethod = getMethodName(getName(), false, false); return (this.setMethod); }
String setMethod = attrInfo.getSetMethod(); if (setMethod == null) throw new AttributeNotFoundException("Cannot find attribute " + aname + " set method name"); String argType=attrInfo.getType();
AttributeInfo attrInfo = new AttributeInfo(); attrInfo.setName("myEnum"); attrInfo.setValue("5"); //For a value of Two | Four attrInfo.setType(EnumName.class); soapObj.addAttribute(attrInfo);
descN = DomUtil.getNext( descN )) AttributeInfo ci=new AttributeInfo(); DomUtil.setAttributes(ci, descN); managed.addAttribute( ci );
/** * Add a new attribute to the set of attributes for this MBean. * * @param attribute The new attribute descriptor */ public void addAttribute(AttributeInfo attribute) { attributes.put(attribute.getName(), attribute); }
throw new AttributeNotFoundException(" Cannot find attribute " + aname + " for " + resource); String getMethod = attrInfo.getGetMethod();
new MBeanAttributeInfo[attrs.length]; for (int i = 0; i < attrs.length; i++) attributes[i] = attrs[i].createAttributeInfo();