mirror of
https://github.com/Rogiel/l2jserver2
synced 2025-12-05 23:22:47 +00:00
Service and transformer improvements
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -12,4 +12,3 @@ target/
|
||||
|
||||
# Find bugs configuration file
|
||||
/.fbprefs
|
||||
/l2jserver2-site
|
||||
|
||||
@@ -91,7 +91,7 @@ public abstract class AbstractService implements Service {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends Service>[] getDependencies() {
|
||||
public final Class<? extends Service>[] getDependencies() {
|
||||
final Depends deps = this.getClass().getAnnotation(Depends.class);
|
||||
if (deps == null)
|
||||
return null;
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
*/
|
||||
package com.l2jserver.service.configuration;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
@@ -45,6 +46,7 @@ public interface Configuration {
|
||||
*/
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(value = ElementType.METHOD)
|
||||
@Documented
|
||||
public @interface ConfigurationPropertyGetter {
|
||||
/**
|
||||
* @return the default value to be used
|
||||
@@ -61,6 +63,7 @@ public interface Configuration {
|
||||
*/
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(value = ElementType.METHOD)
|
||||
@Documented
|
||||
public @interface ConfigurationPropertySetter {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ public class ProxyConfigurationService extends AbstractService implements
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
@Target(value = ElementType.METHOD)
|
||||
public @interface ConfigurationPropertiesKey {
|
||||
public @interface ConfigurationPropertyKey {
|
||||
String value();
|
||||
}
|
||||
|
||||
@@ -156,8 +156,8 @@ public class ProxyConfigurationService extends AbstractService implements
|
||||
if (args == null || args.length == 0) {
|
||||
final ConfigurationPropertyGetter getter = method
|
||||
.getAnnotation(ConfigurationPropertyGetter.class);
|
||||
final ConfigurationPropertiesKey propertiesKey = method
|
||||
.getAnnotation(ConfigurationPropertiesKey.class);
|
||||
final ConfigurationPropertyKey propertiesKey = method
|
||||
.getAnnotation(ConfigurationPropertyKey.class);
|
||||
if (getter == null)
|
||||
return null;
|
||||
if (propertiesKey == null)
|
||||
@@ -166,8 +166,8 @@ public class ProxyConfigurationService extends AbstractService implements
|
||||
} else if (args.length == 1) {
|
||||
final ConfigurationPropertySetter setter = method
|
||||
.getAnnotation(ConfigurationPropertySetter.class);
|
||||
final ConfigurationPropertiesKey propertiesKey = method
|
||||
.getAnnotation(ConfigurationPropertiesKey.class);
|
||||
final ConfigurationPropertyKey propertiesKey = method
|
||||
.getAnnotation(ConfigurationPropertyKey.class);
|
||||
if (setter == null)
|
||||
return null;
|
||||
if (propertiesKey == null)
|
||||
@@ -189,7 +189,7 @@ public class ProxyConfigurationService extends AbstractService implements
|
||||
* @return the untransformed property
|
||||
*/
|
||||
private Object get(ConfigurationPropertyGetter getter,
|
||||
ConfigurationPropertiesKey propertiesKey, Class<?> type) {
|
||||
ConfigurationPropertyKey propertiesKey, Class<?> type) {
|
||||
if (cache.containsKey(propertiesKey.value()))
|
||||
return cache.get(propertiesKey.value());
|
||||
Object o = untransform(
|
||||
@@ -208,7 +208,7 @@ public class ProxyConfigurationService extends AbstractService implements
|
||||
* @param type
|
||||
* the transformed type
|
||||
*/
|
||||
private void set(ConfigurationPropertiesKey setter, Object value,
|
||||
private void set(ConfigurationPropertyKey setter, Object value,
|
||||
Class<?> type) {
|
||||
if (value != null) {
|
||||
properties.setProperty(setter.value(),
|
||||
|
||||
@@ -23,7 +23,7 @@ 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.ConfigurationPropertiesKey;
|
||||
import com.l2jserver.service.configuration.ProxyConfigurationService.ConfigurationPropertyKey;
|
||||
import com.l2jserver.service.configuration.XMLConfigurationService.ConfigurationXPath;
|
||||
|
||||
/**
|
||||
@@ -45,7 +45,7 @@ public interface VFSService extends Service {
|
||||
* @return the VFS root {@link URI}
|
||||
*/
|
||||
@ConfigurationPropertyGetter(defaultValue = "")
|
||||
@ConfigurationPropertiesKey("vfs.root")
|
||||
@ConfigurationPropertyKey("vfs.root")
|
||||
@ConfigurationXPath("/configuration/services/vfs/root")
|
||||
Path getRoot();
|
||||
|
||||
@@ -54,7 +54,7 @@ public interface VFSService extends Service {
|
||||
* the new VFS root {@link URI}
|
||||
*/
|
||||
@ConfigurationPropertySetter
|
||||
@ConfigurationPropertiesKey("vfs.root")
|
||||
@ConfigurationPropertyKey("vfs.root")
|
||||
@ConfigurationXPath("/configuration/services/vfs/root")
|
||||
void setRoot(Path root);
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ 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.ConfigurationPropertiesKey;
|
||||
import com.l2jserver.service.configuration.ProxyConfigurationService.ConfigurationPropertyKey;
|
||||
import com.l2jserver.service.configuration.XMLConfigurationService.ConfigurationXPath;
|
||||
import com.l2jserver.service.core.threading.ScheduledAsyncFuture;
|
||||
import com.l2jserver.service.core.threading.ThreadService;
|
||||
@@ -139,7 +139,7 @@ public abstract class AbstractJDBCDatabaseService extends AbstractService
|
||||
* @return the jdbc url
|
||||
*/
|
||||
@ConfigurationPropertyGetter(defaultValue = "jdbc:mysql://localhost/l2jserver2")
|
||||
@ConfigurationPropertiesKey("jdbc.url")
|
||||
@ConfigurationPropertyKey("jdbc.url")
|
||||
@ConfigurationXPath("/configuration/services/database/jdbc/url")
|
||||
String getJdbcUrl();
|
||||
|
||||
@@ -148,7 +148,7 @@ public abstract class AbstractJDBCDatabaseService extends AbstractService
|
||||
* the new jdbc url
|
||||
*/
|
||||
@ConfigurationPropertySetter
|
||||
@ConfigurationPropertiesKey("jdbc.url")
|
||||
@ConfigurationPropertyKey("jdbc.url")
|
||||
@ConfigurationXPath("/configuration/services/database/jdbc/url")
|
||||
void setJdbcUrl(String jdbcUrl);
|
||||
|
||||
@@ -156,7 +156,7 @@ public abstract class AbstractJDBCDatabaseService extends AbstractService
|
||||
* @return the jdbc driver class
|
||||
*/
|
||||
@ConfigurationPropertyGetter(defaultValue = "com.jdbc.jdbc.Driver")
|
||||
@ConfigurationPropertiesKey("jdbc.driver")
|
||||
@ConfigurationPropertyKey("jdbc.driver")
|
||||
@ConfigurationXPath("/configuration/services/database/jdbc/driver")
|
||||
String getDriver();
|
||||
|
||||
@@ -165,7 +165,7 @@ public abstract class AbstractJDBCDatabaseService extends AbstractService
|
||||
* the new jdbc driver
|
||||
*/
|
||||
@ConfigurationPropertySetter
|
||||
@ConfigurationPropertiesKey("jdbc.driver")
|
||||
@ConfigurationPropertyKey("jdbc.driver")
|
||||
@ConfigurationXPath("/configuration/services/database/jdbc/driver")
|
||||
void setDriver(Class<?> driver);
|
||||
|
||||
@@ -173,7 +173,7 @@ public abstract class AbstractJDBCDatabaseService extends AbstractService
|
||||
* @return the jdbc database username
|
||||
*/
|
||||
@ConfigurationPropertyGetter(defaultValue = "l2j")
|
||||
@ConfigurationPropertiesKey("jdbc.username")
|
||||
@ConfigurationPropertyKey("jdbc.username")
|
||||
@ConfigurationXPath("/configuration/services/database/jdbc/username")
|
||||
String getUsername();
|
||||
|
||||
@@ -182,7 +182,7 @@ public abstract class AbstractJDBCDatabaseService extends AbstractService
|
||||
* the jdbc database username
|
||||
*/
|
||||
@ConfigurationPropertySetter
|
||||
@ConfigurationPropertiesKey("jdbc.username")
|
||||
@ConfigurationPropertyKey("jdbc.username")
|
||||
@ConfigurationXPath("/configuration/services/database/jdbc/username")
|
||||
void setUsername(String username);
|
||||
|
||||
@@ -190,7 +190,7 @@ public abstract class AbstractJDBCDatabaseService extends AbstractService
|
||||
* @return the jdbc database password
|
||||
*/
|
||||
@ConfigurationPropertyGetter(defaultValue = "changeme")
|
||||
@ConfigurationPropertiesKey("jdbc.password")
|
||||
@ConfigurationPropertyKey("jdbc.password")
|
||||
@ConfigurationXPath("/configuration/services/database/jdbc/password")
|
||||
String getPassword();
|
||||
|
||||
@@ -199,7 +199,7 @@ public abstract class AbstractJDBCDatabaseService extends AbstractService
|
||||
* the jdbc database password
|
||||
*/
|
||||
@ConfigurationPropertySetter
|
||||
@ConfigurationPropertiesKey("jdbc.password")
|
||||
@ConfigurationPropertyKey("jdbc.password")
|
||||
@ConfigurationXPath("/configuration/services/database/jdbc/password")
|
||||
void setPassword(String password);
|
||||
|
||||
@@ -207,7 +207,7 @@ public abstract class AbstractJDBCDatabaseService extends AbstractService
|
||||
* @return the maximum number of active connections
|
||||
*/
|
||||
@ConfigurationPropertyGetter(defaultValue = "20")
|
||||
@ConfigurationPropertiesKey("jdbc.active.max")
|
||||
@ConfigurationPropertyKey("jdbc.active.max")
|
||||
@ConfigurationXPath("/configuration/services/database/connections/active-maximum")
|
||||
int getMaxActiveConnections();
|
||||
|
||||
@@ -216,7 +216,7 @@ public abstract class AbstractJDBCDatabaseService extends AbstractService
|
||||
* the maximum number of active connections
|
||||
*/
|
||||
@ConfigurationPropertySetter
|
||||
@ConfigurationPropertiesKey("jdbc.active.max")
|
||||
@ConfigurationPropertyKey("jdbc.active.max")
|
||||
@ConfigurationXPath("/configuration/services/database/connections/active-maximum")
|
||||
void setMaxActiveConnections(int password);
|
||||
|
||||
@@ -224,7 +224,7 @@ public abstract class AbstractJDBCDatabaseService extends AbstractService
|
||||
* @return the maximum number of idle connections
|
||||
*/
|
||||
@ConfigurationPropertyGetter(defaultValue = "20")
|
||||
@ConfigurationPropertiesKey("jdbc.idle.max")
|
||||
@ConfigurationPropertyKey("jdbc.idle.max")
|
||||
@ConfigurationXPath("/configuration/services/database/connections/idle-maximum")
|
||||
int getMaxIdleConnections();
|
||||
|
||||
@@ -233,7 +233,7 @@ public abstract class AbstractJDBCDatabaseService extends AbstractService
|
||||
* the maximum number of idle connections
|
||||
*/
|
||||
@ConfigurationPropertySetter
|
||||
@ConfigurationPropertiesKey("jdbc.idle.max")
|
||||
@ConfigurationPropertyKey("jdbc.idle.max")
|
||||
@ConfigurationXPath("/configuration/services/database/connections/idle-maximum")
|
||||
void setMaxIdleConnections(int password);
|
||||
|
||||
@@ -241,7 +241,7 @@ public abstract class AbstractJDBCDatabaseService extends AbstractService
|
||||
* @return the minimum number of idle connections
|
||||
*/
|
||||
@ConfigurationPropertyGetter(defaultValue = "5")
|
||||
@ConfigurationPropertiesKey("jdbc.idle.min")
|
||||
@ConfigurationPropertyKey("jdbc.idle.min")
|
||||
@ConfigurationXPath("/configuration/services/database/connections/idle-minimum")
|
||||
int getMinIdleConnections();
|
||||
|
||||
@@ -250,7 +250,7 @@ public abstract class AbstractJDBCDatabaseService extends AbstractService
|
||||
* the minimum number of idle connections
|
||||
*/
|
||||
@ConfigurationPropertySetter
|
||||
@ConfigurationPropertiesKey("jdbc.idle.min")
|
||||
@ConfigurationPropertyKey("jdbc.idle.min")
|
||||
@ConfigurationXPath("/configuration/services/database/connections/idle-minimum")
|
||||
void setMinIdleConnections(int password);
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ 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.ConfigurationPropertiesKey;
|
||||
import com.l2jserver.service.configuration.ProxyConfigurationService.ConfigurationPropertyKey;
|
||||
import com.l2jserver.service.configuration.XMLConfigurationService.ConfigurationXPath;
|
||||
import com.l2jserver.service.core.threading.ScheduledAsyncFuture;
|
||||
import com.l2jserver.service.core.threading.ThreadService;
|
||||
@@ -117,7 +117,7 @@ public abstract class AbstractOrientDatabaseService extends AbstractService
|
||||
* @return the orientdb url
|
||||
*/
|
||||
@ConfigurationPropertyGetter(defaultValue = "file:data/database")
|
||||
@ConfigurationPropertiesKey("orientdb.url")
|
||||
@ConfigurationPropertyKey("orientdb.url")
|
||||
@ConfigurationXPath("/configuration/services/database/orientdb/url")
|
||||
String getUrl();
|
||||
|
||||
@@ -126,7 +126,7 @@ public abstract class AbstractOrientDatabaseService extends AbstractService
|
||||
* the new orientdb url
|
||||
*/
|
||||
@ConfigurationPropertySetter
|
||||
@ConfigurationPropertiesKey("orientdb.url")
|
||||
@ConfigurationPropertyKey("orientdb.url")
|
||||
@ConfigurationXPath("/configuration/services/database/orientdb/url")
|
||||
void setUrl(String url);
|
||||
|
||||
@@ -134,7 +134,7 @@ public abstract class AbstractOrientDatabaseService extends AbstractService
|
||||
* @return the orientdb database username
|
||||
*/
|
||||
@ConfigurationPropertyGetter(defaultValue = "l2j")
|
||||
@ConfigurationPropertiesKey("orientdb.username")
|
||||
@ConfigurationPropertyKey("orientdb.username")
|
||||
@ConfigurationXPath("/configuration/services/database/orientdb/username")
|
||||
String getUsername();
|
||||
|
||||
@@ -143,7 +143,7 @@ public abstract class AbstractOrientDatabaseService extends AbstractService
|
||||
* the orientdb database username
|
||||
*/
|
||||
@ConfigurationPropertySetter
|
||||
@ConfigurationPropertiesKey("orientdb.username")
|
||||
@ConfigurationPropertyKey("orientdb.username")
|
||||
@ConfigurationXPath("/configuration/services/database/orientdb/username")
|
||||
void setUsername(String username);
|
||||
|
||||
@@ -151,7 +151,7 @@ public abstract class AbstractOrientDatabaseService extends AbstractService
|
||||
* @return the orientdb database password
|
||||
*/
|
||||
@ConfigurationPropertyGetter(defaultValue = "changeme")
|
||||
@ConfigurationPropertiesKey("orientdb.password")
|
||||
@ConfigurationPropertyKey("orientdb.password")
|
||||
@ConfigurationXPath("/configuration/services/database/orientdb/password")
|
||||
String getPassword();
|
||||
|
||||
@@ -160,7 +160,7 @@ public abstract class AbstractOrientDatabaseService extends AbstractService
|
||||
* the jdbc database password
|
||||
*/
|
||||
@ConfigurationPropertySetter
|
||||
@ConfigurationPropertiesKey("jdbc.password")
|
||||
@ConfigurationPropertyKey("jdbc.password")
|
||||
@ConfigurationXPath("/configuration/services/database/jdbc/password")
|
||||
void setPassword(String password);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
* This file is part of l2jserver2 <l2jserver2.com>.
|
||||
*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.util.transformer;
|
||||
|
||||
/**
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*
|
||||
*/
|
||||
public class TransformException extends RuntimeException {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public TransformException() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param message
|
||||
* the message
|
||||
*/
|
||||
public TransformException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param cause
|
||||
* the cause
|
||||
*/
|
||||
public TransformException(Throwable cause) {
|
||||
super(cause);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param message
|
||||
* the message
|
||||
* @param cause
|
||||
* the cause
|
||||
*/
|
||||
public TransformException(String message, Throwable cause) {
|
||||
super(message, cause);
|
||||
}
|
||||
}
|
||||
@@ -32,8 +32,10 @@ public interface Transformer<T> {
|
||||
* @param value
|
||||
* the object
|
||||
* @return the string of the object
|
||||
* @throws TransformException
|
||||
* if any error occur while transforming
|
||||
*/
|
||||
String transform(T value);
|
||||
String transform(T value) throws TransformException;
|
||||
|
||||
/**
|
||||
* Untransforms the string back to an object
|
||||
@@ -41,6 +43,8 @@ public interface Transformer<T> {
|
||||
* @param value
|
||||
* the string
|
||||
* @return the object
|
||||
* @throws TransformException
|
||||
* if any error occur while transforming
|
||||
*/
|
||||
T untransform(String value);
|
||||
T untransform(String value) throws TransformException;
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
*/
|
||||
package com.l2jserver.util.transformer.impl;
|
||||
|
||||
import com.l2jserver.util.transformer.TransformException;
|
||||
import com.l2jserver.util.transformer.Transformer;
|
||||
|
||||
/**
|
||||
@@ -39,7 +40,7 @@ public class ClassTransformer implements Transformer<Class<?>> {
|
||||
try {
|
||||
return Class.forName(value);
|
||||
} catch (ClassNotFoundException e) {
|
||||
return null;
|
||||
throw new TransformException(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ package com.l2jserver.util.transformer.impl;
|
||||
|
||||
import java.net.InetSocketAddress;
|
||||
|
||||
import com.l2jserver.util.transformer.TransformException;
|
||||
import com.l2jserver.util.transformer.Transformer;
|
||||
|
||||
/**
|
||||
@@ -41,7 +42,7 @@ public class InetSocketAddressTransformer implements
|
||||
public InetSocketAddress untransform(String value) {
|
||||
final String[] pieces = value.split(":");
|
||||
if (pieces.length != 2)
|
||||
return null;
|
||||
throw new TransformException("InetSocketAddress must have format ip:port");
|
||||
return new InetSocketAddress(pieces[0], Integer.parseInt(pieces[1]));
|
||||
}
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ import java.net.MalformedURLException;
|
||||
import java.net.URI;
|
||||
import java.net.URL;
|
||||
|
||||
import com.l2jserver.util.transformer.TransformException;
|
||||
import com.l2jserver.util.transformer.Transformer;
|
||||
|
||||
/**
|
||||
@@ -43,7 +44,7 @@ public class URLTransformer implements Transformer<URL> {
|
||||
try {
|
||||
return new URL(value);
|
||||
} catch (MalformedURLException e) {
|
||||
return null;
|
||||
throw new TransformException(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ 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.ConfigurationPropertiesKey;
|
||||
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;
|
||||
@@ -147,7 +147,7 @@ public class XMLTemplateService extends AbstractService implements
|
||||
* @return the directory in which templates are stored
|
||||
*/
|
||||
@ConfigurationPropertyGetter(defaultValue = "data/template")
|
||||
@ConfigurationPropertiesKey("template.directory")
|
||||
@ConfigurationPropertyKey("template.directory")
|
||||
@ConfigurationXPath("/configuration/services/template/directory")
|
||||
URI getTemplateDirectory();
|
||||
|
||||
@@ -156,7 +156,7 @@ public class XMLTemplateService extends AbstractService implements
|
||||
* the directory in which templates are stored
|
||||
*/
|
||||
@ConfigurationPropertySetter
|
||||
@ConfigurationPropertiesKey("template.directory")
|
||||
@ConfigurationPropertyKey("template.directory")
|
||||
@ConfigurationXPath("/configuration/services/template/directory")
|
||||
void setTemplateDirectory(URI file);
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ 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.ConfigurationPropertiesKey;
|
||||
import com.l2jserver.service.configuration.ProxyConfigurationService.ConfigurationPropertyKey;
|
||||
import com.l2jserver.service.configuration.XMLConfigurationService.ConfigurationXPath;
|
||||
|
||||
/**
|
||||
@@ -81,7 +81,7 @@ public interface NetworkService extends Service {
|
||||
* @return the listen address
|
||||
*/
|
||||
@ConfigurationPropertyGetter(defaultValue = "0.0.0.0:7777")
|
||||
@ConfigurationPropertiesKey("network.listen")
|
||||
@ConfigurationPropertyKey("network.listen")
|
||||
@ConfigurationXPath("/configuration/services/network/listen")
|
||||
InetSocketAddress getListenAddress();
|
||||
|
||||
@@ -92,7 +92,7 @@ public interface NetworkService extends Service {
|
||||
* the listen address
|
||||
*/
|
||||
@ConfigurationPropertySetter
|
||||
@ConfigurationPropertiesKey("network.listen")
|
||||
@ConfigurationPropertyKey("network.listen")
|
||||
@ConfigurationXPath("/configuration/services/network/listen")
|
||||
void setListenAddress(InetSocketAddress addr);
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ 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.ConfigurationPropertiesKey;
|
||||
import com.l2jserver.service.configuration.ProxyConfigurationService.ConfigurationPropertyKey;
|
||||
import com.l2jserver.service.configuration.XMLConfigurationService.ConfigurationXPath;
|
||||
|
||||
/**
|
||||
@@ -44,7 +44,7 @@ public interface GameServerNetworkService extends Service {
|
||||
* @return the listen address
|
||||
*/
|
||||
@ConfigurationPropertyGetter(defaultValue = "0.0.0.0:2104")
|
||||
@ConfigurationPropertiesKey("network.listen")
|
||||
@ConfigurationPropertyKey("network.listen")
|
||||
@ConfigurationXPath("/configuration/services/network/listen")
|
||||
InetSocketAddress getListenAddress();
|
||||
|
||||
@@ -55,7 +55,7 @@ public interface GameServerNetworkService extends Service {
|
||||
* the listen address
|
||||
*/
|
||||
@ConfigurationPropertySetter
|
||||
@ConfigurationPropertiesKey("network.listen")
|
||||
@ConfigurationPropertyKey("network.listen")
|
||||
@ConfigurationXPath("/configuration/services/network/listen")
|
||||
void setListenAddress(InetSocketAddress addr);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user