Changeset 5935 for branches/cleanup


Ignore:
Timestamp:
02/18/10 10:45:37 (10 years ago)
Author:
callan
Message:

#464 Implementation of OME reader/writer service (includes test cases)

Location:
branches/cleanup/components
Files:
4 added
4 edited

Legend:

Unmodified
Added
Removed
  • branches/cleanup/components/bio-formats/build.properties

    r5926 r5935  
    6666                               ${lib.dir}/slf4j-log4j12-1.5.10.jar:\ 
    6767                               ${lib.dir}/testng-5.11-jdk15.jar 
     68# Used by TestNG suite that tests the absence of class from ome-io.jar 
     69component.classpath.noomeio  = ${artifact.dir}/jai_imageio.jar:\ 
     70                               ${artifact.dir}/loci-common.jar:\ 
     71                               ${artifact.dir}/mdbtools-java.jar:\ 
     72                               ${artifact.dir}/ome-xml.jar:\ 
     73                               ${artifact.dir}/poi-loci.jar:\ 
     74                               ${lib.dir}/forms-1.3.0.jar:\ 
     75                               ${lib.dir}/log4j-1.2.15.jar:\ 
     76                               ${lib.dir}/slf4j-api-1.5.10.jar:\ 
     77                               ${lib.dir}/slf4j-log4j12-1.5.10.jar:\ 
     78                               ${lib.dir}/testng-5.11-jdk15.jar 
    6879component.java-version       = 1.5 
    6980component.deprecation        = true 
  • branches/cleanup/components/bio-formats/build.xml

    r5931 r5935  
    6969    </testng> 
    7070  </target> 
     71 
     72  <target name="test-no-ome-io" depends="compile-tests" 
     73    description="run missing OME I/O JAR tests" if="doTests"> 
     74    <copy tofile="${build.dir}/testng.xml" overwrite="true" 
     75      file="${tests.dir}/loci/formats/utests/testng-no-ome-io.xml"/> 
     76    <testng classpath= 
     77      "${test-classes.dir}:${classes.dir}:${component.classpath.noomeio}"> 
     78      <xmlfileset file="${build.dir}/testng.xml"/> 
     79      <jvmarg value="-mx${testng.memory}"/> 
     80    </testng> 
     81  </target> 
    7182</project> 
  • branches/cleanup/components/bio-formats/src/loci/formats/gui/ImageViewer.java

    r5920 r5935  
    5858import javax.swing.event.ChangeListener; 
    5959 
    60 import loci.common.ReflectException; 
    61 import loci.common.ReflectedUniverse; 
    6260import loci.common.dependency.DependencyException; 
    6361import loci.common.dependency.ServiceFactory; 
     
    7169import loci.formats.IFormatWriter; 
    7270import loci.formats.ImageWriter; 
     71import loci.formats.OMEReaderWriterService; 
    7372 
    7473import org.slf4j.Logger; 
     
    153152 
    154153    // NB: avoid dependencies on optional loci.ome.io package 
    155     ReflectedUniverse r = new ReflectedUniverse(); 
    156  
    157     // OME server I/O engine 
    158154    try { 
    159       r.exec("import loci.ome.io.OMEReader"); 
    160       omeReader = (IFormatReader) r.exec("new OMEReader()"); 
    161     } 
    162     catch (ReflectException exc) { 
    163       LOGGER.warn("OME reader not available"); 
    164     } 
    165     try { 
    166       r.exec("import loci.ome.io.OMEWriter"); 
    167       omeWriter = (IFormatWriter) r.exec("new OMEWriter()"); 
    168     } 
    169     catch (ReflectException exc) { 
    170       LOGGER.warn("OME writer not available"); 
    171     } 
    172  
    173     // OMERO server I/O engine 
    174     try { 
    175       r.exec("import loci.ome.io.OMEROReader"); 
    176       omeroReader = (IFormatReader) r.exec("new OMEROReader()"); 
    177     } 
    178     catch (ReflectException exc) { 
    179       LOGGER.warn("OMERO reader not available"); 
    180     } 
    181     try { 
    182       r.exec("import loci.ome.io.OMEROWriter"); 
    183       omeroWriter = (IFormatWriter) r.exec("new OMEROWriter()"); 
    184     } 
    185     catch (ReflectException exc) { 
    186       LOGGER.warn("OMERO writer not available"); 
     155      ServiceFactory factory = new ServiceFactory(); 
     156      OMEReaderWriterService service =  
     157        factory.getInstance(OMEReaderWriterService.class); 
     158      // OME server I/O engine 
     159      try { 
     160        omeReader = service.newOMEReader(); 
     161      } 
     162      catch (Exception exc) { 
     163        LOGGER.warn("OME reader not available", exc); 
     164      } 
     165      try { 
     166        omeWriter = service.newOMEWriter(); 
     167      } 
     168      catch (Exception exc) { 
     169        LOGGER.warn("OME writer not available", exc); 
     170      } 
     171 
     172      // OMERO server I/O engine 
     173      try { 
     174        omeroReader = service.newOMEROReader(); 
     175      } 
     176      catch (Exception exc) { 
     177        LOGGER.warn("OMERO reader not available", exc); 
     178      } 
     179      try { 
     180        omeroWriter = service.newOMEROWriter(); 
     181      } 
     182      catch (Exception exc) { 
     183        LOGGER.warn("OMERO writer not available", exc); 
     184      } 
     185    } 
     186    catch (DependencyException e) { 
     187      LOGGER.warn("OME and OMERO reader/writer service unavailble", e); 
    187188    } 
    188189 
  • branches/cleanup/components/common/src/loci/common/dependency/services.properties

    r5921 r5935  
    1515# JAI Image I/O service (interface and implementation in bio-formats component) 
    1616loci.formats.codec.JAIIIOService=loci.formats.codec.JAIIIOServiceImpl 
     17# OME and OMERO reader/writer service (interface in bio-formats component and 
     18# implementation in ome-io component) 
     19loci.formats.OMEReaderWriterService=loci.ome.io.OMEReaderWriterServiceImpl 
Note: See TracChangeset for help on using the changeset viewer.