1
0
mirror of https://github.com/Rogiel/l2jserver2 synced 2025-12-10 17:32:46 +00:00

First commit

Change-Id: I4d273faba7286288d2b9a214c87c39a76724d787
This commit is contained in:
rogiel
2011-04-28 18:49:39 -03:00
commit 6d52f44278
112 changed files with 1746 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
package com.l2jserver.service.database;
import com.google.inject.Inject;
public abstract class AbstractDAO implements DataAccessObject {
protected final DatabaseService database;
@Inject
protected AbstractDAO(DatabaseService database) {
this.database = database;
}
public DatabaseService getDatabase() {
return database;
}
}

View File

@@ -0,0 +1,15 @@
package com.l2jserver.service.database;
public class DB4ODatabaseService implements DatabaseService {
@Override
public void start() {
// TODO Auto-generated method stub
}
@Override
public void stop() {
// TODO Auto-generated method stub
}
}

View File

@@ -0,0 +1,10 @@
package com.l2jserver.service.database;
/**
* The DAO interface
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
public interface DataAccessObject {
}

View File

@@ -0,0 +1,11 @@
package com.l2jserver.service.database;
import com.l2jserver.service.configuration.Configuration;
import com.l2jserver.service.configuration.Configuration.ConfigurationName;
import com.l2jserver.service.configuration.Configuration.ConfigurationPrefix;
@ConfigurationName("database")
@ConfigurationPrefix("database")
public interface DatabaseConfiguration extends Configuration {
}

View File

@@ -0,0 +1,7 @@
package com.l2jserver.service.database;
import com.l2jserver.service.Service;
public interface DatabaseService extends Service {
}

View File

@@ -0,0 +1,25 @@
package com.l2jserver.service.database;
import com.google.inject.Inject;
import com.l2jserver.service.configuration.ConfigurationService;
public class MySQL5DatabaseService implements DatabaseService {
private final MySQLDatabaseConfiguration config;
@Inject
public MySQL5DatabaseService(ConfigurationService configService) {
config = configService.get(MySQLDatabaseConfiguration.class);
}
@Override
public void start() {
// TODO Auto-generated method stub
}
@Override
public void stop() {
// TODO Auto-generated method stub
}
}

View File

@@ -0,0 +1,31 @@
package com.l2jserver.service.database;
import com.l2jserver.service.configuration.Configuration.ConfigurationPrefix;
@ConfigurationPrefix("mysql")
public interface MySQLDatabaseConfiguration extends DatabaseConfiguration {
/**
* @return the jdbc url
*/
@ConfigurationPropertyGetter(name = "jdbc.url", defaultValue = "jdbc:mysql://localhost/l2jserver-gs")
String getJdbcUrl();
/**
* @param jdbcUrl
* the new jdbc url
*/
@ConfigurationPropertySetter(name = "jdbc.url")
void setJdbcUrl(String jdbcUrl);
@ConfigurationPropertyGetter(name = "jdbc.username", defaultValue = "root")
String getUsername();
@ConfigurationPropertySetter(name = "jdbc.username")
void setUsername(String username);
@ConfigurationPropertyGetter(name = "jdbc.password")
String getPassword();
@ConfigurationPropertySetter(name = "jdbc.password")
void setPassword(String password);
}