diff --git a/l2jserver2-common/src/main/java/com/l2jserver/service/configuration/Configuration.java b/l2jserver2-common/src/main/java/com/l2jserver/service/configuration/Configuration.java index 8b76bf42a..13c592814 100644 --- a/l2jserver2-common/src/main/java/com/l2jserver/service/configuration/Configuration.java +++ b/l2jserver2-common/src/main/java/com/l2jserver/service/configuration/Configuration.java @@ -22,17 +22,13 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -import com.l2jserver.service.configuration.ProxyConfigurationService.ConfigurationName; - /** * Configuration interface *

* Each service desiring to use the configuration system must extend the * interface and define methods for getters and setters. Each method must be * annotated either with {@link ConfigurationPropertyGetter} or - * {@link ConfigurationPropertySetter} - *

- * Each interface may optionally be annotated with {@link ConfigurationName}. + * {@link ConfigurationPropertySetter}. * * @author Rogiel */ diff --git a/l2jserver2-common/src/main/java/com/l2jserver/service/configuration/ProxyConfigurationService.java b/l2jserver2-common/src/main/java/com/l2jserver/service/configuration/ProxyConfigurationService.java deleted file mode 100644 index 4c4fe0122..000000000 --- a/l2jserver2-common/src/main/java/com/l2jserver/service/configuration/ProxyConfigurationService.java +++ /dev/null @@ -1,355 +0,0 @@ -/* - * This file is part of l2jserver2 . - * - * l2jserver2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * l2jserver2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with l2jserver2. If not, see . - */ -package com.l2jserver.service.configuration; - -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.lang.annotation.Annotation; -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; -import java.lang.reflect.InvocationHandler; -import java.lang.reflect.Method; -import java.lang.reflect.Proxy; -import java.util.Map; -import java.util.Properties; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.google.common.base.Preconditions; -import com.l2jserver.service.AbstractService; -import com.l2jserver.service.AbstractService.Depends; -import com.l2jserver.service.ServiceStartException; -import com.l2jserver.service.cache.CacheService; -import com.l2jserver.service.configuration.Configuration.ConfigurationPropertyGetter; -import com.l2jserver.service.configuration.Configuration.ConfigurationPropertySetter; -import com.l2jserver.service.core.LoggingService; -import com.l2jserver.util.factory.CollectionFactory; -import com.l2jserver.util.transformer.Transformer; -import com.l2jserver.util.transformer.TransformerFactory; - -/** - * Creates {@link Configuration} object through Java {@link Proxy}. Uses the - * annotations in the interface to retrieve and store values. - * - * @author Rogiel - */ -@Depends({ LoggingService.class, CacheService.class }) -public class ProxyConfigurationService extends AbstractService implements - ConfigurationService { - /** - * The directory in which configuration files are stored - */ - private final File directory = new File("./config/properties"); - /** - * The logger - */ - private final Logger log = LoggerFactory.getLogger(this.getClass()); - - /** - * The cache of configuration objects - */ - private Map, Object> cache = CollectionFactory.newWeakMap(); - - @Retention(RetentionPolicy.RUNTIME) - @Documented - @Target(value = ElementType.METHOD) - public @interface ConfigurationPropertyKey { - String value(); - } - - /** - * Each configuration can define the name of its configuration. This will be - * used by implementations to look for the configuration. - * - * @author Rogiel - * - */ - @Retention(RetentionPolicy.RUNTIME) - @Documented - @Target(value = ElementType.TYPE) - public @interface ConfigurationName { - /** - * @return the configuration name - */ - String value(); - } - - @Override - protected void doStart() throws ServiceStartException { - if (!directory.exists()) - if (!directory.mkdirs()) - throw new ServiceStartException("Failed to create directories"); - } - - @Override - @SuppressWarnings("unchecked") - public C get(Class config) { - Preconditions.checkNotNull(config, "config"); - - if (cache.containsKey(config)) - return (C) cache.get(config); - log.debug("Trying to create {} proxy", config); - Properties properties; - try { - properties = findProperties(config); - } catch (IOException e) { - properties = new Properties(); - log.warn( - "Configuration file for {} not found, falling back to default values", - config); - } - C proxy = (C) Proxy.newProxyInstance(this.getClass().getClassLoader(), - new Class[] { config }, new ConfigInvocationHandler( - properties)); - cache.put(config, proxy); - return proxy; - } - - /** - * The invocation handler for configuration interfaces - * - * @author Rogiel - */ - private class ConfigInvocationHandler implements InvocationHandler { - /** - * The invocation handler properties - */ - private final Properties properties; - /** - * The invocation cache - */ - private Map cache = CollectionFactory.newWeakMap(); - - /** - * @param properties - * the properties - */ - public ConfigInvocationHandler(Properties properties) { - this.properties = properties; - } - - @Override - public Object invoke(Object proxy, Method method, Object[] args) - throws Throwable { - log.debug("Configuration service, method invoked: {}", - method.getName()); - if (args == null || args.length == 0) { - final ConfigurationPropertyGetter getter = method - .getAnnotation(ConfigurationPropertyGetter.class); - final ConfigurationPropertyKey propertiesKey = method - .getAnnotation(ConfigurationPropertyKey.class); - if (getter == null) - return null; - if (propertiesKey == null) - return null; - return get(getter, propertiesKey, method.getReturnType()); - } else if (args.length == 1) { - final ConfigurationPropertySetter setter = method - .getAnnotation(ConfigurationPropertySetter.class); - final ConfigurationPropertyKey propertiesKey = method - .getAnnotation(ConfigurationPropertyKey.class); - if (setter == null) - return null; - if (propertiesKey == null) - return null; - set(propertiesKey, args[0], method.getParameterTypes()[0]); - } - return null; - } - - /** - * Get the untransformed value of an property - * - * @param getter - * the getter annotation - * @param propertiesKey - * if properties key annotation - * @param type - * the transformed type - * @return the untransformed property - */ - private Object get(ConfigurationPropertyGetter getter, - ConfigurationPropertyKey propertiesKey, Class type) { - if (cache.containsKey(propertiesKey.value())) - return cache.get(propertiesKey.value()); - Object o = untransform( - getRaw(propertiesKey.value(), getter.defaultValue()), type); - cache.put(propertiesKey.value(), o); - return o; - } - - /** - * Set the transformed value of an property - * - * @param setter - * the setter annotation - * @param value - * the untransformed value - * @param type - * the transformed type - */ - private void set(ConfigurationPropertyKey setter, Object value, - Class type) { - if (value != null) { - properties.setProperty(setter.value(), - transform(value.toString(), type)); - cache.remove(setter.value()); - } else { - properties.remove(setter.value()); - cache.remove(setter.value()); - } - } - - /** - * Untransforms an value - * - * @param value - * the raw value - * @param type - * the output type - * @return the untransformed value - */ - private Object untransform(String value, Class type) { - if (value == null) - return null; - if (type == String.class) - return value; - final Transformer transformer = TransformerFactory - .getTransfromer(type); - if (transformer == null) - return null; - return transformer.untransform(value); - } - - /** - * Transforms an value - * - * @param value - * the raw typed value - * @param type - * the input type - * @return the string representing value - */ - @SuppressWarnings({ "rawtypes", "unchecked" }) - private String transform(Object value, Class type) { - if (value == null) - return null; - if (value instanceof String) - return (String) value; - final Transformer transformer = TransformerFactory - .getTransfromer(type); - if (transformer == null) - return null; - return transformer.transform(value); - } - - /** - * Retrieve the raw value from the property file - * - * @param key - * the key - * @param defaultValue - * the default value - * @return the value found or default value - */ - private String getRaw(String key, String defaultValue) { - if (properties == null) - return defaultValue; - if (properties.containsKey(key)) { - return (String) properties.get(key); - } - return defaultValue; - } - } - - /** - * Tries to locate an .properties file - * - * @param clazz - * configuration interface class - * @return the found property - * @throws IOException - * if any i/o error occur - */ - private Properties findProperties(Class clazz) throws IOException { - Preconditions.checkNotNull(clazz, "clazz"); - - ConfigurationName config = findAnnotation(ConfigurationName.class, - clazz); - Properties prop; - if (config == null) { - for (final Class parent : clazz.getInterfaces()) { - prop = findProperties(parent); - if (prop != null) - return prop; - } - return null; - } - prop = new Properties(); - final File file = new File(directory, config.value() + ".properties"); - final InputStream in = new FileInputStream(file); - try { - prop.load(in); - } finally { - in.close(); - } - return prop; - } - - /** - * Tries to find an annotation in the class or any parent-class. - * - * @param - * the annotation type - * @param annotationClass - * the annotation class - * @param clazz - * the class to look for annotations - * @return the annotation found - */ - private T findAnnotation(Class annotationClass, - Class clazz) { - Preconditions.checkNotNull(annotationClass, "annotationClass"); - Preconditions.checkNotNull(clazz, "clazz"); - - T ann = clazz.getAnnotation(annotationClass); - if (ann != null) - return ann; - - for (Class clazz2 : annotationClass.getInterfaces()) { - if (clazz2 == clazz) - continue; - ann = findAnnotation(annotationClass, clazz2); - if (ann != null) - return ann; - } - return null; - } - - /** - * @return the configuration store directory - */ - public File getDirectory() { - return directory; - } -} diff --git a/l2jserver2-common/src/main/java/com/l2jserver/service/core/vfs/VFSService.java b/l2jserver2-common/src/main/java/com/l2jserver/service/core/vfs/VFSService.java index 96ac68573..80c6e29fe 100644 --- a/l2jserver2-common/src/main/java/com/l2jserver/service/core/vfs/VFSService.java +++ b/l2jserver2-common/src/main/java/com/l2jserver/service/core/vfs/VFSService.java @@ -22,8 +22,6 @@ import java.nio.file.Path; import com.l2jserver.service.Service; import com.l2jserver.service.ServiceConfiguration; import com.l2jserver.service.configuration.Configuration; -import com.l2jserver.service.configuration.ProxyConfigurationService.ConfigurationName; -import com.l2jserver.service.configuration.ProxyConfigurationService.ConfigurationPropertyKey; import com.l2jserver.service.configuration.XMLConfigurationService.ConfigurationXPath; /** @@ -39,13 +37,11 @@ public interface VFSService extends Service { * @author Rogiel * @see Configuration */ - @ConfigurationName("vfs") public interface VFSConfiguration extends ServiceConfiguration { /** * @return the VFS root {@link URI} */ @ConfigurationPropertyGetter(defaultValue = "") - @ConfigurationPropertyKey("vfs.root") @ConfigurationXPath("/configuration/services/vfs/root") Path getRoot(); @@ -54,7 +50,6 @@ public interface VFSService extends Service { * the new VFS root {@link URI} */ @ConfigurationPropertySetter - @ConfigurationPropertyKey("vfs.root") @ConfigurationXPath("/configuration/services/vfs/root") void setRoot(Path root); } diff --git a/l2jserver2-common/src/main/java/com/l2jserver/service/database/AbstractJDBCDatabaseService.java b/l2jserver2-common/src/main/java/com/l2jserver/service/database/AbstractJDBCDatabaseService.java index 04a059ec8..ce4335248 100644 --- a/l2jserver2-common/src/main/java/com/l2jserver/service/database/AbstractJDBCDatabaseService.java +++ b/l2jserver2-common/src/main/java/com/l2jserver/service/database/AbstractJDBCDatabaseService.java @@ -47,7 +47,6 @@ import com.l2jserver.service.ServiceStopException; import com.l2jserver.service.cache.Cache; import com.l2jserver.service.cache.CacheService; import com.l2jserver.service.configuration.ConfigurationService; -import com.l2jserver.service.configuration.ProxyConfigurationService.ConfigurationPropertyKey; import com.l2jserver.service.configuration.XMLConfigurationService.ConfigurationXPath; import com.l2jserver.service.core.threading.AbstractTask; import com.l2jserver.service.core.threading.AsyncFuture; @@ -146,7 +145,6 @@ public abstract class AbstractJDBCDatabaseService extends AbstractService * @return the jdbc url */ @ConfigurationPropertyGetter(defaultValue = "jdbc:mysql://localhost/l2jserver2") - @ConfigurationPropertyKey("jdbc.url") @ConfigurationXPath("/configuration/services/database/jdbc/url") String getJdbcUrl(); @@ -155,7 +153,6 @@ public abstract class AbstractJDBCDatabaseService extends AbstractService * the new jdbc url */ @ConfigurationPropertySetter - @ConfigurationPropertyKey("jdbc.url") @ConfigurationXPath("/configuration/services/database/jdbc/url") void setJdbcUrl(String jdbcUrl); @@ -163,7 +160,6 @@ public abstract class AbstractJDBCDatabaseService extends AbstractService * @return the jdbc driver class */ @ConfigurationPropertyGetter(defaultValue = "com.jdbc.jdbc.Driver") - @ConfigurationPropertyKey("jdbc.driver") @ConfigurationXPath("/configuration/services/database/jdbc/driver") String getDriver(); @@ -172,7 +168,6 @@ public abstract class AbstractJDBCDatabaseService extends AbstractService * the new jdbc driver */ @ConfigurationPropertySetter - @ConfigurationPropertyKey("jdbc.driver") @ConfigurationXPath("/configuration/services/database/jdbc/driver") void setDriver(Class driver); @@ -180,7 +175,6 @@ public abstract class AbstractJDBCDatabaseService extends AbstractService * @return the jdbc database username */ @ConfigurationPropertyGetter(defaultValue = "l2j") - @ConfigurationPropertyKey("jdbc.username") @ConfigurationXPath("/configuration/services/database/jdbc/username") String getUsername(); @@ -189,7 +183,6 @@ public abstract class AbstractJDBCDatabaseService extends AbstractService * the jdbc database username */ @ConfigurationPropertySetter - @ConfigurationPropertyKey("jdbc.username") @ConfigurationXPath("/configuration/services/database/jdbc/username") void setUsername(String username); @@ -197,7 +190,6 @@ public abstract class AbstractJDBCDatabaseService extends AbstractService * @return the jdbc database password */ @ConfigurationPropertyGetter(defaultValue = "changeme") - @ConfigurationPropertyKey("jdbc.password") @ConfigurationXPath("/configuration/services/database/jdbc/password") String getPassword(); @@ -206,7 +198,6 @@ public abstract class AbstractJDBCDatabaseService extends AbstractService * the jdbc database password */ @ConfigurationPropertySetter - @ConfigurationPropertyKey("jdbc.password") @ConfigurationXPath("/configuration/services/database/jdbc/password") void setPassword(String password); @@ -214,7 +205,6 @@ public abstract class AbstractJDBCDatabaseService extends AbstractService * @return the maximum number of active connections */ @ConfigurationPropertyGetter(defaultValue = "20") - @ConfigurationPropertyKey("jdbc.active.max") @ConfigurationXPath("/configuration/services/database/connections/active-maximum") int getMaxActiveConnections(); @@ -223,7 +213,6 @@ public abstract class AbstractJDBCDatabaseService extends AbstractService * the maximum number of active connections */ @ConfigurationPropertySetter - @ConfigurationPropertyKey("jdbc.active.max") @ConfigurationXPath("/configuration/services/database/connections/active-maximum") void setMaxActiveConnections(int password); @@ -231,7 +220,6 @@ public abstract class AbstractJDBCDatabaseService extends AbstractService * @return the maximum number of idle connections */ @ConfigurationPropertyGetter(defaultValue = "20") - @ConfigurationPropertyKey("jdbc.idle.max") @ConfigurationXPath("/configuration/services/database/connections/idle-maximum") int getMaxIdleConnections(); @@ -240,7 +228,6 @@ public abstract class AbstractJDBCDatabaseService extends AbstractService * the maximum number of idle connections */ @ConfigurationPropertySetter - @ConfigurationPropertyKey("jdbc.idle.max") @ConfigurationXPath("/configuration/services/database/connections/idle-maximum") void setMaxIdleConnections(int password); @@ -248,7 +235,6 @@ public abstract class AbstractJDBCDatabaseService extends AbstractService * @return the minimum number of idle connections */ @ConfigurationPropertyGetter(defaultValue = "5") - @ConfigurationPropertyKey("jdbc.idle.min") @ConfigurationXPath("/configuration/services/database/connections/idle-minimum") int getMinIdleConnections(); @@ -257,7 +243,6 @@ public abstract class AbstractJDBCDatabaseService extends AbstractService * the minimum number of idle connections */ @ConfigurationPropertySetter - @ConfigurationPropertyKey("jdbc.idle.min") @ConfigurationXPath("/configuration/services/database/connections/idle-minimum") void setMinIdleConnections(int password); } diff --git a/l2jserver2-common/src/main/java/com/l2jserver/service/database/AbstractOrientDatabaseService.java b/l2jserver2-common/src/main/java/com/l2jserver/service/database/AbstractOrientDatabaseService.java index 4a0f32fc3..be17dfc87 100644 --- a/l2jserver2-common/src/main/java/com/l2jserver/service/database/AbstractOrientDatabaseService.java +++ b/l2jserver2-common/src/main/java/com/l2jserver/service/database/AbstractOrientDatabaseService.java @@ -37,7 +37,6 @@ import com.l2jserver.service.ServiceStopException; import com.l2jserver.service.cache.Cache; import com.l2jserver.service.cache.CacheService; import com.l2jserver.service.configuration.ConfigurationService; -import com.l2jserver.service.configuration.ProxyConfigurationService.ConfigurationPropertyKey; import com.l2jserver.service.configuration.XMLConfigurationService.ConfigurationXPath; import com.l2jserver.service.core.threading.AbstractTask; import com.l2jserver.service.core.threading.AsyncFuture; @@ -119,7 +118,6 @@ public abstract class AbstractOrientDatabaseService extends AbstractService * @return the orientdb url */ @ConfigurationPropertyGetter(defaultValue = "file:data/database") - @ConfigurationPropertyKey("orientdb.url") @ConfigurationXPath("/configuration/services/database/orientdb/url") String getUrl(); @@ -128,7 +126,6 @@ public abstract class AbstractOrientDatabaseService extends AbstractService * the new orientdb url */ @ConfigurationPropertySetter - @ConfigurationPropertyKey("orientdb.url") @ConfigurationXPath("/configuration/services/database/orientdb/url") void setUrl(String url); @@ -136,7 +133,6 @@ public abstract class AbstractOrientDatabaseService extends AbstractService * @return the orientdb database username */ @ConfigurationPropertyGetter(defaultValue = "l2j") - @ConfigurationPropertyKey("orientdb.username") @ConfigurationXPath("/configuration/services/database/orientdb/username") String getUsername(); @@ -145,7 +141,6 @@ public abstract class AbstractOrientDatabaseService extends AbstractService * the orientdb database username */ @ConfigurationPropertySetter - @ConfigurationPropertyKey("orientdb.username") @ConfigurationXPath("/configuration/services/database/orientdb/username") void setUsername(String username); @@ -153,7 +148,6 @@ public abstract class AbstractOrientDatabaseService extends AbstractService * @return the orientdb database password */ @ConfigurationPropertyGetter(defaultValue = "changeme") - @ConfigurationPropertyKey("orientdb.password") @ConfigurationXPath("/configuration/services/database/orientdb/password") String getPassword(); @@ -162,7 +156,6 @@ public abstract class AbstractOrientDatabaseService extends AbstractService * the jdbc database password */ @ConfigurationPropertySetter - @ConfigurationPropertyKey("jdbc.password") @ConfigurationXPath("/configuration/services/database/jdbc/password") void setPassword(String password); } diff --git a/l2jserver2-common/src/main/java/com/l2jserver/service/database/DatabaseService.java b/l2jserver2-common/src/main/java/com/l2jserver/service/database/DatabaseService.java index 6efcd4008..4f77a19ef 100644 --- a/l2jserver2-common/src/main/java/com/l2jserver/service/database/DatabaseService.java +++ b/l2jserver2-common/src/main/java/com/l2jserver/service/database/DatabaseService.java @@ -19,7 +19,6 @@ package com.l2jserver.service.database; import com.l2jserver.service.Service; import com.l2jserver.service.ServiceConfiguration; import com.l2jserver.service.configuration.Configuration; -import com.l2jserver.service.configuration.ProxyConfigurationService.ConfigurationName; import com.l2jserver.service.core.threading.AsyncFuture; /** @@ -44,7 +43,6 @@ public interface DatabaseService extends Service { * @author Rogiel * @see Configuration */ - @ConfigurationName("database") public interface DatabaseConfiguration extends ServiceConfiguration { } diff --git a/l2jserver2-gameserver/config/properties/database.properties b/l2jserver2-gameserver/config/properties/database.properties deleted file mode 100644 index 84f8d02f1..000000000 --- a/l2jserver2-gameserver/config/properties/database.properties +++ /dev/null @@ -1,30 +0,0 @@ -# --------------------------------------------------------------------------- -# JDBCDatabaseService configuration -# --------------------------------------------------------------------------- -# Parameters in this file are used by JDBCDatabaseService. -# If you are not sure on the usage of any parameter, read the "Configuration" -# section in wiki article about "JDBCDatabaseService". -# https://github.com/l2jserver2/ -# --------------------------------------------------------------------------- -# NOTE: this is the development configuration file. Always remember to add -# new parameters to "dist/config" files too! -# --------------------------------------------------------------------------- - -# This defines the connection URL used by JDBC to connect to the database. -# Default: jdbc:mysql://localhost/l2jserver2 -jdbc.url = jdbc:mysql://localhost/l2jserver2 - -# The driver used to connect to the database. Please note that the driver -# library must be available in the JVM classpath. -# Default: com.mysql.jdbc.Driver in MySQL binary distribution or -# org.h2.Driver in H2 binary distribution -jdbc.driver = com.mysql.jdbc.Driver - -# The username used to login into the database. -# NOTE: Try not use "root" in production servers! -# Default: l2j -jdbc.username = l2j - -# The password used to login into the database. -# Default: changeme -jdbc.password = changeme \ No newline at end of file diff --git a/l2jserver2-gameserver/config/properties/template.properties b/l2jserver2-gameserver/config/properties/template.properties deleted file mode 100644 index e90d854b6..000000000 --- a/l2jserver2-gameserver/config/properties/template.properties +++ /dev/null @@ -1,16 +0,0 @@ -# --------------------------------------------------------------------------- -# XMLTemplateService configuration -# --------------------------------------------------------------------------- -# Parameters in this file are used by XMLTemplateService. -# If you are not sure on the usage of any parameter, read the "Configuration" -# section in wiki article about "XMLTemplateService". -# https://github.com/l2jserver2/ -# --------------------------------------------------------------------------- -# NOTE: this is the development configuration file. Always remember to add -# new parameters to "dist/config" files too! -# --------------------------------------------------------------------------- - -# The directory in which templates are located. All template files must be -# in .xml # file format. Must be relative to 'vfs.root' (vfs.properties) -# Default: data/templates -template.directory = data/templates \ No newline at end of file diff --git a/l2jserver2-gameserver/config/properties/vfs.properties b/l2jserver2-gameserver/config/properties/vfs.properties deleted file mode 100644 index 2512df5d6..000000000 --- a/l2jserver2-gameserver/config/properties/vfs.properties +++ /dev/null @@ -1,15 +0,0 @@ -# --------------------------------------------------------------------------- -# Java7VFSService configuration -# --------------------------------------------------------------------------- -# Parameters in this file are used by Java7VFSService. -# If you are not sure on the usage of any parameter, read the "Configuration" -# section in wiki article about "Java7VFSService". -# https://github.com/l2jserver2/ -# --------------------------------------------------------------------------- -# NOTE: this is the development configuration file. Always remember to add -# new parameters to "dist/config" files too! -# --------------------------------------------------------------------------- - -# The root of the VFS, any file placed in "/" will go to specified path. -# Defaul: (will inherit from terminal working directory, if any) -vfs.root = \ No newline at end of file diff --git a/l2jserver2-gameserver/distribution/global/config/properties/database.properties b/l2jserver2-gameserver/distribution/global/config/properties/database.properties deleted file mode 100644 index 232669a63..000000000 --- a/l2jserver2-gameserver/distribution/global/config/properties/database.properties +++ /dev/null @@ -1,27 +0,0 @@ -# --------------------------------------------------------------------------- -# JDBCDatabaseService configuration -# --------------------------------------------------------------------------- -# Parameters in this file are used by JDBCDatabaseService. -# If you are not sure on the usage of any parameter, read the "Configuration" -# section in wiki article about "JDBCDatabaseService". -# https://github.com/l2jserver2/ -# --------------------------------------------------------------------------- - -# This defines the connection URL used by JDBC to connect to the database. -# Default: jdbc:mysql://localhost/l2jserver2 -jdbc.url = jdbc:mysql://localhost/l2jserver2 - -# The driver used to connect to the database. Please note that the driver -# library must be available in the JVM classpath. -# Default: com.mysql.jdbc.Driver in MySQL binary distribution or -# org.h2.Driver in H2 binary distribution -jdbc.driver = com.mysql.jdbc.Driver - -# The username used to login into the database. -# NOTE: Try not use "root" in production servers! -# Default: -jdbc.username = l2j - -# The password used to login into the database. -# Default: -jdbc.password = changeme \ No newline at end of file diff --git a/l2jserver2-gameserver/distribution/global/config/properties/template.properties b/l2jserver2-gameserver/distribution/global/config/properties/template.properties deleted file mode 100644 index c1d5e0e48..000000000 --- a/l2jserver2-gameserver/distribution/global/config/properties/template.properties +++ /dev/null @@ -1,13 +0,0 @@ -# --------------------------------------------------------------------------- -# XMLTemplateService configuration -# --------------------------------------------------------------------------- -# Parameters in this file are used by XMLTemplateService. -# If you are not sure on the usage of any parameter, read the "Configuration" -# section in wiki article about "XMLTemplateService". -# https://github.com/l2jserver2/ -# --------------------------------------------------------------------------- - -# The directory in which templates are located. All template files must be -# in .xml # file format. Must be relative to 'vfs.root' (vfs.properties) -# Default: data/templates -template.directory = data/templates \ No newline at end of file diff --git a/l2jserver2-gameserver/distribution/global/config/properties/vfs.properties b/l2jserver2-gameserver/distribution/global/config/properties/vfs.properties deleted file mode 100644 index 7d96566d5..000000000 --- a/l2jserver2-gameserver/distribution/global/config/properties/vfs.properties +++ /dev/null @@ -1,12 +0,0 @@ -# --------------------------------------------------------------------------- -# Java7VFSService configuration -# --------------------------------------------------------------------------- -# Parameters in this file are used by Java7VFSService. -# If you are not sure on the usage of any parameter, read the "Configuration" -# section in wiki article about "Java7VFSService". -# https://github.com/l2jserver2/ -# --------------------------------------------------------------------------- - -# The root of the VFS, any file placed in "/" will go to specified path. -# Defaul: (will inherit from terminal working directory, if any) -vfs.root = \ No newline at end of file diff --git a/l2jserver2-gameserver/src/main/java/com/l2jserver/service/game/template/XMLTemplateService.java b/l2jserver2-gameserver/src/main/java/com/l2jserver/service/game/template/XMLTemplateService.java index 85c8d1e3b..b12b12dbe 100644 --- a/l2jserver2-gameserver/src/main/java/com/l2jserver/service/game/template/XMLTemplateService.java +++ b/l2jserver2-gameserver/src/main/java/com/l2jserver/service/game/template/XMLTemplateService.java @@ -55,8 +55,6 @@ import com.l2jserver.service.ServiceStopException; import com.l2jserver.service.cache.Cache; import com.l2jserver.service.cache.CacheService; import com.l2jserver.service.configuration.ConfigurationService; -import com.l2jserver.service.configuration.ProxyConfigurationService.ConfigurationName; -import com.l2jserver.service.configuration.ProxyConfigurationService.ConfigurationPropertyKey; import com.l2jserver.service.configuration.XMLConfigurationService.ConfigurationXPath; import com.l2jserver.service.core.LoggingService; import com.l2jserver.service.core.vfs.VFSService; @@ -140,14 +138,12 @@ public class XMLTemplateService extends AbstractService implements * * @author Rogiel */ - @ConfigurationName("template") public interface XMLTemplateServiceConfiguration extends TemplateServiceConfiguration { /** * @return the directory in which templates are stored */ @ConfigurationPropertyGetter(defaultValue = "data/template") - @ConfigurationPropertyKey("template.directory") @ConfigurationXPath("/configuration/services/template/directory") URI getTemplateDirectory(); @@ -156,7 +152,6 @@ public class XMLTemplateService extends AbstractService implements * the directory in which templates are stored */ @ConfigurationPropertySetter - @ConfigurationPropertyKey("template.directory") @ConfigurationXPath("/configuration/services/template/directory") void setTemplateDirectory(URI file); } diff --git a/l2jserver2-gameserver/src/main/java/com/l2jserver/service/network/NetworkService.java b/l2jserver2-gameserver/src/main/java/com/l2jserver/service/network/NetworkService.java index 4b27feaa9..d2db0ecc2 100644 --- a/l2jserver2-gameserver/src/main/java/com/l2jserver/service/network/NetworkService.java +++ b/l2jserver2-gameserver/src/main/java/com/l2jserver/service/network/NetworkService.java @@ -27,8 +27,6 @@ import com.l2jserver.model.world.L2Character; import com.l2jserver.service.Service; import com.l2jserver.service.ServiceConfiguration; import com.l2jserver.service.configuration.Configuration; -import com.l2jserver.service.configuration.ProxyConfigurationService.ConfigurationName; -import com.l2jserver.service.configuration.ProxyConfigurationService.ConfigurationPropertyKey; import com.l2jserver.service.configuration.XMLConfigurationService.ConfigurationXPath; /** @@ -73,7 +71,6 @@ public interface NetworkService extends Service { * * @author Rogiel */ - @ConfigurationName("network") public interface NetworkConfiguration extends ServiceConfiguration { /** * Get the server listen address @@ -81,7 +78,6 @@ public interface NetworkService extends Service { * @return the listen address */ @ConfigurationPropertyGetter(defaultValue = "0.0.0.0:7777") - @ConfigurationPropertyKey("network.listen") @ConfigurationXPath("/configuration/services/network/listen") InetSocketAddress getListenAddress(); @@ -92,7 +88,6 @@ public interface NetworkService extends Service { * the listen address */ @ConfigurationPropertySetter - @ConfigurationPropertyKey("network.listen") @ConfigurationXPath("/configuration/services/network/listen") void setListenAddress(InetSocketAddress addr); } diff --git a/l2jserver2-loginserver/src/main/java/com/l2jserver/service/ServiceModule.java b/l2jserver2-loginserver/src/main/java/com/l2jserver/service/ServiceModule.java index 381ab565b..fa3d4cf79 100644 --- a/l2jserver2-loginserver/src/main/java/com/l2jserver/service/ServiceModule.java +++ b/l2jserver2-loginserver/src/main/java/com/l2jserver/service/ServiceModule.java @@ -3,7 +3,7 @@ package com.l2jserver.service; import com.google.inject.AbstractModule; import com.google.inject.Scopes; import com.l2jserver.service.configuration.ConfigurationService; -import com.l2jserver.service.configuration.ProxyConfigurationService; +import com.l2jserver.service.configuration.XMLConfigurationService; import com.l2jserver.service.core.Log4JLoggingService; import com.l2jserver.service.core.LoggingService; import com.l2jserver.service.database.DatabaseService; @@ -15,7 +15,7 @@ public class ServiceModule extends AbstractModule { bind(ServiceManager.class).in(Scopes.SINGLETON); bind(LoggingService.class).to(Log4JLoggingService.class).in( Scopes.SINGLETON); - bind(ConfigurationService.class).to(ProxyConfigurationService.class) + bind(ConfigurationService.class).to(XMLConfigurationService.class) .in(Scopes.SINGLETON); bind(DatabaseService.class).to(LoginServerJDBCDatabaseService.class) .in(Scopes.SINGLETON); diff --git a/l2jserver2-loginserver/src/main/java/com/l2jserver/service/gameserver/GameServerNetworkService.java b/l2jserver2-loginserver/src/main/java/com/l2jserver/service/gameserver/GameServerNetworkService.java index a02b6ccd9..1c0c044a8 100644 --- a/l2jserver2-loginserver/src/main/java/com/l2jserver/service/gameserver/GameServerNetworkService.java +++ b/l2jserver2-loginserver/src/main/java/com/l2jserver/service/gameserver/GameServerNetworkService.java @@ -21,8 +21,6 @@ import java.net.InetSocketAddress; import com.l2jserver.service.Service; import com.l2jserver.service.ServiceConfiguration; import com.l2jserver.service.configuration.Configuration; -import com.l2jserver.service.configuration.ProxyConfigurationService.ConfigurationName; -import com.l2jserver.service.configuration.ProxyConfigurationService.ConfigurationPropertyKey; import com.l2jserver.service.configuration.XMLConfigurationService.ConfigurationXPath; /** @@ -36,7 +34,6 @@ public interface GameServerNetworkService extends Service { * * @author Rogiel */ - @ConfigurationName("network") public interface NetworkConfiguration extends ServiceConfiguration { /** * Get the server listen address @@ -44,7 +41,6 @@ public interface GameServerNetworkService extends Service { * @return the listen address */ @ConfigurationPropertyGetter(defaultValue = "0.0.0.0:2104") - @ConfigurationPropertyKey("network.listen") @ConfigurationXPath("/configuration/services/network/listen") InetSocketAddress getListenAddress(); @@ -55,7 +51,6 @@ public interface GameServerNetworkService extends Service { * the listen address */ @ConfigurationPropertySetter - @ConfigurationPropertyKey("network.listen") @ConfigurationXPath("/configuration/services/network/listen") void setListenAddress(InetSocketAddress addr); }