Some work on services
This commit is contained in:
parent
fc093b3ab8
commit
8532b681ca
14 changed files with 152 additions and 131 deletions
|
|
@ -1,6 +1,7 @@
|
|||
package wa.server.plugin.apache;
|
||||
|
||||
import wa.server.WAConstants;
|
||||
import wa.server.WAContext;
|
||||
import wa.server.plugin.WAConfigEntry;
|
||||
import wa.server.plugin.WAServiceConfig;
|
||||
import wa.server.util.ConfigFileUtil;
|
||||
|
|
@ -13,6 +14,7 @@ import zutil.ui.Configurator;
|
|||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.PrintStream;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -26,9 +28,8 @@ public class ApacheConfigVirtualHost implements WAServiceConfig{
|
|||
private List<ApacheVirtualHostEntry> vhosts = new ArrayList<>();
|
||||
|
||||
|
||||
public ApacheConfigVirtualHost() throws Exception {
|
||||
DBConnection db = WAConstants.getDB();
|
||||
vhosts = DBBean.load(db, ApacheVirtualHostEntry.class);
|
||||
public ApacheConfigVirtualHost() throws SQLException {
|
||||
vhosts = DBBean.load(WAContext.getDB(), ApacheVirtualHostEntry.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -25,13 +25,15 @@ package wa.server.plugin.apache;
|
|||
import wa.server.plugin.*;
|
||||
import zutil.log.LogUtil;
|
||||
|
||||
import java.sql.SQLException;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
/**
|
||||
* Created by Ziver on 2014-12-23.
|
||||
*/
|
||||
public class ApacheService implements WAService {
|
||||
private static Logger log = LogUtil.getLogger();
|
||||
private static Logger logger = LogUtil.getLogger();
|
||||
public static final String SERVICE_NAME = "Apache2";
|
||||
|
||||
private ApacheStatus status;
|
||||
|
|
@ -65,9 +67,13 @@ public class ApacheService implements WAService {
|
|||
@Override
|
||||
public WAServiceConfig[] getConfigurations() {
|
||||
if(config == null)
|
||||
config = new WAServiceConfig[]{
|
||||
//new ApacheConfigVirtualHost()
|
||||
};
|
||||
try {
|
||||
config = new WAServiceConfig[]{
|
||||
new ApacheConfigVirtualHost()
|
||||
};
|
||||
} catch (SQLException e) {
|
||||
logger.log(Level.SEVERE, null, e);
|
||||
}
|
||||
return config;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue