Skip to content

Commit

Permalink
Deprecate unused CacheService
Browse files Browse the repository at this point in the history
  • Loading branch information
dominikl committed Sep 11, 2019
1 parent 9220153 commit 7a2546c
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
35 changes: 35 additions & 0 deletions src/main/java/omero/gateway/Gateway.java
Expand Up @@ -199,7 +199,11 @@ public Gateway(Logger log) {
* A {@link Logger}
* @param cacheService
* A {@link CacheService}, can be <code>null</code>
*
* @deprecated This constructor will be removed in future. Please
* use {@link #Gateway(Logger) instead}
*/
@Deprecated
public Gateway(Logger log, CacheService cacheService) {
this(log, cacheService, null, true);
}
Expand All @@ -220,7 +224,11 @@ public Gateway(Logger log, CacheService cacheService) {
* disconnect (only taken into account if an
* {@link ExecutorService} was provided; the default cached
* thread pool will be shut down by default)
*
* @deprecated This constructor will be removed in future. Please
* use {@link #Gateway(Logger, ExecutorService, boolean) instead}
*/
@Deprecated
public Gateway(Logger log, CacheService cacheService,
ExecutorService executorService,
boolean executorShutdownOnDisconnect) {
Expand All @@ -232,6 +240,30 @@ public Gateway(Logger log, CacheService cacheService,
: executorShutdownOnDisconnect;
}

/**
* Creates a new Gateway instance
*
* @param log
* A {@link Logger}
* @param executorService
* A {@link ExecutorService} for handling asynchronous tasks, can
* be <code>null</code> (in which case the Java built-in cached
* thread pool will be used)
* @param executorShutdownOnDisconnect
* Flag to indicate that executor threads should be shutdown on
* disconnect (only taken into account if an
* {@link ExecutorService} was provided; the default cached
* thread pool will be shut down by default)
*/
public Gateway(Logger log, ExecutorService executorService,
boolean executorShutdownOnDisconnect) {
this.log = log;
this.executorService = executorService == null ? Executors
.newCachedThreadPool() : executorService;
this.executorShutdownOnDisconnect = executorService == null ? true
: executorShutdownOnDisconnect;
}

/**
* Submits an async task
*
Expand Down Expand Up @@ -573,7 +605,10 @@ public Logger getLogger() {
* Provides access to the {@link CacheService}
*
* @return See above
*
* @deprecated This method will be removed in future.
*/
@Deprecated
public CacheService getCacheService() {
return cacheService;
}
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/omero/gateway/cache/CacheService.java
Expand Up @@ -29,7 +29,10 @@
* @author Donald MacDonald &nbsp;&nbsp;&nbsp;&nbsp;
* <a href="mailto:donald@lifesci.dundee.ac.uk">donald@lifesci.dundee.ac.uk</a>
* @version 3.0
*
* @deprecated This interface is not used and will be removed in future.
*/
@Deprecated
public interface CacheService
{

Expand Down

0 comments on commit 7a2546c

Please sign in to comment.