Skip to content

Commit

Permalink
Rename classes that inherit CoreService
Browse files Browse the repository at this point in the history
  • Loading branch information
topframe committed Sep 16, 2019
1 parent c0f42c8 commit dff12ac
Show file tree
Hide file tree
Showing 14 changed files with 112 additions and 106 deletions.
6 changes: 3 additions & 3 deletions daemon/src/main/java/com/aspectran/daemon/AbstractDaemon.java
Expand Up @@ -25,8 +25,8 @@
import com.aspectran.daemon.command.builtins.QuitCommand;
import com.aspectran.daemon.command.polling.CommandPoller;
import com.aspectran.daemon.command.polling.FileCommandPoller;
import com.aspectran.daemon.service.AspectranDaemonService;
import com.aspectran.daemon.service.DaemonService;
import com.aspectran.daemon.service.DefaultDaemonService;

import java.io.File;

Expand All @@ -41,7 +41,7 @@ public class AbstractDaemon implements Daemon {

private String name;

private AspectranDaemonService service;
private DefaultDaemonService service;

private CommandPoller commandPoller;

Expand Down Expand Up @@ -105,7 +105,7 @@ protected void init(String basePath, File aspectranConfigFile) throws Exception

protected void init(AspectranConfig aspectranConfig) throws Exception {
try {
this.service = AspectranDaemonService.create(aspectranConfig);
this.service = DefaultDaemonService.create(aspectranConfig);
this.service.start();
} catch (Exception e) {
throw new Exception("Failed to initialize daemon", e);
Expand Down
Expand Up @@ -15,9 +15,9 @@
*/
package com.aspectran.daemon.adapter;

import com.aspectran.core.component.session.SessionAgent;
import com.aspectran.core.adapter.BasicSessionAdapter;
import com.aspectran.core.adapter.SessionAdapter;
import com.aspectran.core.component.session.SessionAgent;

/**
* Adapt {@link SessionAgent} to Core {@link SessionAdapter}.
Expand Down
Expand Up @@ -26,7 +26,7 @@
import com.aspectran.daemon.adapter.DaemonSessionAdapter;

/**
* The Class AspectranDaemonService.
* The Class DefaultDaemonService.
*
* @since 5.1.0
*/
Expand Down
20 changes: 10 additions & 10 deletions ...aemon/service/AspectranDaemonService.java → .../daemon/service/DefaultDaemonService.java 100755 → 100644
Expand Up @@ -35,17 +35,17 @@
import static com.aspectran.core.context.config.AspectranConfig.DEFAULT_APP_CONFIG_ROOT_FILE;

/**
* The Class AspectranDaemonService.
* The Class DefaultDaemonService.
*
* @since 5.1.0
*/
public class AspectranDaemonService extends AbstractDaemonService {
public class DefaultDaemonService extends AbstractDaemonService {

private static final Log log = LogFactory.getLog(AspectranDaemonService.class);
private static final Log log = LogFactory.getLog(DefaultDaemonService.class);

private volatile long pauseTimeout = -1L;

public AspectranDaemonService() {
public DefaultDaemonService() {
super();
}

Expand Down Expand Up @@ -108,12 +108,12 @@ public Translet translate(String name, MethodType method, ParameterMap parameter
}

/**
* Returns a new instance of {@code AspectranDaemonService}.
* Returns a new instance of {@code DefaultDaemonService}.
*
* @param aspectranConfig the parameters for aspectran configuration
* @return the instance of {@code AspectranDaemonService}
* @return the instance of {@code DefaultDaemonService}
*/
public static AspectranDaemonService create(AspectranConfig aspectranConfig) {
public static DefaultDaemonService create(AspectranConfig aspectranConfig) {
ContextConfig contextConfig = aspectranConfig.touchContextConfig();
String rootFile = contextConfig.getRootFile();
if (!StringUtils.hasText(rootFile)) {
Expand All @@ -122,7 +122,7 @@ public static AspectranDaemonService create(AspectranConfig aspectranConfig) {
}
}

AspectranDaemonService service = new AspectranDaemonService();
DefaultDaemonService service = new DefaultDaemonService();
service.prepare(aspectranConfig);
DaemonConfig daemonConfig = aspectranConfig.getDaemonConfig();
if (daemonConfig != null) {
Expand All @@ -132,7 +132,7 @@ public static AspectranDaemonService create(AspectranConfig aspectranConfig) {
return service;
}

private static void applyDaemonConfig(AspectranDaemonService service, DaemonConfig daemonConfig) {
private static void applyDaemonConfig(DefaultDaemonService service, DaemonConfig daemonConfig) {
ExposalsConfig exposalsConfig = daemonConfig.getExposalsConfig();
if (exposalsConfig != null) {
String[] includePatterns = exposalsConfig.getIncludePatterns();
Expand All @@ -141,7 +141,7 @@ private static void applyDaemonConfig(AspectranDaemonService service, DaemonConf
}
}

private static void setServiceStateListener(final AspectranDaemonService service) {
private static void setServiceStateListener(final DefaultDaemonService service) {
service.setServiceStateListener(new ServiceStateListener() {
@Override
public void started() {
Expand Down
Expand Up @@ -29,7 +29,7 @@
import com.aspectran.shell.command.option.ParsedOptions;
import com.aspectran.shell.console.Console;
import com.aspectran.shell.console.ConsoleWrapper;
import com.aspectran.shell.service.AspectranShellService;
import com.aspectran.shell.service.DefaultShellService;
import com.aspectran.shell.service.ShellService;

import java.io.File;
Expand All @@ -51,7 +51,7 @@ public class ShellCommandInterpreter implements CommandInterpreter {

private ShellCommandRegistry commandRegistry;

private AspectranShellService service;
private DefaultShellService service;

private PrintStream originalSystemOut;

Expand Down Expand Up @@ -98,7 +98,7 @@ public void init(@Nullable String basePath, File aspectranConfigFile) throws Exc
}

if (aspectranConfig.hasContextConfig()) {
service = AspectranShellService.create(aspectranConfig, console);
service = DefaultShellService.create(aspectranConfig, console);
service.start();
} else {
String greetings = shellConfig.getGreetings();
Expand Down
Expand Up @@ -44,15 +44,15 @@
*
* @since 2016. 1. 18.
*/
public class AspectranShellService extends AbstractShellService {
public class DefaultShellService extends AbstractShellService {

private static final Log log = LogFactory.getLog(AspectranShellService.class);
private static final Log log = LogFactory.getLog(DefaultShellService.class);

private static final String DEFAULT_APP_CONFIG_ROOT_FILE = "/config/app-config.xml";

private long pauseTimeout = -1L;

private AspectranShellService(Console console) {
private DefaultShellService(Console console) {
super(console);
}

Expand Down Expand Up @@ -150,20 +150,20 @@ private boolean checkPaused(Console console) {
}

/**
* Returns a new instance of {@code AspectranShellService}.
* Returns a new instance of {@code DefaultShellService}.
*
* @param aspectranConfig the aspectran configuration
* @param console the {@code Console} instance
* @return the instance of {@code AspectranShellService}
* @return the instance of {@code DefaultShellService}
*/
public static AspectranShellService create(AspectranConfig aspectranConfig, Console console) {
public static DefaultShellService create(AspectranConfig aspectranConfig, Console console) {
ContextConfig contextConfig = aspectranConfig.touchContextConfig();
String rootFile = contextConfig.getRootFile();
if (!StringUtils.hasText(rootFile) && !contextConfig.hasAspectranParameters()) {
contextConfig.setRootFile(DEFAULT_APP_CONFIG_ROOT_FILE);
}

AspectranShellService service = new AspectranShellService(console);
DefaultShellService service = new DefaultShellService(console);
ShellConfig shellConfig = aspectranConfig.getShellConfig();
if (shellConfig != null) {
applyShellConfig(service, shellConfig);
Expand All @@ -173,7 +173,7 @@ public static AspectranShellService create(AspectranConfig aspectranConfig, Cons
return service;
}

private static void applyShellConfig(AspectranShellService service, ShellConfig shellConfig) {
private static void applyShellConfig(DefaultShellService service, ShellConfig shellConfig) {
service.setVerbose(shellConfig.isVerbose());
service.setGreetings(shellConfig.getGreetings());
ExposalsConfig exposalsConfig = shellConfig.getExposalsConfig();
Expand All @@ -184,7 +184,7 @@ private static void applyShellConfig(AspectranShellService service, ShellConfig
}
}

private static void setServiceStateListener(final AspectranShellService service) {
private static void setServiceStateListener(final DefaultShellService service) {
service.setServiceStateListener(new ServiceStateListener() {
@Override
public void started() {
Expand Down

0 comments on commit dff12ac

Please sign in to comment.