Changeset 5938 for branches/cleanup


Ignore:
Timestamp:
02/19/10 06:06:33 (10 years ago)
Author:
callan
Message:

#464 Various cleanup changes:

  • Normalized all service packages to loci.*.services convention
  • Added missing JAIIIOService test cases
  • Cleaned up some ServiceFactory exception handling
  • Fixed some missing dependency checks
  • Added missing specific missing JAR check test targets to catch all target
Location:
branches/cleanup/components
Files:
6 added
46 edited
20 moved

Legend:

Unmodified
Added
Removed
  • branches/cleanup/components/autogen/src/ice/IMetadataI.vm

    r5915 r5938  
    3333 
    3434import Ice.Current; 
    35 import loci.common.dependency.DependencyException; 
    36 import loci.common.dependency.ServiceException; 
    37 import loci.common.dependency.ServiceFactory; 
     35import loci.common.services.DependencyException; 
     36import loci.common.services.ServiceException; 
     37import loci.common.services.ServiceFactory; 
    3838import loci.formats.MetadataTools; 
    3939import loci.formats.meta.IMetadata; 
    40 import loci.formats.ome.OMEXMLService; 
     40import loci.formats.services.OMEXMLService; 
    4141 
    4242/** 
  • branches/cleanup/components/bf-ice/src/bio-formats.ice

    r5915 r5938  
    2525 * 
    2626 * THIS IS AUTOMATICALLY GENERATED CODE.  DO NOT MODIFY. 
    27  * Created by callan via MetadataAutogen on Feb 15, 2010 5:18:33 PM GMT 
     27 * Created by callan via MetadataAutogen on Feb 19, 2010 10:41:34 AM GMT 
    2828 * 
    2929 *----------------------------------------------------------------------------- 
  • branches/cleanup/components/bf-ice/src/loci/ice/formats/IMetadataI.java

    r5915 r5938  
    2525 * 
    2626 * THIS IS AUTOMATICALLY GENERATED CODE.  DO NOT MODIFY. 
    27  * Created by callan via MetadataAutogen on Feb 15, 2010 5:18:33 PM GMT 
     27 * Created by callan via MetadataAutogen on Feb 19, 2010 10:41:34 AM GMT 
    2828 * 
    2929 *----------------------------------------------------------------------------- 
     
    3333 
    3434import Ice.Current; 
    35 import loci.common.dependency.DependencyException; 
    36 import loci.common.dependency.ServiceException; 
    37 import loci.common.dependency.ServiceFactory; 
     35import loci.common.services.DependencyException; 
     36import loci.common.services.ServiceException; 
     37import loci.common.services.ServiceFactory; 
    3838import loci.formats.MetadataTools; 
    3939import loci.formats.meta.IMetadata; 
    40 import loci.formats.ome.OMEXMLService; 
     40import loci.formats.services.OMEXMLService; 
    4141 
    4242/** 
  • branches/cleanup/components/bio-formats/build.properties

    r5935 r5938  
    7777                               ${lib.dir}/slf4j-log4j12-1.5.10.jar:\ 
    7878                               ${lib.dir}/testng-5.11-jdk15.jar 
     79# Used by TestNG suite that tests the absence of class from jai_imageio.jar 
     80component.classpath.nojai    = ${artifact.dir}/loci-common.jar:\ 
     81                               ${artifact.dir}/mdbtools-java.jar:\ 
     82                               ${artifact.dir}/ome-xml.jar:\ 
     83                               ${artifact.dir}/poi-loci.jar:\ 
     84                               ${lib.dir}/forms-1.3.0.jar:\ 
     85                               ${lib.dir}/log4j-1.2.15.jar:\ 
     86                               ${lib.dir}/slf4j-api-1.5.10.jar:\ 
     87                               ${lib.dir}/slf4j-log4j12-1.5.10.jar:\ 
     88                               ${lib.dir}/testng-5.11-jdk15.jar 
    7989component.java-version       = 1.5 
    8090component.deprecation        = true 
  • branches/cleanup/components/bio-formats/build.xml

    r5935 r5938  
    1414 
    1515  <target name="test" 
    16     depends="jar,compile-tests,test-no-mdb,test-no-netcdf,test-no-ome-xml,test-no-poi" 
     16    depends="jar,compile-tests,test-no-mdb,test-no-netcdf,test-no-ome-xml, 
     17    test-no-poi,test-no-ome-io,test-no-jai" 
    1718    description="run tests" if="doTests"> 
    1819    <!-- NOTE: Overrides default "test" target from java.xml --> 
     
    8081    </testng> 
    8182  </target> 
     83 
     84  <target name="test-no-jai" depends="compile-tests" 
     85    description="run missing JAI ImageIO JAR tests" if="doTests"> 
     86    <copy tofile="${build.dir}/testng.xml" overwrite="true" 
     87      file="${tests.dir}/loci/formats/utests/testng-no-jai.xml"/> 
     88    <testng classpath= 
     89      "${test-classes.dir}:${classes.dir}:${component.classpath.nojai}"> 
     90      <xmlfileset file="${build.dir}/testng.xml"/> 
     91      <jvmarg value="-mx${testng.memory}"/> 
     92    </testng> 
     93  </target> 
    8294</project> 
  • branches/cleanup/components/bio-formats/src/loci/formats/FormatReader.java

    r5898 r5938  
    3131import loci.common.Location; 
    3232import loci.common.RandomAccessInputStream; 
    33 import loci.common.dependency.DependencyException; 
    34 import loci.common.dependency.ServiceFactory; 
     33import loci.common.services.DependencyException; 
     34import loci.common.services.ServiceFactory; 
    3535import loci.formats.meta.DummyMetadata; 
    3636import loci.formats.meta.IMetadata; 
    3737import loci.formats.meta.MetadataStore; 
    3838import loci.formats.ome.OMEXMLMetadata; 
    39 import loci.formats.ome.OMEXMLService; 
     39import loci.formats.services.OMEXMLService; 
    4040 
    4141/** 
  • branches/cleanup/components/bio-formats/src/loci/formats/codec/JPEG2000Codec.java

    r5921 r5938  
    3434import loci.common.DataTools; 
    3535import loci.common.RandomAccessInputStream; 
    36 import loci.common.dependency.DependencyException; 
    37 import loci.common.dependency.ServiceException; 
    38 import loci.common.dependency.ServiceFactory; 
     36import loci.common.services.DependencyException; 
     37import loci.common.services.ServiceException; 
     38import loci.common.services.ServiceFactory; 
    3939import loci.formats.FormatException; 
    4040import loci.formats.MissingLibraryException; 
    4141import loci.formats.gui.AWTImageTools; 
     42import loci.formats.services.JAIIIOService; 
    4243 
    4344/** 
  • branches/cleanup/components/bio-formats/src/loci/formats/enums/EnumerationProvider.java

    r5898 r5938  
    3030import org.slf4j.LoggerFactory; 
    3131 
    32 import loci.common.dependency.DependencyException; 
    33 import loci.common.dependency.ServiceFactory; 
     32import loci.common.services.DependencyException; 
     33import loci.common.services.ServiceFactory; 
    3434import loci.formats.MetadataTools; 
    3535import loci.formats.MissingLibraryException; 
     
    3737import loci.formats.enums.handler.IEnumerationHandler; 
    3838import loci.formats.ome.OMEXMLMetadata; 
    39 import loci.formats.ome.OMEXMLService; 
     39import loci.formats.services.OMEXMLService; 
    4040import loci.formats.tools.ImageConverter; 
    4141 
  • branches/cleanup/components/bio-formats/src/loci/formats/gui/ImageViewer.java

    r5935 r5938  
    5858import javax.swing.event.ChangeListener; 
    5959 
    60 import loci.common.dependency.DependencyException; 
    61 import loci.common.dependency.ServiceFactory; 
    62 import loci.common.dependency.services.OMENotesService; 
     60import loci.common.services.DependencyException; 
     61import loci.common.services.OMENotesService; 
     62import loci.common.services.ServiceFactory; 
    6363import loci.formats.ChannelMerger; 
    6464import loci.formats.FileStitcher; 
     
    6969import loci.formats.IFormatWriter; 
    7070import loci.formats.ImageWriter; 
    71 import loci.formats.OMEReaderWriterService; 
     71import loci.formats.services.OMEReaderWriterService; 
    7272 
    7373import org.slf4j.Logger; 
  • branches/cleanup/components/bio-formats/src/loci/formats/in/APLReader.java

    r5919 r5938  
    3030import loci.common.DataTools; 
    3131import loci.common.Location; 
    32 import loci.common.dependency.DependencyException; 
    33 import loci.common.dependency.ServiceFactory; 
     32import loci.common.services.DependencyException; 
     33import loci.common.services.ServiceFactory; 
    3434import loci.formats.CoreMetadata; 
    3535import loci.formats.FormatException; 
    3636import loci.formats.FormatReader; 
    3737import loci.formats.FormatTools; 
    38 import loci.formats.MDBService; 
    3938import loci.formats.MetadataTools; 
    4039import loci.formats.meta.FilterMetadata; 
    4140import loci.formats.meta.MetadataStore; 
     41import loci.formats.services.MDBService; 
    4242 
    4343/** 
  • branches/cleanup/components/bio-formats/src/loci/formats/in/FV1000Reader.java

    r5913 r5938  
    3636import loci.common.Location; 
    3737import loci.common.RandomAccessInputStream; 
    38 import loci.common.dependency.DependencyException; 
    39 import loci.common.dependency.ServiceFactory; 
     38import loci.common.services.DependencyException; 
     39import loci.common.services.ServiceFactory; 
    4040import loci.formats.CoreMetadata; 
    4141import loci.formats.FormatException; 
     
    4343import loci.formats.FormatTools; 
    4444import loci.formats.MetadataTools; 
    45 import loci.formats.POIService; 
    4645import loci.formats.meta.FilterMetadata; 
    4746import loci.formats.meta.MetadataStore; 
     47import loci.formats.services.POIService; 
    4848import loci.formats.tiff.IFD; 
    4949import loci.formats.tiff.IFDList; 
  • branches/cleanup/components/bio-formats/src/loci/formats/in/IPWReader.java

    r5913 r5938  
    3232import loci.common.DataTools; 
    3333import loci.common.DateTools; 
    34 import loci.common.dependency.DependencyException; 
    35 import loci.common.dependency.ServiceFactory; 
     34import loci.common.services.DependencyException; 
     35import loci.common.services.ServiceFactory; 
    3636import loci.common.Location; 
    3737import loci.common.RandomAccessInputStream; 
     
    4141import loci.formats.MetadataTools; 
    4242import loci.formats.MissingLibraryException; 
    43 import loci.formats.POIService; 
    4443import loci.formats.meta.FilterMetadata; 
    4544import loci.formats.meta.MetadataStore; 
     45import loci.formats.services.POIService; 
    4646import loci.formats.tiff.IFD; 
    4747import loci.formats.tiff.IFDList; 
  • branches/cleanup/components/bio-formats/src/loci/formats/in/ImarisHDFReader.java

    r5918 r5938  
    3030import loci.common.Location; 
    3131import loci.common.RandomAccessInputStream; 
    32 import loci.common.dependency.DependencyException; 
    33 import loci.common.dependency.ServiceException; 
    34 import loci.common.dependency.ServiceFactory; 
     32import loci.common.services.DependencyException; 
     33import loci.common.services.ServiceException; 
     34import loci.common.services.ServiceFactory; 
    3535import loci.formats.CoreMetadata; 
    3636import loci.formats.FormatException; 
     
    3939import loci.formats.MetadataTools; 
    4040import loci.formats.MissingLibraryException; 
    41 import loci.formats.NetCDFService; 
    42 import loci.formats.NetCDFServiceImpl; 
    4341import loci.formats.meta.FilterMetadata; 
    4442import loci.formats.meta.MetadataStore; 
     43import loci.formats.services.NetCDFService; 
     44import loci.formats.services.NetCDFServiceImpl; 
    4545 
    4646/** 
  • branches/cleanup/components/bio-formats/src/loci/formats/in/MINCReader.java

    r5918 r5938  
    2929import java.util.Vector; 
    3030 
    31 import loci.common.dependency.DependencyException; 
    32 import loci.common.dependency.ServiceException; 
    33 import loci.common.dependency.ServiceFactory; 
     31import loci.common.services.DependencyException; 
     32import loci.common.services.ServiceException; 
     33import loci.common.services.ServiceFactory; 
    3434import loci.formats.FormatException; 
    3535import loci.formats.FormatReader; 
     
    3737import loci.formats.MetadataTools; 
    3838import loci.formats.MissingLibraryException; 
    39 import loci.formats.NetCDFService; 
    4039import loci.formats.meta.FilterMetadata; 
    4140import loci.formats.meta.MetadataStore; 
     41import loci.formats.services.NetCDFService; 
    4242 
    4343/** 
  • branches/cleanup/components/bio-formats/src/loci/formats/in/OMETiffReader.java

    r5915 r5938  
    3434import loci.common.Location; 
    3535import loci.common.RandomAccessInputStream; 
    36 import loci.common.dependency.DependencyException; 
    37 import loci.common.dependency.ServiceException; 
    38 import loci.common.dependency.ServiceFactory; 
     36import loci.common.services.DependencyException; 
     37import loci.common.services.ServiceException; 
     38import loci.common.services.ServiceFactory; 
    3939import loci.formats.CoreMetadata; 
    4040import loci.formats.FormatException; 
     
    4444import loci.formats.MissingLibraryException; 
    4545import loci.formats.ome.OMEXMLMetadata; 
    46 import loci.formats.ome.OMEXMLService; 
     46import loci.formats.services.OMEXMLService; 
    4747import loci.formats.tiff.IFD; 
    4848import loci.formats.tiff.IFDList; 
  • branches/cleanup/components/bio-formats/src/loci/formats/in/OMEXMLReader.java

    r5915 r5938  
    3131import loci.common.CBZip2InputStream; 
    3232import loci.common.RandomAccessInputStream; 
    33 import loci.common.dependency.DependencyException; 
    34 import loci.common.dependency.ServiceException; 
    35 import loci.common.dependency.ServiceFactory; 
     33import loci.common.services.DependencyException; 
     34import loci.common.services.ServiceException; 
     35import loci.common.services.ServiceFactory; 
    3636import loci.common.xml.XMLTools; 
    3737import loci.formats.CoreMetadata; 
     
    4747import loci.formats.meta.MetadataStore; 
    4848import loci.formats.ome.OMEXMLMetadata; 
    49 import loci.formats.ome.OMEXMLService; 
     49import loci.formats.services.OMEXMLService; 
    5050 
    5151import org.xml.sax.Attributes; 
  • branches/cleanup/components/bio-formats/src/loci/formats/in/PCIReader.java

    r5913 r5938  
    3333import loci.common.Location; 
    3434import loci.common.RandomAccessInputStream; 
    35 import loci.common.dependency.DependencyException; 
    36 import loci.common.dependency.ServiceFactory; 
     35import loci.common.services.DependencyException; 
     36import loci.common.services.ServiceFactory; 
    3737import loci.formats.FormatException; 
    3838import loci.formats.FormatReader; 
    3939import loci.formats.FormatTools; 
    4040import loci.formats.MetadataTools; 
    41 import loci.formats.POIService; 
    4241import loci.formats.meta.FilterMetadata; 
    4342import loci.formats.meta.MetadataStore; 
     43import loci.formats.services.POIService; 
    4444import loci.formats.tiff.IFD; 
    4545import loci.formats.tiff.TiffParser; 
  • branches/cleanup/components/bio-formats/src/loci/formats/in/TillVisionReader.java

    r5913 r5938  
    3535import loci.common.Location; 
    3636import loci.common.RandomAccessInputStream; 
    37 import loci.common.dependency.DependencyException; 
    38 import loci.common.dependency.ServiceFactory; 
     37import loci.common.services.DependencyException; 
     38import loci.common.services.ServiceFactory; 
    3939import loci.formats.CoreMetadata; 
    4040import loci.formats.FormatException; 
     
    4242import loci.formats.FormatTools; 
    4343import loci.formats.MetadataTools; 
    44 import loci.formats.POIService; 
    4544import loci.formats.meta.FilterMetadata; 
    4645import loci.formats.meta.MetadataStore; 
     46import loci.formats.services.POIService; 
    4747 
    4848/** 
  • branches/cleanup/components/bio-formats/src/loci/formats/in/ZeissLSMReader.java

    r5919 r5938  
    3333import loci.common.Location; 
    3434import loci.common.RandomAccessInputStream; 
    35 import loci.common.dependency.DependencyException; 
    36 import loci.common.dependency.ServiceFactory; 
     35import loci.common.services.DependencyException; 
     36import loci.common.services.ServiceFactory; 
    3737import loci.formats.CoreMetadata; 
    3838import loci.formats.FormatException; 
    3939import loci.formats.FormatReader; 
    4040import loci.formats.FormatTools; 
    41 import loci.formats.MDBService; 
    4241import loci.formats.MetadataTools; 
    4342import loci.formats.meta.FilterMetadata; 
    4443import loci.formats.meta.MetadataStore; 
     44import loci.formats.services.MDBService; 
    4545import loci.formats.tiff.IFD; 
    4646import loci.formats.tiff.IFDList; 
  • branches/cleanup/components/bio-formats/src/loci/formats/in/ZeissZVIReader.java

    r5913 r5938  
    3737import loci.common.Location; 
    3838import loci.common.RandomAccessInputStream; 
    39 import loci.common.dependency.DependencyException; 
    40 import loci.common.dependency.ServiceFactory; 
     39import loci.common.services.DependencyException; 
     40import loci.common.services.ServiceFactory; 
    4141import loci.formats.FormatException; 
    4242import loci.formats.FormatReader; 
    4343import loci.formats.FormatTools; 
    4444import loci.formats.MetadataTools; 
    45 import loci.formats.POIService; 
    4645import loci.formats.codec.Codec; 
    4746import loci.formats.codec.CodecOptions; 
     
    5150import loci.formats.meta.FilterMetadata; 
    5251import loci.formats.meta.MetadataStore; 
     52import loci.formats.services.POIService; 
    5353 
    5454/** 
  • branches/cleanup/components/bio-formats/src/loci/formats/out/OMETiffWriter.java

    r5915 r5938  
    3030 
    3131import loci.common.Location; 
    32 import loci.common.dependency.DependencyException; 
    33 import loci.common.dependency.ServiceException; 
    34 import loci.common.dependency.ServiceFactory; 
     32import loci.common.services.DependencyException; 
     33import loci.common.services.ServiceException; 
     34import loci.common.services.ServiceFactory; 
    3535import loci.formats.FormatException; 
    3636import loci.formats.FormatTools; 
    3737import loci.formats.meta.MetadataRetrieve; 
    3838import loci.formats.ome.OMEXMLMetadata; 
    39 import loci.formats.ome.OMEXMLService; 
     39import loci.formats.services.OMEXMLService; 
    4040import loci.formats.tiff.TiffSaver; 
    4141 
  • branches/cleanup/components/bio-formats/src/loci/formats/out/OMEXMLWriter.java

    r5915 r5938  
    2828 
    2929import loci.common.RandomAccessOutputStream; 
    30 import loci.common.dependency.DependencyException; 
    31 import loci.common.dependency.ServiceException; 
    32 import loci.common.dependency.ServiceFactory; 
     30import loci.common.services.DependencyException; 
     31import loci.common.services.ServiceException; 
     32import loci.common.services.ServiceFactory; 
    3333import loci.common.xml.XMLTools; 
    3434import loci.formats.FormatException; 
     
    4545import loci.formats.in.OMETiffReader; 
    4646import loci.formats.meta.MetadataRetrieve; 
    47 import loci.formats.ome.OMEXMLService; 
     47import loci.formats.services.OMEXMLService; 
    4848 
    4949import org.xml.sax.Attributes; 
  • branches/cleanup/components/bio-formats/src/loci/formats/services/JAIIIOService.java

    r5921 r5938  
    2222*/ 
    2323 
    24 package loci.formats.codec; 
     24package loci.formats.services; 
    2525 
    2626import java.awt.image.BufferedImage; 
     
    2929import java.io.OutputStream; 
    3030 
    31 import loci.common.dependency.ServiceException; 
    32 import loci.common.dependency.services.Service; 
     31import loci.common.services.Service; 
     32import loci.common.services.ServiceException; 
    3333 
    3434/** 
     
    3636 * 
    3737 * <dl><dt><b>Source code:</b></dt> 
    38  * <dd><a href="https://skyking.microscopy.wisc.edu/trac/java/browser/trunk/components/bio-formats/src/loci/formats/codec/JAIIIOService.java">Trac</a>, 
    39  * <a href="https://skyking.microscopy.wisc.edu/svn/java/trunk/components/bio-format/src/loci/formats/codec/JAIIIOService.java">SVN</a></dd></dl> 
     38 * <dd><a href="https://skyking.microscopy.wisc.edu/trac/java/browser/trunk/components/bio-formats/src/loci/formats/services/JAIIIOService.java">Trac</a>, 
     39 * <a href="https://skyking.microscopy.wisc.edu/svn/java/trunk/components/bio-format/src/loci/formats/services/JAIIIOService.java">SVN</a></dd></dl> 
    4040 */ 
    4141public interface JAIIIOService extends Service { 
  • branches/cleanup/components/bio-formats/src/loci/formats/services/JAIIIOServiceImpl.java

    r5921 r5938  
    2222*/ 
    2323 
    24 package loci.formats.codec; 
     24package loci.formats.services; 
    2525 
    2626import com.sun.media.imageio.plugins.jpeg2000.J2KImageWriteParam; 
     
    4343import javax.imageio.stream.MemoryCacheImageInputStream; 
    4444 
    45 import loci.common.dependency.ServiceException; 
    46 import loci.common.dependency.services.Service; 
     45import loci.common.services.AbstractService; 
     46import loci.common.services.ServiceException; 
    4747import loci.formats.MissingLibraryException; 
    4848 
     
    5151 * 
    5252 * <dl><dt><b>Source code:</b></dt> 
    53  * <dd><a href="https://skyking.microscopy.wisc.edu/trac/java/browser/trunk/components/bio-formats/src/loci/formats/codec/JAIIIOServiceImpl.java">Trac</a>, 
    54  * <a href="https://skyking.microscopy.wisc.edu/svn/java/trunk/components/bio-format/src/loci/formats/codec/JAIIIOServiceImpl.java">SVN</a></dd></dl> 
     53 * <dd><a href="https://skyking.microscopy.wisc.edu/trac/java/browser/trunk/components/bio-formats/src/loci/formats/services/JAIIIOServiceImpl.java">Trac</a>, 
     54 * <a href="https://skyking.microscopy.wisc.edu/svn/java/trunk/components/bio-format/src/loci/formats/services/JAIIIOServiceImpl.java">SVN</a></dd></dl> 
    5555 */ 
    56 public class JAIIIOServiceImpl implements JAIIIOService { 
     56public class JAIIIOServiceImpl extends AbstractService 
     57  implements JAIIIOService { 
    5758 
    5859  private static final String NO_J2K_MSG = 
     
    107108 
    108109  // -- JAIIIOService API methods -- 
     110   
     111  /** 
     112   * Default constructor. 
     113   */ 
     114  public JAIIIOServiceImpl() { 
     115    // Thorough class checking 
     116    checkClassDependency(J2KImageWriteParam.class); 
     117    checkClassDependency(J2KImageWriter.class); 
     118    checkClassDependency(J2KImageReader.class); 
     119  } 
    109120 
    110121  /* @see JAIIIOService#writeImage(OutputStream, BufferedImage) */ 
  • branches/cleanup/components/bio-formats/src/loci/formats/services/MDBService.java

    r5919 r5938  
    2222*/ 
    2323 
    24 package loci.formats; 
     24package loci.formats.services; 
    2525 
    2626import java.io.IOException; 
    2727import java.util.Vector; 
    2828 
    29 import loci.common.dependency.services.Service; 
     29import loci.common.services.Service; 
    3030 
    3131/** 
     
    3333 * 
    3434 * <dl><dt><b>Source code:</b></dt> 
    35  * <dd><a href="https://skyking.microscopy.wisc.edu/trac/java/browser/trunk/components/bio-formats/src/loci/formats/MDBService.java">Trac</a>, 
    36  * <a href="https://skyking.microscopy.wisc.edu/svn/java/trunk/components/bio-format/src/loci/formats/MDBService.java">SVN</a></dd></dl> 
     35 * <dd><a href="https://skyking.microscopy.wisc.edu/trac/java/browser/trunk/components/bio-formats/src/loci/formats/services/MDBService.java">Trac</a>, 
     36 * <a href="https://skyking.microscopy.wisc.edu/svn/java/trunk/components/bio-format/src/loci/formats/services/MDBService.java">SVN</a></dd></dl> 
    3737 */ 
    3838public interface MDBService extends Service { 
  • branches/cleanup/components/bio-formats/src/loci/formats/services/MDBServiceImpl.java

    r5926 r5938  
    2222*/ 
    2323 
    24 package loci.formats; 
     24package loci.formats.services; 
    2525 
    2626import java.io.IOException; 
     
    2828import java.util.Vector; 
    2929 
    30 import loci.common.dependency.services.AbstractService; 
     30import loci.common.services.AbstractService; 
    3131 
    3232import mdbtools.jdbc2.File; 
     
    4747 * 
    4848 * <dl><dt><b>Source code:</b></dt> 
    49  * <dd><a href="https://skyking.microscopy.wisc.edu/trac/java/browser/trunk/components/bio-formats/src/loci/formats/MDBServiceImpl.java">Trac</a>, 
    50  * <a href="https://skyking.microscopy.wisc.edu/svn/java/trunk/components/bio-formats/src/loci/formats/MDBServiceImpl.java">SVN</a></dd></dl> 
     49 * <dd><a href="https://skyking.microscopy.wisc.edu/trac/java/browser/trunk/components/bio-formats/src/loci/formats/services/MDBServiceImpl.java">Trac</a>, 
     50 * <a href="https://skyking.microscopy.wisc.edu/svn/java/trunk/components/bio-formats/src/loci/formats/services/MDBServiceImpl.java">SVN</a></dd></dl> 
    5151 */ 
    5252public class MDBServiceImpl extends AbstractService implements MDBService { 
  • branches/cleanup/components/bio-formats/src/loci/formats/services/NetCDFService.java

    r5918 r5938  
    2222*/ 
    2323 
    24 package loci.formats; 
     24package loci.formats.services; 
    2525 
    2626import java.io.IOException; 
     
    2828import java.util.Vector; 
    2929 
    30 import loci.common.dependency.ServiceException; 
    31 import loci.common.dependency.services.Service; 
     30import loci.common.services.Service; 
     31import loci.common.services.ServiceException; 
    3232 
    3333/** 
     
    3636 * 
    3737 * <dl><dt><b>Source code:</b></dt> 
    38  * <dd><a href="https://skyking.microscopy.wisc.edu/trac/java/browser/trunk/components/bio-formats/src/loci/formats/NetCDFService.java">Trac</a>, 
    39  * <a href="https://skyking.microscopy.wisc.edu/svn/java/trunk/components/bio-formats/src/loci/formats/NetCDFService.java">SVN</a></dd></dl> 
     38 * <dd><a href="https://skyking.microscopy.wisc.edu/trac/java/browser/trunk/components/bio-formats/src/loci/formats/services/NetCDFService.java">Trac</a>, 
     39 * <a href="https://skyking.microscopy.wisc.edu/svn/java/trunk/components/bio-formats/src/loci/formats/services/NetCDFService.java">SVN</a></dd></dl> 
    4040 */ 
    4141public interface NetCDFService extends Service { 
  • branches/cleanup/components/bio-formats/src/loci/formats/services/NetCDFServiceImpl.java

    r5926 r5938  
    2222*/ 
    2323 
    24 package loci.formats; 
     24package loci.formats.services; 
    2525 
    2626import java.io.IOException; 
     
    3333 
    3434import loci.common.Location; 
    35 import loci.common.dependency.ServiceException; 
    36 import loci.common.dependency.services.AbstractService; 
     35import loci.common.services.AbstractService; 
     36import loci.common.services.ServiceException; 
    3737 
    3838import org.slf4j.Logger; 
     
    5151 * 
    5252 * <dl><dt><b>Source code:</b></dt> 
    53  * <dd><a href="https://skyking.microscopy.wisc.edu/trac/java/browser/trunk/components/bio-formats/src/loci/formats/NetCDFServiceImpl.java">Trac</a>, 
    54  * <a href="https://skyking.microscopy.wisc.edu/svn/java/trunk/components/bio-formats/src/loci/formats/NetCDFServiceImpl.java">SVN</a></dd></dl> 
     53 * <dd><a href="https://skyking.microscopy.wisc.edu/trac/java/browser/trunk/components/bio-formats/src/loci/formats/services/NetCDFServiceImpl.java">Trac</a>, 
     54 * <a href="https://skyking.microscopy.wisc.edu/svn/java/trunk/components/bio-formats/src/loci/formats/services/NetCDFServiceImpl.java">SVN</a></dd></dl> 
    5555 */ 
    5656public class NetCDFServiceImpl extends AbstractService 
     
    9797  public void setFile(String file) throws IOException { 
    9898    this.currentFile = file; 
    99     initialize(); 
     99    // HACK - NetCDF prints a fair number of warning messages to stdout 
     100    // we need to filter these out so that they don't interfere with omebf 
     101    // FIXME: Get rid of this. 
     102    PrintStream out = new PrintStream(System.out) { 
     103      public void print(String s) { 
     104        if (s == null || !s.trim().startsWith("WARN:")) super.print(s); 
     105      } 
     106      public void println(String s) { 
     107        if (s == null || !s.trim().startsWith("WARN:")) super.println(s); 
     108      } 
     109    }; 
     110    System.setOut(out); 
     111 
     112    String currentId = Location.getMappedId(currentFile); 
     113    netCDFFile = NetcdfFile.open(currentId); 
     114    root = netCDFFile.getRootGroup(); 
     115 
     116    attributeList = new Vector<String>(); 
     117    variableList = new Vector<String>(); 
     118    List<Group> groups = new ArrayList<Group>(); 
     119    groups.add(root); 
     120    parseAttributesAndVariables(groups); 
    100121  } 
    101122 
     
    216237  // -- Helper methods -- 
    217238 
    218   private void initialize() throws IOException { 
    219     // HACK - NetCDF prints a fair number of warning messages to stdout 
    220     // we need to filter these out so that they don't interfere with omebf 
    221     // FIXME: Get rid of this. 
    222     PrintStream out = new PrintStream(System.out) { 
    223       public void print(String s) { 
    224         if (s == null || !s.trim().startsWith("WARN:")) super.print(s); 
    225       } 
    226       public void println(String s) { 
    227         if (s == null || !s.trim().startsWith("WARN:")) super.println(s); 
    228       } 
    229     }; 
    230     System.setOut(out); 
    231  
    232     String currentId = Location.getMappedId(currentFile); 
    233     netCDFFile = NetcdfFile.open(currentId); 
    234     root = netCDFFile.getRootGroup(); 
    235  
    236     attributeList = new Vector<String>(); 
    237     variableList = new Vector<String>(); 
    238     List<Group> groups = new ArrayList<Group>(); 
    239     groups.add(root); 
    240     parseAttributesAndVariables(groups); 
    241   } 
    242  
     239  /** 
     240   * Recursively parses attribute and variable paths, filling 
     241   * <code>attributeList</code> and <code>variableList</code>. 
     242   * @param groups List of groups to recursively parse. 
     243   */ 
    243244  private void parseAttributesAndVariables(List<Group> groups) { 
    244245    for (Group group : groups) { 
  • branches/cleanup/components/bio-formats/src/loci/formats/services/OMEReaderWriterService.java

    r5935 r5938  
    2222*/ 
    2323 
    24 package loci.formats; 
     24package loci.formats.services; 
    2525 
    26 import loci.common.dependency.services.Service; 
     26import loci.common.services.Service; 
     27import loci.formats.IFormatReader; 
     28import loci.formats.IFormatWriter; 
    2729 
    2830/** 
     
    3133 * 
    3234 * <dl><dt><b>Source code:</b></dt> 
    33  * <dd><a href="https://skyking.microscopy.wisc.edu/trac/java/browser/trunk/components/bio-formats/src/loci/formats/OMEReaderWriterService.java">Trac</a>, 
    34  * <a href="https://skyking.microscopy.wisc.edu/svn/java/trunk/components/bio-formats/src/loci/formats/OMEReaderWriterService.java">SVN</a></dd></dl> 
     35 * <dd><a href="https://skyking.microscopy.wisc.edu/trac/java/browser/trunk/components/bio-formats/src/loci/formats/services/OMEReaderWriterService.java">Trac</a>, 
     36 * <a href="https://skyking.microscopy.wisc.edu/svn/java/trunk/components/bio-formats/src/loci/formats/services/OMEReaderWriterService.java">SVN</a></dd></dl> 
    3537 */ 
    3638public interface OMEReaderWriterService extends Service { 
  • branches/cleanup/components/bio-formats/src/loci/formats/services/OMEXMLService.java

    r5915 r5938  
    2222*/ 
    2323 
    24 package loci.formats.ome; 
     24package loci.formats.services; 
    2525 
    26 import loci.common.dependency.ServiceException; 
    27 import loci.common.dependency.services.Service; 
     26import loci.common.services.Service; 
     27import loci.common.services.ServiceException; 
    2828import loci.formats.meta.MetadataRetrieve; 
    2929import loci.formats.meta.MetadataStore; 
     30import loci.formats.ome.OMEXMLMetadata; 
    3031 
    3132 
     
    3334 *  
    3435 * <dl><dt><b>Source code:</b></dt> 
    35  * <dd><a href="https://skyking.microscopy.wisc.edu/trac/java/browser/trunk/components/bio-formats/src/loci/formats/ome/OMEXMLService.java">Trac</a>, 
    36  * <a href="https://skyking.microscopy.wisc.edu/svn/java/trunk/components/bio-formats/src/loci/formats/ome/OMEXMLService.java">SVN</a></dd></dl> 
     36 * <dd><a href="https://skyking.microscopy.wisc.edu/trac/java/browser/trunk/components/bio-formats/src/loci/formats/services/OMEXMLService.java">Trac</a>, 
     37 * <a href="https://skyking.microscopy.wisc.edu/svn/java/trunk/components/bio-formats/src/loci/formats/services/OMEXMLService.java">SVN</a></dd></dl> 
    3738 */ 
    3839public interface OMEXMLService extends Service { 
  • branches/cleanup/components/bio-formats/src/loci/formats/services/OMEXMLServiceImpl.java

    r5926 r5938  
    2222*/ 
    2323 
    24 package loci.formats.ome; 
     24package loci.formats.services; 
    2525 
    2626import java.io.IOException; 
     
    4141import org.xml.sax.SAXException; 
    4242 
    43 import loci.common.dependency.ServiceException; 
    44 import loci.common.dependency.services.AbstractService; 
     43import loci.common.services.AbstractService; 
     44import loci.common.services.ServiceException; 
    4545import loci.common.xml.XMLTools; 
    4646import loci.formats.meta.IMetadata; 
     
    4848import loci.formats.meta.MetadataRetrieve; 
    4949import loci.formats.meta.MetadataStore; 
     50import loci.formats.ome.OMEXMLMetadata; 
    5051 
    5152/** 
     
    5455 * 
    5556 * <dl><dt><b>Source code:</b></dt> 
    56  * <dd><a href="https://skyking.microscopy.wisc.edu/trac/java/browser/trunk/components/bio-formats/src/loci/formats/ome/OMEXMLServiceImpl.java">Trac</a>, 
    57  * <a href="https://skyking.microscopy.wisc.edu/svn/java/trunk/components/bio-formats/src/loci/formats/ome/OMEXMLServiceImpl.java">SVN</a></dd></dl> 
     57 * <dd><a href="https://skyking.microscopy.wisc.edu/trac/java/browser/trunk/components/bio-formats/src/loci/formats/services/OMEXMLServiceImpl.java">Trac</a>, 
     58 * <a href="https://skyking.microscopy.wisc.edu/svn/java/trunk/components/bio-formats/src/loci/formats/services/OMEXMLServiceImpl.java">SVN</a></dd></dl> 
    5859 */ 
    5960public class OMEXMLServiceImpl extends AbstractService 
     
    7778  } 
    7879   
    79   /** 
    80    * Retrieves the latest supported version of the OME-XML schema. 
     80  /* (non-Javadoc) 
     81   * @see loci.formats.services.OMEXMLService#getLatestVersion() 
    8182   */ 
    8283  public String getLatestVersion() { 
  • branches/cleanup/components/bio-formats/src/loci/formats/services/POIService.java

    r5919 r5938  
    2222*/ 
    2323 
    24 package loci.formats; 
     24package loci.formats.services; 
    2525 
    2626import java.io.InputStream; 
     
    2929 
    3030import loci.common.RandomAccessInputStream; 
    31 import loci.common.dependency.services.Service; 
     31import loci.common.services.Service; 
    3232 
    3333/** 
     
    3636 * 
    3737 * <dl><dt><b>Source code:</b></dt> 
    38  * <dd><a href="https://skyking.microscopy.wisc.edu/trac/java/browser/trunk/components/bio-formats/src/loci/formats/POIService.java">Trac</a>, 
    39  * <a href="https://skyking.microscopy.wisc.edu/svn/java/trunk/components/bio-format/src/loci/formats/POIService.java">SVN</a></dd></dl> 
     38 * <dd><a href="https://skyking.microscopy.wisc.edu/trac/java/browser/trunk/components/bio-formats/src/loci/formats/services/POIService.java">Trac</a>, 
     39 * <a href="https://skyking.microscopy.wisc.edu/svn/java/trunk/components/bio-format/src/loci/formats/services/POIService.java">SVN</a></dd></dl> 
    4040 */ 
    4141public interface POIService extends Service { 
  • branches/cleanup/components/bio-formats/src/loci/formats/services/POIServiceImpl.java

    r5926 r5938  
    2222*/ 
    2323 
    24 package loci.formats; 
     24package loci.formats.services; 
    2525 
    2626import java.io.File; 
     
    3232 
    3333import loci.common.RandomAccessInputStream; 
    34 import loci.common.dependency.services.AbstractService; 
     34import loci.common.services.AbstractService; 
    3535 
    3636import loci.poi.poifs.filesystem.DirectoryEntry; 
     
    4343 * 
    4444 * <dl><dt><b>Source code:</b></dt> 
    45  * <dd><a href="https://skyking.microscopy.wisc.edu/trac/java/browser/trunk/components/bio-formats/src/loci/formats/POIServiceImpl.java">Trac</a>, 
    46  * <a href="https://skyking.microscopy.wisc.edu/svn/java/trunk/components/bio-formats/src/loci/formats/POIServiceImpl.java">SVN</a></dd></dl> 
     45 * <dd><a href="https://skyking.microscopy.wisc.edu/trac/java/browser/trunk/components/bio-formats/src/loci/formats/services/POIServiceImpl.java">Trac</a>, 
     46 * <a href="https://skyking.microscopy.wisc.edu/svn/java/trunk/components/bio-formats/src/loci/formats/services/POIServiceImpl.java">SVN</a></dd></dl> 
    4747 */ 
    4848public class POIServiceImpl extends AbstractService implements POIService { 
  • branches/cleanup/components/bio-formats/src/loci/formats/tools/ImageConverter.java

    r5915 r5938  
    2828 
    2929import loci.common.Location; 
    30 import loci.common.dependency.DependencyException; 
    31 import loci.common.dependency.ServiceException; 
    32 import loci.common.dependency.ServiceFactory; 
     30import loci.common.services.DependencyException; 
     31import loci.common.services.ServiceException; 
     32import loci.common.services.ServiceFactory; 
    3333import loci.formats.ChannelFiller; 
    3434import loci.formats.ChannelMerger; 
     
    4545import loci.formats.meta.MetadataRetrieve; 
    4646import loci.formats.meta.MetadataStore; 
    47 import loci.formats.ome.OMEXMLService; 
    4847import loci.formats.out.TiffWriter; 
     48import loci.formats.services.OMEXMLService; 
    4949 
    5050import org.apache.log4j.ConsoleAppender; 
  • branches/cleanup/components/bio-formats/src/loci/formats/tools/ImageInfo.java

    r5915 r5938  
    3535import loci.common.Location; 
    3636import loci.common.RandomAccessInputStream; 
    37 import loci.common.dependency.DependencyException; 
    38 import loci.common.dependency.ServiceException; 
    39 import loci.common.dependency.ServiceFactory; 
     37import loci.common.services.DependencyException; 
     38import loci.common.services.ServiceException; 
     39import loci.common.services.ServiceFactory; 
    4040import loci.common.xml.XMLTools; 
    4141import loci.formats.ChannelFiller; 
     
    5959import loci.formats.meta.MetadataRetrieve; 
    6060import loci.formats.meta.MetadataStore; 
    61 import loci.formats.ome.OMEXMLService; 
     61import loci.formats.services.OMEXMLService; 
    6262 
    6363import org.apache.log4j.ConsoleAppender; 
  • branches/cleanup/components/bio-formats/test/loci/formats/utests/MissingMDBServiceTest.java

    r5929 r5938  
    2626import static org.testng.AssertJUnit.assertNotNull; 
    2727 
    28 import loci.common.dependency.DependencyException; 
    29 import loci.common.dependency.ServiceFactory; 
    30 import loci.formats.MDBService; 
     28import loci.common.services.DependencyException; 
     29import loci.common.services.ServiceFactory; 
     30import loci.formats.services.MDBService; 
    3131 
    3232import org.testng.annotations.BeforeMethod; 
  • branches/cleanup/components/bio-formats/test/loci/formats/utests/MissingNetCDFServiceTest.java

    r5926 r5938  
    2626import static org.testng.AssertJUnit.assertNotNull; 
    2727 
    28 import loci.common.dependency.DependencyException; 
    29 import loci.common.dependency.ServiceFactory; 
    30 import loci.formats.NetCDFService; 
     28import loci.common.services.DependencyException; 
     29import loci.common.services.ServiceFactory; 
     30import loci.formats.services.NetCDFService; 
    3131 
    3232import org.testng.annotations.BeforeMethod; 
  • branches/cleanup/components/bio-formats/test/loci/formats/utests/MissingOMEReaderWriterServiceTest.java

    r5935 r5938  
    2626import static org.testng.AssertJUnit.assertNotNull; 
    2727 
    28 import loci.common.dependency.DependencyException; 
    29 import loci.common.dependency.ServiceFactory; 
    30 import loci.formats.OMEReaderWriterService; 
     28import loci.common.services.DependencyException; 
     29import loci.common.services.ServiceFactory; 
     30import loci.formats.services.OMEReaderWriterService; 
    3131 
    3232import org.testng.annotations.BeforeMethod; 
  • branches/cleanup/components/bio-formats/test/loci/formats/utests/MissingOMEXMLServiceTest.java

    r5926 r5938  
    2626import static org.testng.AssertJUnit.assertNotNull; 
    2727 
    28 import loci.common.dependency.DependencyException; 
    29 import loci.common.dependency.ServiceFactory; 
    30 import loci.formats.ome.OMEXMLService; 
     28import loci.common.services.DependencyException; 
     29import loci.common.services.ServiceFactory; 
     30import loci.formats.services.OMEXMLService; 
    3131 
    3232import org.testng.annotations.BeforeMethod; 
  • branches/cleanup/components/bio-formats/test/loci/formats/utests/MissingPOIServiceTest.java

    r5926 r5938  
    2626import static org.testng.AssertJUnit.assertNotNull; 
    2727 
    28 import loci.common.dependency.DependencyException; 
    29 import loci.common.dependency.ServiceFactory; 
    30 import loci.formats.POIService; 
     28import loci.common.services.DependencyException; 
     29import loci.common.services.ServiceFactory; 
     30import loci.formats.services.POIService; 
    3131 
    3232import org.testng.annotations.BeforeMethod; 
  • branches/cleanup/components/bio-formats/test/loci/formats/utests/OMEXMLServiceTest.java

    r5898 r5938  
    2626import static org.testng.AssertJUnit.assertEquals; 
    2727 
    28 import loci.common.dependency.DependencyException; 
    29 import loci.common.dependency.ServiceFactory; 
    30 import loci.formats.ome.OMEXMLService; 
     28import loci.common.services.DependencyException; 
     29import loci.common.services.ServiceFactory; 
     30import loci.formats.services.OMEXMLService; 
    3131 
    3232import org.testng.annotations.BeforeMethod; 
  • branches/cleanup/components/bio-formats/test/loci/formats/utests/ServiceFactoryTest.java

    r5898 r5938  
    2424package loci.formats.utests; 
    2525 
    26 import loci.common.dependency.DependencyException; 
    27 import loci.common.dependency.ServiceFactory; 
    28 import loci.common.dependency.services.Service; 
     26import loci.common.services.DependencyException; 
     27import loci.common.services.Service; 
     28import loci.common.services.ServiceFactory; 
    2929 
    3030import org.testng.annotations.BeforeMethod; 
  • branches/cleanup/components/common/build.properties

    r5913 r5938  
    1818 
    1919component.resources-bin  = 
    20 component.resources-text = loci/common/dependency/services.properties 
     20component.resources-text = loci/common/services/services.properties 
    2121 
    2222component.main-class     = 
  • branches/cleanup/components/common/src/loci/common/services/AbstractService.java

    r5928 r5938  
    2222*/ 
    2323 
    24 package loci.common.dependency.services; 
     24package loci.common.services; 
    2525 
    2626 
  • branches/cleanup/components/common/src/loci/common/services/DependencyException.java

    r5926 r5938  
    2222*/ 
    2323 
    24 package loci.common.dependency; 
     24package loci.common.services; 
    2525 
    26 import loci.common.dependency.services.Service; 
    2726 
    2827/** 
     
    6867   * @param message Error message.  
    6968   * @param klass Failed instantiation class. 
    70    * @param exception Upstream exception. 
     69   * @param cause Upstream exception. 
    7170   */ 
    7271  public DependencyException(String message, Class<? extends Service> klass, 
    73       Exception exception) 
     72      Throwable cause) 
    7473  { 
    75     super(message, exception); 
     74    super(message, cause); 
    7675    this.failureClass = klass; 
    7776  } 
     
    7978  /** 
    8079   * Default constructor. 
    81    * @param exception Upstream exception. 
     80   * @param cause Upstream exception. 
    8281   */ 
    83   public DependencyException(Exception exception) 
     82  public DependencyException(Throwable cause) 
    8483  { 
    85     super(exception); 
     84    super(cause); 
    8685  } 
    8786 
  • branches/cleanup/components/common/src/loci/common/services/OMENotesService.java

    r5898 r5938  
    2222*/ 
    2323 
    24 package loci.common.dependency.services; 
     24package loci.common.services; 
    2525 
    2626 
  • branches/cleanup/components/common/src/loci/common/services/Service.java

    r5898 r5938  
    2222*/ 
    2323 
    24 package loci.common.dependency.services; 
     24package loci.common.services; 
    2525 
    2626/** 
  • branches/cleanup/components/common/src/loci/common/services/ServiceException.java

    r5916 r5938  
    2222*/ 
    2323 
    24 package loci.common.dependency; 
     24package loci.common.services; 
    2525 
    2626/** 
     
    5151   * Default constructor. 
    5252   * @param message Error message.  
    53    * @param exception Upstream exception. 
     53   * @param cause Upstream exception. 
    5454   */ 
    55   public ServiceException(String message, Exception exception) 
     55  public ServiceException(String message, Throwable cause) 
    5656  { 
    57     super(message, exception); 
     57    super(message, cause); 
    5858  } 
    5959 
    6060  /** 
    6161   * Default constructor. 
    62    * @param exception Upstream exception. 
     62   * @param cause Upstream exception. 
    6363   */ 
    64   public ServiceException(Exception exception) 
     64  public ServiceException(Throwable cause) 
    6565  { 
    66     super(exception); 
     66    super(cause); 
    6767  } 
    6868} 
  • branches/cleanup/components/common/src/loci/common/services/ServiceFactory.java

    r5926 r5938  
    2222*/ 
    2323 
    24 package loci.common.dependency; 
     24package loci.common.services; 
    2525 
    26 import java.io.IOException; 
    2726import java.io.InputStream; 
    2827import java.lang.reflect.Constructor; 
     
    3332import java.util.Map.Entry; 
    3433 
    35 import loci.common.dependency.services.Service; 
    3634 
    3735import org.slf4j.Logger; 
     
    4947 
    5048  /** Logger for this class. */ 
    51   protected static final Logger LOGGER = 
     49  private static final Logger LOGGER = 
    5250    LoggerFactory.getLogger(ServiceFactory.class); 
    5351 
     
    5654 
    5755  /** Constructor cache. */ 
    58   private Map<Class<? extends Service>, Constructor<? extends Service>>  
     56  private static Map<Class<? extends Service>, Constructor<? extends Service>>  
    5957    constructorCache =  
    6058      new HashMap<Class<? extends Service>, Constructor<? extends Service>>(); 
     
    6462    services = 
    6563      new HashMap<Class<? extends Service>, Class<? extends Service>>(); 
    66  
    67   /* 
    68   static { 
    69     services.put(IOMENotesService.class, OMENotesService.class); 
    70   } 
    71   */ 
    7264 
    7365  /** 
     
    8981    InputStream stream = this.getClass().getResourceAsStream(path); 
    9082    Properties properties = new Properties(); 
     83    if (stream == null) { 
     84      throw new DependencyException(path + " not found on CLASSPATH"); 
     85    } 
    9186    try { 
    9287      properties.load(stream); 
    9388      LOGGER.debug("Loaded properties from: {}", path); 
    94     } catch (IOException e) { 
    95       throw new DependencyException(e); 
     89    } catch (Throwable t) { 
     90      throw new DependencyException(t); 
    9691    } 
    9792    Set<Entry<Object, Object>> entries = properties.entrySet(); 
     
    105100          Class.forName((String) entry.getKey()); 
    106101      } 
    107       catch (ClassNotFoundException e) { 
    108         LOGGER.warn("CLASSPATH missing interface: {}", interfaceName); 
     102      catch (Throwable t) { 
     103        LOGGER.warn("CLASSPATH missing interface: {}", interfaceName, t); 
    109104        continue; 
    110105      } 
     
    113108          Class.forName((String) entry.getValue()); 
    114109      } 
    115       catch (ClassNotFoundException e) { 
     110      catch (Throwable t) { 
    116111        LOGGER.warn( 
    117112            "CLASSPATH missing implementation or implementation dependency: {}", 
    118             implementationName); 
    119       } 
    120       catch (NoClassDefFoundError e) { 
    121         LOGGER.warn( 
    122             "CLASSPATH missing implementation or implementation dependency: {}", 
    123             implementationName); 
     113            implementationName, t); 
    124114      } 
    125115      services.put(interfaceClass, implementationClass); 
     
    151141    try { 
    152142      return constructor.newInstance(); 
    153     } catch (Exception e) { 
    154       throw new DependencyException("Unable to instantiate service", type, e); 
     143    } catch (Throwable t) { 
     144      throw new DependencyException("Unable to instantiate service", type, t); 
    155145    } 
    156146  } 
     
    167157    throws DependencyException 
    168158  { 
    169     Constructor<? extends Service> constructor = 
    170       constructorCache.get(klass); 
    171     if (constructor == null) 
    172     { 
    173       try 
    174       { 
    175         Class<T> concreteClass = (Class<T>) Class.forName(klass.getName()); 
    176         constructor = concreteClass.getDeclaredConstructor(); 
    177         constructorCache.put(klass, constructor); 
     159    synchronized (constructorCache) { 
     160      Constructor<? extends Service> constructor = 
     161        constructorCache.get(klass); 
     162      if (constructor == null) { 
     163        try { 
     164          Class<T> concreteClass = (Class<T>) Class.forName(klass.getName()); 
     165          constructor = concreteClass.getDeclaredConstructor(); 
     166          constructorCache.put(klass, constructor); 
     167        } 
     168        catch (Throwable t) { 
     169          throw new DependencyException( 
     170              "Unable to retrieve constructor", klass, t); 
     171        } 
    178172      } 
    179       catch (Exception e) 
    180       { 
    181         String m = "Unable to retrieve constructor."; 
    182         throw new DependencyException(m, klass, e); 
    183       } 
     173      return (Constructor<T>) constructor; 
    184174    } 
    185     return (Constructor<T>) constructor; 
    186175  } 
    187176 
  • branches/cleanup/components/common/src/loci/common/services/services.properties

    r5935 r5938  
    44 
    55# OME notes service (implementation in legacy ome-notes component) 
    6 loci.common.dependency.services.OMENotesService=loci.ome.notes.OMENotesServiceImpl 
     6loci.common.services.OMENotesService=loci.ome.notes.services.OMENotesServiceImpl 
    77# OME-XML service (interface and implementation in bio-formats component) 
    8 loci.formats.ome.OMEXMLService=loci.formats.ome.OMEXMLServiceImpl 
     8loci.formats.services.OMEXMLService=loci.formats.services.OMEXMLServiceImpl 
    99# POI service (interface and implementation in bio-formats component) 
    10 loci.formats.POIService=loci.formats.POIServiceImpl 
     10loci.formats.services.POIService=loci.formats.services.POIServiceImpl 
    1111# NetCDF service (interface and implementation in bio-formats component) 
    12 loci.formats.NetCDFService=loci.formats.NetCDFServiceImpl 
     12loci.formats.services.NetCDFService=loci.formats.services.NetCDFServiceImpl 
    1313# MDB Tools service (interface and implementation in bio-formats component) 
    14 loci.formats.MDBService=loci.formats.MDBServiceImpl 
     14loci.formats.services.MDBService=loci.formats.services.MDBServiceImpl 
    1515# JAI Image I/O service (interface and implementation in bio-formats component) 
    16 loci.formats.codec.JAIIIOService=loci.formats.codec.JAIIIOServiceImpl 
     16loci.formats.services.JAIIIOService=loci.formats.services.JAIIIOServiceImpl 
    1717# OME and OMERO reader/writer service (interface in bio-formats component and 
    1818# implementation in ome-io component) 
    19 loci.formats.OMEReaderWriterService=loci.ome.io.OMEReaderWriterServiceImpl 
     19loci.formats.services.OMEReaderWriterService=loci.ome.io.services.OMEReaderWriterServiceImpl 
  • branches/cleanup/components/flow-cytometry/src/loci/apps/flow/FlowCytometry.java

    r5915 r5938  
    6666import javax.swing.JPanel; 
    6767 
    68 import loci.common.dependency.DependencyException; 
    69 import loci.common.dependency.ServiceException; 
    70 import loci.common.dependency.ServiceFactory; 
     68import loci.common.services.DependencyException; 
     69import loci.common.services.ServiceException; 
     70import loci.common.services.ServiceFactory; 
    7171import loci.formats.FormatException; 
    7272import loci.formats.ImageWriter; 
    7373import loci.formats.MetadataTools; 
    7474import loci.formats.ome.OMEXMLMetadata; 
    75 import loci.formats.ome.OMEXMLService; 
     75import loci.formats.services.OMEXMLService; 
    7676 
    7777import visad.DataReferenceImpl; 
  • branches/cleanup/components/legacy/ome-editor/src/loci/ome/editor/MetadataPane.java

    r5902 r5938  
    7272 
    7373import loci.common.ReflectedUniverse; 
    74 import loci.common.dependency.ServiceFactory; 
     74import loci.common.services.ServiceFactory; 
    7575import loci.formats.FormatException; 
    7676import loci.formats.ImageReader; 
     
    8383import loci.formats.ome.OMEXML2003FCMetadata; 
    8484import loci.formats.ome.OMEXMLMetadata; 
    85 import loci.formats.ome.OMEXMLService; 
     85import loci.formats.services.OMEXMLService; 
    8686import loci.formats.out.TiffWriter; 
    8787import loci.formats.tiff.IFD; 
  • branches/cleanup/components/legacy/ome-notes/src/loci/ome/notes/Notes.java

    r5915 r5938  
    6464 
    6565import loci.common.RandomAccessInputStream; 
    66 import loci.common.dependency.DependencyException; 
    67 import loci.common.dependency.ServiceException; 
    68 import loci.common.dependency.ServiceFactory; 
     66import loci.common.services.DependencyException; 
     67import loci.common.services.ServiceException; 
     68import loci.common.services.ServiceFactory; 
    6969import loci.formats.ImageReader; 
    7070import loci.formats.gui.BufferedImageReader; 
     
    7373import loci.formats.meta.MetadataRetrieve; 
    7474import loci.formats.meta.MetadataStore; 
    75 import loci.formats.ome.OMEXMLService; 
     75import loci.formats.services.OMEXMLService; 
    7676 
    7777import com.jgoodies.forms.layout.CellConstraints; 
  • branches/cleanup/components/legacy/ome-notes/src/loci/ome/notes/services/OMENotesServiceImpl.java

    r5926 r5938  
    2222*/ 
    2323 
    24 package loci.ome.notes; 
     24package loci.ome.notes.services; 
    2525 
    26 import loci.common.dependency.services.AbstractService; 
    27 import loci.common.dependency.services.OMENotesService; 
     26import loci.common.services.AbstractService; 
     27import loci.common.services.OMENotesService; 
     28import loci.ome.notes.Notes; 
    2829 
    2930/** 
     
    3233 * 
    3334 * <dl><dt><b>Source code:</b></dt> 
    34  * <dd><a href="https://skyking.microscopy.wisc.edu/trac/java/browser/trunk/components/legacy/ome-notes/src/loci/ome/notes/OMENotesServiceImpl.java">Trac</a>, 
    35  * <a href="https://skyking.microscopy.wisc.edu/svn/java/trunk/components/legacy/ome-notes/src/loci/ome/notes/OMENotesServiceImpl.java">SVN</a></dd></dl> 
     35 * <dd><a href="https://skyking.microscopy.wisc.edu/trac/java/browser/trunk/components/legacy/ome-notes/src/loci/ome/notes/services/OMENotesServiceImpl.java">Trac</a>, 
     36 * <a href="https://skyking.microscopy.wisc.edu/svn/java/trunk/components/legacy/ome-notes/src/loci/ome/notes/services/OMENotesServiceImpl.java">SVN</a></dd></dl> 
    3637 */ 
    3738public class OMENotesServiceImpl extends AbstractService 
  • branches/cleanup/components/loci-plugins/src/loci/plugins/exporter/Exporter.java

    r5915 r5938  
    5151 
    5252import loci.common.DataTools; 
    53 import loci.common.dependency.DependencyException; 
    54 import loci.common.dependency.ServiceException; 
    55 import loci.common.dependency.ServiceFactory; 
     53import loci.common.services.DependencyException; 
     54import loci.common.services.ServiceException; 
     55import loci.common.services.ServiceFactory; 
    5656import loci.formats.FormatException; 
    5757import loci.formats.FormatTools; 
     
    6363import loci.formats.gui.GUITools; 
    6464import loci.formats.meta.IMetadata; 
    65 import loci.formats.ome.OMEXMLService; 
     65import loci.formats.services.OMEXMLService; 
    6666import loci.plugins.LociExporter; 
    6767import loci.plugins.util.RecordedImageProcessor; 
  • branches/cleanup/components/loci-plugins/src/loci/plugins/importer/Importer.java

    r5937 r5938  
    5353import loci.common.ReflectException; 
    5454import loci.common.ReflectedUniverse; 
    55 import loci.common.dependency.DependencyException; 
    56 import loci.common.dependency.ServiceException; 
    57 import loci.common.dependency.ServiceFactory; 
     55import loci.common.services.DependencyException; 
     56import loci.common.services.ServiceException; 
     57import loci.common.services.ServiceFactory; 
    5858import loci.formats.ChannelMerger; 
    5959import loci.formats.FilePattern; 
     
    6363import loci.formats.gui.XMLWindow; 
    6464import loci.formats.meta.MetadataRetrieve; 
    65 import loci.formats.ome.OMEXMLService; 
     65import loci.formats.services.OMEXMLService; 
    6666import loci.plugins.Colorizer; 
    6767import loci.plugins.LociImporter; 
  • branches/cleanup/components/loci-plugins/src/loci/plugins/importer/ImporterOptions.java

    r5937 r5938  
    3434 
    3535import loci.common.Location; 
    36 import loci.common.dependency.DependencyException; 
    37 import loci.common.dependency.ServiceException; 
    38 import loci.common.dependency.ServiceFactory; 
     36import loci.common.services.DependencyException; 
     37import loci.common.services.ServiceException; 
     38import loci.common.services.ServiceFactory; 
    3939import loci.formats.ChannelSeparator; 
    4040import loci.formats.FilePattern; 
     
    4646import loci.formats.OMEReaderWriterService; 
    4747import loci.formats.meta.IMetadata; 
    48 import loci.formats.ome.OMEXMLService; 
     48import loci.formats.services.OMEXMLService; 
    4949import loci.plugins.prefs.OptionsDialog; 
    5050import loci.plugins.prefs.OptionsList; 
  • branches/cleanup/components/loci-plugins/src/loci/plugins/macro/LociFunctions.java

    r5915 r5938  
    3232import java.io.IOException; 
    3333 
    34 import loci.common.dependency.DependencyException; 
    35 import loci.common.dependency.ServiceException; 
    36 import loci.common.dependency.ServiceFactory; 
     34import loci.common.services.DependencyException; 
     35import loci.common.services.ServiceException; 
     36import loci.common.services.ServiceFactory; 
    3737import loci.formats.ChannelSeparator; 
    3838import loci.formats.FileStitcher; 
     
    4343import loci.formats.MetadataTools; 
    4444import loci.formats.meta.MetadataRetrieve; 
    45 import loci.formats.ome.OMEXMLService; 
     45import loci.formats.services.OMEXMLService; 
    4646import loci.plugins.util.ImagePlusReader; 
    4747import loci.plugins.util.ImagePlusTools; 
  • branches/cleanup/components/ome-io/src/loci/ome/io/OMEWriter.java

    r5915 r5938  
    3333import loci.common.ReflectException; 
    3434import loci.common.ReflectedUniverse; 
    35 import loci.common.dependency.DependencyException; 
    36 import loci.common.dependency.ServiceException; 
    37 import loci.common.dependency.ServiceFactory; 
     35import loci.common.services.DependencyException; 
     36import loci.common.services.ServiceException; 
     37import loci.common.services.ServiceFactory; 
    3838import loci.common.xml.XMLTools; 
    3939import loci.formats.FileStitcher; 
     
    4444import loci.formats.MetadataTools; 
    4545import loci.formats.meta.MetadataRetrieve; 
    46 import loci.formats.ome.OMEXMLService; 
     46import loci.formats.services.OMEXMLService; 
    4747 
    4848import org.apache.log4j.ConsoleAppender; 
  • branches/cleanup/components/ome-io/src/loci/ome/io/services/OMEReaderWriterServiceImpl.java

    r5935 r5938  
    2222*/ 
    2323 
    24 package loci.ome.io; 
     24package loci.ome.io.services; 
    2525 
    26 import loci.common.dependency.services.AbstractService; 
     26import loci.common.services.AbstractService; 
    2727import loci.formats.IFormatReader; 
    2828import loci.formats.IFormatWriter; 
    29 import loci.formats.OMEReaderWriterService; 
     29import loci.formats.services.OMEReaderWriterService; 
     30import loci.ome.io.OMEReader; 
     31import loci.ome.io.OMEWriter; 
     32import loci.ome.io.OmeroReader; 
    3033 
    3134/** 
  • branches/cleanup/components/ome-plugins/src/loci/plugins/ome/LociUploader.java

    r5915 r5938  
    4040 
    4141import loci.common.DataTools; 
    42 import loci.common.dependency.DependencyException; 
    43 import loci.common.dependency.ServiceException; 
    44 import loci.common.dependency.ServiceFactory; 
     42import loci.common.services.DependencyException; 
     43import loci.common.services.ServiceException; 
     44import loci.common.services.ServiceFactory; 
    4545import loci.formats.FormatTools; 
    4646import loci.formats.MetadataTools; 
    4747import loci.formats.meta.MetadataRetrieve; 
    4848import loci.formats.meta.MetadataStore; 
    49 import loci.formats.ome.OMEXMLService; 
     49import loci.formats.services.OMEXMLService; 
    5050import loci.ome.io.OMEWriter; 
    5151import loci.plugins.util.LibraryChecker; 
  • branches/cleanup/components/test-suite/src/loci/tests/EnumTest.java

    r5902 r5938  
    3333 
    3434import java.util.Vector; 
    35 import loci.common.dependency.DependencyException; 
     35import loci.common.services.DependencyException; 
    3636import loci.formats.enums.*; 
    3737 
  • branches/cleanup/components/test-suite/src/loci/tests/testng/FormatReaderTest.java

    r5915 r5938  
    4343import loci.common.DateTools; 
    4444import loci.common.Location; 
    45 import loci.common.dependency.DependencyException; 
    46 import loci.common.dependency.ServiceException; 
    47 import loci.common.dependency.ServiceFactory; 
     45import loci.common.services.DependencyException; 
     46import loci.common.services.ServiceException; 
     47import loci.common.services.ServiceFactory; 
    4848import loci.formats.FileStitcher; 
    4949import loci.formats.FormatTools; 
     
    5858import loci.formats.meta.MetadataRetrieve; 
    5959import loci.formats.meta.MetadataStore; 
    60 import loci.formats.ome.OMEXMLService; 
     60import loci.formats.services.OMEXMLService; 
    6161 
    6262import org.slf4j.Logger; 
  • branches/cleanup/components/test-suite/src/loci/tests/testng/FormatWriterTest.java

    r5902 r5938  
    3939 
    4040import loci.common.DataTools; 
    41 import loci.common.dependency.ServiceFactory; 
     41import loci.common.services.ServiceFactory; 
    4242import loci.formats.FormatException; 
    4343import loci.formats.IFormatWriter; 
     
    4646import loci.formats.meta.IMetadata; 
    4747import loci.formats.meta.MetadataRetrieve; 
    48 import loci.formats.ome.OMEXMLService; 
     48import loci.formats.services.OMEXMLService; 
    4949import loci.formats.out.JPEG2000Writer; 
    5050import loci.formats.out.JPEGWriter; 
  • branches/cleanup/components/visbio/src/loci/visbio/data/Dataset.java

    r5915 r5938  
    3737 
    3838import loci.common.Location; 
    39 import loci.common.dependency.DependencyException; 
    40 import loci.common.dependency.ServiceException; 
    41 import loci.common.dependency.ServiceFactory; 
     39import loci.common.services.DependencyException; 
     40import loci.common.services.ServiceException; 
     41import loci.common.services.ServiceFactory; 
    4242import loci.formats.ChannelSeparator; 
    4343import loci.formats.FilePattern; 
     
    5050import loci.formats.gui.GUITools; 
    5151import loci.formats.meta.MetadataStore; 
    52 import loci.formats.ome.OMEXMLService; 
     52import loci.formats.services.OMEXMLService; 
    5353import loci.visbio.StatusEvent; 
    5454import loci.visbio.StatusListener; 
  • branches/cleanup/components/visbio/src/loci/visbio/ome/ImageUploader.java

    r5902 r5938  
    2626import java.util.Vector; 
    2727 
    28 import loci.common.dependency.ServiceFactory; 
     28import loci.common.services.ServiceFactory; 
    2929import loci.formats.FormatTools; 
    3030import loci.formats.MetadataTools; 
     
    3232import loci.formats.meta.MetadataRetrieve; 
    3333import loci.formats.meta.MetadataStore; 
    34 import loci.formats.ome.OMEXMLService; 
     34import loci.formats.services.OMEXMLService; 
    3535import loci.ome.io.OMEWriter; 
    3636import loci.visbio.StatusEvent; 
Note: See TracChangeset for help on using the changeset viewer.