Package org.jboss.managed.plugins

Examples of org.jboss.managed.plugins.ManagedObjectImpl


    CollectionValueSupport valueSupport = (CollectionValueSupport) property.getValue();
    MetaValue[] metaValues = valueSupport.getElements();

    for (MetaValue value : metaValues) {
      GenericValueSupport genValueSupport = (GenericValueSupport) value;
      ManagedObjectImpl managedObject = (ManagedObjectImpl) genValueSupport.getValue();

      // Get any model errors/warnings
      MetaValue errors = managedObject.getProperty("errors").getValue(); //$NON-NLS-1$
      if (errors != null) {
        CollectionValueSupport errorValueSupport = (CollectionValueSupport) errors;
        MetaValue[] errorArray = errorValueSupport.getElements();
        count += errorArray.length;
      }
View Full Code Here


    }

    public MetaValue convertToMetaValue(PropertyMap propMap, PropertyDefinitionMap propDefMap, MetaType metaType)
    {
        //GenericMetaType genericMetaType = (GenericMetaType)metaType;
        ManagedObjectImpl managedObject = new ManagedObjectImpl(propDefMap.getName());
        for (PropertyDefinition mapMemberPropDef : propDefMap.getPropertyDefinitions().values())
        {
            ManagedPropertyImpl managedProp = new ManagedPropertyImpl(mapMemberPropDef.getName());
            MetaType managedPropMetaType = ProfileServiceUtil.convertPropertyDefinitionToMetaType(mapMemberPropDef);
            managedProp.setMetaType(managedPropMetaType);
            managedProp.setManagedObject(managedObject);
            managedObject.getProperties().put(managedProp.getName(), managedProp);
        }
        GenericValue genericValue = new GenericValueSupport(new GenericMetaType(propDefMap.getName(),
                propDefMap.getDescription()), managedObject);
        populateMetaValueFromProperty(propMap, genericValue, propDefMap);
        return genericValue;
View Full Code Here

    PropertyList errorList = new PropertyList("errorList");
    configuration.put(errorList);

    for (MetaValue value : metaValues) {
      GenericValueSupport genValueSupport = (GenericValueSupport) value;
      ManagedObjectImpl managedObject = (ManagedObjectImpl) genValueSupport
          .getValue();

      Boolean isSource = Boolean.TRUE;
      try {
        isSource = ProfileServiceUtil.booleanValue(managedObject
            .getProperty("source").getValue());
      } catch (Exception e) {
        LOG.error(e.getMessage());
      }

      Boolean supportMultiSource = Boolean.TRUE;
      try {
        supportMultiSource = ProfileServiceUtil
            .booleanValue(managedObject.getProperty(
                "supportsMultiSourceBindings").getValue());
      } catch (Exception e) {
        LOG.error(e.getMessage());
      }

      String modelName = managedObject.getName();
      ManagedProperty connectorBinding = managedObject
          .getProperty("sourceMappings");
      Collection<Map<String, String>> sourceList = new ArrayList<Map<String, String>>();

      getSourceMappingValue(connectorBinding.getValue(), sourceList);

      String visibility = ((SimpleValueSupport) managedObject
          .getProperty("visible").getValue()).getValue().toString();
      String type = ((EnumValueSupport) managedObject.getProperty(
          "modelType").getValue()).getValue().toString();

      // Get any model errors/warnings
      MetaValue errors = managedObject.getProperty("errors").getValue();
      if (errors != null) {
        CollectionValueSupport errorValueSupport = (CollectionValueSupport) errors;
        MetaValue[] errorArray = errorValueSupport.getElements();

        for (MetaValue error : errorArray) {
View Full Code Here

    PropertyList translatorsList = new PropertyList("translators");
    configuration.put(translatorsList);

    for (MetaValue value : metaValues) {
      GenericValueSupport genValueSupport = (GenericValueSupport) value;
      ManagedObjectImpl managedObject = (ManagedObjectImpl) genValueSupport
          .getValue();

      String translatorName = ProfileServiceUtil.getSimpleValue(
          managedObject, "name", String.class);
      String translatorType = ProfileServiceUtil.getSimpleValue(
          managedObject, "type", String.class);
      ManagedProperty properties = managedObject.getProperty("property");

      if (properties != null) {
        CollectionValueSupport props = (CollectionValueSupport) properties
            .getValue();
        for (MetaValue propertyMetaData : props) {
View Full Code Here

        MetaValue[] propsArray = ((CollectionValueSupport)mcVdb.getProperty("JAXBProperties").getValue()).getElements();
        String isPreview = "false";
       
        for (MetaValue propertyMetaData : propsArray) {
          GenericValueSupport genValueSupport = (GenericValueSupport) propertyMetaData;
          ManagedObjectImpl managedObject = (ManagedObjectImpl) genValueSupport
              .getValue();
 
          String propertyName = ProfileServiceUtil.getSimpleValue(
              managedObject, "name", String.class);
          if (propertyName.equals("preview")){
View Full Code Here

      String anyAuthenticated = resourceConfiguration.getSimpleValue(
          "anyAuthenticated", null); //$NON-NLS-1$

      for (MetaValue val : dataRolesListMp.getElements()) {
        GenericValueSupport genValueSupport = (GenericValueSupport) val;
        ManagedObjectImpl managedObject = (ManagedObjectImpl) genValueSupport
            .getValue();

        for (String dataRolesProp : managedObject.getPropertyNames()) {
          ManagedProperty property = managedObject
              .getProperty(dataRolesProp);

          String pname = ProfileServiceUtil.stringValue(managedObject
              .getProperty("name").getValue()); //$NON-NLS-1$
          if (!pname.equals(name)) {
            continue;
          }

          anyAuthenticatedMp = managedObject
              .getProperty("anyAuthenticated"); //$NON-NLS-1$
          anyAuthenticatedMp.setValue(ProfileServiceUtil.wrap(
              SimpleMetaType.BOOLEAN, anyAuthenticated));
          List<Property> mappedRoleNamePropertyList = resourceConfiguration.getList("mappedRoleNameList").getList(); //$NON-NLS-1$
          List<String> mappedRoleNameList = new ArrayList<String>();
         
          for (Property mappedRoleNameProperty : mappedRoleNamePropertyList){
            String mappedRoleNameString = ((PropertyMap)mappedRoleNameProperty).getSimpleValue("name", null); //$NON-NLS-1$
            mappedRoleNameList.add(mappedRoleNameString);
          }
          ManagedProperty mappedRoleNameMp = managedObject.getProperty("mappedRoleNames"); //$NON-NLS-1$
          mappedRoleNameMp.setValue(convertListOfStringsToMetaValue(mappedRoleNameList));
        }

        try {
          managementView.updateComponent(managedComponent);
View Full Code Here

          .getValue();
      MetaValue[] metaValues = valueSupport.getElements();

      for (MetaValue value : metaValues) {
        GenericValueSupport genValueSupport = (GenericValueSupport) value;
        ManagedObjectImpl managedObject = (ManagedObjectImpl) genValueSupport
            .getValue();

        String dataRoleName = ProfileServiceUtil.getSimpleValue(
            managedObject, "name", String.class); //$NON-NLS-1$
        Boolean anyAuthenticated = ProfileServiceUtil.getSimpleValue(
            managedObject, "anyAuthenticated", Boolean.class); //$NON-NLS-1$
        String description = ProfileServiceUtil.getSimpleValue(
            managedObject, "description", String.class); //$NON-NLS-1$

        configuration.put(new PropertySimple("name", dataRoleName)); //$NON-NLS-1$
        configuration.put(new PropertySimple("anyAuthenticated", //$NON-NLS-1$
            anyAuthenticated));
        configuration
            .put(new PropertySimple("description", description)); //$NON-NLS-1$

        PropertyList mappedRoleNameList = new PropertyList(
            "mappedRoleNameList"); //$NON-NLS-1$
        configuration.put(mappedRoleNameList);
        ManagedProperty mappedRoleNames = managedObject
            .getProperty("mappedRoleNames"); //$NON-NLS-1$
        if (mappedRoleNames != null) {
          CollectionValueSupport props = (CollectionValueSupport) mappedRoleNames
              .getValue();
          for (MetaValue mappedRoleName : props.getElements()) {
View Full Code Here

          .getValue();
      MetaValue[] metaValues = valueSupport.getElements();

      for (MetaValue value : metaValues) {
        GenericValueSupport genValueSupport = (GenericValueSupport) value;
        ManagedObjectImpl managedObject = (ManagedObjectImpl) genValueSupport
            .getValue();

        String dataRoleName = ProfileServiceUtil.getSimpleValue(
            managedObject, "name", String.class);
        Boolean anyAuthenticated = ProfileServiceUtil.getSimpleValue(
            managedObject, "anyAuthenticated", Boolean.class);
        String description = ProfileServiceUtil.getSimpleValue(
            managedObject, "description", String.class);

        /**
         *
         * A discovered resource must have a unique key, that must stay
         * the same when the resource is discovered the next time
         */
        DiscoveredResourceDetails detail = new DiscoveredResourceDetails(
            discoveryContext.getResourceType(), // ResourceType
            dataRoleName, // Resource Key
            dataRoleName, // Resource Name
            null, // Version
            PluginConstants.ComponentType.DATA_ROLE.DESCRIPTION, // Description
            discoveryContext.getDefaultPluginConfiguration(), // Plugin
            // Config
            null // Process info from a process scan
        );

        Configuration configuration = detail.getPluginConfiguration();

        configuration.put(new PropertySimple("name", dataRoleName));
        configuration.put(new PropertySimple("anyAuthenticated",
            anyAuthenticated));
        configuration
            .put(new PropertySimple("description", description));

        PropertyList mappedRoleNameList = new PropertyList(
            "mappedRoleNameList");
        configuration.put(mappedRoleNameList);
        ManagedProperty mappedRoleNames = managedObject
            .getProperty("mappedRoleNames");
        if (mappedRoleNames != null) {
          CollectionValueSupport props = (CollectionValueSupport)mappedRoleNames.getValue();
          for (MetaValue mappedRoleName : props.getElements()) {
            mappedRoleNameList.add(new PropertySimple("name", ProfileServiceUtil.stringValue(mappedRoleName)));
View Full Code Here

               log.debug("Failed to create ManagedOperation for: "+methodInfo.getName(), e);
            }
         }
      }

      ManagedObjectImpl result = new ManagedObjectImpl(mbean.getCanonicalName(), properties);
      // TODO
      Map<String, Annotation> empty = Collections.emptyMap();
      result.setAnnotations(empty);
      // Set the component name to name if this is a runtime MO with a name specified
      result.setComponentName(name);
      if (nameType != null)
         result.setNameType(nameType);
      if (attachmentName != null)
         result.setAttachmentName(attachmentName);
      if (operations.size() > 0 )
         result.setOperations(operations);
      for (ManagedProperty property : properties)
         property.setManagedObject(result);
      result.setTransientAttachment(MBeanInfo.class.getName(), info);

      // Marker for associating the correct dispatcher
      result.setTransientAttachment(MBeanRuntimeComponentDispatcher.class.getName(), true);
      return result;
   }
View Full Code Here

   }

   protected ManagedObject createFactoryManagedObject(BeanMetaDataFactory bmdf,
         ManagedObject parent, MetaData metaData)
   {
      ManagedObjectImpl bmdfMO = new ManagedObjectImpl(bmdf.getClass().getName());
      Map<String, ManagedProperty> newProps = new HashMap<String, ManagedProperty>();
      bmdfMO.setParent(parent);
      bmdfMO.setProperties(newProps);
      return bmdfMO;
   }
View Full Code Here

TOP

Related Classes of org.jboss.managed.plugins.ManagedObjectImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.