[jboss-jira] [JBoss JIRA] Resolved: (JBMAN-23) Need MutableManagedObject interface extension of ManagedObject

Scott M Stark (JIRA) jira-events at lists.jboss.org
Wed Oct 22 23:52:20 EDT 2008


     [ https://jira.jboss.org/jira/browse/JBMAN-23?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Scott M Stark resolved JBMAN-23.
--------------------------------

    Resolution: Done


package org.jboss.managed.api;

import java.util.Map;
import java.util.Set;

import org.jboss.managed.api.annotation.ManagementObject;
import org.jboss.managed.api.annotation.ManagementObjectID;
import org.jboss.managed.api.annotation.ManagementRuntimeRef;

/**
 * An extension of ManagedObject that allows setting of key values after
 * the ManagedObject has been created.
 * 
 * @author Scott.Stark at jboss.org
 * @version $Revision: 79928 $
 */
public interface MutableManagedObject extends ManagedObject
{
   /**
    * Set the external name by which the ManagedObject is known
    * @see {@linkplain ManagementObject#name}}
    * @see {@linkplain ManagementObjectID#name}}
    * @return the name
    */
   public void setName(String name);
   /**
    * Set the runtime component name.
    *
    * @see {@linkplain ManagementRuntimeRef}
    * @return name of runtime component if one exists, null if no component exists.
    */
   public void setComponentName(Object name);
   /**
    * Set the parent ManagedObject.
    * @param parent - the parent ManagedObject, null if no parent exists.
    */
   public void setParent(ManagedObject parent);
   /**
    * Set the metadata attachment.
    * @param attachment - the metadata attachment this ManagedObject maps to.
    */
   public void setAttachment(Object attachment);
   /**
    * Set the ManagedObject ManagedProperty mapping.
    * @param properties - the ManagedProperty mapping.
    */
   public void setProperties(Map<String, ManagedProperty> properties);
   /**
    * Set the ManagedOperation associated with the ManagedObject.
    * @param operations - the ManagedOperations for the ManagedObject.
    */
   public void setOperations(Set<ManagedOperation> operations);
}


> Need MutableManagedObject interface extension of ManagedObject
> --------------------------------------------------------------
>
>                 Key: JBMAN-23
>                 URL: https://jira.jboss.org/jira/browse/JBMAN-23
>             Project: JBoss Managed
>          Issue Type: Feature Request
>          Components: managedobject
>            Reporter: Scott M Stark
>            Assignee: Scott M Stark
>             Fix For: JBossMan.2.0.0.CR2
>
>
> We need an extension of the ManagedObject interface that allows for updating the managed object name. When one creates a ManagedObject from a template, a property with a ManagementObjectID is used to set the ManagedObject name. Currently this has to look to the ManagedObjectImpl:
>             ManagementObjectID id = (ManagementObjectID) pannotations.get(ManagementObjectID.class.getName());
>             if (id != null)
>             {
>                Object refName = getRefName(prop.getValue());
>                if (refName == null)
>                   refName = id.name();
>                String name = "" + refName;
>                log.debug("Updating template ManagedObject name to:"+name+" from property: "+prop);
>                ManagedObject mo = prop.getManagedObject();
>                if(mo instanceof ManagedObjectImpl)
>                {
>                   // TODO: need a MutableManagedObject type
>                   ManagedObjectImpl moi = (ManagedObjectImpl) mo;
>                   moi.setName(name);
>                }
>                else
>                {
>                   formatter.applyPattern(i18n.getString("ManagementView.InvalidTemplatePropertyMO")); //$NON-NLS-1$
>                   Object[] args = {prop.getName()};
>                   String msg = formatter.format(args);
>                   throw new IllegalArgumentException(msg);
>                }
>             }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list