mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-11 16:05:44 +01:00
repository client should be closeable
This commit is contained in:
@@ -33,17 +33,24 @@ package sonia.scm.repository.client.api;
|
||||
|
||||
//~--- non-JDK imports --------------------------------------------------------
|
||||
|
||||
import com.google.common.io.Closeables;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import sonia.scm.repository.client.spi.RepositoryClientProvider;
|
||||
|
||||
//~--- JDK imports ------------------------------------------------------------
|
||||
|
||||
import java.io.Closeable;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Sebastian Sdorra
|
||||
* @since 1.18
|
||||
*/
|
||||
public final class RepositoryClient
|
||||
public final class RepositoryClient implements Closeable
|
||||
{
|
||||
|
||||
/**
|
||||
@@ -66,6 +73,23 @@ public final class RepositoryClient
|
||||
this.clientProvider = clientProvider;
|
||||
}
|
||||
|
||||
//~--- methods --------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*/
|
||||
@Override
|
||||
public void close()
|
||||
{
|
||||
if (logger.isTraceEnabled())
|
||||
{
|
||||
logger.trace("close client provider");
|
||||
}
|
||||
|
||||
Closeables.closeQuietly(clientProvider);
|
||||
}
|
||||
|
||||
//~--- get methods ----------------------------------------------------------
|
||||
|
||||
/**
|
||||
|
||||
@@ -38,6 +38,9 @@ import sonia.scm.repository.client.api.ClientCommandNotSupportedException;
|
||||
|
||||
//~--- JDK imports ------------------------------------------------------------
|
||||
|
||||
import java.io.Closeable;
|
||||
import java.io.IOException;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
@@ -45,7 +48,7 @@ import java.util.Set;
|
||||
* @author Sebastian Sdorra
|
||||
* @since 1.18
|
||||
*/
|
||||
public abstract class RepositoryClientProvider
|
||||
public abstract class RepositoryClientProvider implements Closeable
|
||||
{
|
||||
|
||||
/**
|
||||
@@ -56,6 +59,19 @@ public abstract class RepositoryClientProvider
|
||||
*/
|
||||
public abstract Set<ClientCommand> getSupportedClientCommands();
|
||||
|
||||
//~--- methods --------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @throws IOException
|
||||
*/
|
||||
@Override
|
||||
public void close() throws IOException {}
|
||||
|
||||
//~--- get methods ----------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user