[jboss-cvs] JBossAS SVN: r80923 - in trunk/system/src/main/org/jboss/system/server/profileservice: repository and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Nov 13 05:46:58 EST 2008


Author: emuckenhuber
Date: 2008-11-13 05:46:58 -0500 (Thu, 13 Nov 2008)
New Revision: 80923

Removed:
   trunk/system/src/main/org/jboss/system/server/profileservice/attachments/JAXBAttachmentHelper.java
Modified:
   trunk/system/src/main/org/jboss/system/server/profileservice/repository/JAXBAttachmentSerializer.java
   trunk/system/src/main/org/jboss/system/server/profileservice/repository/SerializableDeploymentRepository.java
Log:
remove not needed helper class

Deleted: trunk/system/src/main/org/jboss/system/server/profileservice/attachments/JAXBAttachmentHelper.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profileservice/attachments/JAXBAttachmentHelper.java	2008-11-13 08:51:57 UTC (rev 80922)
+++ trunk/system/src/main/org/jboss/system/server/profileservice/attachments/JAXBAttachmentHelper.java	2008-11-13 10:46:58 UTC (rev 80923)
@@ -1,107 +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.attachments;
-
-import java.io.File;
-import java.io.IOException;
-
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.Marshaller;
-import javax.xml.bind.Unmarshaller;
-
-import org.jboss.logging.Logger;
-
-/**
- * Use JAXB to load and save metadata to the file system.
- * 
- * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
- * @version $Revision$
- */
-public class JAXBAttachmentHelper
-{
-
-   /** The deployment pre-processed attachments store dir */
-   private final File attachmentsStoreDir;
-   
-   /** The logger */
-   private static final Logger log = Logger.getLogger(JAXBAttachmentHelper.class);
-   
-   public JAXBAttachmentHelper(File attachmentsStoreDir)
-   {
-      this.attachmentsStoreDir = attachmentsStoreDir;
-   }
-
-   protected <T> T loadAttachment(File attachmentsStore, Class<T> expected) throws Exception
-   {
-      JAXBContext ctx = JAXBContext.newInstance(expected);
-      Unmarshaller unmarshaller = ctx.createUnmarshaller();
-      return (T) unmarshaller.unmarshal(attachmentsStore);
-   }
-
-   protected void saveAttachment(File attachmentsStore, Object attachment) throws Exception
-   {
-      JAXBContext ctx = JAXBContext.newInstance(attachment.getClass());
-      Marshaller marshaller = ctx.createMarshaller();
-      marshaller.setProperty("jaxb.formatted.output", Boolean.TRUE);
-      marshaller.marshal(attachment, attachmentsStore);
-   }
-   
-   public <T> T loadAttachment(String baseName, Class<T> expected) throws Exception
-   {
-      if( attachmentsStoreDir == null )
-         throw new IllegalStateException("attachmentsStoreDir has not been set");
-
-      String vfsPath = baseName;
-      vfsPath += ".attachment";
-
-      File attachmentsStore = new File(attachmentsStoreDir, vfsPath);
-      if( attachmentsStore.exists() == false )
-      {
-         log.trace("attachmentStore does not exist: " + attachmentsStore);
-         return null;
-      }
-
-      return loadAttachment(attachmentsStore, expected);
-   }
-
-   public void saveAttachment(String baseName, Object attachment) throws Exception
-   {
-      if( attachmentsStoreDir == null )
-         throw new IllegalStateException("attachmentsStoreDir has not been set");
-
-      String vfsPath = baseName;
-      vfsPath += ".attachment";
-      File attachmentsStore = new File(attachmentsStoreDir, vfsPath);
-      File attachmentsParent = attachmentsStore.getParentFile();
-      if( attachmentsParent.exists() == false )
-      {
-         if( attachmentsParent.mkdirs() == false )
-            throw new IOException("Failed to create attachmentsParent: "+attachmentsParent.getAbsolutePath());
-      }
-
-      if( attachment != null )
-      {
-         saveAttachment(attachmentsStore, attachment);
-      }
-   }
-}
-

Modified: trunk/system/src/main/org/jboss/system/server/profileservice/repository/JAXBAttachmentSerializer.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profileservice/repository/JAXBAttachmentSerializer.java	2008-11-13 08:51:57 UTC (rev 80922)
+++ trunk/system/src/main/org/jboss/system/server/profileservice/repository/JAXBAttachmentSerializer.java	2008-11-13 10:46:58 UTC (rev 80923)
@@ -28,7 +28,6 @@
 import javax.xml.bind.Unmarshaller;
 
 import org.jboss.logging.Logger;
-import org.jboss.system.server.profileservice.attachments.JAXBAttachmentHelper;
 
 /**
  * A basic JAXB attachment serializer.
@@ -40,7 +39,7 @@
 {
    
    /** The logger */
-   private static final Logger log = Logger.getLogger(JAXBAttachmentHelper.class);
+   private static final Logger log = Logger.getLogger(JAXBAttachmentSerializer.class);
    
    @SuppressWarnings("unchecked")
    protected <T> T loadAttachment(File attachmentsStore, Class<T> expected) throws Exception

Modified: trunk/system/src/main/org/jboss/system/server/profileservice/repository/SerializableDeploymentRepository.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profileservice/repository/SerializableDeploymentRepository.java	2008-11-13 08:51:57 UTC (rev 80922)
+++ trunk/system/src/main/org/jboss/system/server/profileservice/repository/SerializableDeploymentRepository.java	2008-11-13 10:46:58 UTC (rev 80923)
@@ -62,7 +62,6 @@
 import org.jboss.system.server.profileservice.attachments.AttachmentMetaData;
 import org.jboss.system.server.profileservice.attachments.DeploymentClassPathMetaData;
 import org.jboss.system.server.profileservice.attachments.DeploymentStructureMetaData;
-import org.jboss.system.server.profileservice.attachments.JAXBAttachmentHelper;
 import org.jboss.system.server.profileservice.attachments.LazyPredeterminedManagedObjects;
 import org.jboss.system.server.profileservice.attachments.RepositoryAttachmentMetaData;
 import org.jboss.util.file.Files;




More information about the jboss-cvs-commits mailing list