Examples of PersistedComponent


Examples of org.jboss.system.server.profileservice.persistence.xml.PersistedComponent

      protected PersistedComponent createComponent(Object attachment, ManagedComponent component)
      {
         // Note: this is using the TestMgtComponentImpl to get the MO
         ManagedObject mo = (ManagedObject) component.getParent();
         PersistedManagedObject persisted = getPersistencePlugin().createPersistedManagedObject(mo);
         PersistedComponent persistedComponent = new PersistedComponent(persisted);
         setComponentName(persistedComponent, mo);
         return persistedComponent;
      }
View Full Code Here

Examples of org.jboss.system.server.profileservice.persistence.xml.PersistedComponent

      return createPersistedComponent(attachment, component, ModificationInfo.MODIFIED);
   }
  
   public PersistedComponent removeComponent(Object attachment, ManagedComponent component)
   {
      PersistedComponent persisted = createPersistedComponent(attachment, component, ModificationInfo.REMOVED);
      // FIXME cleanup properties, as they are not need for removed components
      persisted.setProperties(new ArrayList<PersistedProperty>());
      return persisted;
   }
View Full Code Here

Examples of org.jboss.system.server.profileservice.persistence.xml.PersistedComponent

   protected PersistedComponent createComponent(Object attachment, ManagedComponent component)
   {
      // ManagedObject mo = component.getDeployment().getManagedObject(component.getName());
      ManagedObject mo = (ManagedObject) component.getParent();
      PersistedManagedObject persisted = getPersistencePlugin().createPersistedManagedObject(mo);
      PersistedComponent persistedComponent = new PersistedComponent(persisted);
      setComponentName(persistedComponent, mo);
      return persistedComponent;
   }
View Full Code Here

Examples of org.jboss.system.server.profileservice.persistence.xml.PersistedComponent

      if(component == null)
         throw new IllegalArgumentException("null component");
      if(modification == null)
         throw new IllegalArgumentException("null modification info");
      // Create the component and set the modification information
      PersistedComponent persisted = createComponent(attachment, component);
      persisted.setModificationInfo(modification);
      return persisted;     
   }
View Full Code Here

Examples of org.jboss.system.server.profileservice.persistence.xml.PersistedComponent

   public PersistenceRoot addComponent(PersistenceRoot root, ManagedObject parent, ManagedComponent component)
   {
      if(root == null)
         throw new IllegalArgumentException("null persistence root");
      ComponentMapper mapper = getComponentMapper(parent);
      PersistedComponent persistedComponent = mapper.addComponent(parent.getAttachment(), component);
      return addPersistedComponent(root, persistedComponent);
   }
View Full Code Here

Examples of org.jboss.system.server.profileservice.persistence.xml.PersistedComponent

   {
      if(root == null)
         throw new IllegalArgumentException("null persistence root");
     
      ComponentMapper mapper = getComponentMapper(parent);
      PersistedComponent persistedComponent = mapper.removeComponent(parent.getAttachment(), component);
      return addPersistedComponent(root, persistedComponent);
   }
View Full Code Here

Examples of org.jboss.system.server.profileservice.persistence.xml.PersistedComponent

   {
      if(root == null)
         throw new IllegalArgumentException("null persistence root");
     
      ComponentMapper mapper = getComponentMapper(parent);
      PersistedComponent persistedComponent = mapper.updateComponent(parent.getAttachment(), component);
      return addPersistedComponent(root, persistedComponent);
   }
View Full Code Here

Examples of org.jboss.system.server.profileservice.persistence.xml.PersistedComponent

    */
   @Override
   public PersistenceRoot resetComponent(PersistenceRoot root, ManagedObject parent, ManagedComponent component)
   {
      ComponentMapper mapper = getComponentMapper(parent);
      PersistedComponent persistedComponent = mapper.updateComponent(parent.getAttachment(), component);
      // Map the components
      Map<String, PersistedComponent> components = mapComponents(root);
      // Remove the component
      PersistedComponent previous = components.remove(persistedComponent.getOriginalName());
      if(previous == null)
         previous = components.remove(persistedComponent.getName());
      // Set the new values
      root.setComponents(new ArrayList<PersistedComponent>(components.values()));
      return root;
View Full Code Here

Examples of org.jboss.system.server.profileservice.persistence.xml.PersistedComponent

    * @return the update persistence root
    */
   protected PersistenceRoot addPersistedComponent(PersistenceRoot root, PersistedComponent component)
   {
      Map<String, PersistedComponent> components = mapComponents(root);
      PersistedComponent previous = components.remove(component.getOriginalName());
      if(previous == null)
         previous = components.remove(component.getName());
      // Add the persisted component
      components.put(component.getName(), component);
     
      // Override with some previous information
      if(previous != null)
      {
         // A added component should remain on added
         if(previous.getModificationInfo() == ModificationInfo.ADDED
               && component.getModificationInfo() == ModificationInfo.MODIFIED)
            component.setModificationInfo(ModificationInfo.ADDED);
        
         // Just remove a previously added component
         if(previous.getModificationInfo() == ModificationInfo.ADDED
               && component.getModificationInfo() == ModificationInfo.REMOVED)
            components.remove(component.getName());
        
         // Override the name
         if(previous.getOriginalName() != null)
            component.setOriginalName(previous.getOriginalName());        
      }
     
      root.setComponents(new ArrayList<PersistedComponent>(components.values()));
      return root;
   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.