[JBoss-dev] CVS update: jmx/src/main/org/jboss/mx/modelmbean XMBean.java
User: juhalindfors Date: 02/03/20 08:53:56 Modified:src/main/org/jboss/mx/modelmbean Tag: BranchMX_1_0 XMBean.java Log: creates attribute-operation mapping for resource with type /StandardInterface Revision ChangesPath No revision No revision 1.6.2.1 +3 -1 jmx/src/main/org/jboss/mx/modelmbean/XMBean.java Index: XMBean.java === RCS file: /cvsroot/jboss/jmx/src/main/org/jboss/mx/modelmbean/XMBean.java,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -u -r1.6 -r1.6.2.1 --- XMBean.java 28 Feb 2002 18:00:32 - 1.6 +++ XMBean.java 20 Mar 2002 16:53:56 - 1.6.2.1 @@ -77,8 +77,10 @@ if (resourceType.equals(STANDARD_INTERFACE)) { +final boolean CREATE_ATTRIBUTE_OPERATION_MAPPING = true; + MBeanInfo standardInfo = new StandardMetaData(resource).build(); -info = MBeanInfoConversion.toModelMBeanInfo(standardInfo); +info = MBeanInfoConversion.toModelMBeanInfo(standardInfo, CREATE_ATTRIBUTE_OPERATION_MAPPING); } if (resourceType.endsWith(.xml)) { ___ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jmx/src/main/org/jboss/mx/modelmbean XMBean.java
User: juhalindfors Date: 02/03/20 10:26:32 Modified:src/main/org/jboss/mx/modelmbean XMBean.java Log: merge RelMX_1_0_0_8 to RelMX_1_0_0_10 to dev branch Revision ChangesPath 1.7 +3 -1 jmx/src/main/org/jboss/mx/modelmbean/XMBean.java Index: XMBean.java === RCS file: /cvsroot/jboss/jmx/src/main/org/jboss/mx/modelmbean/XMBean.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- XMBean.java 28 Feb 2002 18:00:32 - 1.6 +++ XMBean.java 20 Mar 2002 18:26:32 - 1.7 @@ -77,8 +77,10 @@ if (resourceType.equals(STANDARD_INTERFACE)) { +final boolean CREATE_ATTRIBUTE_OPERATION_MAPPING = true; + MBeanInfo standardInfo = new StandardMetaData(resource).build(); -info = MBeanInfoConversion.toModelMBeanInfo(standardInfo); +info = MBeanInfoConversion.toModelMBeanInfo(standardInfo, CREATE_ATTRIBUTE_OPERATION_MAPPING); } if (resourceType.endsWith(.xml)) { ___ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jmx/src/main/org/jboss/mx/modelmbean XMBean.java ModelMBeanConstants.java
User: d_jencks Date: 02/02/28 10:00:32 Modified:src/main/org/jboss/mx/modelmbean XMBean.java ModelMBeanConstants.java Log: changed to use new xmbean dtd, and provided User.xml sample generated from xdoclet jboss xmbean task (available in xdoclet 1.1.2) Revision ChangesPath 1.6 +18 -0 jmx/src/main/org/jboss/mx/modelmbean/XMBean.java Index: XMBean.java === RCS file: /cvsroot/jboss/jmx/src/main/org/jboss/mx/modelmbean/XMBean.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- XMBean.java 26 Feb 2002 02:03:00 - 1.5 +++ XMBean.java 28 Feb 2002 18:00:32 - 1.6 @@ -46,6 +46,24 @@ super(info); } + public XMBean(Object resource, URL config) throws MBeanException, NotCompliantMBeanException + { + try + { + setManagedResource(resource, config.toString()); + info = new ModelMBeanInfoSupport( +(ModelMBeanInfo)new XMLMetaData(resource.getClass().getName(), config).build()); + } + catch (InstanceNotFoundException e) + { + throw new MBeanException(e); + } + catch (InvalidTargetObjectTypeException e) + { + throw new MBeanException(e, Unsupported resource type: + config); + } + } + public XMBean(Object resource, String resourceType/*, Object resourceInfo*/) throws MBeanException, NotCompliantMBeanException { 1.4 +16 -1 jmx/src/main/org/jboss/mx/modelmbean/ModelMBeanConstants.java Index: ModelMBeanConstants.java === RCS file: /cvsroot/jboss/jmx/src/main/org/jboss/mx/modelmbean/ModelMBeanConstants.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- ModelMBeanConstants.java 23 Jan 2002 22:04:23 - 1.3 +++ ModelMBeanConstants.java 28 Feb 2002 18:00:32 - 1.4 @@ -21,11 +21,13 @@ final static String ROLE = role; // descriptor types - final static String MBEAN_DESCRIPTOR = MBean; + final static String MBEAN_DESCRIPTOR = MBean;//should this be mbean? as in XMLMetaData final static String ATTRIBUTE_DESCRIPTOR = attribute; final static String OPERATION_DESCRIPTOR = operation; final static String NOTIFICATION_DESCRIPTOR = notification; final static String CONSTRUCTOR_DESCRIPTOR = constructor; + //not so sure about this guy + final static String DESCRIPTOR = descriptor; final static String ALL_DESCRIPTORS = null; @@ -60,11 +62,24 @@ final static String NO_MORE_OFTEN_THAN = NoMoreOftenThan; final static String NEVER= Never; final static String ON_TIMER = OnTimer; + final static String[] PERSIST_POLICY_LIST = {NEVER, ON_UPDATE, NO_MORE_OFTEN_THAN, ON_TIMER}; // Constants for metadata objects final static boolean IS_READABLE = true; final static boolean IS_WRITABLE = true; final static boolean IS_IS = true; + + //impact + final static String ACTION = ACTION; + final static String ACTION_INFO = ACTION_INFO; + final static String INFO = INFO; + + //these are jboss specific. + final static String STATE_ACTION_ON_UPDATE = state-action-on-update; + final static String KEEP_RUNNING = KEEP_RUNNING; + final static String RESTART = RESTART; + final static String REINSTANTIATE = REINSTANTIATE; + final static String[] STATE_ACTION_ON_UPDATE_LIST = {KEEP_RUNNING, RESTART, REINSTANTIATE}; } ___ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jmx/src/main/org/jboss/mx/modelmbean XMBean.java
User: squirest Date: 02/02/25 18:03:00 Modified:src/main/org/jboss/mx/modelmbean XMBean.java Log: moved and removed stuff. new items will go into capability until a better home can be found Revision ChangesPath 1.5 +30 -24jmx/src/main/org/jboss/mx/modelmbean/XMBean.java Index: XMBean.java === RCS file: /cvsroot/jboss/jmx/src/main/org/jboss/mx/modelmbean/XMBean.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- XMBean.java 26 Jan 2002 21:13:29 - 1.4 +++ XMBean.java 26 Feb 2002 02:03:00 - 1.5 @@ -27,10 +27,11 @@ import org.jboss.mx.metadata.XMLMetaData; import org.jboss.mx.metadata.StandardMetaData; +import org.jboss.mx.metadata.MBeanInfoConversion; import org.jboss.mx.interceptor.ModelMBeanInterceptor; public class XMBean - extends ModelBase + extends ModelBase implements MBeanRegistration, XMBeanConstants { @@ -50,18 +51,23 @@ { try { - //if (resourceType.startsWith(CLASS_NAME)) + //if (resourceType.startsWith(CLASS_NAME)) //{ - // String - setManagedResource(resource, resourceType); - - + // String + setManagedResource(resource, resourceType); + + if (resourceType.equals(STANDARD_INTERFACE)) -info = new ModelMBeanInfoSupport((ModelMBeanInfo)new StandardMetaData(resource, true).build()); + { +MBeanInfo standardInfo = new StandardMetaData(resource).build(); +info = MBeanInfoConversion.toModelMBeanInfo(standardInfo); + } if (resourceType.endsWith(.xml)) -info = new ModelMBeanInfoSupport((ModelMBeanInfo)new XMLMetaData(resource.getClass().getName(), resourceType).build()); + { +info = new ModelMBeanInfoSupport((ModelMBeanInfo)new XMLMetaData(resource.getClass().getName(), resourceType).build()); + } } - catch (InstanceNotFoundException e) + catch (InstanceNotFoundException e) { throw new MBeanException(e); } @@ -69,66 +75,66 @@ { if (resourceType.endsWith(.xml)) throw new MBeanException(e, Malformed URL: + resourceType); - + throw new MBeanException(e, Unsupported resource type: + resourceType); } catch (MalformedURLException e) { throw new MBeanException(e, Malformed URL: + resourceType); - } + } } - public XMBean(String resourceClass, String resourceType, Object resourceInfo) + public XMBean(String resourceClass, String resourceType, Object resourceInfo) throws MBeanException, NotCompliantMBeanException { - - + + } - + // Public public boolean isSupportedResourceType(String resourceType) { return true; - + /* if (resourceType == null) return false; - + StringTokenizer strTokenizer = new StringTokenizer(resourceType, /); String referenceType = strTokenizer.nextToken(); String interfaceType = / + strTokenizer.nextToken(); String resourceInfo = strTokenizer.nextToken(); - + if (referenceType.equals(OBJET_REF)) return true; if (resourceType.equals(OBJECT_REF)) return true; if (resourceType.equals(STANDARD_INTERFACE)) return true; - + if (resourceType.endsWith(.xml)) try { new URL(resourceType); return true; } - catch (MalformedURLException e) + catch (MalformedURLException e) { return false; } - + return false; */ } - + // DynamicMBean implementation --- public MBeanInfo getMBeanInfo() { return info; } - - + + } ___ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jmx/src/main/org/jboss/mx/modelmbean XMBean.java
User: ejort Date: 02/01/26 13:13:29 Modified:src/main/org/jboss/mx/modelmbean XMBean.java Log: Always build clobber before committing Revision ChangesPath 1.4 +3 -3 jmx/src/main/org/jboss/mx/modelmbean/XMBean.java Index: XMBean.java === RCS file: /cvsroot/jboss/jmx/src/main/org/jboss/mx/modelmbean/XMBean.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- XMBean.java 2002/01/23 22:05:35 1.3 +++ XMBean.java 2002/01/26 21:13:29 1.4 @@ -57,9 +57,9 @@ if (resourceType.equals(STANDARD_INTERFACE)) -metadata = new ModelMBeanInfoSupport((ModelMBeanInfo)new StandardMetaData(resource, true).build()); +info = new ModelMBeanInfoSupport((ModelMBeanInfo)new StandardMetaData(resource, true).build()); if (resourceType.endsWith(.xml)) -metadata = new ModelMBeanInfoSupport((ModelMBeanInfo)new XMLMetaData(resource.getClass().getName(), resourceType).build()); +info = new ModelMBeanInfoSupport((ModelMBeanInfo)new XMLMetaData(resource.getClass().getName(), resourceType).build()); } catch (InstanceNotFoundException e) { @@ -124,7 +124,7 @@ // DynamicMBean implementation --- public MBeanInfo getMBeanInfo() { - return (MBeanInfo)metadata; + return info; } ___ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jmx/src/main/org/jboss/mx/modelmbean XMBean.java
User: juhalindfors Date: 02/01/23 14:05:35 Modified:src/main/org/jboss/mx/modelmbean XMBean.java Log: removing unused code Revision ChangesPath 1.3 +0 -46 jmx/src/main/org/jboss/mx/modelmbean/XMBean.java Index: XMBean.java === RCS file: /cvsroot/jboss/jmx/src/main/org/jboss/mx/modelmbean/XMBean.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- XMBean.java 2002/01/16 11:34:09 1.2 +++ XMBean.java 2002/01/23 22:05:35 1.3 @@ -121,19 +121,6 @@ */ } - // MBeanRegistration implementation -- - public ObjectName preRegister(MBeanServer server, ObjectName name) throws Exception - { - // FIXME: this should be in the base - this.stack = new ModelMBeanInterceptor(resource, metadata); - - return name; - } - - public void postRegister(Boolean registrationSuccessful) { } - public void preDeregister() throws Exception { } - public void postDeregister() { } - // DynamicMBean implementation --- public MBeanInfo getMBeanInfo() { @@ -142,39 +129,6 @@ - -/* - private Map createAttributeMap(MBeanAttributeInfo[] attributes) throws MBeanException, ReflectionException { - - Map attrMap = new HashMap(); - - for (int i = 0; i attributes.length; ++i) { - String name = attributes[i].getName(); - ModelMBeanAttributeInfo info = (ModelMBeanAttributeInfo)attributes[i]; - attrMap.put(name, new XMBeanAttribute(this, info)); - } - - return attrMap; - } - - private Map createOperationMap(MBeanOperationInfo[] operations) throws MBeanException { - - Map operMap = new HashMap(); - - for (int i = 0; i operations.length; ++i) { - String name = operations[i].getName(); - MBeanParameterInfo[] params = operations[i].getSignature(); - - for (int j = 0; j params.length; ++j) -name += params[j].getType(); - - ModelMBeanOperationInfo info = (ModelMBeanOperationInfo)operations[i]; - operMap.put(name, new XMBeanOperation(this, info)); - } - - return operMap; - } -*/ } ___ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jmx/src/main/org/jboss/mx/modelmbean XMBean.java XMBeanConstants.java
User: juhalindfors Date: 02/01/16 03:34:09 Modified:src/main/org/jboss/mx/modelmbean XMBean.java XMBeanConstants.java Log: some stuff from last year Revision ChangesPath 1.2 +42 -91jmx/src/main/org/jboss/mx/modelmbean/XMBean.java Index: XMBean.java === RCS file: /cvsroot/jboss/jmx/src/main/org/jboss/mx/modelmbean/XMBean.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- XMBean.java 2001/12/13 00:02:21 1.1 +++ XMBean.java 2002/01/16 11:34:09 1.2 @@ -45,12 +45,17 @@ super(info); } - public XMBean(Object resource, String resourceType) throws MBeanException, NotCompliantMBeanException + public XMBean(Object resource, String resourceType/*, Object resourceInfo*/) + throws MBeanException, NotCompliantMBeanException { try { + //if (resourceType.startsWith(CLASS_NAME)) + //{ + // String setManagedResource(resource, resourceType); + if (resourceType.equals(STANDARD_INTERFACE)) metadata = new ModelMBeanInfoSupport((ModelMBeanInfo)new StandardMetaData(resource, true).build()); if (resourceType.endsWith(.xml)) @@ -72,106 +77,30 @@ throw new MBeanException(e, Malformed URL: + resourceType); } } - - // MBeanRegistration implementation -- - public ObjectName preRegister(MBeanServer server, ObjectName name) throws Exception - { - /* - // store the server reference - this.server = server; - this.name= name; - - // create attribute and operation maps - operationMap = createOperationMap(metadata.getOperations()); - attributeMap = createAttributeMap(metadata.getAttributes()); - - return name; - */ - - // FIXME: this should be in the base - this.stack = new ModelMBeanInterceptor(resource, metadata); - - return name; - } - - public void postRegister(Boolean registrationSuccessful) { } - public void preDeregister() throws Exception { } - public void postDeregister() { } - // DynamicMBean implementation --- -/* - public Object getAttribute(String attribute) - throws AttributeNotFoundException, MBeanException, ReflectionException + public XMBean(String resourceClass, String resourceType, Object resourceInfo) + throws MBeanException, NotCompliantMBeanException { - /* - XMBeanAttribute attr = (XMBeanAttribute)attributeMap.get(attribute); - - if (attr == null) - throw new AttributeNotFoundException(); - - return attr.getValue(); - } - - public void setAttribute(Attribute attribute) - throws AttributeNotFoundException, InvalidAttributeValueException, MBeanException, ReflectionException - { - String attrName = attribute.getName(); - Object attrValue = attribute.getValue(); - - XMBeanAttribute attr = (XMBeanAttribute)attributeMap.get(attrName); - - if (attr == null) - throw new AttributeNotFoundException(); - - try { - attr.setValue(attrValue); - } - catch (InstanceNotFoundException e) { - - // may be thrown by PersistentMBean.store() - - throw new MBeanException(e); - } - - } - - public Object invoke(String actionName, Object[] params, String[] signature) - throws MBeanException, ReflectionException - { - String method = actionName; - - if (signature != null) { - for (int i = 0; i signature.length; ++i) - method += signature[i]; - } - - - XMBeanOperation operation = - (XMBeanOperation)operationMap.get(method); - - if (operation == null) { - throw new ReflectionException( -new IllegalArgumentException(unknown operation) - ); - } - - return operation.invoke(params); - - } -*/ - public MBeanInfo getMBeanInfo() - { - return (MBeanInfo)metadata; } - + // Public public boolean isSupportedResourceType(String resourceType) { + return true; + + /* if (resourceType == null) return false; - + + StringTokenizer strTokenizer = new StringTokenizer(resourceType, /); + String referenceType = strTokenizer.nextToken(); + String