• Views
  • Iteration Report
  • My Iteration Report
  •  
OMERO.server
  • Login
  • Help/Guide
  • About Trac
  • Preferences
  • Wiki
  • Timeline
  • Roadmap
  • Browse Source
  • View Tickets
  • Search

Context Navigation

  • ← Previous Changeset
  • Next Changeset →

Changeset 1067

Show
Ignore:
Timestamp:
11/06/06 19:18:00 (2 years ago)
Author:
callan
Message:

Should now have #457 squashed finally. *ahem*

Location:
trunk/components
Files:
1 added
1 removed
5 modified
1 moved

  • client/resources/ome/client/spring.xml (modified) (2 diffs)
  • common/src/ome/api/ThumbnailStore.java (moved) (moved from trunk/components/common/src/ome/api/IThumb.java) (13 diffs)
  • common/src/ome/system/ServiceFactory.java (modified) (3 diffs)
  • server/resources/ome/services/service-ome.api.IThumb.xml (modified) (1 diff)
  • server/src/ome/logic/AWTScaleService.java (modified) (2 diffs)
  • server/src/ome/logic/ThumbImpl.java (deleted)
  • server/src/ome/services/RawFileBean.java (modified) (1 diff)
  • server/src/ome/services/ThumbnailBean.java (added)

Legend:

Unmodified
Added
Removed
  • trunk/components/client/resources/ome/client/spring.xml

    r1049 r1067  
    146146    <property name="proxyInterface" value="ome.api.ITypes"/> 
    147147  </bean> 
    148    
    149   <bean id="managed:ome.api.IThumb" parent="statelessJndi"> 
    150     <property name="jndiName" value="omero/remote/ome.api.IThumb"/> 
    151     <property name="proxyInterface" value="ome.api.IThumb"/> 
    152   </bean> 
    153148 
    154149  <bean id="managed:ome.api.IUpdate" parent="statelessJndi"> 
    … …  
    175170    <property name="proxyInterface" value="omeis.providers.re.RenderingEngine"/> 
    176171  </bean> 
    177              
     172 
     173  <bean id="managed:ome.api.ThumbnailStore" parent="statefulJndi"> 
     174    <property name="jndiName" value="omero/remote/ome.api.ThumbnailStore"/> 
     175    <property name="proxyInterface" value="ome.api.ThumbnailStore"/> 
     176  </bean> 
    178177</beans> 
  • trunk/components/common/src/ome/api/ThumbnailStore.java

    r1049 r1067  
    11package ome.api; 
    2  
    3 import ome.model.core.Pixels; 
    4 import ome.model.display.RenderingDef; 
    52 
    63/**  
    … …  
    85 * retrieve thumbnails using the on-disk cache (provided by <i>ROMIO</i>) or 
    96 * on the fly. 
     7 * <p> 
     8 * NOTE: The calling order for the service is as follows: 
     9 * <ol> 
     10 *   <li>setPixelsId()</li> 
     11 *   <li>setRenderingDefId()</li> 
     12 *   <li>any of the thumbnail accessor methods</li> 
     13 * </ol> 
     14 * </p> 
    1015 *  
    1116 * @author  Chris Allan &nbsp;&nbsp;&nbsp;&nbsp; 
    … …  
    1722 * @since 3.0 
    1823 */ 
    19 public interface IThumb extends ServiceInterface 
     24public interface ThumbnailStore extends StatefulServiceInterface 
    2025{ 
     26    /** 
     27     * This method manages the state of the service; it must be invoked before 
     28     * using any other methods. 
     29     * @param pixelsId an {@link ome.model.core.Pixels} id. 
     30     * @throws ApiUsageException if no pixels object exists with the ID 
     31     * <i>pixelsId</i>. 
     32     */ 
     33    public void setPixelsId(long pixelsId); 
     34     
     35    /** 
     36     * This method manages the state of the service; it should be invoked 
     37     * directly after {@link setPixelsId}. If it is not invoked with a valid 
     38     * rendering definition ID before using the thumbnail accessor methods 
     39     * execution continues as if <i>renderingDefId</i> were set to 
     40     * <code>null</code>. 
     41     * @param renderingDefId an {@link ome.model.display.RenderingDef} id.  
     42     * <code>null</code> specifies the user's currently active rendering 
     43     * settings to be used. 
     44     * @throws ApiUsageException if no rendering definition exists with the ID 
     45     * <i>renderingDefId</i>. 
     46     */ 
     47    public void setRenderingDefId(Long renderingDefId); 
     48     
    2149        /** 
    2250         * Retrieves the a thumbnail for a pixels set using a given set of rendering 
    … …  
    2553         * #getThumbDirect()}. 
    2654         *  
    27          * @param pixels the pixels set. 
    2855         * @param sizeX the X-axis width of the thumbnail. <code>null</code> 
    2956         * specifies the default size of 48. 
    3057         * @param sizeY the Y-axis width of the thumbnail. <code>null</code> 
    3158         * specifies the default size of 48. 
    32          * @param def the rendering settings. <code>null</code> specifies the user's 
    33          * currently active rendering settings to be used. 
    3459         * @throws ApiUsageException if: 
    3560         * <ul> 
    … …  
    3863         *   <li><i>sizeY</i> > pixels.sizeY</li> 
    3964         *   <li><i>sizeY</i> is negative</li> 
     65         *   <li>{@link setPixelsId()} has not yet been called</li> 
    4066         * </ul> 
    4167         * @return a JPEG thumbnail byte buffer. 
    4268         * @see getThumbnailDirect() 
    4369         */ 
    44         public byte[] getThumbnail(Pixels pixels, RenderingDef def, 
    45                                    Integer sizeX, Integer sizeY); 
     70        public byte[] getThumbnail(Integer sizeX, Integer sizeY); 
    4671         
    4772        /** 
    … …  
    5378         * of the original image. 
    5479         *  
    55          * @param pixels the pixels set. 
    5680         * @param size the size of the longest side of the thumbnail requested. 
    5781         * <code>null</code> specifies the default size of 48. 
    58          * @param def the rendering settings. <code>null</code> specifies the user's 
    59          * currently active rendering settings to be used. 
    6082         * @throws ApiUsageException if: 
    6183         * <ul> 
    6284         *   <li><i>size</i> > pixels.sizeX and pixels.sizeY</li> 
     85         *   <li>{@link setPixelsId()} has not yet been called</li> 
    6386         * </ul> 
    6487         * @return a JPEG thumbnail byte buffer. 
    6588         * @see getThumbnail() 
    6689         */ 
    67         public byte[] getThumbnailByLongestSide(Pixels pixels, RenderingDef def, 
    68                                                 Integer size); 
    69          
     90        public byte[] getThumbnailByLongestSide(Integer size); 
    7091         
    7192        /** 
    … …  
    7495         * ignoring the on-disk cache. 
    7596         *  
    76          * @param pixels the pixels set. 
    7797         * @param sizeX the X-axis width of the thumbnail. <code>null</code> 
    7898         * specifies the default size of 48. 
    7999         * @param sizeY the Y-axis width of the thumbnail. <code>null</code> 
    80100         * specifies the default size of 48. 
    81          * @param def the rendering settings. <code>null</code> specifies the user's 
    82          * currently active rendering settings to be used. 
    83101         * @throws ApiUsageException if: 
    84102         * <ul> 
    … …  
    87105         *   <li><i>sizeY</i> > pixels.sizeY</li> 
    88106         *   <li><i>sizeY</i> is negative</li> 
     107         *   <li>{@link setPixelsId()} has not yet been called</li> 
    89108         * </ul> 
    90109         * @return a JPEG thumbnail byte buffer. 
    91110         * @see getThumbnail() 
    92111         */ 
    93         public byte[] getThumbnailDirect(Pixels pixels, RenderingDef def, 
    94                                      Integer sizeX, Integer sizeY); 
     112        public byte[] getThumbnailDirect(Integer sizeX, Integer sizeY); 
    95113         
    96114        /** 
    … …  
    101119         * of the original image. 
    102120         *  
    103          * @param pixels the pixels set. 
    104121         * @param size the size of the longest side of the thumbnail requested. 
    105122         * <code>null</code> specifies the default size of 48. 
    106          * @param def the rendering settings. <code>null</code> specifies the user's 
    107          * currently active rendering settings to be used. 
    108123         * @throws ApiUsageException if: 
    109124         * <ul> 
    110125         *   <li><i>size</i> > pixels.sizeX and pixels.sizeY</li> 
     126         *   <li>{@link setPixelsId()} has not yet been called</li> 
    111127         * </ul> 
    112128         * @return a JPEG thumbnail byte buffer. 
    113129         * @see getThumbnailDirect() 
    114130         */ 
    115         public byte[] getThumbnailByLongestSideDirect(Pixels pixels, 
    116                                                       RenderingDef def, 
    117                                                   Integer size); 
     131        public byte[] getThumbnailByLongestSideDirect(Integer size); 
    118132         
    119133        /** 
    … …  
    121135         * settings (RenderingDef) in the on-disk cache. 
    122136         *  
    123          * @param pixels the pixels set. 
    124137         * @param sizeX the X-axis width of the thumbnail. <code>null</code> 
    125138         * specifies the default size of 48. 
    126139         * @param sizeY the Y-axis width of the thumbnail. <code>null</code> 
    127140         * specifies the default size of 48. 
    128          * @param def the rendering settings. <code>null</code> specifies the user's 
    129          * currently active rendering settings to be used. 
    130141         * @throws ApiUsageException if: 
    131142         * <ul> 
    … …  
    134145         *   <li><i>sizeY</i> > pixels.sizeY</li> 
    135146         *   <li><i>sizeY</i> is negative</li> 
     147         *   <li>{@link setPixelsId()} has not yet been called</li> 
    136148         * </ul> 
    137149         * @see getThumb() 
    138150         * @see getThumbDirect() 
    139151         */ 
    140         public void createThumbnail(Pixels pixels, RenderingDef def, 
    141                                 Integer sizeX, Integer sizeY); 
     152        public void createThumbnail(Integer sizeX, Integer sizeY); 
    142153         
    143154        /** 
    … …  
    146157         * combination already cached. 
    147158         *  
    148          * @param pixels the pixels set. 
    149          * @param def the rendering settings. <code>null</code> specifies the user's 
    150          * currently active rendering settings to be used. 
    151159         * @see getThumb() 
    152160         * @see getThumbDirect() 
    153161         */ 
    154         public void createThumbnails(Pixels pixels, RenderingDef def); 
     162        public void createThumbnails(); 
    155163         
    156164        /** 
    157165         * Checks if a thumbnail of a particular size exists for a pixels set. 
    158166         *  
    159          * @param pixels the pixels set. 
    160167         * @param sizeX the X-axis width of the thumbnail. <code>null</code> 
    161168         * specifies use the default size of 48. 
    … …  
    166173         *   <li><i>sizeX</i> is negative</li> 
    167174         *   <li><i>sizeY</i> is negative</li> 
     175         *   <li>{@link setPixelsId()} has not yet been called</li> 
    168176         * </ul> 
    169177         * @see getThumb() 
    170178         * @see getThumbDirect() 
    171179         */ 
    172         public boolean thumbnailExists(Pixels pixels, Integer sizeX, Integer sizeY); 
     180        public boolean thumbnailExists(Integer sizeX, Integer sizeY); 
    173181} 
  • trunk/components/common/src/ome/system/ServiceFactory.java

    r1049 r1067  
    4242import ome.api.IPojos; 
    4343import ome.api.IQuery; 
    44 import ome.api.IThumb; 
     44import ome.api.ThumbnailStore; 
    4545import ome.api.ITypes; 
    4646import ome.api.IUpdate; 
    … …  
    215215    } 
    216216     
    217     public IThumb getThumbnailService(){ 
    218         return getServiceByClass(IThumb.class); 
    219     } 
    220      
    221217    // ~ Stateful services 
    222218    // ========================================================================= 
    … …  
    242238    public RenderingEngine createRenderingEngine(){ 
    243239        return getServiceByClass(RenderingEngine.class); 
     240    } 
     241     
     242    /** create a new {@link ThumbnailStore} proxy. This proxy will have to be 
     243     * initialized using {@link ThumbnailStore#setPixelsId(long)} 
     244     */ 
     245    public ThumbnailStore createThumbnailService(){ 
     246        return getServiceByClass(ThumbnailStore.class); 
    244247    } 
    245248     
  • trunk/components/server/resources/ome/services/service-ome.api.IThumb.xml

    r1024 r1067  
    3636<beans>  
    3737 
    38   <bean parent="level2" id="internal:ome.api.IThumb" class="ome.logic.ThumbImpl"> 
     38  <bean singleton="false" parent="level2" 
     39                id="internal:ome.api.ThumbnailStore" 
     40        class="ome.services.ThumbnailBean"> 
    3941    <property name="ioService" ref="/OME/OMEIS/Thumbs"/> 
    40     <property name="renderingEngine" ref="internal:omeis.providers.re.RenderingEngine"/> 
     42    <property name="renderingEngine" 
     43        ref="internal:omeis.providers.re.RenderingEngine"/> 
    4144    <property name="scaleService" ref="internal:ome.api.IScale"/> 
    4245  </bean> 
    4346   
    44   <bean id="managed:ome.api.IThumb" parent="managedService"> 
    45     <property name="proxyInterfaces" value="ome.api.IThumb"/> 
    46     <property name="target" ref="internal:ome.api.IThumb"/> 
     47  <bean id="managed:ome.api.ThumbnailStore" parent="managedStatefulService"> 
     48    <property name="proxyInterfaces" value="ome.api.ThumbnailStore"/> 
     49    <property name="target" ref="internal:ome.api.ThumbnailStore"/> 
    4750  </bean> 
    4851 
  • trunk/components/server/src/ome/logic/AWTScaleService.java

    r966 r1067  
    4343//Application-internal dependencies 
    4444import ome.api.IScale; 
     45import ome.services.ThumbnailBean; 
    4546 
    4647/**  
    … …  
    5960{ 
    6061        /** The logger for this class. */ 
    61         private static Log log = LogFactory.getLog(ThumbImpl.class); 
     62        private static Log log = LogFactory.getLog(ThumbnailBean.class); 
    6263         
    6364    /* (non-Javadoc) 
  • trunk/components/server/src/ome/services/RawFileBean.java

    r1060 r1067  
    8181@Remote(RawFileStore.class) 
    8282@RemoteBinding(jndiBinding="omero/remote/ome.api.RawFileStore") 
    83 @Local(RenderingEngine.class) 
     83@Local(RawFileStore.class) 
    8484@LocalBinding (jndiBinding="omero/local/ome.api.RawFileStore") 
    8585@SecurityDomain("OmeroSecurity") 

Download in other formats:

  • Unified Diff
  • Zip Archive

Trac Powered

Powered by Trac 0.11
By Edgewall Software.

Visit the Trac open source project at
http://trac.edgewall.org/