@Mapping( "isWriteable" ) public ValueRepresentation isWriteable() { return bool( attrInfo.isWritable() ); }
if (inf.isWritable()) { this.serverToUse.setAttribute(this.objectName, new Attribute(attributeName, invocation.getArguments()[0])); return null;
/** * Description of the specified attribute name. * * @param attr - the attribute * @return String the description */ protected String describeAttribute(MBeanAttributeInfo attr) { StringBuilder buf = new StringBuilder(); buf.append("("); if (attr.isReadable()) { buf.append("r"); } if (attr.isWritable()) { buf.append("w"); } buf.append(") ") .append(attr.getType()) .append(" ") .append(attr.getName()); return buf.toString(); }
if (inf.isWritable()) { this.serverToUse.setAttribute(this.objectName, new Attribute(attributeName, invocation.getArguments()[0])); return null;
public void set(ObjectName bean, String attr, String value) throws Exception { MBeanInfo mbinfo = mserver.getMBeanInfo(bean); MBeanAttributeInfo ai = attrInfo(mbinfo, attr); if (ai == null) { throw new IllegalArgumentException("No such attribute '" + attr + "'"); } if (!ai.isWritable()) { throw new IllegalArgumentException("Attribute '" + attr + "' is not writeable"); } String type = ai.getType(); Object ov = convert(value, type); mserver.setAttribute(bean, new Attribute(attr, ov)); }
sb.append(" - WRITEONLY"); else if (ai.isWritable()) { sb.append(" - WRITEABLE");
log.info(" ** NAME: \t" + attrInfo[i].getName()); log.info(" DESCR: \t" + attrInfo[i].getDescription()); log.info(" TYPE: \t" + attrInfo[i].getType() + "\tREAD: " + attrInfo[i].isReadable() + "\tWRITE: " + attrInfo[i].isWritable());
private void assertNickName(MBeanAttributeInfo attr) { assertNotNull("Nick Name should not be null", attr); assertTrue("Nick Name should be writable", attr.isWritable()); assertTrue("Nick Name should be readable", attr.isReadable()); }
private void assertNickName(MBeanAttributeInfo attr) { assertNotNull("Nick Name should not be null", attr); assertTrue("Nick Name should be writable", attr.isWritable()); assertTrue("Nick Name should be readable", attr.isReadable()); }
@Test public void testNickNameIsExposed() throws Exception { ModelMBeanInfo inf = (ModelMBeanInfo) getMBeanInfo(); MBeanAttributeInfo attr = inf.getAttribute("NickName"); assertNotNull("Nick Name should not be null", attr); assertTrue("Nick Name should be writable", attr.isWritable()); assertTrue("Nick Name should be readable", attr.isReadable()); }
@Test public void testNickNameIsExposed() throws Exception { ModelMBeanInfo inf = (ModelMBeanInfo) getMBeanInfo(); MBeanAttributeInfo attr = inf.getAttribute("NickName"); assertNotNull("Nick Name should not be null", attr); assertTrue("Nick Name should be writable", attr.isWritable()); assertTrue("Nick Name should be readable", attr.isReadable()); }
@Test public void testNickNameIsExposed() throws Exception { ModelMBeanInfo inf = (ModelMBeanInfo) getMBeanInfo(); MBeanAttributeInfo attr = inf.getAttribute("NickName"); assertNotNull("Nick Name should not be null", attr); assertTrue("Nick Name should be writable", attr.isWritable()); assertTrue("Nick Name should be readable", attr.isReadable()); }
assertEquals("java.lang.Long", info.getType()); assertTrue(info.isReadable()); assertTrue(info.isWritable()); assertFalse(info.isIs());
if (attrInfo.isWritable() == false) { assert (attrInfo.getDescription().equals("MBeanReadonlyGetter.") == true || attrInfo.getDescription().equals("MBeanROGetter."));
/** {@inheritDoc} */ @Override protected JSONObject extractData(MBeanInfo pMBeanInfo, String attribute) { JSONObject attrMap = new JSONObject(); for (MBeanAttributeInfo attrInfo : pMBeanInfo.getAttributes()) { if (attribute == null || attrInfo.getName().equals(attribute)) { JSONObject map = new JSONObject(); map.put(TYPE.getKey(), attrInfo.getType()); map.put(DESCRIPTION.getKey(), attrInfo.getDescription()); map.put(READ_WRITE.getKey(), Boolean.valueOf(attrInfo.isWritable() && attrInfo.isReadable())); attrMap.put(attrInfo.getName(), map); } } return attrMap; } }
private MBeanAttributeInfo[] getWrappedAttributeInfo(MBeanInfo pMBeanInfo) { MBeanAttributeInfo origAttrInfo[] = pMBeanInfo.getAttributes(); MBeanAttributeInfo attrInfo[] = new MBeanAttributeInfo[origAttrInfo.length]; for (int i = 0; i < origAttrInfo.length; i++) { MBeanAttributeInfo aInfo = origAttrInfo[i]; String clazz = aInfo.getType(); String attrType; if (isDirectlySupported(clazz)) { attrType = clazz; } else { attrType = STRING_TYPE; // Remember type for later conversion when setting an attribute attributeInfoMap.put(aInfo.getName(), aInfo); } attrInfo[i] = new MBeanAttributeInfo( aInfo.getName(), attrType, aInfo.getDescription(), aInfo.isReadable(), aInfo.isWritable(), aInfo.isIs(), aInfo.getDescriptor()); } return attrInfo; }
public boolean filterAttribute( final MBeanAttributeInfo info ) { return( info.isWritable() ); } };
@Mapping( "isWriteable" ) public ValueRepresentation isWriteable() { return bool( attrInfo.isWritable() ); }
public boolean filterAttribute( final MBeanAttributeInfo info ) { return( info.isWritable() && ! info.isReadable() ); } };
public boolean filterAttribute( final MBeanAttributeInfo info ) { return( info.isWritable() && info.isReadable() ); } };