[jboss-cvs] JBossAS SVN: r84198 - in trunk/system: src/main/org/jboss/system/server/profileservice/persistence and 2 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Feb 13 19:37:03 EST 2009


Author: emuckenhuber
Date: 2009-02-13 19:37:03 -0500 (Fri, 13 Feb 2009)
New Revision: 84198

Removed:
   trunk/system/src/main/org/jboss/system/server/profileservice/persistence/xml/AbstractMapSupport.java
Modified:
   trunk/system/.classpath
   trunk/system/src/main/org/jboss/system/server/profileservice/persistence/ManagedObjectPersistence.java
   trunk/system/src/main/org/jboss/system/server/profileservice/repository/AbstractAttachmentStore.java
Log:
minor update

Modified: trunk/system/.classpath
===================================================================
--- trunk/system/.classpath	2009-02-13 22:57:46 UTC (rev 84197)
+++ trunk/system/.classpath	2009-02-14 00:37:03 UTC (rev 84198)
@@ -30,5 +30,7 @@
 	<classpathentry kind="lib" path="/thirdparty/jboss/jboss-deployers/lib/jboss-deployers-core.jar" sourcepath="/thirdparty/jboss/jboss-deployers/lib/jboss-deployers-core-sources.jar"/>
 	<classpathentry kind="lib" path="/thirdparty/jboss/profileservice-spi/lib/jboss-profileservice-spi.jar" sourcepath="/thirdparty/jboss/profileservice-spi/lib/jboss-profileservice-spi-sources.jar"/>
 	<classpathentry kind="lib" path="/thirdparty/jboss/jboss-deployers/lib/jboss-deployers-client.jar" sourcepath="/thirdparty/jboss/jboss-deployers/lib/jboss-deployers-client-sources.jar"/>
+	<classpathentry kind="lib" path="/thirdparty/sun-jaxb/lib/jaxb-impl.jar"/>
+	<classpathentry kind="lib" path="/thirdparty/sun-jaf/lib/activation.jar"/>
 	<classpathentry kind="output" path="output/eclipse-classes"/>
 </classpath>

Modified: trunk/system/src/main/org/jboss/system/server/profileservice/persistence/ManagedObjectPersistence.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profileservice/persistence/ManagedObjectPersistence.java	2009-02-13 22:57:46 UTC (rev 84197)
+++ trunk/system/src/main/org/jboss/system/server/profileservice/persistence/ManagedObjectPersistence.java	2009-02-14 00:37:03 UTC (rev 84198)
@@ -147,7 +147,7 @@
          PersistedProperty propertyElement = createPersistedProperty(
                propertyName,
                property.getValue(),
-               property.getMetaType());
+               property.getMetaType(), trace);
       
          properties.add(propertyElement);
       }
@@ -161,12 +161,15 @@
     * @param metaType the meta type
     * @return the property
     */
-   protected PersistedProperty createPersistedProperty(String name, MetaValue value, MetaType metaType)
+   protected PersistedProperty createPersistedProperty(String name, MetaValue value, MetaType metaType, boolean trace)
    {
       if(name == null)
          throw new IllegalArgumentException("Null name.");
       if(metaType == null)
          throw new IllegalArgumentException("Null meta type.");
+    
+      if(trace)
+         log.trace("processing property name="+ name + "[metaValue="+ value + ", metaType="+ metaType + "]" );
       
       // Create Property
       PersistedProperty property = new PersistedProperty(name);
@@ -360,7 +363,7 @@
          {
             persistedValue = createPersistedValue((MetaValue) subElement, type);
          }
-         if (subElement != null && subElement.getClass().isArray())
+         else if (subElement != null && subElement.getClass().isArray())
          {
             persistedValue = unwrapArray(newElement, subElement, type);
          }

Deleted: trunk/system/src/main/org/jboss/system/server/profileservice/persistence/xml/AbstractMapSupport.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profileservice/persistence/xml/AbstractMapSupport.java	2009-02-13 22:57:46 UTC (rev 84197)
+++ trunk/system/src/main/org/jboss/system/server/profileservice/persistence/xml/AbstractMapSupport.java	2009-02-14 00:37:03 UTC (rev 84198)
@@ -1,92 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.system.server.profileservice.persistence.xml;
-
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * A Map helper class.
- * 
- * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
- * @version $Revision$
- */
-public abstract class AbstractMapSupport<T extends PersistedElement> extends AbstractElement
-{
-   /** The map. */
-   private Map<String, T> map = new HashMap<String, T>();
-
-   public AbstractMapSupport()
-   {
-      //
-   }
-   
-   public AbstractMapSupport(String name)
-   {
-      super(name, null);
-   }
-   
-   public AbstractMapSupport(String name, String className)
-   {
-      super(name, className);
-   }
-   
-   public Set<String> keySet()
-   {
-      return map.keySet();
-   }
-
-   public T get(String name)
-   {
-      return map.get(name);
-   }
-   
-   public void put(String name, T element)
-   {
-      if(name == null)
-         throw new IllegalArgumentException("Null name.");
-
-      this.map.put(name, element);
-   }
-   
-   public Collection<T> values()
-   {
-      return this.map.values();
-   }
-   
-   public void createMap(Collection<T> collection)
-   {
-      if(collection == null)
-         throw new IllegalArgumentException("null children.");
-      
-      for(T element : collection)
-      {
-         if(element.getName() == null)
-            throw new IllegalStateException("name required for element: "+ element);
-         
-         this.map.put(element.getName(), element);
-      }
-   }
-
-}

Modified: trunk/system/src/main/org/jboss/system/server/profileservice/repository/AbstractAttachmentStore.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profileservice/repository/AbstractAttachmentStore.java	2009-02-13 22:57:46 UTC (rev 84197)
+++ trunk/system/src/main/org/jboss/system/server/profileservice/repository/AbstractAttachmentStore.java	2009-02-14 00:37:03 UTC (rev 84198)
@@ -257,6 +257,9 @@
       
       boolean trace = log.isTraceEnabled();
       
+      // Log 
+      log.debug("updating deployment: "+ deployment + ", component: "+ comp);
+      
       // simpleName + hash
       String deploymentPath = createRelativeDeploymentPath(deployment);
       RepositoryAttachmentMetaData savedMetaData = loadAttachmentMetaData(deploymentPath); 
@@ -410,7 +413,7 @@
       boolean trace = log.isTraceEnabled();
          
       // Save attachments for the root context
-      if(metaData.getAttachments() != null && !metaData.getAttachments().isEmpty())
+      if(metaData.getAttachments() != null && metaData.getAttachments().isEmpty() == false)
       {
          for(AttachmentMetaData attachment : metaData.getAttachments())
          {
@@ -432,7 +435,7 @@
       }
       
       // Save the attachments for the childs
-      if(metaData.getChildren() != null && ! metaData.getChildren().isEmpty())
+      if(metaData.getChildren() != null && metaData.getChildren().isEmpty() == false)
       {
          for(RepositoryAttachmentMetaData child : metaData.getChildren())
          {
@@ -450,12 +453,8 @@
     */
    protected PersistedManagedObject createPersistedMetaData(ManagedObject mo)
    {
-      // TODO - load already persisted attachment.
-      PersistedManagedObject root = new PersistedManagedObject();
-      // Process
-      handler.processManagedObject(root, mo);
       // Return
-      return root;
+      return handler.createPersistenceMetaData(mo);
    }
    
    /**
@@ -539,7 +538,7 @@
       
       // Process children
       List<RepositoryAttachmentMetaData> children = attachmentMetaData.getChildren(); 
-      if(children != null && ! children.isEmpty())
+      if(children != null && children.isEmpty() == false)
       {
          for(RepositoryAttachmentMetaData childMetaData : children)
          {




More information about the jboss-cvs-commits mailing list