1
0
mirror of https://github.com/Rogiel/l2jserver2 synced 2025-12-10 09:22:49 +00:00

Update assembly descriptor and improves significantly the documentation

Fixes an issue in the assembly descriptor that included older
compilation binaries into assemblies.
Improved javadoc documentation in more than 150 classes, including
fixing mistakes.
This commit is contained in:
2011-09-15 01:21:52 -03:00
parent 8a8557606f
commit a2e8680f72
155 changed files with 1223 additions and 225 deletions

View File

@@ -20,6 +20,8 @@ package com.l2jserver.service.cache;
* This interface represents a Map structure for cache usage.
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
* @param <K> the key type
* @param <V> the value type
*/
public interface Cache<K, V> extends Iterable<V> {
/**
@@ -30,7 +32,9 @@ public interface Cache<K, V> extends Iterable<V> {
* given id in the map, {@link IllegalArgumentException} will be thrown.
*
* @param key
* the key name
* @param value
* the cache content value
*/
void put(K key, V value);
@@ -38,7 +42,8 @@ public interface Cache<K, V> extends Iterable<V> {
* Returns cached value correlated to given key.
*
* @param key
* @return
* the key
* @return the cached value for this key
*/
V get(K key);
@@ -46,7 +51,8 @@ public interface Cache<K, V> extends Iterable<V> {
* Checks whether this map contains a value related to given key.
*
* @param key
* @return
* the key
* @return true if key has an value
*/
boolean contains(K key);
@@ -54,6 +60,7 @@ public interface Cache<K, V> extends Iterable<V> {
* Removes an entry from the map, that has given key.
*
* @param key
* the key
*/
void remove(K key);

View File

@@ -56,6 +56,7 @@ public interface CacheService extends Service {
* the cache value type
* @param name
* the cache name
* @param size the maximum cache size
* @size the maximum cache size
* @return the created cache
*/
@@ -72,6 +73,7 @@ public interface CacheService extends Service {
* the cache value type
* @param name
* the cache name
* @param size the maximum cache size
* @size the maximum cache size
* @return the created cache
*/

View File

@@ -130,6 +130,8 @@ public class SoftCacheService extends AbstractService implements CacheService {
* value object)
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
* @param <K> the key type
* @param <V> the value type
*/
private class SoftCache<K, V> extends AbstractReferenceCache<K, V> implements
Cache<K, V> {

View File

@@ -130,6 +130,8 @@ public class WeakCacheService extends AbstractService implements CacheService {
* if there isn't any strong reference to the value object.
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
* @param <K> the key type
* @param <V> the value type
*/
private class WeakCache<K, V> extends AbstractReferenceCache<K, V>
implements Cache<K, V> {

View File

@@ -26,6 +26,8 @@ import java.util.concurrent.TimeoutException;
* features, such as waiting for an given task to finish.
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
* @param <T>
* the {@link Future} return type
*/
public interface AsyncFuture<T> extends Future<T> {
/**

View File

@@ -55,14 +55,14 @@ public interface ThreadPool {
/**
* Executes an asynchronous tasks at an scheduled time.
*
* @param callable
* the callable instance
* @param delay
* the initial delay to wait before the task is executed
* @param repeat
* the repeating interval for this task
* @param unit
* the time unit of delay
* @param repeat
* the repeating interval for this task
* @param task
* the task to be executed
* @return the {@link AsyncFuture} notified once the task has completed
*/
ScheduledAsyncFuture async(long delay, TimeUnit unit, long repeat,

View File

@@ -67,14 +67,14 @@ public interface ThreadService extends Service {
* <p>
* Tasks scheduled here will go to an default shared thread pool.
*
* @param callable
* the callable instance
* @param delay
* the initial delay to wait before the task is executed
* @param repeat
* the repeating interval for this task
* @param unit
* the time unit of delay
* @param repeat
* the repeating interval for this task
* @param task
* the task to be executed
* @return the {@link AsyncFuture} notified once the task has completed
*/
ScheduledAsyncFuture async(long delay, TimeUnit unit, long repeat,

View File

@@ -59,9 +59,9 @@ public interface VFSService extends Service {
* Please note that event if the file DOES NOT exists a valid object will be
* returned.
*
* @param uri
* the file uri as an string
* @param path
* the file path as an string
* @return the resolved file. Will return null if could not resolve.
*/
Path resolve(String name);
Path resolve(String path);
}

View File

@@ -38,7 +38,13 @@ import com.l2jserver.service.cache.IgnoreCaching;
* could be a huge performance issue. DAO implementations are encouraged to
* override the iterator implementation with a more specific implementation.
*
* @param <O>
* the {@link Model} supported by this DAO
* @param <I>
* the ID used to represent the {@link Model} in this DAO
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*
*/
public interface DataAccessObject<O extends Model<?>, I extends ID<?>> extends
Iterable<O> {
@@ -47,6 +53,8 @@ public interface DataAccessObject<O extends Model<?>, I extends ID<?>> extends
*
* @param id
* the id
* @return the selected object. <tt>null</tt> if could not be found in the
* database.
*/
O select(I id);

View File

@@ -406,6 +406,7 @@ public class JDBCDatabaseService extends AbstractService implements
* the connection
* @return the query return value
* @throws SQLException
* if any SQL error occur
*/
R query(Connection conn) throws SQLException;
}
@@ -514,6 +515,7 @@ public class JDBCDatabaseService extends AbstractService implements
* @param object
* the object
* @throws SQLException
* if any SQL error occur
*/
protected abstract void parametize(PreparedStatement st, T object)
throws SQLException;
@@ -522,8 +524,6 @@ public class JDBCDatabaseService extends AbstractService implements
* Return the key mapper. Can be null if no generated keys are used or
* are not important.
*
* @param object
* the object
* @return the key mapper
*/
protected Mapper<? extends ID<?>> keyMapper() {
@@ -593,9 +593,8 @@ public class JDBCDatabaseService extends AbstractService implements
*
* @param st
* the prepared statement
* @param object
* the object
* @throws SQLException
* if any SQL error occur
*/
protected void parametize(PreparedStatement st) throws SQLException {
}
@@ -670,9 +669,8 @@ public class JDBCDatabaseService extends AbstractService implements
*
* @param st
* the prepared statement
* @param object
* the object
* @throws SQLException
* if any SQL error occur
*/
protected void parametize(PreparedStatement st) throws SQLException {
}
@@ -706,6 +704,7 @@ public class JDBCDatabaseService extends AbstractService implements
* the result set
* @return the created instance
* @throws SQLException
* if any SQL error occur
*/
T map(ResultSet rs) throws SQLException;
}
@@ -744,6 +743,8 @@ public class JDBCDatabaseService extends AbstractService implements
*
* @param database
* the database service
* @param idMapper
* the {@link ID} {@link Mapper}
*/
public CachedMapper(JDBCDatabaseService database, Mapper<I> idMapper) {
this.database = database;
@@ -781,6 +782,7 @@ public class JDBCDatabaseService extends AbstractService implements
* the jdbc result set
* @return the created object
* @throws SQLException
* if any SQL error occur
*/
protected abstract T map(I id, ResultSet rs) throws SQLException;
}

View File

@@ -16,6 +16,7 @@
*/
package com.l2jserver.service.game.castle;
import com.l2jserver.model.game.Castle;
import com.l2jserver.service.Service;
/**

View File

@@ -39,7 +39,7 @@ public enum ChatMessageType {
*/
PARTY(3),
/**
* @
* \@
*/
CLAN(4), GM(5), PETITION_PLAYER(6), PETITION_GM(7),
/**

View File

@@ -16,7 +16,7 @@
*/
package com.l2jserver.service.game.chat;
import com.l2jserver.model.id.object.CharacterID;
import com.l2jserver.model.server.ChatMessage;
/**
* An public {@link ChatChannel}. Please note that the concept of "public" does
@@ -24,8 +24,8 @@ import com.l2jserver.model.id.object.CharacterID;
* (i.e. clan, global, region, etc...). That mean that a single message can be
* broadcasted to more than a single client. Note that even in a public channel
* only a single event
* {@link ChatChannelListener#onMessage(ChatChannel, CharacterID, String)} will
* be dispatched per listener.
* {@link ChatChannelListener#onMessage(ChatChannel, ChatMessage)} will be
* dispatched per listener.
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/

View File

@@ -25,6 +25,7 @@ import org.slf4j.LoggerFactory;
import com.google.common.base.Preconditions;
import com.google.inject.Inject;
import com.l2jserver.model.dao.CharacterDAO;
import com.l2jserver.model.id.ID;
import com.l2jserver.model.id.object.CharacterID;
import com.l2jserver.model.id.object.ClanID;
import com.l2jserver.model.server.ChatMessage;
@@ -34,6 +35,7 @@ import com.l2jserver.service.AbstractService;
import com.l2jserver.service.AbstractService.Depends;
import com.l2jserver.service.ServiceStartException;
import com.l2jserver.service.ServiceStopException;
import com.l2jserver.service.database.DataAccessObject;
import com.l2jserver.service.game.region.Region;
import com.l2jserver.service.game.region.RegionService;
import com.l2jserver.util.factory.CollectionFactory;
@@ -93,8 +95,10 @@ public class SimpleChatService extends AbstractService implements ChatService {
/**
* Creates a new instance
*
* @param regionService
* the region service
* @param chatLogService
* the chat log service
* @param charDao
* the character {@link DataAccessObject DAO}
*/
@Inject
public SimpleChatService(ChatLoggingService chatLogService,
@@ -420,6 +424,7 @@ public class SimpleChatService extends AbstractService implements ChatService {
* Creates a new instance
*
* @param clanID
* the clan {@link ID} used in this channel
*/
public ClanChatChannelImpl(ClanID clanID) {
Preconditions.checkNotNull(clanID, "clanID");
@@ -453,7 +458,8 @@ public class SimpleChatService extends AbstractService implements ChatService {
/**
* Creates a new instance
*
* @param clanID
* @param region
* the region represented in this channel
*/
public RegionChatChannelImpl(Region region) {
Preconditions.checkNotNull(region, "region");

View File

@@ -44,6 +44,8 @@ public interface NPCService extends Service {
* the character
* @param action
* the action type
* @throws ActionServiceException
* if the action thrown an exception
* @throws CannotSetTargetServiceException
* if was not possible to set the target
*/
@@ -60,6 +62,8 @@ public interface NPCService extends Service {
* the character
* @param args
* the action arguments
* @throws ActionServiceException
* if the action thrown an exeption
* @throws CannotSetTargetServiceException
* if was not possible to set the target
*/

View File

@@ -32,10 +32,11 @@ import com.l2jserver.service.Service;
*/
public interface ScriptingService extends Service {
/**
* Loads script contexes from descriptor
* Loads script contexts from descriptor
*
* @param scriptDescriptor
* xml file that describes contexes
* @return the {@link List} of {@link ScriptContext} loaded
* @throws Exception
* if can't load file
*/

View File

@@ -67,6 +67,8 @@ public class BinaryClass implements JavaFileObject {
*
* @param name
* class name
* @param data
* the class contents
*/
public BinaryClass(String name, byte[] data) {
this.name = name;

View File

@@ -54,6 +54,8 @@ public class JavaSourceFromByteArray extends SimpleJavaFileObject {
* class name of class
* @param code
* source code of class
* @param kind
* the class {@link javax.tools.JavaFileObject.Kind}
*/
public JavaSourceFromByteArray(String className, byte[] code,
JavaFileObject.Kind kind) {

View File

@@ -86,6 +86,8 @@ public class ScriptContextImpl implements ScriptContext {
/**
* Creates new scriptcontext with given root file
*
* @param injector
* the Guice {@link Injector}
* @param root
* file that represents root directory of this script context
* @throws NullPointerException
@@ -101,6 +103,8 @@ public class ScriptContextImpl implements ScriptContext {
* Creates new ScriptContext with given file as root and another
* ScriptContext as parent
*
* @param injector
* the Guice {@link Injector}
* @param root
* file that represents root directory of this script context
* @param parent

View File

@@ -44,6 +44,9 @@ public class PrecompiledScriptClassLoader extends ScriptClassLoader {
/**
* Creates new ScriptClassLoader with given ClassFileManger
*
* @param root
* the root file
*/
PrecompiledScriptClassLoader(final File root) {
super(new URL[] {});
@@ -66,6 +69,7 @@ public class PrecompiledScriptClassLoader extends ScriptClassLoader {
* @param file
* jar file to add
* @throws IOException
* if any I/O error occur
*/
@Override
public void addLibrary(File file) throws IOException {
@@ -74,14 +78,13 @@ public class PrecompiledScriptClassLoader extends ScriptClassLoader {
/**
* Loads class from library, parent or compiled
*
* @param name
* class to load
* @param file
* the class file
* @return loaded class
* @throws ClassNotFoundException
* if class not found
* @throws IOException
* if any I/O error occur
*/
public Class<?> loadClass(File file) throws ClassNotFoundException,
IOException {

View File

@@ -114,6 +114,7 @@ public class ScriptClassLoaderImpl extends ScriptClassLoader {
* @param file
* jar file to add
* @throws IOException
* if any I/O error occur
*/
@Override
public void addLibrary(File file) throws IOException {

View File

@@ -82,6 +82,9 @@ public interface SpawnService extends Service {
* Schedules an {@link PositionableObject} object to be spawned in a certain
* time.
*
* @param <T>
* the {@link PositionableObject} to be spawned
*
* @param object
* the PositionableObject object
* @param point
@@ -110,6 +113,9 @@ public interface SpawnService extends Service {
* Schedules an {@link PositionableObject} object to be spawned in a certain
* time.
*
* @param <T>
* the {@link PositionableObject} to be unspawned
*
* @param object
* the PositionableObject object
* @param time

View File

@@ -38,8 +38,8 @@ import com.l2jserver.service.cache.CacheService;
import com.l2jserver.service.database.DatabaseService;
/**
* Implementation for {@link IDService} that caches all {@link ID} objects in
* memory.
* Implementation for {@link WorldIDService} that caches all {@link ID} objects
* in memory.
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
@@ -50,7 +50,7 @@ public class CachedWorldIDService extends AbstractService implements
* The logger
*/
private final Logger log = LoggerFactory.getLogger(this.getClass());
/**
* The cache service
*/
@@ -105,11 +105,11 @@ public class CachedWorldIDService extends AbstractService implements
@Override
public void load() {
log.debug("Loading IDs from database");
load(characterDao.selectIDs());
load(itemDao.selectIDs());
load(npcDao.selectIDs());
log.debug("IDs loaded from database");
loaded = true;
}

View File

@@ -43,8 +43,6 @@ public interface WorldIDService extends Service {
/**
* Tries to resolve an ID based on its raw value
*
* @param <V>
* the raw ID type
* @param <I>
* the ID type
* @param id

View File

@@ -154,7 +154,7 @@ public interface WorldService extends Service, Iterable<WorldObject> {
final WorldObjectFilter<T> filter);
/**
* Shortcut method for {@link Iterable#iterable()} with filters. The
* Shortcut method for {@link Iterable#iterator()} with filters. The
* iterable instance returns the same {@link Iterator} as
* {@link #iterator(WorldObjectFilter)}.
*

View File

@@ -24,6 +24,8 @@ import com.l2jserver.service.game.world.filter.WorldObjectFilter;
* This listener will filter to only dispatch events on which the object matches
* an given {@link WorldObjectFilter}.
*
* @param <T>
* the type of objects filtered in this filter
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
public abstract class FilteredWorldListener<T extends WorldObject> implements
@@ -44,6 +46,11 @@ public abstract class FilteredWorldListener<T extends WorldObject> implements
}
/**
* @param e
* the event
* @param object
* the object represented in the event
* @return true to keep listener alive
* @see WorldListener#dispatch(WorldEvent)
*/
protected abstract boolean dispatch(WorldEvent e, T object);

View File

@@ -21,6 +21,9 @@ import com.google.common.base.Preconditions;
/**
* This listener will filter to only dispatch an certain type events.
*
* @param <T>
* the type filtered by this {@link WorldListener}
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
public abstract class TypedWorldListener<T> implements WorldListener {
@@ -40,6 +43,9 @@ public abstract class TypedWorldListener<T> implements WorldListener {
}
/**
* @param e
* the event
* @return true to keep listener alive
* @see WorldListener#dispatch(WorldEvent)
*/
protected abstract boolean dispatch(T e);

View File

@@ -25,6 +25,9 @@ import java.util.concurrent.TimeoutException;
* used to receive notifications once an event has been dispatched to all
* listeners.
*
* @param <E>
* the event type in this future
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
public interface WorldEventFuture<E extends WorldEvent> extends Future<E> {

View File

@@ -20,9 +20,6 @@ package com.l2jserver.service.game.world.event;
* This is the most abstract listener for the listening engine.
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*
* @param <E>
* the received event type
*/
public interface WorldListener {
/**

View File

@@ -57,8 +57,8 @@ public final class WorldFilters {
*
* @param <O>
* the object type
* @param filters
* the filters
* @param filter
* the filter
* @return the {@link NotFilter}
*/
public static final <O extends WorldObject> WorldObjectFilter<O> not(

View File

@@ -21,6 +21,9 @@ import com.l2jserver.model.world.WorldObject;
/**
* Filter an object in a world
*
* @param <O>
* the {@link WorldObject} filtered by this filter
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
public interface WorldObjectFilter<O extends WorldObject> {

View File

@@ -40,7 +40,7 @@ public class RangeFilter implements WorldObjectFilter<PositionableObject> {
/**
* Creates a new instance
*
* @param objcect
* @param object
* the positionable object as center point for range search
* @param range
* the desired maximum distance of the object

View File

@@ -41,8 +41,8 @@ public class RangePointFilter implements WorldObjectFilter<PositionableObject> {
/**
* Creates a new instance
*
* @param objcect
* the positionable object as center point for range search
* @param point
* the point to start the range search
* @param range
* the desired maximum distance of the object
*/

View File

@@ -85,7 +85,7 @@ public class BroadcastServiceImpl extends AbstractService implements
final L2Character character = conn.getCharacter();
Preconditions.checkNotNull(character, "character");
final CharacterID id = character.getID();
log.debug("Starting character broadcast");
// broadcast everything nearby
@@ -197,8 +197,8 @@ public class BroadcastServiceImpl extends AbstractService implements
*
* @param conn
* the connection
* @param character
* the character
* @param o
* the object to be broadcasted
*/
private void broadcast(Lineage2Client conn, WorldObject o) {
log.debug("Broadcasting {} to {}", o, conn);