Skip to content

Commit

Permalink
Deprecate unused APIs for removal to clarify responsibility/intent
Browse files Browse the repository at this point in the history
  • Loading branch information
niloc132 committed Jul 10, 2023
1 parent 988bb49 commit 391f362
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -174,33 +174,48 @@ default Throwable sanitizeThrowable(Throwable e) {
/**
* Called before Application initialization, should setup sourcing from the controller (as required).
*/
void onApplicationInitializationBegin(Supplier<ScriptPathLoader> pathLoader,
ScriptPathLoaderState scriptLoaderState);
@Deprecated(forRemoval = true)
default void onApplicationInitializationBegin(Supplier<ScriptPathLoader> pathLoader,
ScriptPathLoaderState scriptLoaderState) {
throw new UnsupportedOperationException("setUseOriginalScriptLoaderState deprecated for removal");
}

/**
* Called after Application initialization.
*/
void onApplicationInitializationEnd();
@Deprecated(forRemoval = true)
default void onApplicationInitializationEnd() {
throw new UnsupportedOperationException("setUseOriginalScriptLoaderState deprecated for removal");
}

/**
* Sets the scriptPathLoader that is in use for this session.
*
* @param scriptPathLoader a supplier of a script path loader
* @param caching whether the source operation should cache results
*/
void setScriptPathLoader(Supplier<ScriptPathLoader> scriptPathLoader, boolean caching);
@Deprecated(forRemoval = true)
default void setScriptPathLoader(Supplier<ScriptPathLoader> scriptPathLoader, boolean caching) {
throw new UnsupportedOperationException("setUseOriginalScriptLoaderState deprecated for removal");
}

/**
* Removes the currently configured script path loader from this script.
*/
void clearScriptPathLoader();
@Deprecated(forRemoval = true)
default void clearScriptPathLoader() {
throw new UnsupportedOperationException("setUseOriginalScriptLoaderState deprecated for removal");
}

/**
* Informs the session whether or not we should be using the original ScriptLoaderState for source commands.
*
* @param useOriginal whether to use the script loader state at persistent query initialization
*/
boolean setUseOriginalScriptLoaderState(boolean useOriginal);
@Deprecated(forRemoval = true)
default boolean setUseOriginalScriptLoaderState(boolean useOriginal) {
throw new UnsupportedOperationException("setUseOriginalScriptLoaderState deprecated for removal");
}

/**
* Asks the session to remove any wrapping that exists on scoped objects so that clients can fetch them. Defaults to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
* This class represents uses of the source() and sourceOnce() method calls. It will use the underlying scriptPathLoader
* to get the script text to use.
*/
@Deprecated(forRemoval = true)
public class SourceClosure extends Closure<Object> {
private final ScriptPathLoader scriptPathLoader;
private final boolean sourceOnce;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import java.util.Collections;
import java.util.Set;

@Deprecated(forRemoval = true)
public class ClasspathScriptPathLoader implements ScriptPathLoader {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* This loader loads *only* using {@link GroovyDeephavenSession#findScript(String)}. Consistency locking and run methods
* are no-ops.
*/
@Deprecated(forRemoval = true)
public class ConsoleScriptPathLoader implements ScriptPathLoader {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
/**
* A {@link ScriptPathLoader} that will load paths from multiple underlying loaders.
*/
@Deprecated(forRemoval = true)
public class MultiScriptPathLoader<LOADER_TYPE extends ScriptPathLoader> implements ScriptPathLoader {

private final List<LOADER_TYPE> loaders;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
/**
* Maps from script language name to file extensions.
*/
@Deprecated(forRemoval = true)
public class ScriptExtensionsMap extends HashMap<String, List<String>> {
private ScriptExtensionsMap() {
put("Groovy", Collections.singletonList("groovy"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
/**
* An interface that defines a method of loading scripts from some source.
*/
@Deprecated(forRemoval = true)
public interface ScriptPathLoader {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
/**
* Tagging interface to be used to transmit {@link ScriptPathLoader} states.
*/
@Deprecated(forRemoval = true)
public interface ScriptPathLoaderState extends Serializable {
ScriptPathLoaderState NONE = null;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
/**
* An extension to the ScriptPathLoader that allows the state to be overridden.
*/
@Deprecated(forRemoval = true)
public interface StateOverrideScriptPathLoader extends ScriptPathLoader {
/**
* Sets a state that should be used for loading operations instead of the state the loader was created with.
Expand Down

0 comments on commit 391f362

Please sign in to comment.