Skip to content

Commit

Permalink
refactor RunModesProvider service
Browse files Browse the repository at this point in the history
  • Loading branch information
dprzybyl committed Oct 17, 2024
1 parent e2f48c9 commit 4cdb723
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
*/
package com.cognifide.apm.api.scripts;

import com.cognifide.apm.api.services.RunModesProvider;
import com.cognifide.apm.core.services.RunModesProvider;
import java.util.Arrays;
import java.util.Optional;
import org.apache.commons.lang3.StringUtils;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@

import com.cognifide.apm.api.scripts.LaunchEnvironment;
import com.cognifide.apm.api.scripts.Script;
import com.cognifide.apm.api.services.RunModesProvider;
import com.cognifide.apm.api.services.ScriptFinder;
import com.cognifide.apm.api.services.ScriptManager;
import com.cognifide.apm.core.Property;
import com.cognifide.apm.core.services.ModifiedScriptFinder;
import com.cognifide.apm.core.services.ResourceResolverProvider;
import com.cognifide.apm.core.services.RunModesProvider;
import com.cognifide.apm.core.utils.sling.SlingHelper;
import java.util.ArrayList;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import com.cognifide.apm.api.scripts.LaunchEnvironment;
import com.cognifide.apm.api.scripts.LaunchMode;
import com.cognifide.apm.api.scripts.Script;
import com.cognifide.apm.api.services.RunModesProvider;
import com.cognifide.apm.core.services.RunModesProvider;
import java.util.Date;
import java.util.Set;
import java.util.function.Predicate;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,27 @@
* limitations under the License.
* =========================LICENSE_END==================================
*/
package com.cognifide.apm.runmodes.services;
package com.cognifide.apm.core.services;

import com.cognifide.apm.api.services.RunModesProvider;
import com.cognifide.apm.core.Property;
import java.util.Set;
import org.apache.sling.settings.SlingSettingsService;
import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Reference;

@Component
public class RunModesProviderService implements RunModesProvider {
@Component(
service = RunModesProvider.class,
property = {
Property.DESCRIPTION + "APM Service for providing run modes",
Property.VENDOR
}
)
public class RunModesProvider {

@Reference
private SlingSettingsService slingSettings;

@Override
public Set<String> getRunModes() {
return slingSettings.getRunModes();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@

import com.cognifide.apm.api.scripts.LaunchMode;
import com.cognifide.apm.api.scripts.Script;
import com.cognifide.apm.api.services.RunModesProvider;
import com.cognifide.apm.api.services.ScriptFinder;
import com.cognifide.apm.api.services.ScriptManager;
import com.cognifide.apm.core.Apm;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@
import com.cognifide.apm.api.scripts.Script;
import com.cognifide.apm.api.services.ExecutionMode;
import com.cognifide.apm.api.services.ExecutionResult;
import com.cognifide.apm.api.services.RunModesProvider;
import com.cognifide.apm.api.services.ScriptFinder;
import com.cognifide.apm.api.services.ScriptManager;
import com.cognifide.apm.api.status.Status;
import com.cognifide.apm.core.services.ModifiedScriptFinder;
import com.cognifide.apm.core.services.ResourceResolverProvider;
import com.cognifide.apm.core.services.RunModesProvider;
import com.cognifide.apm.core.services.event.ApmEvent;
import com.cognifide.apm.core.services.event.EventManager;
import com.cognifide.apm.core.utils.sling.SlingHelper;
Expand Down

0 comments on commit 4cdb723

Please sign in to comment.