Commits

Mihai Glonț committed 6f9bb92

Use Grails2 API to get appCtx from classes in src/groovy.

Also made minor formatting changes to aid consistency and updated author
list.

  • Participants
  • Parent commits abd868d

Comments (0)

Files changed (1)

File jummp-plugins/jummp-plugin-core-api/src/groovy/net/biomodels/jummp/core/model/RevisionTransportCommand.groovy

 package net.biomodels.jummp.core.model
-import org.codehaus.groovy.grails.web.context.ServletContextHolder as SCH
-import org.codehaus.groovy.grails.web.servlet.GrailsApplicationAttributes as GA
+
+import grails.util.Holders
+
 /**
  * @short Wrapper for a Revision to be transported through JMS.
  *
  *
  * @author Martin Gräßlin <m.graesslin@dkfz-heidelberg.de>
  * @author Mihai Glonț <mihai.glont@ebi.ac.uk>
+ * @author Raza Ali <raza.ali@ebi.ac.uk>
  */
 class RevisionTransportCommand implements Serializable {
     private static final long serialVersionUID = 1L
      * The list of files associated with this revision
      */
      List<RepositoryFileTransportCommand> files = null;
-     
+
      List<RepositoryFileTransportCommand> getFiles() {
-     	     if (!files) {
-     	     	     // See: http://grails.org/FAQ#Q: How do I get access to the application context from sources in src/groovy?
-     	     	     def ctx = SCH.servletContext.getAttribute(GA.APPLICATION_CONTEXT)
-     	     	     files=ctx.modelDelegateService.retrieveModelFiles(this)
-     	     }
-     	     return files
+         if (!files) {
+             def ctx = Holders.getApplicationContext()
+             files=ctx.modelDelegateService.retrieveModelFiles(this)
+         }
+         return files
      }
-     
+
      void setFiles(List<RepositoryFileTransportCommand> f) {
-     	     files=f;
+         files=f;
      }
 }