java-link-svn Mailing List for JLink Game
Status: Pre-Alpha
Brought to you by:
welterde0
You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
(4) |
Apr
|
May
(4) |
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
(11) |
Nov
(11) |
Dec
(1) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <wel...@us...> - 2007-01-07 18:45:56
|
Revision: 33 http://svn.sourceforge.net/java-link/?rev=33&view=rev Author: welterde0 Date: 2007-01-07 10:45:53 -0800 (Sun, 07 Jan 2007) Log Message: ----------- preperation for switch to ant as build system Modified Paths: -------------- branches/private_welterde0/client/pom.xml branches/private_welterde0/server/pom.xml branches/private_welterde0/server/src/main/java/org/jlink/server/Core.java branches/private_welterde0/server/src/main/java/org/jlink/server/Main.java branches/private_welterde0/server/src/main/java/org/jlink/server/MainJMX.java branches/private_welterde0/server/src/main/java/org/jlink/server/net/NetworkManager.java Added Paths: ----------- branches/private_welterde0/env_client/log4j.xml branches/private_welterde0/env_client/run.bat branches/private_welterde0/env_client/run.sh branches/private_welterde0/env_server/run.sh branches/private_welterde0/examples/ branches/private_welterde0/examples/view_0.1_basic.xml branches/private_welterde0/libgui/src/main/java/org/jlink/libgui/GUIPanel.java branches/private_welterde0/libview/ branches/private_welterde0/libview/catalog.xml branches/private_welterde0/libview/pom.xml branches/private_welterde0/libview/src/ branches/private_welterde0/libview/src/main/ branches/private_welterde0/libview/src/main/java/ branches/private_welterde0/libview/src/main/java/org/ branches/private_welterde0/libview/src/main/java/org/jlink/ branches/private_welterde0/libview/src/main/java/org/jlink/libview/ branches/private_welterde0/libview/src/main/java/org/jlink/libview/View.java branches/private_welterde0/libview/src/test/ branches/private_welterde0/libview/src/test/java/ branches/private_welterde0/libview/src/test/java/org/ branches/private_welterde0/libview/src/test/java/org/jlink/ branches/private_welterde0/libview/src/test/java/org/jlink/libview/ branches/private_welterde0/libview/src/test/java/org/jlink/libview/AppTest.java branches/private_welterde0/server/src/main/java/org/jlink/server/ConnectionHandler.java branches/private_welterde0/server/src/main/java/org/jlink/server/Context.java branches/private_welterde0/server/src/main/java/org/jlink/server/ScriptManager.java branches/private_welterde0/server/src/main/java/org/jlink/server/Session.java branches/private_welterde0/server/src/main/java/org/jlink/server/SessionManager.java branches/private_welterde0/server/src/main/java/org/jlink/server/net/Connection.java branches/private_welterde0/server/src/main/java/org/jlink/server/net/ConnectionID.java branches/private_welterde0/server/src/main/java/org/jlink/server/net/ConnectionIDFactory.java branches/private_welterde0/server/src/main/java/org/jlink/server/net/ConnectionManager.java branches/private_welterde0/server/src/main/java/org/jlink/server/net/Protocol.java branches/private_welterde0/server/src/main/java/org/jlink/server/net/ProtocolManager.java branches/private_welterde0/server/src/main/java/org/jlink/server/net/SimpleConnectionIDFactory.java Modified: branches/private_welterde0/client/pom.xml =================================================================== --- branches/private_welterde0/client/pom.xml 2006-12-10 11:04:49 UTC (rev 32) +++ branches/private_welterde0/client/pom.xml 2007-01-07 18:45:53 UTC (rev 33) @@ -77,43 +77,51 @@ <reporting> <plugins> <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>jxr-maven-plugin</artifactId> + <groupId>org.codehaus.mojo</groupId> + <artifactId>findbugs-maven-plugin</artifactId> + <configuration> + <threshold>low</threshold> + <effort>Max</effort> + </configuration> </plugin> <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-javadoc-plugin</artifactId> + <groupId>org.codehaus.mojo</groupId> + <artifactId>jxr-maven-plugin</artifactId> </plugin> <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-pmd-plugin</artifactId> - <configuration> - <rulesets> - <ruleset>/rulesets/basic.xml</ruleset> - <ruleset>/rulesets/codesize.xml</ruleset> - <ruleset>/rulesets/coupling.xml</ruleset> - <ruleset>/rulesets/design.xml</ruleset>- - <ruleset>/rulesets/finalizers.xml</ruleset> - <ruleset>/rulesets/imports.xml</ruleset> - <ruleset>/rulesets/javabeans.xml</ruleset> - <ruleset>/rulesets/logging-java.xml</ruleset> - <ruleset>/rulesets/naming.xml</ruleset> - <ruleset>/rulesets/optimizations.xml</ruleset> - <ruleset>/rulesets/strictexception.xml</ruleset> - <ruleset>/rulesets/strings.xml</ruleset> - <ruleset>/rulesets/sunsecure.xml</ruleset> - <ruleset>/rulesets/unusedcode.xml</ruleset> - </rulesets> - <linkXref>true</linkXref> - <sourceEncoding>utf-8</sourceEncoding> - <minimumTokens>100</minimumTokens> - <targetJdk>1.5</targetJdk> - </configuration> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-javadoc-plugin</artifactId> </plugin> <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-surefire-report-plugin</artifactId> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-pmd-plugin</artifactId> + <configuration> + <rulesets> + <ruleset>/rulesets/basic.xml</ruleset> + <ruleset>/rulesets/codesize.xml</ruleset> + <ruleset>/rulesets/coupling.xml</ruleset> + <ruleset>/rulesets/design.xml</ruleset>- + <ruleset>/rulesets/finalizers.xml</ruleset> + <ruleset>/rulesets/imports.xml</ruleset> + <ruleset>/rulesets/javabeans.xml</ruleset> + <ruleset>/rulesets/logging-java.xml</ruleset> + <ruleset>/rulesets/naming.xml</ruleset> + <ruleset>/rulesets/optimizations.xml</ruleset> + <ruleset>/rulesets/strictexception.xml</ruleset> + <ruleset>/rulesets/strings.xml</ruleset> + <ruleset>/rulesets/sunsecure.xml</ruleset> + <ruleset>/rulesets/unusedcode.xml</ruleset> + </rulesets> + <linkXref>true</linkXref> + <sourceEncoding>utf-8</sourceEncoding> + <minimumTokens>100</minimumTokens> + <targetJdk>1.5</targetJdk> + </configuration> </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-report-plugin</artifactId> + </plugin> </plugins> </reporting> <!--//////////////////////////////////////// Added: branches/private_welterde0/env_client/log4j.xml =================================================================== --- branches/private_welterde0/env_client/log4j.xml (rev 0) +++ branches/private_welterde0/env_client/log4j.xml 2007-01-07 18:45:53 UTC (rev 33) @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> + +<log4j:configuration> + <appender name="LIVE-I" class="org.apache.log4j.ConsoleAppender"> + <param name="Threshold" value="info"/> + <layout class="org.apache.log4j.PatternLayout"> + <param name="ConversionPattern" value="%d{ISO8601} %-5p %c - %m%n"/> + </layout> + </appender> + <appender name="DEBUG-I" class="org.apache.log4j.FileAppender"> + <param name="Threshold" value="all"/> + <param name="File" value="logs/debug.log.xml"/> + <param name="Append" value="false"/> + <layout class="org.apache.log4j.xml.XMLLayout"/> + </appender> +<!-- + <appender name="FILE-I" class="org.apache.log4j.DailyRollingFileAppender"> + <param name="datePattern" value="'.'yyyy-MM-dd-HH"/> + <param name="File" value="logs/server.log.xml"/> + <param name="Threshold" value="debug"/> + <layout class="org.apache.log4j.xml.XMLLayout"/> + </appender> +--> + <root> + <priority value ="all" /> + <appender-ref ref="LIVE-I"/> + <appender-ref ref="DEBUG-I"/> + <!--<appender-ref ref="FILE-I"/> --> + </root> + +</log4j:configuration> Added: branches/private_welterde0/env_client/run.bat =================================================================== Added: branches/private_welterde0/env_client/run.sh =================================================================== --- branches/private_welterde0/env_client/run.sh (rev 0) +++ branches/private_welterde0/env_client/run.sh 2007-01-07 18:45:53 UTC (rev 33) @@ -0,0 +1,3 @@ +#!/bin/sh + +java \ No newline at end of file Added: branches/private_welterde0/env_server/run.sh =================================================================== --- branches/private_welterde0/env_server/run.sh (rev 0) +++ branches/private_welterde0/env_server/run.sh 2007-01-07 18:45:53 UTC (rev 33) @@ -0,0 +1,6 @@ +#!/bin/sh + +export CONF=config/example.xml +if[ -f config/config.xml ]; then + export CONF=config/config.xml +endif \ No newline at end of file Added: branches/private_welterde0/examples/view_0.1_basic.xml =================================================================== --- branches/private_welterde0/examples/view_0.1_basic.xml (rev 0) +++ branches/private_welterde0/examples/view_0.1_basic.xml 2007-01-07 18:45:53 UTC (rev 33) @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<view:root xmlns:view="http://java-link.sourceforge.net/specs/VIEW/0.0.1dev"> + <info:view xmlns:info="http://java-link.sourceforge.net/specs/INFO/0.0.1dev"> + <info:name>Basic</info:name> + <info:requires> + <info:require plugin="auth_passowrd" as="auth" /><!-- this is for having an simple component as password input --> + <info:require plugin="pwprotocol" as "proto" /><!-- how the password will be transfered --> + </info:requires> + </info:view> + <config:view xmlns:components="http://java-link.sourceforge.net/specs/CONFIG/0.0.1dev"> + <config:define component="pwscreen" plugin="$$auth"> + <config:submit host="example.com" path="/login/auth/pw/nv&43d3_$1" protocol="$$proto"/> + <config:text domain="example.com" company="Example AG" /> + <config:forward on="$$proto.success" to="http://example.com/secure/?sess=$$proto.session" /> + </config:define> + </config:view> + <layout:view xmlns:layout="http://java-link.sourceforge.net/specs/LAYOUT/0.0.1dev"> + <layout:config use="null" /> + <layout:show component="$$pwscreen" /> + </layout:view> +</view:root> \ No newline at end of file Added: branches/private_welterde0/libgui/src/main/java/org/jlink/libgui/GUIPanel.java =================================================================== --- branches/private_welterde0/libgui/src/main/java/org/jlink/libgui/GUIPanel.java (rev 0) +++ branches/private_welterde0/libgui/src/main/java/org/jlink/libgui/GUIPanel.java 2007-01-07 18:45:53 UTC (rev 33) @@ -0,0 +1,36 @@ +/* + * GUIPanel.java + * + * Created on 2. November 2006, 14:42 + * + * JLink: An Introversion Uplink Clone with multiplayer support. + * Copyright (C) 2006 Tassilo Schweyer + * + * This program 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 2 + * of the License, or (at your option) any later version. + * + * This program 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 this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package org.jlink.libgui; + +/** + * + * @author welterde + */ +public class GUIPanel { + + /** Creates a new instance of GUIPanel */ + public GUIPanel() { + } + +} Added: branches/private_welterde0/libview/catalog.xml =================================================================== --- branches/private_welterde0/libview/catalog.xml (rev 0) +++ branches/private_welterde0/libview/catalog.xml 2007-01-07 18:45:53 UTC (rev 33) @@ -0,0 +1 @@ + Added: branches/private_welterde0/libview/pom.xml =================================================================== --- branches/private_welterde0/libview/pom.xml (rev 0) +++ branches/private_welterde0/libview/pom.xml 2007-01-07 18:45:53 UTC (rev 33) @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <groupId>org.jlink</groupId> + <artifactId>libview</artifactId> + <packaging>jar</packaging> + <version>0.0.1-SNAPSHOT</version> + <name>JLink Views</name> + <url>http://java-link.sourceforge.net/</url> + <dependencies> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>3.8.1</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>jdom</groupId> + <artifactId>jdom</artifactId> + <version>1.0</version> + <scope>compile</scope> + </dependency> + </dependencies> +</project> Added: branches/private_welterde0/libview/src/main/java/org/jlink/libview/View.java =================================================================== --- branches/private_welterde0/libview/src/main/java/org/jlink/libview/View.java (rev 0) +++ branches/private_welterde0/libview/src/main/java/org/jlink/libview/View.java 2007-01-07 18:45:53 UTC (rev 33) @@ -0,0 +1,36 @@ +/* + * View.java + * + * Created on 7. Januar 2007, 14:59 + * + * JLink: An Uplink Clone with multiplayer support. + * Copyright (C) 2007 Tassilo Schweyer + * + * This program 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 2 + * of the License, or (at your option) any later version. + * + * This program 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 this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package org.jlink.libview; + +/** + * + * @author welterde + */ +public class View { + + /** Creates a new instance of View */ + public View() { + } + +} Added: branches/private_welterde0/libview/src/test/java/org/jlink/libview/AppTest.java =================================================================== --- branches/private_welterde0/libview/src/test/java/org/jlink/libview/AppTest.java (rev 0) +++ branches/private_welterde0/libview/src/test/java/org/jlink/libview/AppTest.java 2007-01-07 18:45:53 UTC (rev 33) @@ -0,0 +1,38 @@ +package org.jlink.libview; + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +/** + * Unit test for simple App. + */ +public class AppTest + extends TestCase +{ + /** + * Create the test case + * + * @param testName name of the test case + */ + public AppTest( String testName ) + { + super( testName ); + } + + /** + * @return the suite of tests being tested + */ + public static Test suite() + { + return new TestSuite( AppTest.class ); + } + + /** + * Rigourous Test :-) + */ + public void testApp() + { + assertTrue( true ); + } +} Modified: branches/private_welterde0/server/pom.xml =================================================================== --- branches/private_welterde0/server/pom.xml 2006-12-10 11:04:49 UTC (rev 32) +++ branches/private_welterde0/server/pom.xml 2007-01-07 18:45:53 UTC (rev 33) @@ -52,6 +52,14 @@ /////////////////////////////////////--> <reporting> <plugins> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>findbugs-maven-plugin</artifactId> + <configuration> + <threshold>low</threshold> + <effort>Max</effort> + </configuration> + </plugin> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>jxr-maven-plugin</artifactId> Added: branches/private_welterde0/server/src/main/java/org/jlink/server/ConnectionHandler.java =================================================================== --- branches/private_welterde0/server/src/main/java/org/jlink/server/ConnectionHandler.java (rev 0) +++ branches/private_welterde0/server/src/main/java/org/jlink/server/ConnectionHandler.java 2007-01-07 18:45:53 UTC (rev 33) @@ -0,0 +1,37 @@ +/* + * ConnectionHandler.java + * + * Created on 13. Dezember 2006, 21:07 + * + * JLink: An Introversion Uplink Clone with multiplayer support. + * Copyright (C) 2006 Tassilo Schweyer + * + * This program 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 2 + * of the License, or (at your option) any later version. + * + * This program 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 this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package org.jlink.server; + +//import +//import::own +import org.jlink.server.net.Connection; +//import::sys + +/** + * + * @author welterde + */ +public interface ConnectionHandler { + public void newConnection(Connection con); +} Added: branches/private_welterde0/server/src/main/java/org/jlink/server/Context.java =================================================================== --- branches/private_welterde0/server/src/main/java/org/jlink/server/Context.java (rev 0) +++ branches/private_welterde0/server/src/main/java/org/jlink/server/Context.java 2007-01-07 18:45:53 UTC (rev 33) @@ -0,0 +1,81 @@ +/* + * Context.java + * + * Created on 7. Januar 2007, 15:03 + * + * JLink: An Uplink Clone with multiplayer support. + * Copyright (C) 2007 Tassilo Schweyer + * + * This program 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 2 + * of the License, or (at your option) any later version. + * + * This program 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 this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package org.jlink.server; + +//import +//import::own +//import::sys +import org.apache.commons.configuration.Configuration; +import org.apache.log4j.Logger; + +/** + * + * @author welterde + */ +public class Context { + + /** Creates a new instance of Context */ + public Context(Configuration cfg) { + if(cfg == null) + throw new NullPointerException(); + this.cfg = cfg; + this.log = Logger.getLogger(Context.class); + log.debug("Context created"); + } + + public void setCore(Core core) { + log.debug("setting Core"); + if(this.app_core != null) + throw new IllegalStateException("you may not set the core again"); + else + this.app_core = core; + log.debug("Core set!"); + } + public Core getCore() { + if(log.isTraceEnabled()) + log.trace("Core requested"); + return this.app_core; + } + + public Configuration getConfig() { + if(log.isTraceEnabled()) + log.trace("Config requested"); + return this.cfg; + } + public void reloadConfig() { + if(log.isDebugEnabled()) + log.debug("reload of config requested"); + log.error("not implemented"); + // TODO: reload the config + } + + + + private Configuration cfg = null; + + private Core app_core = null; + + private Logger log = null; + +} Modified: branches/private_welterde0/server/src/main/java/org/jlink/server/Core.java =================================================================== --- branches/private_welterde0/server/src/main/java/org/jlink/server/Core.java 2006-12-10 11:04:49 UTC (rev 32) +++ branches/private_welterde0/server/src/main/java/org/jlink/server/Core.java 2007-01-07 18:45:53 UTC (rev 33) @@ -39,27 +39,30 @@ import org.apache.log4j.Logger; /** - * + * The core of the Server. + * It is responsible for managing all other components of the Server * @author welterde */ public class Core implements Runnable { /** Creates a new instance of Core */ - public Core() { + public Core(Context ctx) { + if(ctx == null) + throw new NullPointerException(); log.debug("Core created"); + this.ctx = ctx; + } - public void init(Configuration conf) { + public void init() { log.info("initing Core"); - if(conf == null) - throw new NullPointerException("the config may not be null"); // <editor-fold defaultstate="collapsed" desc=" init StorageManager "> { try { log.info("initalizing StorageManager"); //create subset for the StorageManager - Configuration comp_conf = conf.subset("server.db"); + Configuration comp_conf = this.ctx.getConfig().subset("database"); //create an instance of the StorageManager this.app_storage = new StorageManager(); //init him, with the config @@ -81,9 +84,9 @@ try { log.info("initalizing NetworkManager"); //create subset for the NetworkManager - Configuration comp_conf = conf.subset("server.net"); + Configuration comp_conf = this.ctx.getConfig().subset("network"); //create an instance of the NetworkManager - this.app_network = new NetworkManager(); + this.app_network = new NetworkManager(this); //init it, with the subset of the config this.app_network.init(comp_conf); //create the JMX wrapper for the NetworkManager @@ -100,8 +103,32 @@ } // </editor-fold> + // <editor-fold defaultstate="collapsed" desc=" init SessionManager "> + { + try { + log.info("initializing SessionManager"); + //create subset for the SessionManager + Configuration comp_conf = this.ctx.getConfig().subset("session"); + //create an instance of the SessionManager + this.app_session = new SessionManager(this); + //init it, with the subset of the config + this.app_session.init(comp_conf); + //create the JMX wrapper for the NetworkManager + //TODO: do this + //register the JMX wrapper + //TODO: register the JMX wrapper + log.info("SessionManager initalized"); + } catch(Exception exc) { + log.error("initializing failed", exc); + //TODO: seperate problems into NetworkManager and NetworkManagerJMX + } + + + } + // </editor-fold> + } @@ -157,12 +184,21 @@ public StorageManager getStorage() { return this.app_storage; } + public NetworkManager getNetwork() { + return this.app_network; + } - private Logger log = Logger.getLogger(Core.class); - private Thread thread = new Thread(this); - private Object runLock = "lock009ij"; + /////////////////////////////////////// + ////////////// Variables ////////////// + /////////////////////////////////////// + + private Logger log = Logger.getLogger(Core.class); + private Context ctx = null; + private Thread thread = new Thread(this); + private Object runLock = "lock009ij"; + private boolean doStop = false; //Composite stuff @@ -171,4 +207,6 @@ public NetworkManager app_network = null; + public SessionManager app_session = null; + } Modified: branches/private_welterde0/server/src/main/java/org/jlink/server/Main.java =================================================================== --- branches/private_welterde0/server/src/main/java/org/jlink/server/Main.java 2006-12-10 11:04:49 UTC (rev 32) +++ branches/private_welterde0/server/src/main/java/org/jlink/server/Main.java 2007-01-07 18:45:53 UTC (rev 33) @@ -65,6 +65,8 @@ String conf_log = null; String conf_srv = null; + Context ctx = null; + // <editor-fold defaultstate="collapsed" desc=" parse arguments "> try { //create options @@ -119,12 +121,14 @@ } else if(conf_log.endsWith("xml")) { DOMConfigurator.configure(conf_log); } else { - //VOTE: shall we crash here or use simply BasicConf + //to make it simple for server operators, use the simple BasicConfigurator BasicConfigurator.configure(); - //TODO: till when vote is over, add log message telling that init logging failed } + // now tell the user, that we started logging log = Logger.getLogger(Main.class); log.info("logging started"); + // print the system information to the log file + // this information is mostly used by us for debugging and bug reports { Logger sys = Logger.getLogger("jlink.init.sysinfo"); sys.info("retrieving system information"); @@ -139,7 +143,6 @@ // </editor-fold> // <editor-fold defaultstate="collapsed" desc=" load config "> - //TODO: check existance of file log.info("loading server configuration"); try { xconf = new XMLConfiguration(conf_srv); @@ -152,6 +155,8 @@ // </editor-fold> + ctx = new Context(conf); + // <editor-fold defaultstate="collapsed" desc=" startup "> // </editor-fold> @@ -160,7 +165,7 @@ JMXAgent agent = JMXAgent.getDefault(); // </editor-fold> - Core core = new Core(); + Core core = new Core(ctx); core.start(); @@ -170,24 +175,14 @@ public static void shutdown() { log.info("shutdown requested"); - confSave(); //TODO: shutdown everything log.info("shutdown complete, exiting"); System.exit(0); } - - - public static void confSave() { - //FIX: Threadsave? - log.debug("saving config"); - try { - xconf.save(); - log.trace("config saved"); - } catch (ConfigurationException exc) { - log.warn("couldnt save config", exc); - } - } + /** + * This will cause the reload of the configuration + */ public static void confReload() { log.info("hit unimplemented method"); //TODO: write this Modified: branches/private_welterde0/server/src/main/java/org/jlink/server/MainJMX.java =================================================================== --- branches/private_welterde0/server/src/main/java/org/jlink/server/MainJMX.java 2006-12-10 11:04:49 UTC (rev 32) +++ branches/private_welterde0/server/src/main/java/org/jlink/server/MainJMX.java 2007-01-07 18:45:53 UTC (rev 33) @@ -103,6 +103,7 @@ return new MBeanNotificationInfo[] {}; } + // Delegates to Main /** * Operation exposed for management */ Added: branches/private_welterde0/server/src/main/java/org/jlink/server/ScriptManager.java =================================================================== --- branches/private_welterde0/server/src/main/java/org/jlink/server/ScriptManager.java (rev 0) +++ branches/private_welterde0/server/src/main/java/org/jlink/server/ScriptManager.java 2007-01-07 18:45:53 UTC (rev 33) @@ -0,0 +1,72 @@ +/* + * ScriptManager.java + * + * Created on 10. Dezember 2006, 13:34 + * + * JLink: An Introversion Uplink Clone with multiplayer support. + * Copyright (C) 2006 Tassilo Schweyer + * + * This program 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 2 + * of the License, or (at your option) any later version. + * + * This program 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 this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package org.jlink.server; + +//import +//import::own +import org.jlink.server.Core; +//import::sys +import org.apache.log4j.Logger; +import org.apache.commons.configuration.Configuration; + +/** + * + * @author welterde + */ +public class ScriptManager { + + /** Creates a new instance of ScriptManager */ + public ScriptManager(Core core) { + log.debug("ScriptManager created"); + if (core == null) + throw new NullPointerException(); + this.core = core; + } + + public void init(Configuration conf) { + log.info("initializing ScriptManager"); + if(conf == null) + throw new NullPointerException("the config may not be null"); + + } + + public Object run(String script) { + if(script == null) + throw new NullPointerException(); + return null; + } + + public void destroy() { + + } + + + + + + private Logger log = Logger.getLogger(ScriptManager.class); + + private Core core = null; + +} Added: branches/private_welterde0/server/src/main/java/org/jlink/server/Session.java =================================================================== --- branches/private_welterde0/server/src/main/java/org/jlink/server/Session.java (rev 0) +++ branches/private_welterde0/server/src/main/java/org/jlink/server/Session.java 2007-01-07 18:45:53 UTC (rev 33) @@ -0,0 +1,36 @@ +/* + * Session.java + * + * Created on 20. Dezember 2006, 19:16 + * + * JLink: An Introversion Uplink Clone with multiplayer support. + * Copyright (C) 2006 Tassilo Schweyer + * + * This program 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 2 + * of the License, or (at your option) any later version. + * + * This program 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 this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package org.jlink.server; + +/** + * + * @author welterde + */ +public class Session { + + /** Creates a new instance of Session */ + public Session() { + } + +} Added: branches/private_welterde0/server/src/main/java/org/jlink/server/SessionManager.java =================================================================== --- branches/private_welterde0/server/src/main/java/org/jlink/server/SessionManager.java (rev 0) +++ branches/private_welterde0/server/src/main/java/org/jlink/server/SessionManager.java 2007-01-07 18:45:53 UTC (rev 33) @@ -0,0 +1,87 @@ +/* + * SessionManager.java + * + * Created on 20. Dezember 2006, 19:17 + * + * JLink: An Introversion Uplink Clone with multiplayer support. + * Copyright (C) 2006 Tassilo Schweyer + * + * This program 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 2 + * of the License, or (at your option) any later version. + * + * This program 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 this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package org.jlink.server; + +//import +//import::own +//import::sys +import org.apache.commons.configuration.Configuration; +import org.apache.log4j.Logger; + +/** + * + * @author welterde + */ +public class SessionManager { + + /** Creates a new instance of SessionManager */ + public SessionManager(Core core) { + log.trace("SessionManager created"); + if(core == null) + throw new NullPointerException(); + else + this.core = core; + } + + public void init(Configuration conf) { + if(this.valid) + return; + log.debug("initializing SessionManager"); + if(conf == null) + throw new NullPointerException(); + this.config = conf; + + + + this.valid = true; + } + + public void start() { + + } + + protected void run() { + + } + + public void stop() { + + } + + public void destroy() { + + } + + + private Logger log = Logger.getLogger(SessionManager.class); + + private Core core = null; + + private Configuration config = null; + + // Status + private boolean valid = false; + + private boolean running = false; +} Added: branches/private_welterde0/server/src/main/java/org/jlink/server/net/Connection.java =================================================================== --- branches/private_welterde0/server/src/main/java/org/jlink/server/net/Connection.java (rev 0) +++ branches/private_welterde0/server/src/main/java/org/jlink/server/net/Connection.java 2007-01-07 18:45:53 UTC (rev 33) @@ -0,0 +1,71 @@ +/* + * Connection.java + * + * Created on 13. Dezember 2006, 20:31 + * + * JLink: An Introversion Uplink Clone with multiplayer support. + * Copyright (C) 2006 Tassilo Schweyer + * + * This program 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 2 + * of the License, or (at your option) any later version. + * + * This program 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 this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package org.jlink.server.net; + +//import +//import::own +//import::sys +import java.net.Socket; +import java.util.Queue; +import java.util.concurrent.LinkedBlockingQueue; + +/** + * Wrapper around the Socket. + * @author welterde + */ +public class Connection { + + /** Creates a new instance of Connection */ + public Connection(Socket sock) { + if(sock == null) + throw new NullPointerException("that is an wrapper around an TCP! but where is the Socket?"); + this.sock = sock; + } + + public void send(Object msg) throws InterruptedException { + if(msg == null) + throw new NullPointerException(); + //enque the Message to be sent + //this.toSent.put(msg); + } + + + + + + + public boolean alive() { + return this.sock.isClosed(); + } + + public boolean valid() { + boolean v = true; + boolean a = this.alive(); + return (v||a); + } + + private Socket sock = null; + + private Queue<Object> toSent = new LinkedBlockingQueue<Object>(); +} Added: branches/private_welterde0/server/src/main/java/org/jlink/server/net/ConnectionID.java =================================================================== --- branches/private_welterde0/server/src/main/java/org/jlink/server/net/ConnectionID.java (rev 0) +++ branches/private_welterde0/server/src/main/java/org/jlink/server/net/ConnectionID.java 2007-01-07 18:45:53 UTC (rev 33) @@ -0,0 +1,44 @@ +/* + * ConnectionID.java + * + * Created on 18. Dezember 2006, 21:43 + * + * JLink: An Introversion Uplink Clone with multiplayer support. + * Copyright (C) 2006 Tassilo Schweyer + * + * This program 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 2 + * of the License, or (at your option) any later version. + * + * This program 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 this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package org.jlink.server.net; + +/** + * + * @author welterde + */ +public class ConnectionID { + + /** Creates a new instance of ConnectionID */ + public ConnectionID(String id) { + if(id == null) + throw new NullPointerException(); + this.id = id; + } + + public String id() { + return this.id; + } + + String id; +} Added: branches/private_welterde0/server/src/main/java/org/jlink/server/net/ConnectionIDFactory.java =================================================================== --- branches/private_welterde0/server/src/main/java/org/jlink/server/net/ConnectionIDFactory.java (rev 0) +++ branches/private_welterde0/server/src/main/java/org/jlink/server/net/ConnectionIDFactory.java 2007-01-07 18:45:53 UTC (rev 33) @@ -0,0 +1,32 @@ +/* + * ConnectionIDFactory.java + * + * Created on 18. Dezember 2006, 21:44 + * + * JLink: An Introversion Uplink Clone with multiplayer support. + * Copyright (C) 2006 Tassilo Schweyer + * + * This program 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 2 + * of the License, or (at your option) any later version. + * + * This program 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 this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package org.jlink.server.net; + +/** + * + * @author welterde + */ +public interface ConnectionIDFactory { + public ConnectionID generateID(); +} Added: branches/private_welterde0/server/src/main/java/org/jlink/server/net/ConnectionManager.java =================================================================== --- branches/private_welterde0/server/src/main/java/org/jlink/server/net/ConnectionManager.java (rev 0) +++ branches/private_welterde0/server/src/main/java/org/jlink/server/net/ConnectionManager.java 2007-01-07 18:45:53 UTC (rev 33) @@ -0,0 +1,71 @@ +/* + * ConnectionManager.java + * + * Created on 18. Dezember 2006, 20:13 + * + * JLink: An Introversion Uplink Clone with multiplayer support. + * Copyright (C) 2006 Tassilo Schweyer + * + * This program 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 2 + * of the License, or (at your option) any later version. + * + * This program 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 this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package org.jlink.server.net; + +//import +//import::own +//import::sys +import org.apache.log4j.Logger; +import java.util.Map; +import java.util.HashMap; + +/** + * This class is responsible for maintaining an list of connections. + * + * @author welterde + */ +public class ConnectionManager { + + /** Creates a new instance of ConnectionManager */ + public ConnectionManager() { + log.debug("ConnectionManager created"); + } + + public void add(Connection con) { + // first check if this connection is already there + //boolean c = this.connections.contains(con); + if(true) { + return; + } else { + //this.connections.add(null, con); + } + + // now we handle the beginning of the JLink Protocol + // TODO: handle the beginning of the JLink Protocol + } + + public void remove(Connection con) { + this.connections.remove(con); + } + + public void purge() { + + } + + + + private Map<ConnectionID, Connection> connections = new HashMap<ConnectionID, Connection>(); + + private Logger log = Logger.getLogger(ConnectionManager.class); +} Modified: branches/private_welterde0/server/src/main/java/org/jlink/server/net/NetworkManager.java =================================================================== --- branches/private_welterde0/server/src/main/java/org/jlink/server/net/NetworkManager.java 2006-12-10 11:04:49 UTC (rev 32) +++ branches/private_welterde0/server/src/main/java/org/jlink/server/net/NetworkManager.java 2007-01-07 18:45:53 UTC (rev 33) @@ -25,24 +25,44 @@ //import //import::own +import org.jlink.server.Core; //import::sys import org.apache.log4j.Logger; import org.apache.commons.configuration.Configuration; +import java.io.IOException; +import java.util.List; +import java.util.LinkedList; +//import::sys::net +import java.net.ServerSocket; +import java.net.Socket; /** - * + * The NetworkManager manages everything related to networking. + * It is a bit like a meta-manager, because it only handles the Socket and the + * creation of connection objects. * @author welterde */ public class NetworkManager implements Runnable { - /** Creates a new instance of NetworkManager */ - public NetworkManager() { + /** + * Creates a new instance of NetworkManager + * @param core The core of the server + */ + public NetworkManager(Core core) { log.trace("NetworkManager created"); + if(core == null) + throw new NullPointerException(); + else + this.core = core; } + /** + * This will initialize, this NetworkManager, with the given configuration. + * @param conf Thats the configuration loaded, has to be the subset, for this module + */ public void init(Configuration conf) { - //bypass, so it isnt inited multiple times + //bypass, so it isnt initialized multiple times if(this.valid) return; log.debug("initing NetworkManager"); @@ -50,20 +70,65 @@ if(conf == null) throw new NullPointerException("no, the configuration may not be null"); this.config = conf; + //enough of the wrapper code, lets get to the business code + /////////////////// + // Business code // + /////////////////// + { + // the port we will listen on + int port = 0; + // the interface we will listen on + String bind = null; + // how many errors may occour before, the port is treated as closed + int errMax = 0; + + //read port and bind adress from the config + port = this.config.getInt("port", 4242); + bind = this.config.getString("bindTo", null); + errMax = this.config.getInt("maxErr", 42); + // now validate the stuff + if (port < 1024) { + log.fatal("it can be dangerous to run jlink on an port < 1024"); + //but lets continue(he knows what he is doing) + } + // empty strings are not valid interfaces + if (bind == "" || bind == " ") + bind = null; + + // read from config; validated; now save it + this.port = port; + this.host = bind; + this.errMax = errMax; + } + + + //set the status variable, so we know that the NM is valid this.valid = true; } + /** + * Starts the NetworkManager, if it is has been initialized. + * It will start listening on the port defined on the port given in the given config. + * Alternatively it will listen on the default port, which is 4242. + */ public void start() { //bypass, so we dont start it multiple times if(this.running) return; log.debug("starting NetworkManager"); + + //now create an new thread, and get to work + this.thread = new Thread(this); + this.thread.start(); } + /** + * should not be called from outside. + */ public void run() { - //bypass, so we have only one instance + //bypass, so we have only one instance runnings if(this.running) return; //TODO: add check for not gracefully stopped threads @@ -73,38 +138,105 @@ //set the status variable, so we know that we're running this.running = true; - //TODO: business code + /////////////////// + // Business code // + /////////////////// + { + // first start the ServerSocket + if(this.host == null) + try { + // listen on port, specified when initialized + this.socket = new ServerSocket(this.port); + } catch(IOException err) { + // tell the user, what failed + log.fatal("cannot listen on port:" + this.port, err); + // now crash the server + throw new RuntimeException("listen failed", err); + } + else { + // listening on an specified port is not possible + throw new UnsupportedOperationException("binding to an selected interface not implemented"); + } + // the connection to the client + Socket sock = null; + // the socket nllw + Connection con = null; + // the current error count + int errC = 0; + // run forever until we should stop + while(!this.doStop) { + try { + // accept one connection + sock = this.socket.accept(); + // now create an Connection object for that object + con = new Connection(sock); + // save the connection + this.connections.add(con); + // call the core as ConnectionHandler + + } catch(IOException err) { + // tell the user, that something has went terrible wrong + log.fatal("accept failed", err); + // increase the error count + errC++; + // if the errorcount exeeds the maximum, stop + if(errC > this.errMax) + this.stop(); + } + } + } //set the status variable, so we know that we're not running anymore this.running = false; } + /** + * Waits until the networkmanager thread has finished. + * Returns immideatly if the thread is not running + * @throws java.lang.InterruptedException delegated from Thread + */ public void join() throws InterruptedException { //bypass, so we dont want to wait for an stopped thread if(!this.running) return; + // tell the user, what we are doing log.debug("joining NetworkManager"); this.thread.join(); } + /** + * This will enque stopping of the server. + * Returns immideatly. + */ public void stop() { //bypass, so we dont want to stop an stopped thread if(!this.running) return; - log.debug("stopping NetworkManager"); + // tell the user, what we are doing + log.debug("stopping NetworkManager"); + + // set async flag to stop + this.doStop = true; } + /** + * This will undo every change done in init(config) and turn this NetworkManager + * invalid. + */ public void destroy() { //bypass, so we dont destroy something destroid if(!this.valid) return; + // tell the user, what we are doing log.debug("destroying NetworkManager"); //check first if the thread is running, if so stop him if(this.running) { + // gently shutdown this.stop(); try { + // wait for the thread to end this.join(); } catch(InterruptedException exc) { //this should never happen @@ -121,13 +253,67 @@ - private Logger log = Logger.getLogger(NetworkManager.class); + /** + * The connection to the operator, to tell him whats going on. + */ + private Logger log = Logger.getLogger(NetworkManager.class); - private Configuration config = null; + /** + * The configuration of us. + */ + private Configuration config = null; - private Thread thread = null; + /** + * The thread we will run on. + */ + private Thread thread = null; + /** + * The core of the Server. + * Used for callbacks. + */ + private Core core = null; + + //business stuff + /** + * The ServerSocket, we will listen on. + */ + private ServerSocket socket = null; + + /** + * All connections + */ + private List<Connection> connections = new LinkedList<Connection>(); + + /** + * The port, we will listen on + */ + private int port = 0; + + /** + * The interface we will listen on + */ + private String host = null; + + /** + * How many errors may occour, before we think thats to much. + */ + private int errMax = 0; + //Status - private boolean valid = false; - private boolean running = false; + /** + * This is true if this NetworkManager is valid. + */ + private boolean valid = false; + /** + * This is true, if this NetworkManager is runnning. + */ + private boolean running = false; + + //operations + /** + * Thats one operation flag. + * If true and if the NetworkManager is running, the run method will stop. + */ + private boolean doStop = false; } Added: branches/private_welterde0/server/src/main/java/org/jlink/server/net/Protocol.java =================================================================== --- branches/private_welterde0/server/src/main/java/org/jlink/server/net/Protocol.java (rev 0) +++ branches/private_welterde0/server/src/main/java/org/jlink/server/net/Protocol.java 2007-01-07 18:45:53 UTC (rev 33) @@ -0,0 +1,44 @@ +/* + * Protocol.java + * + * Created on 19. Dezember 2006, 17:54 + * + * JLink: An Introversion Uplink Clone with multiplayer support. + * Copyright (C) 2006 Tassilo Schweyer + * + * This program 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 2 + * of the License, or (at your option) any later version. + * + * This program 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 this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package org.jlink.server.net; + +//import +//import::own +import org.jlink.server.Session; +//import::sys + +/** + * + * @author welterde + */ +public interface Protocol { + public boolean recocgnize(byte[] data); + + public void init(Connection con); + + public Session start(); + + public void reset(); + +} Added: branches/private_welterde0/server/src/main/java/org/jlink/server/net/ProtocolManager.java =================================================================== --- branches/private_welterde0/server/src/main/java/org/jlink/server/net/ProtocolManager.java (rev 0) +++ branches/private_welterde0/server/src/main/java/org/jlink/server/net/ProtocolManager.java 2007-01-07 18:45:53 UTC (rev 33) @@ -0,0 +1,68 @@ +/* + * ProtocolManager.java + * + * Created on 19. Dezember 2006, 18:08 + * + * JLink: An Introversion Uplink Clone with multiplayer support. + * Copyright (C) 2006 Tassilo Schweyer + * + * This program 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 2 + * of the License, or (at your option) any later version. + * + * This program 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 this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package org.jlink.server.net; + +//import +//import::own +//import::sys +import java.util.List; +import java.util.LinkedList; + +/** + * + * @author welterde + */ +public class ProtocolManager { + + /** Creates a new instance of ProtocolManager */ + private ProtocolManager() { + } + + public static void register(Protocol p) { + if(p == null) + throw new NullPointerException(); + protocols.add(p); + } + public static ProtocolManager getInstance() { + if(instance == null) + instance = new ProtocolManager(); + return instance; + } + + + + public Protocol recocgnize(byte[] data) { + for(int i = 0; i < protocols.size();i++) { + if(protocols.get(i).recocgnize(data)) + return protocols.get(i); + } + throw new RuntimeException("no suitable protocol found"); + } + + + + private static List<Protocol> protocols = new LinkedList<Protocol>(); + + private static ProtocolManager instance = null; +} Added: branches/private_welterde0/server/src/main/java/org/jlink/server/net/SimpleConnectionIDFactory.java =================================================================== --- branches/private_welterde0/server/src/main/java/org/jlink/server/net/SimpleConnectionIDFactory.java (rev 0) +++ branches/private_welterde0/server/src/main/java/org/jlink/server/net/SimpleConnectionIDFactory.java 2007-01-07 18:45:53 UTC (rev 33) @@ -0,0 +1,59 @@ +/* + * SimpleConnectionIDFactory.java + * + * Created on 18. Dezember 2006, 21:46 + * + * JLink: An Introversion Uplink Clone with multiplayer support. + * Copyright (C) 2006 Tassilo Schweyer + * + * This program 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 2 + * of the License, or (at your option) any later version. + * + * This program 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 this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package org.jlink.server.net; + +import java.util.Random; + +/** + * + * @author welterde + */ +public class SimpleConnectionIDFactory implements ConnectionIDFactory { + public SimpleConnectionIDFactory() { + current = current + 34500; + this.rand = new Random(); + } + + public ConnectionID generateID(String namespace) { + int add = 0; + long c = 0L; + synchronized(current_lock) { + c = current; + } + add = rand.nextInt(); + long res = c + add; + return new ConnectionID(namespace + res); + } + public ConnectionID generateID() { + return this.generateID(""); + } + + + + private static long current = 0L; + + private static String current_lock = "adsfdcvbhztrf"; + + private Random rand = null; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wel...@us...> - 2006-12-10 11:04:52
|
Revision: 32 http://svn.sourceforge.net/java-link/?rev=32&view=rev Author: welterde0 Date: 2006-12-10 03:04:49 -0800 (Sun, 10 Dec 2006) Log Message: ----------- updated docu to be better readable in the console(for all those console geeks out there) Modified Paths: -------------- branches/private_welterde0/LICENSE branches/private_welterde0/PROJECTS branches/private_welterde0/README branches/private_welterde0/TODO Modified: branches/private_welterde0/LICENSE =================================================================== --- branches/private_welterde0/LICENSE 2006-11-25 17:27:34 UTC (rev 31) +++ branches/private_welterde0/LICENSE 2006-12-10 11:04:49 UTC (rev 32) @@ -277,4 +277,4 @@ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - END OF TERMS AND CONDITIONS \ No newline at end of file + END OF TERMS AND CONDITIONS Modified: branches/private_welterde0/PROJECTS =================================================================== --- branches/private_welterde0/PROJECTS 2006-11-25 17:27:34 UTC (rev 31) +++ branches/private_welterde0/PROJECTS 2006-12-10 11:04:49 UTC (rev 32) @@ -10,4 +10,4 @@ 4 Share -5 Themes \ No newline at end of file +5 Themes Modified: branches/private_welterde0/README =================================================================== --- branches/private_welterde0/README 2006-11-25 17:27:34 UTC (rev 31) +++ branches/private_welterde0/README 2006-12-10 11:04:49 UTC (rev 32) @@ -24,4 +24,4 @@ TODO: write this :-) 6.Further Questions -see http://java-link.sourceforge.net/moin \ No newline at end of file +see http://java-link.sourceforge.net/moin Modified: branches/private_welterde0/TODO =================================================================== --- branches/private_welterde0/TODO 2006-11-25 17:27:34 UTC (rev 31) +++ branches/private_welterde0/TODO 2006-12-10 11:04:49 UTC (rev 32) @@ -10,4 +10,4 @@ /////////////////////////////////////////////////// //////////Share//////////////////////////////////// -/////////////////////////////////////////////////// \ No newline at end of file +/////////////////////////////////////////////////// This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wel...@us...> - 2006-11-25 17:27:35
|
Revision: 31 http://svn.sourceforge.net/java-link/?rev=31&view=rev Author: welterde0 Date: 2006-11-25 09:27:34 -0800 (Sat, 25 Nov 2006) Log Message: ----------- added sample log4j config to server env Modified Paths: -------------- branches/private_welterde0/env_server/logging/sample.xml Modified: branches/private_welterde0/env_server/logging/sample.xml =================================================================== --- branches/private_welterde0/env_server/logging/sample.xml 2006-11-25 17:25:49 UTC (rev 30) +++ branches/private_welterde0/env_server/logging/sample.xml 2006-11-25 17:27:34 UTC (rev 31) @@ -34,4 +34,4 @@ <appender-ref ref="FILE-I"/> </root> -</log4j:configuration> \ No newline at end of file +</log4j:configuration> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wel...@us...> - 2006-11-25 17:25:51
|
Revision: 30 http://svn.sourceforge.net/java-link/?rev=30&view=rev Author: welterde0 Date: 2006-11-25 09:25:49 -0800 (Sat, 25 Nov 2006) Log Message: ----------- updated client codebase Modified Paths: -------------- branches/private_welterde0/client/src/main/java/org/jlink/client/Core.java branches/private_welterde0/client/src/main/java/org/jlink/client/Main.java Modified: branches/private_welterde0/client/src/main/java/org/jlink/client/Core.java =================================================================== --- branches/private_welterde0/client/src/main/java/org/jlink/client/Core.java 2006-11-25 17:24:45 UTC (rev 29) +++ branches/private_welterde0/client/src/main/java/org/jlink/client/Core.java 2006-11-25 17:25:49 UTC (rev 30) @@ -23,14 +23,16 @@ package org.jlink.client; -import org.jlink.Controller; -import org.jlink.ControllerSupport; +//import +//import::own +//import::sys +import org.apache.log4j.Logger; /** * * @author tassilo */ -public class Core implements Controller { +public class Core { /** Creates a new instance of Core */ public Core() { @@ -90,4 +92,6 @@ private boolean statRun = false; private Object callStop = new Object();//lock + + private Logger log = Logger.getLogger(Core.class); } Modified: branches/private_welterde0/client/src/main/java/org/jlink/client/Main.java =================================================================== --- branches/private_welterde0/client/src/main/java/org/jlink/client/Main.java 2006-11-25 17:24:45 UTC (rev 29) +++ branches/private_welterde0/client/src/main/java/org/jlink/client/Main.java 2006-11-25 17:25:49 UTC (rev 30) @@ -23,21 +23,53 @@ package org.jlink.client; +//import +//import::own +//import::sys +import org.apache.log4j.Logger; +import java.io.File; + /** * * @author tassilo */ public class Main { - /** Creates a new instance of Main */ - public Main() { + public static void main(String[] args) { + //set the application dir to the local directory + File appdir = new File("."); + //now check if there is an argument + if(args.length > 0) { + //ok, that means he wants to specify that manually + appdir = new File(args[0]); + } + + //create an Main object + Main main = new Main(); + + //init Main + main.init(appdir); + + //run Main + main.run(); } - /** - * @param args the command line arguments - */ - public static void main(String[] args) { - // TODO code application logic here + + + public void init(File appdir) { + //that could be an internal error + assert appdir != null; + //this is an user error + if(!appdir.exists()) { + + } } + + public void run() { + + } + + + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wel...@us...> - 2006-11-25 17:24:47
|
Revision: 29 http://svn.sourceforge.net/java-link/?rev=29&view=rev Author: welterde0 Date: 2006-11-25 09:24:45 -0800 (Sat, 25 Nov 2006) Log Message: ----------- changed netbeans project version from 5.0 to 5.5 Modified Paths: -------------- branches/private_welterde0/client/nbproject/project.properties branches/private_welterde0/client/nbproject/project.xml Modified: branches/private_welterde0/client/nbproject/project.properties =================================================================== --- branches/private_welterde0/client/nbproject/project.properties 2006-11-25 17:21:41 UTC (rev 28) +++ branches/private_welterde0/client/nbproject/project.properties 2006-11-25 17:24:45 UTC (rev 29) @@ -1,4 +1,5 @@ #The netbeans freeform property file -#Sat May 13 22:20:34 CEST 2006 -local.repository=/home/tassilo/.m2/repository +#Thu Nov 02 15:30:13 CET 2006 +local.repository=/Users/welterde/.m2/repository mvn.path=mvn +project.directory=/Users/welterde/Documents/dev/jlink/current_private/client Modified: branches/private_welterde0/client/nbproject/project.xml =================================================================== --- branches/private_welterde0/client/nbproject/project.xml 2006-11-25 17:21:41 UTC (rev 28) +++ branches/private_welterde0/client/nbproject/project.xml 2006-11-25 17:24:45 UTC (rev 29) @@ -1,134 +1,121 @@ -<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://www.netbeans.org/ns/project/1"> - <type>org.netbeans.modules.ant.freeform</type> - <configuration> - <general-data xmlns="http://www.netbeans.org/ns/freeform-project/1"> - <name>JLink Client</name> - <properties> - <property name="ant.script">nbproject/mavencall.xml</property> - <property-file>nbproject/project.properties</property-file> - </properties> - <folders> - <source-folder> - <label>src/main/java</label> - <type>java</type> - <location>src/main/java</location> - </source-folder> - <source-folder> - <label>src/test/java</label> - <type>java</type> - <location>src/test/java</location> - </source-folder> - </folders> - <ide-actions> - <action name="build"> - <script>${ant.script}</script> - <target>build</target> - </action> - <action name="clean"> - <script>${ant.script}</script> - <target>clean</target> - </action> - <action name="rebuild"> - <script>${ant.script}</script> - <target>clean</target> - <target>build</target> - </action> - <action name="javadoc"> - <script>${ant.script}</script> - <target>javadoc</target> - </action> - <action name="run"> - <script>${ant.script}</script> - <target>run</target> - </action> - <action name="test"> - <script>${ant.script}</script> - <target>test</target> - </action> - </ide-actions> - <export> - <type>folder</type> - <location>target/classes</location> - <script>${ant.script}</script> - <build-target>build</build-target> - </export> - <export> - <type>folder</type> - <location>target/test-classes</location> - <script>${ant.script}</script> - <build-target>build</build-target> - </export> - <view> - <items> - <source-folder style="packages"> - <label>src/main/java</label> - <location>src/main/java</location> - </source-folder> - <source-folder style="packages"> - <label>src/test/java</label> - <location>src/test/java</location> - </source-folder> - <source-file> - <label>pom</label> - <location>pom.xml</location> - </source-file> - <source-file> - <label>mavencall</label> - <location>nbproject/mavencall.xml</location> - </source-file> - <source-folder style="tree"> - <label>src/main/resources</label> - <location>src/main/resources</location> - </source-folder> - <source-folder style="tree"> - <label>src/test/resources</label> - <location>src/test/resources</location> - </source-folder> - <source-folder style="tree"> - <label>src/site</label> - <location>src/site</location> - </source-folder> - <source-folder style="tree"> - <label>target</label> - <location>target</location> - </source-folder> - </items> - <context-menu> - <action> - <script>${ant.script}</script> - <label>Refresh Project</label> - <target>refresh-project</target> - </action> - <ide-action name="build"/> - <ide-action name="clean"/> - <ide-action name="rebuild"/> - <ide-action name="javadoc"/> - <ide-action name="run"/> - <ide-action name="test"/> - <action> - <script>${ant.script}</script> - <label>Format Code</label> - <target>jalopy</target> - </action> - </context-menu> - </view> - <subprojects/> - </general-data> - <java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/2"> - <compilation-unit> - <package-root>src/main/java</package-root> - <classpath mode="compile">${local.repository}/org/jvnet/substance/core/2.2.02/core-2.2.02.jar:${local.repository}/jdom/jdom/1.0/jdom-1.0.jar:${local.repository}/org/jlink/share/0.0.1-SNAPSHOT/share-0.0.1-SNAPSHOT.jar:${local.repository}/org/jvnet/swing-layout/core/1.0/core-1.0.jar:${local.repository}/log4j/log4j/1.2.13/log4j-1.2.13.jar</classpath> - <built-to>target/classes</built-to> - <source-level>1.5</source-level> - </compilation-unit> - <compilation-unit> - <package-root>src/test/java</package-root> - <unit-tests/> - <classpath mode="compile">target/classes:${local.repository}/org/jvnet/substance/core/2.2.02/core-2.2.02.jar:${local.repository}/junit/junit/3.8.1/junit-3.8.1.jar:${local.repository}/jdom/jdom/1.0/jdom-1.0.jar:${local.repository}/org/jlink/share/0.0.1-SNAPSHOT/share-0.0.1-SNAPSHOT.jar:${local.repository}/org/jvnet/swing-layout/core/1.0/core-1.0.jar:${local.repository}/log4j/log4j/1.2.13/log4j-1.2.13.jar</classpath> - <built-to>target/test-classes</built-to> - <source-level>1.5</source-level> - </compilation-unit> - </java-data> - </configuration> -</project> + <type>org.netbeans.modules.ant.freeform</type> + <configuration> + <general-data xmlns="http://www.netbeans.org/ns/freeform-project/1"> + <name>JLink Client</name> + <properties> + <property name="ant.script">nbproject/mavencall.xml</property> + <property-file>nbproject/project.properties</property-file> + </properties> + <folders> + <source-folder> + <label>src/main/java</label> + <type>java</type> + <location>src/main/java</location> + </source-folder> + <source-folder> + <label>src/test/java</label> + <type>java</type> + <location>src/test/java</location> + </source-folder> + </folders> + <ide-actions> + <action name="build"> + <script>${ant.script}</script> + <target>build</target> + </action> + <action name="clean"> + <script>${ant.script}</script> + <target>clean</target> + </action> + <action name="rebuild"> + <script>${ant.script}</script> + <target>clean</target> + <target>build</target> + </action> + <action name="javadoc"> + <script>${ant.script}</script> + <target>javadoc</target> + </action> + <action name="run"> + <script>${ant.script}</script> + <target>run</target> + </action> + <action name="test"> + <script>${ant.script}</script> + <target>test</target> + </action> + </ide-actions> + <view> + <items> + <source-file> + <label>pom</label> + <location>pom.xml</location> + </source-file> + <source-file> + <label>mavencall</label> + <location>nbproject/mavencall.xml</location> + </source-file> + <source-folder style="packages"> + <label>src/main/java</label> + <location>src/main/java</location> + </source-folder> + <source-folder style="packages"> + <label>src/test/java</label> + <location>src/test/java</location> + </source-folder> + <source-folder style="tree"> + <label>src/main/resources</label> + <location>src/main/resources</location> + </source-folder> + <source-folder style="tree"> + <label>src/test/resources</label> + <location>src/test/resources</location> + </source-folder> + <source-folder style="tree"> + <label>src/site</label> + <location>src/site</location> + </source-folder> + <source-folder style="tree"> + <label>target</label> + <location>target</location> + </source-folder> + </items> + <context-menu> + <action> + <script>${ant.script}</script> + <label>Refresh Project</label> + <target>refresh-project</target> + </action> + <ide-action name="build"/> + <ide-action name="clean"/> + <ide-action name="rebuild"/> + <ide-action name="javadoc"/> + <ide-action name="run"/> + <ide-action name="test"/> + <action> + <script>${ant.script}</script> + <label>Format Code</label> + <target>jalopy</target> + </action> + </context-menu> + </view> + <subprojects/> + </general-data> + <java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/2"> + <compilation-unit> + <package-root>src/main/java</package-root> + <classpath mode="compile">${local.repository}/relaxngDatatype/relaxngDatatype/20020414/relaxngDatatype-20020414.jar:${local.repository}/isorelax/isorelax/20020414/isorelax-20020414.jar:${local.repository}/commons-lang/commons-lang/2.1/commons-lang-2.1.jar:${local.repository}/yan/jfunutil/5.0/jfunutil-5.0.jar:${local.repository}/log4j/log4j/1.2.13/log4j-1.2.13.jar:${local.repository}/commons-collections/commons-collections/3.1/commons-collections-3.1.jar:${local.repository}/jdom/jdom/1.0/jdom-1.0.jar:${local.repository}/commons-digester/commons-digester/1.6/commons-digester-1.6.jar:${local.repository}/msv/msv/20020414/msv-20020414.jar:${local.repository}/commons-codec/commons-codec/1.3/commons-codec-1.3.jar:${local.repository}/commons-logging/commons-logging/1.0/commons-logging-1.0.jar:${local.repository}/org/jlink/share/0.0.1-SNAPSHOT/share-0.0.1-SNAPSHOT.jar:${local.repository}/xerces/xercesImpl/2.2.1/xercesImpl-2.2.1.jar:${local.repository}/javax/servlet/servlet-api/2.3/servlet-api-2.3.jar:${local.repository}/xalan/xalan/2.7.0/xalan-2.7.0.jar:${local.repository}/yan/yan/5.0/yan-5.0.jar:${local.repository}/commons-configuration/commons-configuration/1.2/commons-configuration-1.2.jar:${local.repository}/nanoxml/nanoxml/2.2.3/nanoxml-2.2.3.jar:${local.repository}/org/jvnet/substance/core/2.2.02/core-2.2.02.jar:${local.repository}/jaxen/jaxen/1.0-FCS/jaxen-1.0-FCS.jar:${local.repository}/commons-beanutils/commons-beanutils/1.6/commons-beanutils-1.6.jar:${local.repository}/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.jar:${local.repository}/commons-logging/commons-logging-api/1.0.4/commons-logging-api-1.0.4.jar:${local.repository}/commons-beanutils/commons-beanutils-core/1.7.0/commons-beanutils-core-1.7.0.jar:${local.repository}/dom4j/dom4j/1.4/dom4j-1.4.jar:${local.repository}/org/jvnet/swing-layout/core/1.0/core-1.0.jar:${local.repository}/saxpath/saxpath/1.0-FCS/saxpath-1.0-FCS.jar</classpath> + <built-to>target/classes</built-to> + <source-level>1.4</source-level> + </compilation-unit> + <compilation-unit> + <package-root>src/test/java</package-root> + <unit-tests/> + <classpath mode="compile">target/classes:${local.repository}/relaxngDatatype/relaxngDatatype/20020414/relaxngDatatype-20020414.jar:${local.repository}/junit/junit/3.8.1/junit-3.8.1.jar:${local.repository}/isorelax/isorelax/20020414/isorelax-20020414.jar:${local.repository}/commons-lang/commons-lang/2.1/commons-lang-2.1.jar:${local.repository}/yan/jfunutil/5.0/jfunutil-5.0.jar:${local.repository}/log4j/log4j/1.2.13/log4j-1.2.13.jar:${local.repository}/commons-collections/commons-collections/3.1/commons-collections-3.1.jar:${local.repository}/jdom/jdom/1.0/jdom-1.0.jar:${local.repository}/commons-digester/commons-digester/1.6/commons-digester-1.6.jar:${local.repository}/msv/msv/20020414/msv-20020414.jar:${local.repository}/commons-codec/commons-codec/1.3/commons-codec-1.3.jar:${local.repository}/commons-logging/commons-logging/1.0/commons-logging-1.0.jar:${local.repository}/org/jlink/share/0.0.1-SNAPSHOT/share-0.0.1-SNAPSHOT.jar:${local.repository}/xerces/xercesImpl/2.2.1/xercesImpl-2.2.1.jar:${local.repository}/javax/servlet/servlet-api/2.3/servlet-api-2.3.jar:${local.repository}/xalan/xalan/2.7.0/xalan-2.7.0.jar:${local.repository}/yan/yan/5.0/yan-5.0.jar:${local.repository}/commons-configuration/commons-configuration/1.2/commons-configuration-1.2.jar:${local.repository}/nanoxml/nanoxml/2.2.3/nanoxml-2.2.3.jar:${local.repository}/org/jvnet/substance/core/2.2.02/core-2.2.02.jar:${local.repository}/jaxen/jaxen/1.0-FCS/jaxen-1.0-FCS.jar:${local.repository}/commons-beanutils/commons-beanutils/1.6/commons-beanutils-1.6.jar:${local.repository}/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.jar:${local.repository}/commons-logging/commons-logging-api/1.0.4/commons-logging-api-1.0.4.jar:${local.repository}/commons-beanutils/commons-beanutils-core/1.7.0/commons-beanutils-core-1.7.0.jar:${local.repository}/dom4j/dom4j/1.4/dom4j-1.4.jar:${local.repository}/org/jvnet/swing-layout/core/1.0/core-1.0.jar:${local.repository}/saxpath/saxpath/1.0-FCS/saxpath-1.0-FCS.jar</classpath> + <built-to>target/test-classes</built-to> + <source-level>1.4</source-level> + </compilation-unit> + </java-data> + </configuration> +</project> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wel...@us...> - 2006-11-25 17:21:45
|
Revision: 28 http://svn.sourceforge.net/java-link/?rev=28&view=rev Author: welterde0 Date: 2006-11-25 09:21:41 -0800 (Sat, 25 Nov 2006) Log Message: ----------- startedreimplemention of NET::NetworkManager and Core of Server Modified Paths: -------------- branches/private_welterde0/server/src/main/java/org/jlink/server/Core.java branches/private_welterde0/server/src/main/java/org/jlink/server/Main.java Added Paths: ----------- branches/private_welterde0/server/src/main/java/org/jlink/server/net/NetworkManager.java Modified: branches/private_welterde0/server/src/main/java/org/jlink/server/Core.java =================================================================== --- branches/private_welterde0/server/src/main/java/org/jlink/server/Core.java 2006-11-25 17:18:30 UTC (rev 27) +++ branches/private_welterde0/server/src/main/java/org/jlink/server/Core.java 2006-11-25 17:21:41 UTC (rev 28) @@ -30,6 +30,8 @@ //import::own::server::libdb import org.jlink.server.libdb.StorageManager; import org.jlink.server.libdb.StorageManagerJMX; +//import::own::server::net +import org.jlink.server.net.NetworkManager; //import::sys //import::sys::commons-configuration import org.apache.commons.configuration.Configuration; @@ -51,53 +53,99 @@ log.info("initing Core"); if(conf == null) throw new NullPointerException("the config may not be null"); - //init StorageManager + + // <editor-fold defaultstate="collapsed" desc=" init StorageManager "> { - try { - log.info("creating StorageManager"); - Configuration comp_conf = conf.subset("server.db"); - this.app_storage = new StorageManager(); - this.app_storage.init(comp_conf); - this.jmx_storage = new StorageManagerJMX(this.app_storage); - JMXAgent.getDefault().register("org.jlink.server.libdb:type=StorageManagerJMX", this.jmx_storage); - log.debug("done"); - } catch(Exception exc) { - log.error("creation failed, ignoring(wish me luck)", exc); - //TODO: split problems into StorageManger and JMX - } - } + try { + log.info("initalizing StorageManager"); + //create subset for the StorageManager + Configuration comp_conf = conf.subset("server.db"); + //create an instance of the StorageManager + this.app_storage = new StorageManager(); + //init him, with the config + this.app_storage.init(comp_conf); + //create the JMX wrapper for the StorageManager + this.jmx_storage = new StorageManagerJMX(this.app_storage); + //register the JMX wrapper + JMXAgent.getDefault().register("org.jlink.server.libdb:type=StorageManagerJMX", this.jmx_storage); + log.debug("StorageManager initalized"); + } catch(Exception exc) { + log.error("creation failed, ignoring(wish me luck)", exc); + //TODO: split problems into StorageManger and JMX + } + } + // </editor-fold> + + // <editor-fold defaultstate="collapsed" desc=" init NetworkManager "> + { + try { + log.info("initalizing NetworkManager"); + //create subset for the NetworkManager + Configuration comp_conf = conf.subset("server.net"); + //create an instance of the NetworkManager + this.app_network = new NetworkManager(); + //init it, with the subset of the config + this.app_network.init(comp_conf); + //create the JMX wrapper for the NetworkManager + //TODO: do this + //register the JMX wrapper + //TODO: register the JMX wrapper + log.info("NetworkManager initalized"); + } catch(Exception exc) { + log.error("initalizing failed", exc); + //TODO: seperate problems into NetworkManager and NetworkManagerJMX + } + + + } + // </editor-fold> + + + } public void start() { log.info("starting core..."); + //simply start the Thread this.thread.start(); log.debug("core started"); } public void run() { - log.debug("waiting for lock to run"); + log.debug("waiting for lock"); + //synchronize, so only one Thread can run here synchronized(runLock) { log.debug("got lock"); + //loop forever while(true) { + //ok, not forever if(this.doStop) break; try { + //wait 10ms => it wont eat up all CPU power Thread.sleep(10); + + //catch everything } catch(Exception exc) { log.error("unknown Exception cought", exc); } catch(Error err) { + log.error("unknown Error caught", err); + throw err; } finally { - + //do cleanup stuff(stop other parts) + //TODO: call cleanup method } } } } public void stop() { + //set internal stop flag, so the Thread will gently shutdown this.doStop = true; } public void shutdown() { + //before shutting down, call stop stop(); } @@ -119,6 +167,8 @@ //Composite stuff public StorageManager app_storage = null; - public StorageManagerJMX jmx_storage = null; + public StorageManagerJMX jmx_storage = null; + public NetworkManager app_network = null; + } Modified: branches/private_welterde0/server/src/main/java/org/jlink/server/Main.java =================================================================== --- branches/private_welterde0/server/src/main/java/org/jlink/server/Main.java 2006-11-25 17:18:30 UTC (rev 27) +++ branches/private_welterde0/server/src/main/java/org/jlink/server/Main.java 2006-11-25 17:21:41 UTC (rev 28) @@ -189,7 +189,7 @@ } } public static void confReload() { - log.info("hit unimplemented method"); + log.info("hit unimplemented method"); //TODO: write this } Added: branches/private_welterde0/server/src/main/java/org/jlink/server/net/NetworkManager.java =================================================================== --- branches/private_welterde0/server/src/main/java/org/jlink/server/net/NetworkManager.java (rev 0) +++ branches/private_welterde0/server/src/main/java/org/jlink/server/net/NetworkManager.java 2006-11-25 17:21:41 UTC (rev 28) @@ -0,0 +1,133 @@ +/* + * NetworkManager.java + * + * Created on 29. Oktober 2006, 14:15 + * + * JLink: An Introversion Uplink Clone with multiplayer support. + * Copyright (C) 2006 Tassilo Schweyer + * + * This program 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 2 + * of the License, or (at your option) any later version. + * + * This program 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 this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package org.jlink.server.net; + +//import +//import::own +//import::sys +import org.apache.log4j.Logger; +import org.apache.commons.configuration.Configuration; + +/** + * + * @author welterde + */ +public class NetworkManager implements Runnable { + + /** Creates a new instance of NetworkManager */ + public NetworkManager() { + log.trace("NetworkManager created"); + } + + + public void init(Configuration conf) { + //bypass, so it isnt inited multiple times + if(this.valid) + return; + log.debug("initing NetworkManager"); + //process the config + if(conf == null) + throw new NullPointerException("no, the configuration may not be null"); + this.config = conf; + + //set the status variable, so we know that the NM is valid + this.valid = true; + } + + public void start() { + //bypass, so we dont start it multiple times + if(this.running) + return; + log.debug("starting NetworkManager"); + } + + public void run() { + //bypass, so we have only one instance + if(this.running) + return; + //TODO: add check for not gracefully stopped threads + //TODO: add check, if the calling thread is the right thread + log.debug("running NetworkManager"); + + //set the status variable, so we know that we're running + this.running = true; + + //TODO: business code + + //set the status variable, so we know that we're not running anymore + this.running = false; + + } + + public void join() throws InterruptedException { + //bypass, so we dont want to wait for an stopped thread + if(!this.running) + return; + log.debug("joining NetworkManager"); + this.thread.join(); + } + + public void stop() { + //bypass, so we dont want to stop an stopped thread + if(!this.running) + return; + log.debug("stopping NetworkManager"); + } + + public void destroy() { + //bypass, so we dont destroy something destroid + if(!this.valid) + return; + log.debug("destroying NetworkManager"); + + //check first if the thread is running, if so stop him + if(this.running) { + this.stop(); + try { + this.join(); + } catch(InterruptedException exc) { + //this should never happen + log.fatal("interrupted", exc); + } + } + + //process the config + this.config = null; + + //set the status variable, so we know that the NM is not valid anymore + this.valid = false; + } + + + + private Logger log = Logger.getLogger(NetworkManager.class); + + private Configuration config = null; + + private Thread thread = null; + + //Status + private boolean valid = false; + private boolean running = false; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wel...@us...> - 2006-11-25 17:18:31
|
Revision: 27 http://svn.sourceforge.net/java-link/?rev=27&view=rev Author: welterde0 Date: 2006-11-25 09:18:30 -0800 (Sat, 25 Nov 2006) Log Message: ----------- added missing resources dir to client Added Paths: ----------- branches/private_welterde0/client/src/main/resources/ branches/private_welterde0/client/src/main/resources/log4j.properties Added: branches/private_welterde0/client/src/main/resources/log4j.properties =================================================================== --- branches/private_welterde0/client/src/main/resources/log4j.properties (rev 0) +++ branches/private_welterde0/client/src/main/resources/log4j.properties 2006-11-25 17:18:30 UTC (rev 27) @@ -0,0 +1 @@ +# The log4j configuration file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wel...@us...> - 2006-11-25 17:14:05
|
Revision: 26 http://svn.sourceforge.net/java-link/?rev=26&view=rev Author: welterde0 Date: 2006-11-25 09:14:00 -0800 (Sat, 25 Nov 2006) Log Message: ----------- removed legay code(part 2) Removed Paths: ------------- branches/private_welterde0/libgui/src/main/java/org/jlink/libgui/GUIRenderer.java branches/private_welterde0/libgui/src/main/java/org/jlink/libgui/RootFrame.java branches/private_welterde0/libgui/src/main/java/org/jlink/libgui/RootPane.java branches/private_welterde0/libgui/src/main/java/org/jlink/libgui/Window.java branches/private_welterde0/libgui/src/main/java/org/jlink/libgui/WindowListener.java branches/private_welterde0/libgui/src/main/java/org/jlink/libgui/widgets/ Deleted: branches/private_welterde0/libgui/src/main/java/org/jlink/libgui/GUIRenderer.java =================================================================== --- branches/private_welterde0/libgui/src/main/java/org/jlink/libgui/GUIRenderer.java 2006-11-25 17:12:10 UTC (rev 25) +++ branches/private_welterde0/libgui/src/main/java/org/jlink/libgui/GUIRenderer.java 2006-11-25 17:14:00 UTC (rev 26) @@ -1,36 +0,0 @@ -/* - * GUIRenderer.java - * - * Created on 5. Oktober 2006, 14:39 - * - * JLink: An Introversion Uplink Clone with multiplayer support. - * Copyright (C) 2006 Tassilo Schweyer - * - * This program 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 2 - * of the License, or (at your option) any later version. - * - * This program 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 this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -package org.jlink.libgui; - -/** - * - * @author welterde - */ -public class GUIRenderer { - - /** Creates a new instance of GUIRenderer */ - public GUIRenderer() { - } - -} Deleted: branches/private_welterde0/libgui/src/main/java/org/jlink/libgui/RootFrame.java =================================================================== --- branches/private_welterde0/libgui/src/main/java/org/jlink/libgui/RootFrame.java 2006-11-25 17:12:10 UTC (rev 25) +++ branches/private_welterde0/libgui/src/main/java/org/jlink/libgui/RootFrame.java 2006-11-25 17:14:00 UTC (rev 26) @@ -1,86 +0,0 @@ -/* - * RootFrame.java - * - * Created on 14. September 2006, 19:15 - * - * JLink: An Introversion Uplink Clone with multiplayer support. - * Copyright (C) 2006 Tassilo Schweyer - * - * This program 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 2 - * of the License, or (at your option) any later version. - * - * This program 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 this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -package org.jlink.libgui; - -import java.awt.GraphicsEnvironment; -import java.awt.GraphicsDevice; - -import javax.swing.JFrame; -import javax.swing.JPanel; - -/** - * - * @author welterde - */ -public class RootFrame { - - /** Creates a new instance of RootFrame */ - public RootFrame(JPanel panel) { - if(panel == null) - throw new NullPointerException(); - this.comp_panel = panel; - this.comp_frame = new JFrame("JLink"); - this.comp_frame.add(this.comp_panel); - this.comp_frame.pack(); - } - - - public void show(boolean fullscreen) { - //try to do fullscreen - if(fullscreen) { - GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); - GraphicsDevice gs = ge.getDefaultScreenDevice(); - //check if we can switch to fullscreen - if (gs.isFullScreenSupported()) { - //TODO: write fullscreen code - fullscreen = false; - } else { - //if not, force fall over to windowed mode - fullscreen = false; - } - } - if(!fullscreen) { - this.comp_frame.setSize(1024, 768); - this.comp_frame.pack(); - this.comp_frame.setVisible(true); - } - } - public void unshow() { - this.comp_frame.setVisible(false); - } - public void dispose() { - this.comp_frame.dispose(); - } - - - - - - - - - - private JPanel comp_panel = null; - private JFrame comp_frame = null; -} Deleted: branches/private_welterde0/libgui/src/main/java/org/jlink/libgui/RootPane.java =================================================================== --- branches/private_welterde0/libgui/src/main/java/org/jlink/libgui/RootPane.java 2006-11-25 17:12:10 UTC (rev 25) +++ branches/private_welterde0/libgui/src/main/java/org/jlink/libgui/RootPane.java 2006-11-25 17:14:00 UTC (rev 26) @@ -1,67 +0,0 @@ -/* - * RootPane.java - * - * Created on 13. September 2006, 21:28 - * - * JLink: An Introversion Uplink Clone with multiplayer support. - * Copyright (C) 2006 Tassilo Schweyer - * - * This program 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 2 - * of the License, or (at your option) any later version. - * - * This program 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 this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -package org.jlink.libgui; - -import javax.swing.JPanel; -import javax.swing.JPopupMenu; -import javax.swing.JMenuItem; - -import org.apache.commons.configuration.Configuration; -import org.apache.commons.configuration.ConversionException; - -/** - * - * @author welterde - */ -public class RootPane extends JPanel { - - /** Creates a new instance of RootPane */ - public RootPane(Configuration conf) { - //try to get an default value for X - try { - this.win_default_x = conf.getInt("win_x", 768); - } catch(ConversionException exc) { - //TODO: log it - } - //set X for panel - //try to get an default value for Y - try { - this.win_default_y = conf.getInt("win_y", 768); - } catch(ConversionException exc) { - //TODO: log it - } - - } - - - - - - //Base configuration - private int win_default_x = 200; - private int win_default_y = 200; - - - -} Deleted: branches/private_welterde0/libgui/src/main/java/org/jlink/libgui/Window.java =================================================================== --- branches/private_welterde0/libgui/src/main/java/org/jlink/libgui/Window.java 2006-11-25 17:12:10 UTC (rev 25) +++ branches/private_welterde0/libgui/src/main/java/org/jlink/libgui/Window.java 2006-11-25 17:14:00 UTC (rev 26) @@ -1,57 +0,0 @@ -/* - * Window.java - * - * Created on 14. September 2006, 15:16 - * - * JLink: An Introversion Uplink Clone with multiplayer support. - * Copyright (C) 2006 Tassilo Schweyer - * - * This program 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 2 - * of the License, or (at your option) any later version. - * - * This program 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 this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -package org.jlink.libgui; - -import javax.swing.JInternalFrame; -import javax.swing.JPanel; -import javax.swing.JPopupMenu; - -/** - * TODO: add Popupmenu in titlebar - * TODO: add transparency - * @author welterde - */ -public abstract class Window extends JInternalFrame { - - /** - * Creates a new instance of Window - */ - public Window(String title, boolean resizable, boolean closeable, boolean maximizable, boolean iconifiable) { - super(title, resizable, closeable, maximizable, iconifiable); - this.pay_panel = this.getPanel(); - } - - - - //abstract methods - protected abstract JPanel getPanel(); - - protected void setModifiedState(boolean modified) { - //TODO: write modified code thingy - } - - - - private JPanel pay_panel = null; -} Deleted: branches/private_welterde0/libgui/src/main/java/org/jlink/libgui/WindowListener.java =================================================================== --- branches/private_welterde0/libgui/src/main/java/org/jlink/libgui/WindowListener.java 2006-11-25 17:12:10 UTC (rev 25) +++ branches/private_welterde0/libgui/src/main/java/org/jlink/libgui/WindowListener.java 2006-11-25 17:14:00 UTC (rev 26) @@ -1,41 +0,0 @@ -/* - * WindowListener.java - * - * Created on 14. September 2006, 22:17 - * - * JLink: An Introversion Uplink Clone with multiplayer support. - * Copyright (C) 2006 Tassilo Schweyer - * - * This program 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 2 - * of the License, or (at your option) any later version. - * - * This program 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 this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -package org.jlink.libgui; - -/** - * - * @author welterde - */ -public interface WindowListener { - //modified state change - public void modified(); - public void discarded();//spelled right? - public void saved(); - - //window itself - public void maximized(); - public void minimized(); - public void resized(int x, int y); - public void moved(int abs_x, int abs_y); -} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wel...@us...> - 2006-11-25 17:12:13
|
Revision: 25 http://svn.sourceforge.net/java-link/?rev=25&view=rev Author: welterde0 Date: 2006-11-25 09:12:10 -0800 (Sat, 25 Nov 2006) Log Message: ----------- removed legacy code Removed Paths: ------------- branches/private_welterde0/server/src/main/java/org/jlink/CoreController.java branches/private_welterde0/server/src/main/java/org/jlink/DatabaseController.java branches/private_welterde0/server/src/main/java/org/jlink/LoginController.java branches/private_welterde0/server/src/main/java/org/jlink/Options.java branches/private_welterde0/server/src/main/java/org/jlink/ServerCore.java branches/private_welterde0/server/src/main/java/org/jlink/ServerDatabase.java branches/private_welterde0/server/src/main/java/org/jlink/ServerMain.java branches/private_welterde0/server/src/main/java/org/jlink/ServerNetwork.java branches/private_welterde0/server/src/main/java/org/jlink/server/db/ Deleted: branches/private_welterde0/server/src/main/java/org/jlink/CoreController.java =================================================================== --- branches/private_welterde0/server/src/main/java/org/jlink/CoreController.java 2006-11-25 16:50:09 UTC (rev 24) +++ branches/private_welterde0/server/src/main/java/org/jlink/CoreController.java 2006-11-25 17:12:10 UTC (rev 25) @@ -1,37 +0,0 @@ -/* - * CoreController.java - * - * Created on 10. Januar 2006, 18:54 - * - * JLink: An Introversion Uplink Clone with multiplayer support. - * Copyright (C) 2006 Tassilo Schweyer - * - * This program 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 2 - * of the License, or (at your option) any later version. - * - * This program 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 this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -package org.jlink; - -/** - * - * @author tassilo - */ -public interface CoreController { - - public void createConnection(int id, String rhost); - public void destroyConnection(int id); - - public boolean login(int id, String user, String pass); - public void logout(int id); -} Deleted: branches/private_welterde0/server/src/main/java/org/jlink/DatabaseController.java =================================================================== --- branches/private_welterde0/server/src/main/java/org/jlink/DatabaseController.java 2006-11-25 16:50:09 UTC (rev 24) +++ branches/private_welterde0/server/src/main/java/org/jlink/DatabaseController.java 2006-11-25 17:12:10 UTC (rev 25) @@ -1,32 +0,0 @@ -/* - * DatabaseController.java - * - * Created on 9. Januar 2006, 20:04 - * - * JLink: An Introversion Uplink Clone with multiplayer support. - * Copyright (C) 2006 Tassilo Schweyer - * - * This program 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 2 - * of the License, or (at your option) any later version. - * - * This program 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 this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -package org.jlink; - -/** - * - * @author tassilo - */ -public interface DatabaseController { - -} Deleted: branches/private_welterde0/server/src/main/java/org/jlink/LoginController.java =================================================================== --- branches/private_welterde0/server/src/main/java/org/jlink/LoginController.java 2006-11-25 16:50:09 UTC (rev 24) +++ branches/private_welterde0/server/src/main/java/org/jlink/LoginController.java 2006-11-25 17:12:10 UTC (rev 25) @@ -1,36 +0,0 @@ -/* - * LoginController.java - * - * Created on 10. Januar 2006, 19:37 - * - * JLink: An Introversion Uplink Clone with multiplayer support. - * Copyright (C) 2006 Tassilo Schweyer - * - * This program 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 2 - * of the License, or (at your option) any later version. - * - * This program 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 this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -package org.jlink; - -/** - * - * @author tassilo - */ -public class LoginController { - - /** Creates a new instance of LoginController */ - public LoginController() { - } - -} Deleted: branches/private_welterde0/server/src/main/java/org/jlink/Options.java =================================================================== --- branches/private_welterde0/server/src/main/java/org/jlink/Options.java 2006-11-25 16:50:09 UTC (rev 24) +++ branches/private_welterde0/server/src/main/java/org/jlink/Options.java 2006-11-25 17:12:10 UTC (rev 25) @@ -1,54 +0,0 @@ -/* - * Options.java - * - * Created on 23. Februar 2006, 17:02 - * - * JLink: An Introversion Uplink Clone with multiplayer support. - * Copyright (C) 2006 Tassilo Schweyer - * - * This program 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 2 - * of the License, or (at your option) any later version. - * - * This program 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 this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -package org.jlink; - -//import::sys -//import::sys::log4j -import org.apache.log4j.Level; - -/** - * - * @author tassilo - */ -public class Options { - private Options() { - } - - public static final boolean GLOBAL_LOGGING_USED = true; - //logging levels(more higher, more logging output) - //public static final Level GLOBAL_LOGGING_LEVEL_CONSOLE = Level.ALL; - public static final Level GLOBAL_LOGGING_LEVEL_CONSOLE = Level.TRACE; - //public static final Level GLOBAL_LOGGING_LEVEL_CONSOLE = Level.DEBUG; - //public static final Level GLOBAL_LOGGING_LEVEL_CONSOLE = Level.INFO; - //public static final Level GLOBAL_LOGGING_LEVEL_CONSOLE = Level.ERROR; - //public static final Level GLOBAL_LOGGING_LEVEL_CONSOLE = Level.FATAL; - public static final String GLOBAL_VERSION = "0.0.1pre-alpha"; - - public static final boolean FRONTEND_LOCAL = true; - - - public static final int NETWORK_LISTEN_PORT = 3470; - public static final int NETWORKBACK_C_ERR = 1000; //if your Connection is bad set this var higher - -} Deleted: branches/private_welterde0/server/src/main/java/org/jlink/ServerCore.java =================================================================== --- branches/private_welterde0/server/src/main/java/org/jlink/ServerCore.java 2006-11-25 16:50:09 UTC (rev 24) +++ branches/private_welterde0/server/src/main/java/org/jlink/ServerCore.java 2006-11-25 17:12:10 UTC (rev 25) @@ -1,134 +0,0 @@ -/* - * ServerCore.java - * - * Created on 27. Februar 2006, 11:49 - * - * JLink: An Introversion Uplink Clone with multiplayer support. - * Copyright (C) 2006 Tassilo Schweyer - * - * This program 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 2 - * of the License, or (at your option) any later version. - * - * This program 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 this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -package org.jlink; - -//import -//import::own -//import::sys -import org.apache.log4j.Logger; -//import::sys::util -import java.util.Vector; -import java.util.concurrent.Executors; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Callable; - -/** - * - * @author tassilo - */ -public class ServerCore extends Core implements CoreController { - - protected void runCoreSuf() { - } - - public void createConnection(int id, String rhost) { - synchronized(this.conLock) { - } - } - - public void destroyConnection(int id) { - } - - public boolean login(int id, String user, String pass) { - return false; - } - - public void logout(int id) { - } - - - - - ServerCore() { - this.conIDs = new Vector<String>(); - this.mod_run = Executors.newCachedThreadPool(); - } - - protected Core createCore() { - ServerCore ret = null; - ret = new ServerCore(); - ret.log = Logger.getLogger("jlink.core"); - - //Creating Core - ret.log.info("Core::create()"); - - - //createing other modules - ret.log.debug("Core::creteModules()"); - ret.mod_network = ServerNetwork.create(this); - - return ret; - } - - protected void runCore() throws Exception { - this.c_gc++; - if(this.c_gc > 14000) { - this.c_gc = 0; - log.debug("System::gc()"); - System.gc(); - } - this.c_final++; - if(this.c_final > 28000) { - this.c_final = 0; - log.debug("System::finalize()"); - System.runFinalization(); - } - Thread.sleep(1); - } - - protected void runCorePre() { - log.debug("calling other modules"); - this.mod_run.submit(new Callable<Void>() { - public Void call() throws Exception { - log.info("Network::run()"); - mod_network.run(); - - return null; - } - }); - } - - ///////////////////////// - ///////////////////////// - ////private Variables//// - ///////////////////////// - ///////////////////////// - //Composite// - ///////////// - private ServerNetwork mod_network = null; - private ServerDatabase mod_database = null; - private ExecutorService mod_run = null; - ////////////// - //Connection// - ////////////// - private Vector<String> conIDs = null; - private Byte conLock = null; - - ////////////////// - //internal Usage// - ////////////////// - private Logger log = null; - private int c_gc = 0; - private int c_final = 0; -} Deleted: branches/private_welterde0/server/src/main/java/org/jlink/ServerDatabase.java =================================================================== --- branches/private_welterde0/server/src/main/java/org/jlink/ServerDatabase.java 2006-11-25 16:50:09 UTC (rev 24) +++ branches/private_welterde0/server/src/main/java/org/jlink/ServerDatabase.java 2006-11-25 17:12:10 UTC (rev 25) @@ -1,88 +0,0 @@ -/* - * ServerDatabase.java - * - * Created on 27. Februar 2006, 11:53 - * - * JLink: An Introversion Uplink Clone with multiplayer support. - * Copyright (C) 2006 Tassilo Schweyer - * - * This program 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 2 - * of the License, or (at your option) any later version. - * - * This program 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 this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -package org.jlink; - -//import -//import::sys -//import::sys::log4j -import org.apache.log4j.Logger; - -/** - * - * @author tassilo - */ -public class ServerDatabase implements Module { - - public static ServerDatabase create(Core c) { - ServerDatabase ret = null; - ret = new ServerDatabase(); - ret.log = Logger.getLogger("jlink.database.core"); - ret.log.info("Database::create()"); - - - return ret; - } - - public synchronized void run() throws IllegalStateException { - log.info("Database::run()"); - if(!this.keep) - throw new IllegalStateException(); - log.debug("in started state now"); - while(this.keep) { - try { - log.trace("sleeping, 100ms"); - Thread.sleep(100); - } - catch(Exception e) { - - } - } - log.debug("in stopped state now"); - } - - public void destroy() { - log.info("Database::destroy()"); - this.keep = false; - } - - public boolean isDestroyed() { - return this.keep; - } - - public void join() { - } - - - - - - - - - private ServerDatabase() { - } - - private Logger log = null; - private boolean keep = true; -} Deleted: branches/private_welterde0/server/src/main/java/org/jlink/ServerMain.java =================================================================== --- branches/private_welterde0/server/src/main/java/org/jlink/ServerMain.java 2006-11-25 16:50:09 UTC (rev 24) +++ branches/private_welterde0/server/src/main/java/org/jlink/ServerMain.java 2006-11-25 17:12:10 UTC (rev 25) @@ -1,116 +0,0 @@ -/* - * ServerMain.java - * - * Created on 14. Februar 2006, 19:36 - * - * JLink: An Introversion Uplink Clone with multiplayer support. - * Copyright (C) 2006 Tassilo Schweyer - * - * This program 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 2 - * of the License, or (at your option) any later version. - * - * This program 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 this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -package org.jlink; - -//import::own -//import::own::jmx -import org.jlink.server.jmx.JMXAgent; -//import::own::net -//import::sys -//import::sys::io -import java.io.File; -//import::sys::log4j -import org.apache.log4j.Logger; -import org.apache.log4j.BasicConfigurator; -import org.apache.log4j.FileAppender; -import org.apache.log4j.PatternLayout; -import org.apache.log4j.Level; -import org.apache.log4j.ConsoleAppender; - -/** - * - * @author tassilo - */ -public class ServerMain { - private static File dir_home = null; - private ServerMain() { - } - - /** - * @param args the command line arguments - */ - public static void main(String[] args) throws Exception { - Logger log = null; - Core mod_core = null; - - dir_home = new File(new File(System.getProperty("user.home")), ".jlink"); - - //start logging - setupLog4j(); - log = Logger.getLogger("jlink"); - log.info("logging started"); - outputSystemInformation(); - compile(); - setup(); - Core.setImpl(new ServerCore()); - mod_core = Core.create(); - setupJMX(); - mod_core.run(); - log.info("logging stopped"); - System.exit(0); - } - - private static void setupLog4j() throws Exception { - if(Options.GLOBAL_LOGGING_USED) { - File dir_logs = new File(dir_home, "logs"); - dir_logs.mkdirs(); - FileAppender log4j_file = new FileAppender(new PatternLayout(), new File(dir_logs, "server.log").getAbsolutePath()); - log4j_file.setLayout(new PatternLayout(PatternLayout.TTCC_CONVERSION_PATTERN)); - log4j_file.clearFilters(); - log4j_file.setThreshold(Level.ALL); - Logger.getRootLogger().setLevel(Level.ALL); - BasicConfigurator.configure(log4j_file); - ConsoleAppender log4j_con = new ConsoleAppender(new PatternLayout("%-5p [%-15t | %10x]: %m%n"), "System.err"); - log4j_con.setThreshold(Options.GLOBAL_LOGGING_LEVEL_CONSOLE); - BasicConfigurator.configure(log4j_con); - } - } - private static void compile() { - Logger log = Logger.getLogger("jlink"); - log.info("pre-compiling some classes"); - boolean b = false; - b = b || Compiler.compileClass(ServerNetwork.class); - log.debug("check for enabled compiling result 1: " + b); - //TODO: do some more checks - if(b) { - //compile more classes - } else { - log.error("Cannot pre-compile classes"); - } - } - private static void setup() { - } - private static void setupJMX() { - JMXAgent agent = JMXAgent.getDefault(); - } - private static void outputSystemInformation() { - Logger log = Logger.getLogger("jlink"); - log.debug("#############JLink############"); - log.debug("##############################"); - log.debug("############System############"); - log.debug("##########Information#########"); - log.debug("##############################"); - log.debug("System.compiler: " + System.getProperty("java.compiler")); - } -} Deleted: branches/private_welterde0/server/src/main/java/org/jlink/ServerNetwork.java =================================================================== --- branches/private_welterde0/server/src/main/java/org/jlink/ServerNetwork.java 2006-11-25 16:50:09 UTC (rev 24) +++ branches/private_welterde0/server/src/main/java/org/jlink/ServerNetwork.java 2006-11-25 17:12:10 UTC (rev 25) @@ -1,163 +0,0 @@ -/* - * ServerNetwork.java - * - * Created on 27. Februar 2006, 11:53 - * - * JLink: An Introversion Uplink Clone with multiplayer support. - * Copyright (C) 2006 Tassilo Schweyer - * - * This program 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 2 - * of the License, or (at your option) any later version. - * - * This program 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 this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -package org.jlink; - -//import -//import::own -import java.io.IOException; -import org.jlink.Options; -//import::own::net -import org.jlink.net.ConnectionHandler; -import org.jlink.net.ConnectionListener; -import org.jlink.net.Message; -//import::own::net::msgs -import org.jlink.net.msgs.ConnectionEnding; -import org.jlink.net.msgs.Login; -//import::sys -import org.apache.log4j.Logger; -import org.apache.log4j.NDC; -//import::sys::util -import java.util.Map; -import java.util.HashMap; - - -/** - * - * @author tassilo - */ -public class ServerNetwork implements Module { - - public static ServerNetwork create(ServerCore c) { - ServerNetwork ret = null; - ret = new ServerNetwork(); - ret.log = Logger.getLogger("jlink.net.core"); - - //Network::create - ret.log.info("Network::create()"); - ret.mod_core = c; - - //creating other Parts - ret.log.debug("Network::createParts()"); - try { - ret.log.debug("trying to listen on Port: " + Options.NETWORK_LISTEN_PORT); - //TODO: something to put here - ret.log.debug("ok we're listening"); - //} catch (IOException ex) { - // ret.log.error("Cannot listen", ex); - //throw new RuntimeException("cannot listen", ex); - } finally { - - } - - - return ret; - } - - public synchronized void run() throws IllegalStateException { - if(!this.status_active) - throw new IllegalStateException("already destroyed"); - log.debug("Network::Core::run() started"); - - - String[] cons = null; - ConnectionHandler curCH = null; - Message cur = null; - int i = 0; - - while(this.status_active) { - try { - Thread.sleep(100); - } catch (InterruptedException ex) { - ex.printStackTrace(); - } - } - log.debug("Network::Core::run() stopped"); - } - - public void destroy() { - this.status_active = false; - } - - public boolean isDestroyed() { - return this.status_active; - } - - //Connection-Services - public void conRegister(int id, final ConnectionHandler h) { - if(h == null) - throw new NullPointerException(); - final String i = "" + id; - log.debug("creating Listener"); - h.setConnectionListener(new ConnectionListener() { - public void recived(Message m) { - try { - NDC.push(i); - conOperate(h, m, i); - NDC.clear(); - } catch(Exception e) { - log.error("Exception catched", e); - NDC.clear(); - } - } - }); - } - - - private ServerNetwork() { - } - - //run-Methods - private void conOperate(ConnectionHandler h, Message c, String id) throws Exception { - //check for connectionEnd - NDC.push("choose"); - if(c instanceof ConnectionEnding) { - log.debug("Message type is ConEnding =>disconnecting"); - h.disconnect(); - } else if(c instanceof Login) { - log.debug("Message type is Login=>login"); - Login t = (Login) c; - String pass = t.getUsername(); - String user = t.getPassword(); - } - } - - public void join() { - } - - ///////////////////////// - ///////////////////////// - ////private Variables//// - ///////////////////////// - ///////////////////////// - //Composite// - ///////////// - private ServerCore mod_core = null; - private Logger log = null; - - //////////////////// - //internal::Status// - //////////////////// - private boolean status_active = true; - -} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wel...@us...> - 2006-11-25 16:50:13
|
Revision: 24 http://svn.sourceforge.net/java-link/?rev=24&view=rev Author: welterde0 Date: 2006-11-25 08:50:09 -0800 (Sat, 25 Nov 2006) Log Message: ----------- added the missing lib files(since the NB5.0 to NB5.5 update) Added Paths: ----------- branches/private_welterde0/client/lib/ branches/private_welterde0/client/lib/complibs/ branches/private_welterde0/libdb/lib/ branches/private_welterde0/libdb/lib/complibs/ branches/private_welterde0/libgui/lib/ branches/private_welterde0/libgui/lib/complibs/ branches/private_welterde0/libnet/lib/ branches/private_welterde0/libnet/lib/complibs/ branches/private_welterde0/libserver/lib/ branches/private_welterde0/libserver/lib/complibs/ branches/private_welterde0/libworld/lib/ branches/private_welterde0/libworld/lib/complibs/ branches/private_welterde0/server/lib/ branches/private_welterde0/server/lib/complibs/ branches/private_welterde0/share/lib/ branches/private_welterde0/share/lib/complibs/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wel...@us...> - 2006-11-25 16:46:17
|
Revision: 23 http://svn.sourceforge.net/java-link/?rev=23&view=rev Author: welterde0 Date: 2006-11-25 08:46:15 -0800 (Sat, 25 Nov 2006) Log Message: ----------- updated deps of client Modified Paths: -------------- branches/private_welterde0/client/pom.xml Modified: branches/private_welterde0/client/pom.xml =================================================================== --- branches/private_welterde0/client/pom.xml 2006-11-25 16:40:48 UTC (rev 22) +++ branches/private_welterde0/client/pom.xml 2006-11-25 16:46:15 UTC (rev 23) @@ -64,6 +64,12 @@ <version>2.2.3</version> <scope>compile</scope> </dependency> + <dependency> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + <version>1.2.13</version> + <scope>compile</scope> + </dependency> </dependencies> <!--//////////////////////////////////////// /////////////Reporting////////////////// This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wel...@us...> - 2006-11-25 16:40:51
|
Revision: 22 http://svn.sourceforge.net/java-link/?rev=22&view=rev Author: welterde0 Date: 2006-11-25 08:40:48 -0800 (Sat, 25 Nov 2006) Log Message: ----------- updated svn:ignore properties Property Changed: ---------------- branches/private_welterde0/ branches/private_welterde0/client/ branches/private_welterde0/env_server/logs/ branches/private_welterde0/libdb/ branches/private_welterde0/libgui/ branches/private_welterde0/libnet/ branches/private_welterde0/libserver/ branches/private_welterde0/libworld/ branches/private_welterde0/server/ branches/private_welterde0/share/ Property changes on: branches/private_welterde0 ___________________________________________________________________ Name: svn:ignore - .DS_Store + .DS_Store tmp share.build.log client.build.log server.build.log libdb.server.build.log Property changes on: branches/private_welterde0/client ___________________________________________________________________ Name: svn:ignore - .DS_Store + .DS_Store target Property changes on: branches/private_welterde0/env_server/logs ___________________________________________________________________ Name: svn:ignore + *.log.xml Property changes on: branches/private_welterde0/libdb ___________________________________________________________________ Name: svn:ignore + .DS_Store target Property changes on: branches/private_welterde0/libgui ___________________________________________________________________ Name: svn:ignore + .DS_Store target Property changes on: branches/private_welterde0/libnet ___________________________________________________________________ Name: svn:ignore + .DS_Store target Property changes on: branches/private_welterde0/libserver ___________________________________________________________________ Name: svn:ignore + .DS_Store target Property changes on: branches/private_welterde0/libworld ___________________________________________________________________ Name: svn:ignore + .DS_Store target Property changes on: branches/private_welterde0/server ___________________________________________________________________ Name: svn:ignore - .DS_Store + .DS_Store target Property changes on: branches/private_welterde0/share ___________________________________________________________________ Name: svn:ignore - .DS_Store + .DS_Store target This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wel...@us...> - 2006-11-25 16:37:50
|
Revision: 21 http://svn.sourceforge.net/java-link/?rev=21&view=rev Author: welterde0 Date: 2006-11-25 08:37:42 -0800 (Sat, 25 Nov 2006) Log Message: ----------- updated doc, with links to the wiki updated license information Modified Paths: -------------- branches/private_welterde0/LICENSE branches/private_welterde0/MODDING branches/private_welterde0/README Modified: branches/private_welterde0/LICENSE =================================================================== --- branches/private_welterde0/LICENSE 2006-10-24 17:26:13 UTC (rev 20) +++ branches/private_welterde0/LICENSE 2006-11-25 16:37:42 UTC (rev 21) @@ -277,64 +277,4 @@ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - <one line to give the program's name and a brief idea of what it does.> - Copyright (C) <year> <name of author> - - This program 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 2 of the License, or - (at your option) any later version. - - This program 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 this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - <signature of Ty Coon>, 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. + END OF TERMS AND CONDITIONS \ No newline at end of file Modified: branches/private_welterde0/MODDING =================================================================== --- branches/private_welterde0/MODDING 2006-10-24 17:26:13 UTC (rev 20) +++ branches/private_welterde0/MODDING 2006-11-25 16:37:42 UTC (rev 21) @@ -0,0 +1,2 @@ +see http://java-link.sourceforge.net/moin +ok, there isnt an article(at the time of writeing this) Modified: branches/private_welterde0/README =================================================================== --- branches/private_welterde0/README 2006-10-24 17:26:13 UTC (rev 20) +++ branches/private_welterde0/README 2006-11-25 16:37:42 UTC (rev 21) @@ -21,4 +21,7 @@ TODO: write this :-) 5.Credits -TODO: write this :-) \ No newline at end of file +TODO: write this :-) + +6.Further Questions +see http://java-link.sourceforge.net/moin \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wel...@us...> - 2006-10-24 17:40:00
|
Revision: 17 http://svn.sourceforge.net/java-link/?rev=17&view=rev Author: welterde0 Date: 2006-10-24 09:47:32 -0700 (Tue, 24 Oct 2006) Log Message: ----------- pushed newest changes into repo updated PROJECTS file(forgot to update, when libdb was added) removed some local System-dependencies updated StorageManager(removed old code, and removed need for the server.db) Client::NET(commented NetworkManager out, i think it was mising) updated Main to include getter for Core and an instruction to save before shutting down Server::JMX(added method for the Modules to register their JMX-Stuff) fixed site.xml of Server||Share Share::NET(added reusability for the LLConfiguration) Share::NET(fixed some design mistackes on LL) Server::Core(rewritten it from scratch) Modified Paths: -------------- trunk/PROJECTS trunk/client/nbproject/project.properties trunk/libdb/src/main/java/org/jlink/server/libdb/StorageManager.java trunk/server/nbproject/project.properties trunk/server/nbproject/project.xml trunk/server/src/main/java/org/jlink/ServerNetwork.java trunk/server/src/main/java/org/jlink/server/Main.java trunk/server/src/main/java/org/jlink/server/jmx/JMXAgent.java trunk/server/src/site/site.xml trunk/share/src/main/java/org/jlink/net/ll/LLConfiguration.java trunk/share/src/main/java/org/jlink/net/ll/LLConfigurationException.java trunk/share/src/main/java/org/jlink/net/ll/LLConnector.java trunk/share/src/main/java/org/jlink/net/ll/xml/XMLConfiguration.java trunk/share/src/main/java/org/jlink/net/ll/xml/XMLConnector.java trunk/share/src/main/java/org/jlink/net/ll/xml/XMLFactory.java trunk/share/src/site/site.xml Added Paths: ----------- trunk/server/src/main/java/org/jlink/server/Core.java Removed Paths: ------------- trunk/server/src/main/java/org/jlink/server/net/NetworkBackend.java Property Changed: ---------------- trunk/ trunk/client/ trunk/client/nbproject/ trunk/client/src/ trunk/client/src/main/ trunk/client/src/main/java/ trunk/client/src/main/java/org/ trunk/client/src/main/java/org/jlink/ trunk/client/src/main/java/org/jlink/frontend/ trunk/client/src/main/java/org/jlink/frontend/system/ trunk/server/ trunk/server/nbproject/ trunk/server/src/ trunk/server/src/main/ trunk/server/src/main/java/ trunk/server/src/main/java/org/ trunk/server/src/main/java/org/jlink/ trunk/server/src/main/java/org/jlink/server/ trunk/share/ trunk/share/nbproject/ trunk/share/src/ trunk/share/src/main/ trunk/share/src/main/assembly/ Property changes on: trunk ___________________________________________________________________ Name: svn:ignore + .DS_Store Modified: trunk/PROJECTS =================================================================== --- trunk/PROJECTS 2006-10-09 17:49:22 UTC (rev 16) +++ trunk/PROJECTS 2006-10-24 16:47:32 UTC (rev 17) @@ -1,12 +1,13 @@ ################################################### ######################PROJECTS##################### ################################################### -1.Documentation +1 Documentation -2.Client +2 Client -3.Server +3 Server +3.1 libdb -4.Share +4 Share -5.Themes \ No newline at end of file +5 Themes \ No newline at end of file Property changes on: trunk/client ___________________________________________________________________ Name: svn:ignore + .DS_Store Property changes on: trunk/client/nbproject ___________________________________________________________________ Name: svn:ignore + private Modified: trunk/client/nbproject/project.properties =================================================================== --- trunk/client/nbproject/project.properties 2006-10-09 17:49:22 UTC (rev 16) +++ trunk/client/nbproject/project.properties 2006-10-24 16:47:32 UTC (rev 17) @@ -2,4 +2,3 @@ #Sat May 13 22:20:34 CEST 2006 local.repository=/home/tassilo/.m2/repository mvn.path=mvn -project.directory=/home/tassilo/Documents/dev/jlink/feature_maven2/client Property changes on: trunk/client/src ___________________________________________________________________ Name: svn:ignore + .DS_Store Property changes on: trunk/client/src/main ___________________________________________________________________ Name: svn:ignore + .DS_Store Property changes on: trunk/client/src/main/java ___________________________________________________________________ Name: svn:ignore + .DS_Store Property changes on: trunk/client/src/main/java/org ___________________________________________________________________ Name: svn:ignore + .DS_Store Property changes on: trunk/client/src/main/java/org/jlink ___________________________________________________________________ Name: svn:ignore + .DS_Store Property changes on: trunk/client/src/main/java/org/jlink/frontend ___________________________________________________________________ Name: svn:ignore + .DS_Store Property changes on: trunk/client/src/main/java/org/jlink/frontend/system ___________________________________________________________________ Name: svn:ignore + .DS_Store Modified: trunk/libdb/src/main/java/org/jlink/server/libdb/StorageManager.java =================================================================== --- trunk/libdb/src/main/java/org/jlink/server/libdb/StorageManager.java 2006-10-09 17:49:22 UTC (rev 16) +++ trunk/libdb/src/main/java/org/jlink/server/libdb/StorageManager.java 2006-10-24 16:47:32 UTC (rev 17) @@ -35,11 +35,6 @@ * @author welterde */ public class StorageManager { - //Static Configuration - public static final String ENV_SEP = System.getProperty("file.separator"); - public static final String DB_HOME = System.getProperty("user.home") + - ENV_SEP + ".jlink" + ENV_SEP + "server" + ENV_SEP + "db"; - public static final String DB_CONF = DB_HOME + ENV_SEP + "config.xml"; /** Creates a new instance of StorageManager */ public StorageManager() { @@ -61,7 +56,7 @@ throw new NullPointerException("the config may not be null"); // <editor-fold defaultstate="collapsed" desc=" create Driver "> - String driverClass = conf.getString("server.db.driver", "org.jlink." + + String driverClass = conf.getString("driver", "org.jlink." + "server.libdb.drivers.JackrabbitDriver"); log.info("creating DatabaseDriver: " + driverClass); //try to create the driver wanted @@ -95,8 +90,8 @@ String config = null; //load the strings from the config, with local defaults - home = conf.getString("server.db.home", "db"); - config = conf.getString("server.db.conf", "db/config.xml"); + home = conf.getString("home", "db"); + config = conf.getString("conf", "db/config.xml"); this.db_driver.init(config, home); } catch(RepositoryException exc) { log.fatal("cannot init driver", exc); Property changes on: trunk/server ___________________________________________________________________ Name: svn:ignore + .DS_Store Property changes on: trunk/server/nbproject ___________________________________________________________________ Name: svn:ignore + private Modified: trunk/server/nbproject/project.properties =================================================================== --- trunk/server/nbproject/project.properties 2006-10-09 17:49:22 UTC (rev 16) +++ trunk/server/nbproject/project.properties 2006-10-24 16:47:32 UTC (rev 17) @@ -1,5 +1,5 @@ #The netbeans freeform property file -#Mon May 15 20:20:00 CEST 2006 -local.repository=/home/tassilo/.m2/repository +#Mon Oct 09 20:16:43 CEST 2006 +local.repository=/Users/welterde/.m2/repository mvn.path=mvn -project.directory=/home/tassilo/Documents/dev/jlink/feature_maven2/server + Modified: trunk/server/nbproject/project.xml =================================================================== --- trunk/server/nbproject/project.xml 2006-10-09 17:49:22 UTC (rev 16) +++ trunk/server/nbproject/project.xml 2006-10-24 16:47:32 UTC (rev 17) @@ -1,121 +1,134 @@ +<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://www.netbeans.org/ns/project/1"> - <type>org.netbeans.modules.ant.freeform</type> - <configuration> - <general-data xmlns="http://www.netbeans.org/ns/freeform-project/1"> - <name>JLink Server</name> - <properties> - <property name="ant.script">nbproject/mavencall.xml</property> - <property-file>nbproject/project.properties</property-file> - </properties> - <folders> - <source-folder> - <label>src/main/java</label> - <type>java</type> - <location>src/main/java</location> - </source-folder> - <source-folder> - <label>src/test/java</label> - <type>java</type> - <location>src/test/java</location> - </source-folder> - </folders> - <ide-actions> - <action name="build"> - <script>${ant.script}</script> - <target>build</target> - </action> - <action name="clean"> - <script>${ant.script}</script> - <target>clean</target> - </action> - <action name="rebuild"> - <script>${ant.script}</script> - <target>clean</target> - <target>build</target> - </action> - <action name="javadoc"> - <script>${ant.script}</script> - <target>javadoc</target> - </action> - <action name="run"> - <script>${ant.script}</script> - <target>run</target> - </action> - <action name="test"> - <script>${ant.script}</script> - <target>test</target> - </action> - </ide-actions> - <view> - <items> - <source-file> - <label>pom</label> - <location>pom.xml</location> - </source-file> - <source-file> - <label>mavencall</label> - <location>nbproject/mavencall.xml</location> - </source-file> - <source-folder style="packages"> - <label>src/main/java</label> - <location>src/main/java</location> - </source-folder> - <source-folder style="packages"> - <label>src/test/java</label> - <location>src/test/java</location> - </source-folder> - <source-folder style="tree"> - <label>src/main/resources</label> - <location>src/main/resources</location> - </source-folder> - <source-folder style="tree"> - <label>src/test/resources</label> - <location>src/test/resources</location> - </source-folder> - <source-folder style="tree"> - <label>src/site</label> - <location>src/site</location> - </source-folder> - <source-folder style="tree"> - <label>target</label> - <location>target</location> - </source-folder> - </items> - <context-menu> - <action> - <script>${ant.script}</script> - <label>Refresh Project</label> - <target>refresh-project</target> - </action> - <ide-action name="build"/> - <ide-action name="clean"/> - <ide-action name="rebuild"/> - <ide-action name="javadoc"/> - <ide-action name="run"/> - <ide-action name="test"/> - <action> - <script>${ant.script}</script> - <label>Format Code</label> - <target>jalopy</target> - </action> - </context-menu> - </view> - <subprojects/> - </general-data> - <java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/2"> - <compilation-unit> - <package-root>src/main/java</package-root> - <classpath mode="compile">${local.repository}/commons-codec/commons-codec/1.3/commons-codec-1.3.jar:${local.repository}/commons-lang/commons-lang/1.0/commons-lang-1.0.jar:${local.repository}/commons-logging/commons-logging/1.0/commons-logging-1.0.jar:${local.repository}/xerces/xercesImpl/2.2.1/xercesImpl-2.2.1.jar:${local.repository}/org/jlink/share/0.0.1-SNAPSHOT/share-0.0.1-SNAPSHOT.jar:${local.repository}/xerces/xerces/1.2.3/xerces-1.2.3.jar:${local.repository}/commons-beanutils/commons-beanutils/1.4/commons-beanutils-1.4.jar:${local.repository}/xalan/xalan/2.7.0/xalan-2.7.0.jar:${local.repository}/log4j/log4j/1.2.13/log4j-1.2.13.jar:${local.repository}/commons-collections/commons-collections/3.1/commons-collections-3.1.jar:${local.repository}/jdom/jdom/b9/jdom-b9.jar:${local.repository}/commons-jxpath/commons-jxpath/1.2/commons-jxpath-1.2.jar:${local.repository}/javax/servlet/servlet-api/2.2/servlet-api-2.2.jar:${local.repository}/commons-digester/commons-digester/1.6/commons-digester-1.6.jar:${local.repository}/ant/ant-optional/1.5.1/ant-optional-1.5.1.jar:${local.repository}/commons-cli/commons-cli/1.0/commons-cli-1.0.jar:${local.repository}/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.jar:${local.repository}/commons-logging/commons-logging-api/1.0.4/commons-logging-api-1.0.4.jar:${local.repository}/commons-beanutils/commons-beanutils-core/1.7.0/commons-beanutils-core-1.7.0.jar:${local.repository}/commons-configuration/commons-configuration/1.3/commons-configuration-1.3.jar</classpath> - <built-to>target/classes</built-to> - <source-level>1.4</source-level> - </compilation-unit> - <compilation-unit> - <package-root>src/test/java</package-root> - <unit-tests/> - <classpath mode="compile">target/classes:${local.repository}/commons-codec/commons-codec/1.3/commons-codec-1.3.jar:${local.repository}/commons-lang/commons-lang/1.0/commons-lang-1.0.jar:${local.repository}/commons-logging/commons-logging/1.0/commons-logging-1.0.jar:${local.repository}/xerces/xercesImpl/2.2.1/xercesImpl-2.2.1.jar:${local.repository}/org/jlink/share/0.0.1-SNAPSHOT/share-0.0.1-SNAPSHOT.jar:${local.repository}/junit/junit/3.8.1/junit-3.8.1.jar:${local.repository}/xerces/xerces/1.2.3/xerces-1.2.3.jar:${local.repository}/commons-beanutils/commons-beanutils/1.4/commons-beanutils-1.4.jar:${local.repository}/xalan/xalan/2.7.0/xalan-2.7.0.jar:${local.repository}/log4j/log4j/1.2.13/log4j-1.2.13.jar:${local.repository}/commons-collections/commons-collections/3.1/commons-collections-3.1.jar:${local.repository}/jdom/jdom/b9/jdom-b9.jar:${local.repository}/commons-jxpath/commons-jxpath/1.2/commons-jxpath-1.2.jar:${local.repository}/javax/servlet/servlet-api/2.2/servlet-api-2.2.jar:${local.repository}/commons-digester/commons-digester/1.6/commons-digester-1.6.jar:${local.repository}/ant/ant-optional/1.5.1/ant-optional-1.5.1.jar:${local.repository}/commons-cli/commons-cli/1.0/commons-cli-1.0.jar:${local.repository}/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.jar:${local.repository}/commons-logging/commons-logging-api/1.0.4/commons-logging-api-1.0.4.jar:${local.repository}/commons-beanutils/commons-beanutils-core/1.7.0/commons-beanutils-core-1.7.0.jar:${local.repository}/commons-configuration/commons-configuration/1.3/commons-configuration-1.3.jar</classpath> - <built-to>target/test-classes</built-to> - <source-level>1.4</source-level> - </compilation-unit> - </java-data> - </configuration> -</project> \ No newline at end of file + <type>org.netbeans.modules.ant.freeform</type> + <configuration> + <general-data xmlns="http://www.netbeans.org/ns/freeform-project/1"> + <name>JLink Server</name> + <properties> + <property name="ant.script">nbproject/mavencall.xml</property> + <property-file>nbproject/project.properties</property-file> + </properties> + <folders> + <source-folder> + <label>src/main/java</label> + <type>java</type> + <location>src/main/java</location> + </source-folder> + <source-folder> + <label>src/test/java</label> + <type>java</type> + <location>src/test/java</location> + </source-folder> + </folders> + <ide-actions> + <action name="build"> + <script>${ant.script}</script> + <target>build</target> + </action> + <action name="clean"> + <script>${ant.script}</script> + <target>clean</target> + </action> + <action name="rebuild"> + <script>${ant.script}</script> + <target>clean</target> + <target>build</target> + </action> + <action name="javadoc"> + <script>${ant.script}</script> + <target>javadoc</target> + </action> + <action name="run"> + <script>${ant.script}</script> + <target>run</target> + </action> + <action name="test"> + <script>${ant.script}</script> + <target>test</target> + </action> + </ide-actions> + <export> + <type>folder</type> + <location>target/classes</location> + <script>${ant.script}</script> + <build-target>build</build-target> + </export> + <export> + <type>folder</type> + <location>target/test-classes</location> + <script>${ant.script}</script> + <build-target>build</build-target> + </export> + <view> + <items> + <source-folder style="packages"> + <label>src/main/java</label> + <location>src/main/java</location> + </source-folder> + <source-folder style="packages"> + <label>src/test/java</label> + <location>src/test/java</location> + </source-folder> + <source-file> + <label>pom</label> + <location>pom.xml</location> + </source-file> + <source-file> + <label>mavencall</label> + <location>nbproject/mavencall.xml</location> + </source-file> + <source-folder style="tree"> + <label>src/main/resources</label> + <location>src/main/resources</location> + </source-folder> + <source-folder style="tree"> + <label>src/test/resources</label> + <location>src/test/resources</location> + </source-folder> + <source-folder style="tree"> + <label>src/site</label> + <location>src/site</location> + </source-folder> + <source-folder style="tree"> + <label>target</label> + <location>target</location> + </source-folder> + </items> + <context-menu> + <action> + <script>${ant.script}</script> + <label>Refresh Project</label> + <target>refresh-project</target> + </action> + <ide-action name="build"/> + <ide-action name="clean"/> + <ide-action name="rebuild"/> + <ide-action name="javadoc"/> + <ide-action name="run"/> + <ide-action name="test"/> + <action> + <script>${ant.script}</script> + <label>Format Code</label> + <target>jalopy</target> + </action> + </context-menu> + </view> + <subprojects/> + </general-data> + <java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/2"> + <compilation-unit> + <package-root>src/main/java</package-root> + <classpath mode="compile">${local.repository}/concurrent/concurrent/1.3.4/concurrent-1.3.4.jar:${local.repository}/commons-beanutils/commons-beanutils/1.4/commons-beanutils-1.4.jar:${local.repository}/yan/jfunutil/5.0/jfunutil-5.0.jar:${local.repository}/log4j/log4j/1.2.13/log4j-1.2.13.jar:${local.repository}/commons-collections/commons-collections/3.1/commons-collections-3.1.jar:${local.repository}/org/apache/derby/derby/10.1.1.0/derby-10.1.1.0.jar:${local.repository}/commons-jxpath/commons-jxpath/1.2/commons-jxpath-1.2.jar:${local.repository}/org/apache/jackrabbit/jackrabbit-core/1.0.1/jackrabbit-core-1.0.1.jar:${local.repository}/commons-digester/commons-digester/1.6/commons-digester-1.6.jar:${local.repository}/ant/ant-optional/1.5.1/ant-optional-1.5.1.jar:${local.repository}/lucene/lucene/1.4.3/lucene-1.4.3.jar:${local.repository}/commons-cli/commons-cli/1.0/commons-cli-1.0.jar:${local.repository}/org/jlink/libdb/0.0.1-SNAPSHOT/libdb-0.0.1-SNAPSHOT.jar:${local.repository}/commons-configuration/commons-configuration/1.3/commons-configuration-1.3.jar:${local.repository}/commons-codec/commons-codec/1.3/commons-codec-1.3.jar:${local.repository}/commons-lang/commons-lang/1.0/commons-lang-1.0.jar:${local.repository}/commons-logging/commons-logging/1.0/commons-logging-1.0.jar:${local.repository}/org/jlink/share/0.0.1-SNAPSHOT/share-0.0.1-SNAPSHOT.jar:${local.repository}/xerces/xercesImpl/2.2.1/xercesImpl-2.2.1.jar:${local.repository}/xerces/xerces/1.2.3/xerces-1.2.3.jar:${local.repository}/xalan/xalan/2.7.0/xalan-2.7.0.jar:${local.repository}/yan/yan/5.0/yan-5.0.jar:${local.repository}/xerces/xmlParserAPIs/2.0.2/xmlParserAPIs-2.0.2.jar:${local.repository}/jdom/jdom/b9/jdom-b9.jar:${local.repository}/javax/servlet/servlet-api/2.2/servlet-api-2.2.jar:${local.repository}/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.jar:${local.repository}/commons-beanutils/commons-beanutils-core/1.7.0/commons-beanutils-core-1.7.0.jar:${local.repository}/commons-logging/commons-logging-api/1.0.4/commons-logging-api-1.0.4.jar:${local.repository}/geronimo-spec/geronimo-spec-jta/1.0-M1/geronimo-spec-jta-1.0-M1.jar:${local.repository}/org/slf4j/slf4j-log4j12/1.0/slf4j-log4j12-1.0.jar:${local.repository}/jsr170/jcr/1.0/jcr-1.0.jar</classpath> + <built-to>target/classes</built-to> + <source-level>1.5</source-level> + </compilation-unit> + <compilation-unit> + <package-root>src/test/java</package-root> + <unit-tests/> + <classpath mode="compile">target/classes:${local.repository}/concurrent/concurrent/1.3.4/concurrent-1.3.4.jar:${local.repository}/junit/junit/3.8.1/junit-3.8.1.jar:${local.repository}/commons-beanutils/commons-beanutils/1.4/commons-beanutils-1.4.jar:${local.repository}/yan/jfunutil/5.0/jfunutil-5.0.jar:${local.repository}/log4j/log4j/1.2.13/log4j-1.2.13.jar:${local.repository}/commons-collections/commons-collections/3.1/commons-collections-3.1.jar:${local.repository}/org/apache/derby/derby/10.1.1.0/derby-10.1.1.0.jar:${local.repository}/commons-jxpath/commons-jxpath/1.2/commons-jxpath-1.2.jar:${local.repository}/org/apache/jackrabbit/jackrabbit-core/1.0.1/jackrabbit-core-1.0.1.jar:${local.repository}/commons-digester/commons-digester/1.6/commons-digester-1.6.jar:${local.repository}/ant/ant-optional/1.5.1/ant-optional-1.5.1.jar:${local.repository}/lucene/lucene/1.4.3/lucene-1.4.3.jar:${local.repository}/commons-cli/commons-cli/1.0/commons-cli-1.0.jar:${local.repository}/org/jlink/libdb/0.0.1-SNAPSHOT/libdb-0.0.1-SNAPSHOT.jar:${local.repository}/commons-configuration/commons-configuration/1.3/commons-configuration-1.3.jar:${local.repository}/commons-codec/commons-codec/1.3/commons-codec-1.3.jar:${local.repository}/commons-lang/commons-lang/1.0/commons-lang-1.0.jar:${local.repository}/commons-logging/commons-logging/1.0/commons-logging-1.0.jar:${local.repository}/org/jlink/share/0.0.1-SNAPSHOT/share-0.0.1-SNAPSHOT.jar:${local.repository}/xerces/xercesImpl/2.2.1/xercesImpl-2.2.1.jar:${local.repository}/xerces/xerces/1.2.3/xerces-1.2.3.jar:${local.repository}/xalan/xalan/2.7.0/xalan-2.7.0.jar:${local.repository}/yan/yan/5.0/yan-5.0.jar:${local.repository}/xerces/xmlParserAPIs/2.0.2/xmlParserAPIs-2.0.2.jar:${local.repository}/jdom/jdom/b9/jdom-b9.jar:${local.repository}/javax/servlet/servlet-api/2.2/servlet-api-2.2.jar:${local.repository}/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.jar:${local.repository}/commons-beanutils/commons-beanutils-core/1.7.0/commons-beanutils-core-1.7.0.jar:${local.repository}/commons-logging/commons-logging-api/1.0.4/commons-logging-api-1.0.4.jar:${local.repository}/geronimo-spec/geronimo-spec-jta/1.0-M1/geronimo-spec-jta-1.0-M1.jar:${local.repository}/org/slf4j/slf4j-log4j12/1.0/slf4j-log4j12-1.0.jar:${local.repository}/jsr170/jcr/1.0/jcr-1.0.jar</classpath> + <built-to>target/test-classes</built-to> + <source-level>1.5</source-level> + </compilation-unit> + </java-data> + </configuration> +</project> Property changes on: trunk/server/src ___________________________________________________________________ Name: svn:ignore + .DS_Store Property changes on: trunk/server/src/main ___________________________________________________________________ Name: svn:ignore + .DS_Store Property changes on: trunk/server/src/main/java ___________________________________________________________________ Name: svn:ignore + .DS_Store Property changes on: trunk/server/src/main/java/org ___________________________________________________________________ Name: svn:ignore + .DS_Store Property changes on: trunk/server/src/main/java/org/jlink ___________________________________________________________________ Name: svn:ignore + .DS_Store Modified: trunk/server/src/main/java/org/jlink/ServerNetwork.java =================================================================== --- trunk/server/src/main/java/org/jlink/ServerNetwork.java 2006-10-09 17:49:22 UTC (rev 16) +++ trunk/server/src/main/java/org/jlink/ServerNetwork.java 2006-10-24 16:47:32 UTC (rev 17) @@ -28,7 +28,6 @@ import java.io.IOException; import org.jlink.Options; //import::own::net -import org.jlink.server.net.NetworkBackend; import org.jlink.net.ConnectionHandler; import org.jlink.net.ConnectionListener; import org.jlink.net.Message; @@ -62,11 +61,13 @@ ret.log.debug("Network::createParts()"); try { ret.log.debug("trying to listen on Port: " + Options.NETWORK_LISTEN_PORT); - ret.mod_back = NetworkBackend.listen(ret, Options.NETWORK_LISTEN_PORT); + //TODO: something to put here ret.log.debug("ok we're listening"); - } catch (IOException ex) { - ret.log.error("Cannot listen", ex); - throw new RuntimeException("cannot listen", ex); + //} catch (IOException ex) { + // ret.log.error("Cannot listen", ex); + //throw new RuntimeException("cannot listen", ex); + } finally { + } @@ -152,7 +153,6 @@ //Composite// ///////////// private ServerCore mod_core = null; - private NetworkBackend mod_back = null; private Logger log = null; //////////////////// Property changes on: trunk/server/src/main/java/org/jlink/server ___________________________________________________________________ Name: svn:ignore + .DS_Store Added: trunk/server/src/main/java/org/jlink/server/Core.java =================================================================== --- trunk/server/src/main/java/org/jlink/server/Core.java (rev 0) +++ trunk/server/src/main/java/org/jlink/server/Core.java 2006-10-24 16:47:32 UTC (rev 17) @@ -0,0 +1,124 @@ +/* + * Core.java + * + * Created on 8. Oktober 2006, 18:30 + * + * JLink: An Introversion Uplink Clone with multiplayer support. + * Copyright (C) 2006 Tassilo Schweyer + * + * This program 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 2 + * of the License, or (at your option) any later version. + * + * This program 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 this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package org.jlink.server; + +//import::own +//import::own::server +import org.jlink.server.Main; +import org.jlink.server.jmx.JMXAgent; +//import::own::server::libdb +import org.jlink.server.libdb.StorageManager; +import org.jlink.server.libdb.StorageManagerJMX; +//import::sys +//import::sys::commons-configuration +import org.apache.commons.configuration.Configuration; +//import::sys::log4j +import org.apache.log4j.Logger; + +/** + * + * @author welterde + */ +public class Core implements Runnable { + + /** Creates a new instance of Core */ + public Core() { + log.debug("Core created"); + } + + public void init(Configuration conf) { + log.info("initing Core"); + if(conf == null) + throw new NullPointerException("the config may not be null"); + //init StorageManager + { + try { + log.info("creating StorageManager"); + Configuration comp_conf = conf.subset("server.db"); + this.app_storage = new StorageManager(); + this.app_storage.init(comp_conf); + this.jmx_storage = new StorageManagerJMX(this.app_storage); + JMXAgent.getDefault().register("org.jlink.server.libdb:type=StorageManagerJMX", this.jmx_storage); + log.debug("done"); + } catch(Exception exc) { + log.error("creation failed, ignoring(wish me luck)", exc); + //TODO: split problems into StorageManger and JMX + } + } + } + + + + public void start() { + log.info("starting core..."); + this.thread.start(); + log.debug("core started"); + } + public void run() { + log.debug("waiting for lock to run"); + synchronized(runLock) { + log.debug("got lock"); + while(true) { + if(this.doStop) + break; + try { + Thread.sleep(10); + } catch(Exception exc) { + log.error("unknown Exception cought", exc); + } catch(Error err) { + log.error("unknown Error caught", err); + } finally { + + } + } + } + } + public void stop() { + this.doStop = true; + } + public void shutdown() { + stop(); + + } + + + + + //Composite getter + public StorageManager getStorage() { + return this.app_storage; + } + + + private Logger log = Logger.getLogger(Core.class); + private Thread thread = new Thread(this); + private Object runLock = "lock009ij"; + + private boolean doStop = false; + + //Composite stuff + public StorageManager app_storage = null; + public StorageManagerJMX jmx_storage = null; + +} Modified: trunk/server/src/main/java/org/jlink/server/Main.java =================================================================== --- trunk/server/src/main/java/org/jlink/server/Main.java 2006-10-09 17:49:22 UTC (rev 16) +++ trunk/server/src/main/java/org/jlink/server/Main.java 2006-10-24 16:47:32 UTC (rev 17) @@ -170,6 +170,7 @@ public static void shutdown() { log.info("shutdown requested"); + confSave(); //TODO: shutdown everything log.info("shutdown complete, exiting"); System.exit(0); @@ -188,11 +189,18 @@ } } public static void confReload() { + log.info("hit unimplemented method"); //TODO: write this } + //Core Access + public static Core getCore() { + return app_core; + } + private static Configuration conf = null; private static XMLConfiguration xconf = null; private static Logger log = null; + private static Core app_core = null; } Modified: trunk/server/src/main/java/org/jlink/server/jmx/JMXAgent.java =================================================================== --- trunk/server/src/main/java/org/jlink/server/jmx/JMXAgent.java 2006-10-09 17:49:22 UTC (rev 16) +++ trunk/server/src/main/java/org/jlink/server/jmx/JMXAgent.java 2006-10-24 16:47:32 UTC (rev 17) @@ -34,6 +34,8 @@ import javax.management.ObjectName; import javax.management.MBeanServer; import java.lang.management.ManagementFactory; +import javax.management.OperationsException; +import javax.management.MBeanRegistrationException; //import::sys::log4j import org.apache.log4j.Logger; @@ -56,23 +58,23 @@ this.mbs.registerMBean(obj, name); log.debug("done"); } -// { -// log.debug("registering StorageManagerJMX"); -// ObjectName name = new ObjectName("org.jlink.server.libdb:type=StorageManagerJMX"); -// StorageManagerJMX obj = new StorageManagerJMX(); -// this.mbs.registerMBean(obj, name); -// log.debug("done"); -// } - //Core::JMX::add() - //Database::JMX::add() + } + + public void register(String name, Object obj) { + //TODO: (low) add check for logging level + log.debug("registering JMX object name: " + name); + try { + ObjectName oname = new ObjectName(name); + this.mbs.registerMBean(obj, oname); + log.debug("registration complete"); + } catch(OperationsException exc) { + log.warn("couldnt register JMX object ", exc); + } catch(MBeanRegistrationException exc) { + log.warn("couldnt register JMX object ", exc); + } - //Frontend::JMX::add() - - //Network::JMX::add() - } - /** * Returns an agent singleton. */ Deleted: trunk/server/src/main/java/org/jlink/server/net/NetworkBackend.java =================================================================== --- trunk/server/src/main/java/org/jlink/server/net/NetworkBackend.java 2006-10-09 17:49:22 UTC (rev 16) +++ trunk/server/src/main/java/org/jlink/server/net/NetworkBackend.java 2006-10-24 16:47:32 UTC (rev 17) @@ -1,145 +0,0 @@ -/* - * NetworkBackend.java - * - * Created on 2. März 2006, 22:45 - * - * JLink: An Introversion Uplink Clone with multiplayer support. - * Copyright (C) 2006 Tassilo Schweyer - * - * This program 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 2 - * of the License, or (at your option) any later version. - * - * This program 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 this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -package org.jlink.server.net; - -//import -//import::own -import org.jlink.Options; -import org.jlink.ServerNetwork; -//import::own::net -import org.jlink.net.ConnectionHandler; -import org.jlink.net.Message; -//import::own::net::msgs -import org.jlink.net.msgs.ConnectionStarting; -import org.jlink.net.msgs.ConnectionAccepted; -//import::sys -import org.apache.log4j.Logger; -import org.apache.log4j.NDC; -//import::sys::io -import java.io.IOException; -//import::sys::net -import java.net.Socket; -import java.net.ServerSocket; - - -/** - * - * @author tassilo - */ -public class NetworkBackend { - - public static NetworkBackend listen(ServerNetwork net, int port) throws IOException { - NetworkBackend ret = null; - ret = new NetworkBackend(); - ret.log = Logger.getLogger("jlink.net.backend"); - ret.log.info("NetworkBackend::listen(" + port + ")"); - - ret.mod_net = net; - //creating Socket - ret.log.debug("ServerSocket::create(port)"); - ret.conSock = new ServerSocket(port); - ret.log.debug("SS::create(port)=> true"); - - //starting Thread - final NetworkBackend t = ret; - ret.thread = new Thread() { - public void run() { - t.runNB(); - } - }; - ret.thread.setDaemon(true); - ret.thread.setName("network-runner"); - ret.thread.start(); - - return ret; - } - - - private NetworkBackend() { - } - - - private void runNB() { - //wait some time to get the creator time to start - try { - Thread.sleep(2000); - } catch(Exception e) { - //should not happen, ignore it - } - int c_err = Options.NETWORKBACK_C_ERR; - try { - while(true) { - try { - this.run(); - c_err++; - if(c_err > (3 * Options.NETWORKBACK_C_ERR)) - c_err = Options.NETWORKBACK_C_ERR; - } catch(Exception e) { - log.error("NetworkBackend::catchException", e); - c_err--; - if(c_err < 0) { - log.fatal("Error Count got too big => self-kill"); - throw new Error("c_err < 0"); - } - } - } - } catch(Throwable t) { - log.debug("Thread ended with Throwable", t); - this.cleanup(); - } - } - private void run() throws Exception { - NDC.clear(); - log.info("waiting for connection"); - Socket cur = this.conSock.accept(); - this.conCount++; - NDC.push("" + this.conCount); - log.info("got Connection from " + cur.getInetAddress()); - NDC.push("init"); - log.debug("creating ConnectionHandler"); - ConnectionHandler h = ConnectionHandler.connect(cur); - log.debug("waiting for ConnectionStart"); - Message in0 = h.reciveMessage(); - log.debug("got Message, answering"); - h.sendMessage(new ConnectionAccepted()); - log.debug("registering Connection"); - this.mod_net.conRegister(conCount, h); - - NDC.pop(); - //put the connection somewhere - NDC.pop(); - } - private void cleanup() { - - } - - //////////////////////// - ///internal Variables/// - //////////////////////// - private ServerSocket conSock = null; - private int conCount = 0; - private Logger log = null; - private Thread thread = null; - private ServerNetwork mod_net = null; -} Modified: trunk/server/src/site/site.xml =================================================================== --- trunk/server/src/site/site.xml 2006-10-09 17:49:22 UTC (rev 16) +++ trunk/server/src/site/site.xml 2006-10-24 16:47:32 UTC (rev 17) @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="ISO-8859-1"?> -<project name="JLink Client"> +<project name="JLink Server"> <bannerRight> <src>http://sflogo.sourceforge.net/sflogo.php?group_id=162264&type=3</src> </bannerRight> Property changes on: trunk/share ___________________________________________________________________ Name: svn:ignore + .DS_Store Property changes on: trunk/share/nbproject ___________________________________________________________________ Name: svn:ignore + private Property changes on: trunk/share/src ___________________________________________________________________ Name: svn:ignore + .DS_Store Property changes on: trunk/share/src/main ___________________________________________________________________ Name: svn:ignore + .DS_Store Property changes on: trunk/share/src/main/assembly ___________________________________________________________________ Name: svn:ignore + .DS_Store Modified: trunk/share/src/main/java/org/jlink/net/ll/LLConfiguration.java =================================================================== --- trunk/share/src/main/java/org/jlink/net/ll/LLConfiguration.java 2006-10-09 17:49:22 UTC (rev 16) +++ trunk/share/src/main/java/org/jlink/net/ll/LLConfiguration.java 2006-10-24 16:47:32 UTC (rev 17) @@ -36,5 +36,8 @@ public String getDescription(int id, Locale l); public String getDescription(int id); - public void setValue(int id, String val); + public void setValue(int id, String val) throws LLConfigurationException; + + //operations + public void reset(); } Modified: trunk/share/src/main/java/org/jlink/net/ll/LLConfigurationException.java =================================================================== --- trunk/share/src/main/java/org/jlink/net/ll/LLConfigurationException.java 2006-10-09 17:49:22 UTC (rev 16) +++ trunk/share/src/main/java/org/jlink/net/ll/LLConfigurationException.java 2006-10-24 16:47:32 UTC (rev 17) @@ -43,4 +43,8 @@ public LLConfigurationException(String msg) { super(msg); } + + public LLConfigurationException(String msg, Throwable t) { + super(msg, t); + } } Modified: trunk/share/src/main/java/org/jlink/net/ll/LLConnector.java =================================================================== --- trunk/share/src/main/java/org/jlink/net/ll/LLConnector.java 2006-10-09 17:49:22 UTC (rev 16) +++ trunk/share/src/main/java/org/jlink/net/ll/LLConnector.java 2006-10-24 16:47:32 UTC (rev 17) @@ -34,7 +34,9 @@ public void recive(LLEvent[] evts) throws LLConnectionException; public boolean isAlive(); - public void close() throws LLConnectionException; - public long ping() throws LLConnectionException; + public int ping() throws LLConnectionException; + + public void connect() throws LLConnectionException; + public void disconnect() throws LLConnectionException; } Modified: trunk/share/src/main/java/org/jlink/net/ll/xml/XMLConfiguration.java =================================================================== --- trunk/share/src/main/java/org/jlink/net/ll/xml/XMLConfiguration.java 2006-10-09 17:49:22 UTC (rev 16) +++ trunk/share/src/main/java/org/jlink/net/ll/xml/XMLConfiguration.java 2006-10-24 16:47:32 UTC (rev 17) @@ -25,6 +25,7 @@ import java.util.Locale; import org.jlink.net.ll.LLConfiguration; +import org.jlink.net.ll.LLConfigurationException; /** * @@ -37,45 +38,113 @@ } public String[] getNames() { - return this.dat_names; + return null; } public String getDefault(int id) { - return this.dat_default[id]; + //bypass, if id is non valid + if(id > 1 || id < 0) + return null; + //The result, which will be returned later + String ret = null; + //get the right default value + if(id == 0) + ret = this.prop_hostname_default; + else + ret = this.prop_hostport_default; + //return it + return ret; } public String getValue(int id) { - return this.dat_values[id]; + //NOTE: C&P from getDefault(int id) + // without the default thingy + //bypass, if id is non valid + if(id > 1 || id < 0) + return null; + //The result, which will be returned later + String ret = null; + //get the right default value + if(id == 0) + ret = this.prop_hostname; + else + ret = this.prop_hostport; + //return it + return ret; } - public String getDescription(int id, final Locale l) { + public String getDescription(int id, Locale l) { + //Dirty-Hack: the Local is ignored, cause there actually no translations return this.getDescription(id); } public String getDescription(int id) { - return this.dat_descs[id]; + //NOTE: C&P from getDefault(int id) + // with the descriptons + //bypass, if id is non valid + if(id > 1 || id < 0) + return null; + //The result, which will be returned later + String ret = null; + //get the right default value + if(id == 0) + ret = this.prop_hostname_desc; + else + ret = this.prop_hostport_desc; + //return it + return ret; } - public void setValue(int id, String val) { - this.dat_values[id] = val; + public void setValue(int id, String val) throws LLConfigurationException { + //bypass, if id is non valid + if(id > 1 || id < 0) + return; + //check for non-null value + if(val == null) + throw new NullPointerException("Value may not be null"); + //validate & set the value + if(id == 0) { + //check, if the hostname has zero-chars + if(val.equals("")) + throw new LLConfigurationException("The hostname may not be zero-lengthted"); + this.prop_hostname = val; + } else { + //cast into an number + int p = 0; + try { + p = Integer.parseInt(val); + } catch(NumberFormatException exc) { + new LLConfigurationException("The Port may only be an number", exc); + } + //check port boundary + if(p < 1) + throw new LLConfigurationException("The port may not be smaller than 1"); + if(p > 65536) + throw new LLConfigurationException("The port may not be bigger than 65536"); + //set the value + this.prop_hostport = val; + } } + + public void reset() { + this.prop_hostname = this.prop_hostname_default; + this.prop_hostport = this.prop_hostport_default; + } - private String[] dat_names = new String[] { - "Host", - "Port", - "compress" - }; - private String[] dat_default = new String[] { - "localhost", - "4236", - "true" - }; - private String[] dat_values = new String[3]; - private String[] dat_descs = new String[] { - "The Hostname of the remote host", - "The Port of the remote host", - "Should the Data be compressed(true/false)" - }; + ////////////// + //Properties + ////////////// + + //ID:0 + private String prop_hostname = "localhost"; + private String prop_hostname_default = "localhost"; + private String prop_hostname_name = "Hostname"; + private String prop_hostname_desc = "The name of the host, you want to connect to"; + //ID:1 + private String prop_hostport = "3742"; + private String prop_hostport_default = "3742"; + private String prop_hostport_name = "Port"; + private String prop_hostport_desc = "The port of the host, you want to connect to"; } Modified: trunk/share/src/main/java/org/jlink/net/ll/xml/XMLConnector.java =================================================================== --- trunk/share/src/main/java/org/jlink/net/ll/xml/XMLConnector.java 2006-10-09 17:49:22 UTC (rev 16) +++ trunk/share/src/main/java/org/jlink/net/ll/xml/XMLConnector.java 2006-10-24 16:47:32 UTC (rev 17) @@ -36,31 +36,57 @@ public class XMLConnector implements LLConnector { /** Creates a new instance of XMLConnector */ - public XMLConnector(LLConfiguration conf) throws LLConfigurationException { + XMLConnector(String host, int port) { + //really basic checkings, should never happen, if so then bug + if(host == null) + throw new NullPointerException(); + this.config_host = host; + this.config_port = port; } - + public void send(LLEvent evt) throws LLConnectionException { } - + public void send(LLEvent[] evts) throws LLConnectionException { } - + public LLEvent recive() throws LLConnectionException { return null; } - + public void recive(LLEvent[] evts) throws LLConnectionException { } - + public boolean isAlive() { return true; } + + public int ping() throws LLConnectionException { + return 0; + } - public void close() throws LLConnectionException { + public void connect() throws LLConnectionException { + //bypass, if connect already has been called + if(this.status_connected) + return; } - public long ping() throws LLConnectionException { - return 0L; + public void disconnect() throws LLConnectionException { + //bypass, if connect has never been called + if(!this.status_connected) + return; + //try to ping remote host, if there is an Exception } + + + + + private boolean status_connected = false;//means the own state, not if it is really connect + + ////////////////// + //Configuration + ////////////////// + private String config_host = ""; + private int config_port = 0; } Modified: trunk/share/src/main/java/org/jlink/net/ll/xml/XMLFactory.java =================================================================== --- trunk/share/src/main/java/org/jlink/net/ll/xml/XMLFactory.java 2006-10-09 17:49:22 UTC (rev 16) +++ trunk/share/src/main/java/org/jlink/net/ll/xml/XMLFactory.java 2006-10-24 16:47:32 UTC (rev 17) @@ -40,17 +40,39 @@ } public LLConfiguration getConfig() { - return new XMLConfiguration(); + //if there isnt already an config, create it + if(this.conf == null) + this.conf = new XMLConfiguration(); + return this.conf; } public void setConfig(LLConfiguration conf) throws LLConfigurationException { + //first check for not null + if(conf == null) + throw new NullPointerException("config may not be null"); + XMLConfiguration xconf = null; + //try to cast to it into an XMLConfiguration + try { + xconf = (XMLConfiguration) conf; + } catch(ClassCastException exc) { + //if this happens, someone is trying something nasty with us + throw new LLConfigurationException("didnt get an XMLConfiguration", exc); + } + this.conf = xconf; } public void resetConfig() { + //bypass, if there is no config doesnt exist + if(this.conf == null) + return; + this.conf.reset(); } - public LLConnector create() throws LLConnectionException, LLConfigurationException { + public LLConnector create() throws LLConfigurationException { return null; } + + private XMLConfiguration conf = null; + } Modified: trunk/share/src/site/site.xml =================================================================== --- trunk/share/src/site/site.xml 2006-10-09 17:49:22 UTC (rev 16) +++ trunk/share/src/site/site.xml 2006-10-24 16:47:32 UTC (rev 17) @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="ISO-8859-1"?> -<project name="JLink Client"> +<project name="JLink Share"> <bannerRight> <src>http://sflogo.sourceforge.net/sflogo.php?group_id=162264&type=3</src> </bannerRight> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wel...@us...> - 2006-10-24 17:26:24
|
Revision: 20 http://svn.sourceforge.net/java-link/?rev=20&view=rev Author: welterde0 Date: 2006-10-24 10:26:13 -0700 (Tue, 24 Oct 2006) Log Message: ----------- created private branche for welterde0(again) Added Paths: ----------- branches/private_welterde0/ Copied: branches/private_welterde0 (from rev 19, trunk) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wel...@us...> - 2006-10-24 17:23:08
|
Revision: 19 http://svn.sourceforge.net/java-link/?rev=19&view=rev Author: welterde0 Date: 2006-10-24 10:21:13 -0700 (Tue, 24 Oct 2006) Log Message: ----------- pushed some unstable into the trunk; fixed missing jmx classes for libdb ok, this is lots of unstable code, ok? Added Paths: ----------- trunk/client/src/main/java/org/jlink/client/gui/RootFrame.java trunk/client/src/main/java/org/jlink/client/net/NetworkCore.java trunk/env_client/ trunk/env_server/ trunk/env_server/config/ trunk/env_server/config/example.xml trunk/env_server/db/ trunk/env_server/db/config.xml trunk/env_server/logging/ trunk/env_server/logging/sample.xml trunk/env_server/logs/ trunk/libdb/src/main/java/org/jlink/server/libdb/StorageManagerJMX.java trunk/libdb/src/main/java/org/jlink/server/libdb/StorageManagerJMXMBean.java trunk/libgui/ trunk/libgui/nbproject/ trunk/libgui/nbproject/mavencall.xml trunk/libgui/nbproject/private/ trunk/libgui/nbproject/private/private.properties trunk/libgui/nbproject/private/private.xml trunk/libgui/nbproject/project.properties trunk/libgui/nbproject/project.xml trunk/libgui/pom.xml trunk/libgui/src/ trunk/libgui/src/main/ trunk/libgui/src/main/java/ trunk/libgui/src/main/java/org/ trunk/libgui/src/main/java/org/jlink/ trunk/libgui/src/main/java/org/jlink/libgui/ trunk/libgui/src/main/java/org/jlink/libgui/GUIRenderer.java trunk/libgui/src/main/java/org/jlink/libgui/RootFrame.java trunk/libgui/src/main/java/org/jlink/libgui/RootPane.java trunk/libgui/src/main/java/org/jlink/libgui/Window.java trunk/libgui/src/main/java/org/jlink/libgui/WindowListener.java trunk/libgui/src/main/java/org/jlink/libgui/widgets/ trunk/libgui/src/main/resources/ trunk/libgui/src/main/resources/org/ trunk/libgui/src/main/resources/org/jlink/ trunk/libgui/src/main/resources/org/jlink/ref/ trunk/libgui/src/site/ trunk/libgui/src/site/site.xml trunk/libgui/src/test/ trunk/libgui/src/test/java/ trunk/libnet/ trunk/libnet/nbproject/ trunk/libnet/nbproject/mavencall.xml trunk/libnet/nbproject/private/ trunk/libnet/nbproject/private/private.properties trunk/libnet/nbproject/private/private.xml trunk/libnet/nbproject/project.properties trunk/libnet/nbproject/project.xml trunk/libnet/pom.xml trunk/libnet/src/ trunk/libnet/src/main/ trunk/libnet/src/main/java/ trunk/libnet/src/main/java/org/ trunk/libnet/src/main/java/org/jlink/ trunk/libnet/src/main/java/org/jlink/libnet/ trunk/libnet/src/main/java/org/jlink/libnet/hl/ trunk/libnet/src/main/java/org/jlink/libnet/hl/HLManager.java trunk/libnet/src/main/java/org/jlink/libnet/hl/HLMode.java trunk/libnet/src/main/java/org/jlink/libnet/hl/HLModeEnum.java trunk/libnet/src/main/java/org/jlink/libnet/hl/modes/ trunk/libnet/src/main/java/org/jlink/libnet/hl/modes/ftp/ trunk/libnet/src/main/java/org/jlink/libnet/ll/ trunk/libnet/src/main/java/org/jlink/libnet/ll/LLConfiguration.java trunk/libnet/src/main/java/org/jlink/libnet/ll/LLConfigurationException.java trunk/libnet/src/main/java/org/jlink/libnet/ll/LLConnector.java trunk/libnet/src/main/java/org/jlink/libnet/ll/LLEvent.java trunk/libnet/src/main/java/org/jlink/libnet/ll/LLFactory.java trunk/libnet/src/main/java/org/jlink/libnet/ll/LLProtocol.java trunk/libnet/src/main/java/org/jlink/libnet/ll/LLServerFactory.java trunk/libnet/src/main/java/org/jlink/libnet/ll/xml/ trunk/libnet/src/main/java/org/jlink/libnet/ml/ trunk/libnet/src/main/resources/ trunk/libnet/src/main/resources/org/ trunk/libnet/src/main/resources/org/jlink/ trunk/libnet/src/main/resources/org/jlink/libnet/ trunk/libnet/src/main/resources/org/jlink/libnet/ll/ trunk/libnet/src/main/resources/org/jlink/libnet/ll/xml/ trunk/libnet/src/main/resources/org/jlink/libnet/ll/xml/Translation.properties trunk/libnet/src/main/resources/org/jlink/libnet/ll/xml/Translation_de_DE.properties trunk/libnet/src/main/resources/org/jlink/libnet/ll/xml/config.properties trunk/libnet/src/site/ trunk/libnet/src/site/site.xml trunk/libnet/src/test/ trunk/libnet/src/test/java/ trunk/libserver/ trunk/libserver/catalog.xml trunk/libserver/nbproject/ trunk/libserver/nbproject/mavencall.xml trunk/libserver/nbproject/private/ trunk/libserver/nbproject/private/private.properties trunk/libserver/nbproject/private/private.xml trunk/libserver/nbproject/project.properties trunk/libserver/nbproject/project.xml trunk/libserver/pom.xml trunk/libserver/src/ trunk/libserver/src/main/ trunk/libserver/src/main/java/ trunk/libserver/src/main/java/org/ trunk/libserver/src/main/java/org/jlink/ trunk/libserver/src/main/java/org/jlink/server/ trunk/libserver/src/main/java/org/jlink/server/Server.java trunk/libserver/src/main/java/org/jlink/server/ServerController.java trunk/libserver/src/main/java/org/jlink/server/ServerDescriptor.java trunk/libserver/src/main/java/org/jlink/server/ServerException.java trunk/libserver/src/main/resources/ trunk/libserver/src/site/ trunk/libserver/src/site/site.xml trunk/libserver/src/test/ trunk/libserver/src/test/java/ trunk/libworld/ trunk/libworld/nbproject/ trunk/libworld/nbproject/mavencall.xml trunk/libworld/nbproject/private/ trunk/libworld/nbproject/private/private.properties trunk/libworld/nbproject/private/private.xml trunk/libworld/nbproject/project.properties trunk/libworld/nbproject/project.xml trunk/libworld/pom.xml trunk/libworld/src/ trunk/libworld/src/main/ trunk/libworld/src/main/java/ trunk/libworld/src/main/java/org/ trunk/libworld/src/main/java/org/jlink/ trunk/libworld/src/main/java/org/jlink/libworld/ trunk/libworld/src/main/java/org/jlink/libworld/Character.java trunk/libworld/src/main/java/org/jlink/libworld/CharacterController.java trunk/libworld/src/main/java/org/jlink/libworld/CharacterModel.java trunk/libworld/src/main/java/org/jlink/libworld/CompanyModel.java trunk/libworld/src/main/java/org/jlink/libworld/Game.java trunk/libworld/src/main/java/org/jlink/libworld/GameModel.java trunk/libworld/src/main/java/org/jlink/libworld/World.java trunk/libworld/src/main/java/org/jlink/libworld/WorldModel.java trunk/libworld/src/main/resources/ trunk/libworld/src/site/ trunk/libworld/src/site/site.xml trunk/libworld/src/test/ trunk/libworld/src/test/java/ trunk/server/src/test/java/ trunk/server/src/test/java/org/ trunk/server/src/test/java/org/jlink/ trunk/server/src/test/java/org/jlink/server/ trunk/share/src/main/java/org/jlink/logic/ trunk/share/src/main/java/org/jlink/logic/Connection.java trunk/share/src/main/java/org/jlink/logic/World.java trunk/share/src/main/java/org/jlink/logic/WorldManager.java trunk/share/src/main/java/org/jlink/logic/error/ trunk/share/src/main/java/org/jlink/logic/error/ErrorHandler.java trunk/share/src/main/java/org/jlink/logic/error/ErrorManager.java trunk/share/src/main/java/org/jlink/logic/plugin/ trunk/share/src/main/java/org/jlink/logic/plugin/PluginManager.java Added: trunk/client/src/main/java/org/jlink/client/gui/RootFrame.java =================================================================== --- trunk/client/src/main/java/org/jlink/client/gui/RootFrame.java (rev 0) +++ trunk/client/src/main/java/org/jlink/client/gui/RootFrame.java 2006-10-24 17:21:13 UTC (rev 19) @@ -0,0 +1,85 @@ +/* + * RootFrame.java + * + * Created on 5. Oktober 2006, 14:43 + * + * JLink: An Introversion Uplink Clone with multiplayer support. + * Copyright (C) 2006 Tassilo Schweyer + * + * This program 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 2 + * of the License, or (at your option) any later version. + * + * This program 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 this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package org.jlink.client.gui; + +import javax.swing.JFrame; +import org.apache.commons.configuration.Configuration; + +/** + * + * @author welterde + */ +public class RootFrame { + + /** Creates a new instance of RootFrame */ + public RootFrame(Configuration conf) { + if(conf == null) + throw new NullPointerException("the configuration may not be null"); + this.conf = conf; + String title = "JLink"; + //TODO: add translation support to title + + //create new frame + this.frame = new JFrame(title); + //TODO: add desktop thing to frame + } + + + public void show(boolean fullscreen) { + //performance bypass + if(this.stat_showed) + return; + + if(fullscreen) { + //TODO: write fullscreen code + fullscreen = false; + } + if(!fullscreen) { + //TODO: read windowed size from config + this.frame.setSize(1024, 768); + this.frame.pack(); + this.frame.setVisible(true); + } + } + public void unshow() { + //performence bypass + if(!this.stat_showed) + return; + } + public void dipose() { + this.frame.dispose(); + } + + + + private JFrame frame = null; + + /** + * The global configuration. + */ + private Configuration conf = null; + + private boolean stat_showed = false; + +} Added: trunk/client/src/main/java/org/jlink/client/net/NetworkCore.java =================================================================== --- trunk/client/src/main/java/org/jlink/client/net/NetworkCore.java (rev 0) +++ trunk/client/src/main/java/org/jlink/client/net/NetworkCore.java 2006-10-24 17:21:13 UTC (rev 19) @@ -0,0 +1,36 @@ +/* + * NetworkCore.java + * + * Created on 9. September 2006, 22:49 + * + * JLink: An Introversion Uplink Clone with multiplayer support. + * Copyright (C) 2006 Tassilo Schweyer + * + * This program 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 2 + * of the License, or (at your option) any later version. + * + * This program 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 this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package org.jlink.client.net; + +/** + * + * @author welterde + */ +public class NetworkCore { + + /** Creates a new instance of NetworkCore */ + public NetworkCore() { + } + +} Added: trunk/env_server/config/example.xml =================================================================== --- trunk/env_server/config/example.xml (rev 0) +++ trunk/env_server/config/example.xml 2006-10-24 17:21:13 UTC (rev 19) @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8"?> +<root> + +</root> Added: trunk/env_server/db/config.xml =================================================================== --- trunk/env_server/db/config.xml (rev 0) +++ trunk/env_server/db/config.xml 2006-10-24 17:21:13 UTC (rev 19) @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<Repository> <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem"> + <param name="path" value="${rep.home}/repository"/> + </FileSystem> <Security> <AccessManager class="org.apache.jackrabbit.core.security.SimpleAccessManager"> </AccessManager> <LoginModule class="org.apache.jackrabbit.core.security.SimpleLoginModule"> <!-- anonymous user name ('anonymous' is the default value) --> <param name="anonymousId" value="anonymous"/> </LoginModule> </Security> <Workspaces rootPath="${rep.home}/workspaces" defaultWorkspace="default"/> <Workspace name="${wsp.name}"> <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem"> <param name="path" value="${wsp.home}"/> </FileSystem> <PersistenceManager class="org.apache.jackrabbit.core.state.db.DerbyPersistenceManager"> <param name="url" value="jdbc:derby:${wsp.home}/db;create=true"/> <param name="schemaObjectPrefix" value="${wsp.name}_"/> </PersistenceManager> <SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex"> <param name="path" value="${wsp.home}/index"/> <param name="useCompoundFile" value="true"/> <param name="minMergeDocs" value="100"/> <param name="volatileIdleTime" value="3"/> <param name="maxMergeDocs" value="100000"/> <param name="mergeFactor" value="10"/> <param name="maxFieldLength" value="10000"/> <param name="bufferSize" value="10"/> <param name="cacheSize" value="1000"/> <param name="forceConsistencyCheck" value="false"/> <param name="autoRepair" value="true"/> <param name="analyzer" value="org.apache.lucene.analysis.standard.StandardAnalyzer"/> <param name="queryClass" value="org.apache.jackrabbit.core.query.QueryImpl"/> <param name="idleTime" value="-1"/> <param name="respectDocumentOrder" value="true"/> </SearchIndex> </Workspace> </Repository> \ No newline at end of file Added: trunk/env_server/logging/sample.xml =================================================================== --- trunk/env_server/logging/sample.xml (rev 0) +++ trunk/env_server/logging/sample.xml 2006-10-24 17:21:13 UTC (rev 19) @@ -0,0 +1,37 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> + +<log4j:configuration> + + <appender name="LIVE-I" class="org.apache.log4j.net.SocketHubAppender"> + <param name="port" value="4445"/> + <param name="Threshold" value="all"/> + </appender> + <appender name="LIVE-II" class="org.apache.log4j.ConsoleAppender"> + <param name="Threshold" value="info"/> + <layout class="org.apache.log4j.PatternLayout"> + <param name="ConversionPattern" value="%d{ISO8601} %-5p %c - %m%n"/> + </layout> + </appender> + <appender name="DEBUG-I" class="org.apache.log4j.FileAppender"> + <param name="Threshold" value="all"/> + <param name="File" value="logs/debug.log.xml"/> + <param name="Append" value="false"/> + <layout class="org.apache.log4j.xml.XMLLayout"/> + </appender> + <appender name="FILE-I" class="org.apache.log4j.DailyRollingFileAppender"> + <param name="datePattern" value="'.'yyyy-MM-dd-HH"/> + <param name="File" value="logs/server.log.xml"/> + <param name="Threshold" value="debug"/> + <layout class="org.apache.log4j.xml.XMLLayout"/> + </appender> + + <root> + <priority value ="all" /> + <appender-ref ref="LIVE-I"/> + <appender-ref ref="LIVE-II"/> + <appender-ref ref="DEBUG-I"/> + <appender-ref ref="FILE-I"/> + </root> + +</log4j:configuration> \ No newline at end of file Added: trunk/libdb/src/main/java/org/jlink/server/libdb/StorageManagerJMX.java =================================================================== --- trunk/libdb/src/main/java/org/jlink/server/libdb/StorageManagerJMX.java (rev 0) +++ trunk/libdb/src/main/java/org/jlink/server/libdb/StorageManagerJMX.java 2006-10-24 17:21:13 UTC (rev 19) @@ -0,0 +1,117 @@ +/* + * StorageManagerJMX.java + * + * Created on 9. Oktober 2006, 19:18 + * + * JLink: An Introversion Uplink Clone with multiplayer support. + * Copyright (C) 2006 Tassilo Schweyer + * + * This program 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 2 + * of the License, or (at your option) any later version. + * + * This program 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 this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package org.jlink.server.libdb; +import javax.management.*; +import java.util.Arrays; + +/** + * Dynamic MBean based on StandardMBean + * Class StorageManagerJMX + * StorageManager Controller + * @author welterde + */ +public class StorageManagerJMX extends javax.management.StandardMBean implements StorageManagerJMXMBean { + + private org.jlink.server.libdb.StorageManager theRef; + + public StorageManagerJMX(org.jlink.server.libdb.StorageManager theRef) throws NotCompliantMBeanException { + super(StorageManagerJMXMBean.class); + this.theRef = theRef; + } + + /** + * Next are the methods to compute MBeanInfo. + * You shouldn't update these methods. + */ + protected String getDescription(MBeanInfo info) { + return "StorageManager Controller"; + } + + protected String getDescription(MBeanAttributeInfo info) { + String description = null; + return description; + } + + protected String getDescription(MBeanOperationInfo op, + MBeanParameterInfo param, + int sequence) { + if (op.getName().equals("destroy")) { + switch (sequence) { + default : return null; + } + } + return null; + } + + protected String getParameterName(MBeanOperationInfo op, + MBeanParameterInfo param, + int sequence) { + if (op.getName().equals("destroy")) { + switch (sequence) { + default : return null; + } + } + return null; + } + + protected String getDescription(MBeanOperationInfo info) { + String description = null; + MBeanParameterInfo[] params = info.getSignature(); + String[] signature = new String[params.length]; + for (int i = 0; i < params.length; i++) + signature[i] = params[i].getType(); + String[] methodSignature; + + methodSignature = new String[] { + }; + if (info.getName().equals("destroy") && Arrays.equals(signature, methodSignature)) { + description = "Operation exposed for management"; + } + + return description; + } + + public MBeanInfo getMBeanInfo() { + MBeanInfo mbinfo = super.getMBeanInfo(); + return new MBeanInfo(mbinfo.getClassName(), + mbinfo.getDescription(), + mbinfo.getAttributes(), + mbinfo.getConstructors(), + mbinfo.getOperations(), + getNotificationInfo()); + } + + public MBeanNotificationInfo[] getNotificationInfo() { + return new MBeanNotificationInfo[] {}; + } + + /** + * Operation exposed for management + */ + public void destroy() { + theRef.destroy(); + } +} + + Added: trunk/libdb/src/main/java/org/jlink/server/libdb/StorageManagerJMXMBean.java =================================================================== --- trunk/libdb/src/main/java/org/jlink/server/libdb/StorageManagerJMXMBean.java (rev 0) +++ trunk/libdb/src/main/java/org/jlink/server/libdb/StorageManagerJMXMBean.java 2006-10-24 17:21:13 UTC (rev 19) @@ -0,0 +1,40 @@ +/* + * StorageManagerJMXMBean.java + * + * Created on 9. Oktober 2006, 19:18 + * + * JLink: An Introversion Uplink Clone with multiplayer support. + * Copyright (C) 2006 Tassilo Schweyer + * + * This program 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 2 + * of the License, or (at your option) any later version. + * + * This program 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 this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package org.jlink.server.libdb; + +/** + * Interface StorageManagerJMXMBean + * StorageManager Controller + * @author welterde + */ +public interface StorageManagerJMXMBean +{ + /** + * Operation exposed for management + */ + public void destroy(); + +} + + Added: trunk/libgui/nbproject/mavencall.xml =================================================================== --- trunk/libgui/nbproject/mavencall.xml (rev 0) +++ trunk/libgui/nbproject/mavencall.xml 2006-10-24 17:21:13 UTC (rev 19) @@ -0,0 +1,42 @@ +<project name="client" default="build" basedir=".."> + <property file="nbproject/private/private.properties"/> + <property file="nbproject/project.properties"/> + <target name="build" description="Build"> + <exec dir="${basedir}" executable="${mvn.path}"> + <arg line="package"/> + </exec> + </target> + <target name="clean" description="Clean"> + <exec dir="${basedir}" executable="${mvn.path}"> + <arg line="clean:clean"/> + </exec> + </target> + <target name="javadoc" description="Javadoc"> + <exec dir="${basedir}" executable="${mvn.path}"> + <arg line="site:site"/> + </exec> + </target> + <target name="run" description="Install Locally"> + <exec dir="${basedir}" executable="${mvn.path}"> + <arg line="install"/> + </exec> + </target> + <target name="test" description="Test Project"> + <exec dir="${basedir}" executable="${mvn.path}"> + <arg line="test"/> + </exec> + </target> + <target name="jalopy" description="Format Code"> + <exec dir="${basedir}" executable="${mvn.path}"> + <arg line="jalopy:format"/> + </exec> + </target> + <target name="refresh-project" description="Refresh Project"> + <copy file="nbproject/mavencall.xml" tofile="nbproject/mavencall.xml.bak"/> + <exec dir="${basedir}" executable="${mvn.path}"> + <arg line="netbeans-freeform:generate-netbeans-project"/> + </exec> + <delete file="nbproject.xml"/> + <move file="nbproject/mavencall.xml.bak" tofile="nbproject/mavencall.xml"/> + </target> +</project> \ No newline at end of file Added: trunk/libgui/nbproject/private/private.properties =================================================================== --- trunk/libgui/nbproject/private/private.properties (rev 0) +++ trunk/libgui/nbproject/private/private.properties 2006-10-24 17:21:13 UTC (rev 19) @@ -0,0 +1,3 @@ +# Own settings for... +#... maven +mvn.path=/opt/local/bin/mvn Added: trunk/libgui/nbproject/private/private.xml =================================================================== --- trunk/libgui/nbproject/private/private.xml (rev 0) +++ trunk/libgui/nbproject/private/private.xml 2006-10-24 17:21:13 UTC (rev 19) @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project-private xmlns="http://www.netbeans.org/ns/project-private/1"> + <editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/1"/> +</project-private> Added: trunk/libgui/nbproject/project.properties =================================================================== --- trunk/libgui/nbproject/project.properties (rev 0) +++ trunk/libgui/nbproject/project.properties 2006-10-24 17:21:13 UTC (rev 19) @@ -0,0 +1,5 @@ +#The netbeans freeform property file +#Wed Sep 13 22:31:11 CEST 2006 +local.repository=/Users/welterde/.m2/repository +mvn.path=mvn +project.directory=/Users/welterde/Documents/dev/jlink/current_trunk/libgui Added: trunk/libgui/nbproject/project.xml =================================================================== --- trunk/libgui/nbproject/project.xml (rev 0) +++ trunk/libgui/nbproject/project.xml 2006-10-24 17:21:13 UTC (rev 19) @@ -0,0 +1,134 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://www.netbeans.org/ns/project/1"> + <type>org.netbeans.modules.ant.freeform</type> + <configuration> + <general-data xmlns="http://www.netbeans.org/ns/freeform-project/1"> + <name>JLink libgui</name> + <properties> + <property name="ant.script">nbproject/mavencall.xml</property> + <property-file>nbproject/project.properties</property-file> + </properties> + <folders> + <source-folder> + <label>src/main/java</label> + <type>java</type> + <location>src/main/java</location> + </source-folder> + <source-folder> + <label>src/test/java</label> + <type>java</type> + <location>src/test/java</location> + </source-folder> + </folders> + <ide-actions> + <action name="build"> + <script>${ant.script}</script> + <target>build</target> + </action> + <action name="clean"> + <script>${ant.script}</script> + <target>clean</target> + </action> + <action name="rebuild"> + <script>${ant.script}</script> + <target>clean</target> + <target>build</target> + </action> + <action name="javadoc"> + <script>${ant.script}</script> + <target>javadoc</target> + </action> + <action name="run"> + <script>${ant.script}</script> + <target>run</target> + </action> + <action name="test"> + <script>${ant.script}</script> + <target>test</target> + </action> + </ide-actions> + <export> + <type>folder</type> + <location>target/classes</location> + <script>${ant.script}</script> + <build-target>build</build-target> + </export> + <export> + <type>folder</type> + <location>target/test-classes</location> + <script>${ant.script}</script> + <build-target>build</build-target> + </export> + <view> + <items> + <source-folder style="packages"> + <label>src/main/java</label> + <location>src/main/java</location> + </source-folder> + <source-folder style="packages"> + <label>src/test/java</label> + <location>src/test/java</location> + </source-folder> + <source-file> + <label>pom</label> + <location>pom.xml</location> + </source-file> + <source-file> + <label>mavencall</label> + <location>nbproject/mavencall.xml</location> + </source-file> + <source-folder style="tree"> + <label>src/main/resources</label> + <location>src/main/resources</location> + </source-folder> + <source-folder style="tree"> + <label>src/test/resources</label> + <location>src/test/resources</location> + </source-folder> + <source-folder style="tree"> + <label>src/site</label> + <location>src/site</location> + </source-folder> + <source-folder style="tree"> + <label>target</label> + <location>target</location> + </source-folder> + </items> + <context-menu> + <action> + <script>${ant.script}</script> + <label>Refresh Project</label> + <target>refresh-project</target> + </action> + <ide-action name="build"/> + <ide-action name="clean"/> + <ide-action name="rebuild"/> + <ide-action name="javadoc"/> + <ide-action name="run"/> + <ide-action name="test"/> + <action> + <script>${ant.script}</script> + <label>Format Code</label> + <target>jalopy</target> + </action> + </context-menu> + </view> + <subprojects/> + </general-data> + <java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/2"> + <compilation-unit> + <package-root>src/main/java</package-root> + <classpath mode="compile">${local.repository}/commons-logging/commons-logging/1.0/commons-logging-1.0.jar:${local.repository}/groovy/groovy/1.0-jsr-06/groovy-1.0-jsr-06.jar:${local.repository}/commons-codec/commons-codec/1.3/commons-codec-1.3.jar:${local.repository}/relaxngDatatype/relaxngDatatype/20020414/relaxngDatatype-20020414.jar:${local.repository}/xerces/xercesImpl/2.2.1/xercesImpl-2.2.1.jar:${local.repository}/isorelax/isorelax/20020414/isorelax-20020414.jar:${local.repository}/javax/servlet/servlet-api/2.3/servlet-api-2.3.jar:${local.repository}/xalan/xalan/2.7.0/xalan-2.7.0.jar:${local.repository}/commons-lang/commons-lang/2.1/commons-lang-2.1.jar:${local.repository}/commons-configuration/commons-configuration/1.2/commons-configuration-1.2.jar:${local.repository}/commons-collections/commons-collections/3.1/commons-collections-3.1.jar:${local.repository}/jaxen/jaxen/1.0-FCS/jaxen-1.0-FCS.jar:${local.repository}/commons-digester/commons-digester/1.6/commons-digester-1.6.jar:${local.repository}/antlr/antlr/2.7.5/antlr-2.7.5.jar:${local.repository}/commons-beanutils/commons-beanutils/1.6/commons-beanutils-1.6.jar:${local.repository}/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.jar:${local.repository}/asm/asm/2.2/asm-2.2.jar:${local.repository}/commons-beanutils/commons-beanutils-core/1.7.0/commons-beanutils-core-1.7.0.jar:${local.repository}/commons-logging/commons-logging-api/1.0.4/commons-logging-api-1.0.4.jar:${local.repository}/dom4j/dom4j/1.4/dom4j-1.4.jar:${local.repository}/saxpath/saxpath/1.0-FCS/saxpath-1.0-FCS.jar:${local.repository}/msv/msv/20020414/msv-20020414.jar</classpath> + <built-to>target/classes</built-to> + <source-level>1.5</source-level> + </compilation-unit> + <compilation-unit> + <package-root>src/test/java</package-root> + <unit-tests/> + <classpath mode="compile">target/classes:${local.repository}/commons-logging/commons-logging/1.0/commons-logging-1.0.jar:${local.repository}/groovy/groovy/1.0-jsr-06/groovy-1.0-jsr-06.jar:${local.repository}/commons-codec/commons-codec/1.3/commons-codec-1.3.jar:${local.repository}/relaxngDatatype/relaxngDatatype/20020414/relaxngDatatype-20020414.jar:${local.repository}/xerces/xercesImpl/2.2.1/xercesImpl-2.2.1.jar:${local.repository}/junit/junit/3.8.1/junit-3.8.1.jar:${local.repository}/isorelax/isorelax/20020414/isorelax-20020414.jar:${local.repository}/javax/servlet/servlet-api/2.3/servlet-api-2.3.jar:${local.repository}/xalan/xalan/2.7.0/xalan-2.7.0.jar:${local.repository}/commons-lang/commons-lang/2.1/commons-lang-2.1.jar:${local.repository}/commons-configuration/commons-configuration/1.2/commons-configuration-1.2.jar:${local.repository}/commons-collections/commons-collections/3.1/commons-collections-3.1.jar:${local.repository}/jaxen/jaxen/1.0-FCS/jaxen-1.0-FCS.jar:${local.repository}/commons-digester/commons-digester/1.6/commons-digester-1.6.jar:${local.repository}/antlr/antlr/2.7.5/antlr-2.7.5.jar:${local.repository}/commons-beanutils/commons-beanutils/1.6/commons-beanutils-1.6.jar:${local.repository}/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.jar:${local.repository}/asm/asm/2.2/asm-2.2.jar:${local.repository}/commons-beanutils/commons-beanutils-core/1.7.0/commons-beanutils-core-1.7.0.jar:${local.repository}/commons-logging/commons-logging-api/1.0.4/commons-logging-api-1.0.4.jar:${local.repository}/dom4j/dom4j/1.4/dom4j-1.4.jar:${local.repository}/saxpath/saxpath/1.0-FCS/saxpath-1.0-FCS.jar:${local.repository}/msv/msv/20020414/msv-20020414.jar</classpath> + <built-to>target/test-classes</built-to> + <source-level>1.5</source-level> + </compilation-unit> + </java-data> + </configuration> +</project> Added: trunk/libgui/pom.xml =================================================================== --- trunk/libgui/pom.xml (rev 0) +++ trunk/libgui/pom.xml 2006-10-24 17:21:13 UTC (rev 19) @@ -0,0 +1,123 @@ +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> +<!--//////////////////////////////////////// + /////////////General//////////////////// + /////////////////////////////////////--> + <modelVersion>4.0.0</modelVersion> + <groupId>org.jlink</groupId> + <artifactId>libgui</artifactId> + <packaging>jar</packaging> + <version>0.0.1-SNAPSHOT</version> + <name>JLink libgui</name> + <url>http://java-link.sf.net/</url> + <dependencies> + <dependency> + <groupId>groovy</groupId> + <artifactId>groovy</artifactId> + <version>1.0-jsr-06</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>commons-configuration</groupId> + <artifactId>commons-configuration</artifactId> + <version>1.2</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>3.8.1</version> + <scope>test</scope> + </dependency> + </dependencies> +<!--//////////////////////////////////////// + /////////////Reporting////////////////// + /////////////////////////////////////--> + <reporting> + <plugins> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>jxr-maven-plugin</artifactId> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-javadoc-plugin</artifactId> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-pmd-plugin</artifactId> + <configuration> + <rulesets> + <ruleset>/rulesets/basic.xml</ruleset> + <ruleset>/rulesets/braces.xml</ruleset> + <ruleset>/rulesets/codesize.xml</ruleset> + <ruleset>/rulesets/coupling.xml</ruleset> + <ruleset>/rulesets/design.xml</ruleset> + <ruleset>/rulesets/finalizers.xml</ruleset> + <ruleset>/rulesets/imports.xml</ruleset> + <ruleset>/rulesets/javabeans.xml</ruleset> + <ruleset>/rulesets/logging-java.xml</ruleset> + <ruleset>/rulesets/naming.xml</ruleset> + <ruleset>/rulesets/optimizations.xml</ruleset> + <ruleset>/rulesets/strictexception.xml</ruleset> + <ruleset>/rulesets/strings.xml</ruleset> + <ruleset>/rulesets/sunsecure.xml</ruleset> + <ruleset>/rulesets/unusedcode.xml</ruleset> + </rulesets> + <linkXref>true</linkXref> + <sourceEncoding>utf-8</sourceEncoding> + <minimumTokens>100</minimumTokens> + <targetJdk>1.5</targetJdk> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-report-plugin</artifactId> + </plugin> + </plugins> + </reporting> +<!--//////////////////////////////////////// + /////////////Building/////////////////// + /////////////////////////////////////--> + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <configuration> + <source>1.5</source> + <target>1.5</target> + </configuration> + </plugin> + </plugins> + </build> +<!--//////////////////////////////////////// + /////////////Deploying////////////////// + /////////////////////////////////////--> + <distributionManagement> + <site> + <id>jlink-sf</id> + <url>scp://shell.sf.net/home/groups/j/ja/java-link/htdocs/maven2/libgui</url> + </site> + </distributionManagement> +<!--//////////////////////////////////////// + /////////////Include from root////////// + /////////////////////////////////////--> + <ciManagement> + <system>cruisecontrol</system> + <url>http://welterde.i2p/cruisecontrol/</url> + </ciManagement> + <issueManagement> + <system>sourceforge</system> + <url>http://sourceforge.net/tracker/?group_id=162264</url> + </issueManagement> + <developers> + <developer> + <id>welterde</id> + <email>wel...@ar...</email> + </developer> + </developers> + <scm> + <connection>scm:svn:https://svn.sourceforge.net/svnroot/javalink</connection> + <url>http://svn.sourceforge.net/viewcvs.cgi/java-link/</url> + </scm> +</project> Added: trunk/libgui/src/main/java/org/jlink/libgui/GUIRenderer.java =================================================================== --- trunk/libgui/src/main/java/org/jlink/libgui/GUIRenderer.java (rev 0) +++ trunk/libgui/src/main/java/org/jlink/libgui/GUIRenderer.java 2006-10-24 17:21:13 UTC (rev 19) @@ -0,0 +1,36 @@ +/* + * GUIRenderer.java + * + * Created on 5. Oktober 2006, 14:39 + * + * JLink: An Introversion Uplink Clone with multiplayer support. + * Copyright (C) 2006 Tassilo Schweyer + * + * This program 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 2 + * of the License, or (at your option) any later version. + * + * This program 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 this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package org.jlink.libgui; + +/** + * + * @author welterde + */ +public class GUIRenderer { + + /** Creates a new instance of GUIRenderer */ + public GUIRenderer() { + } + +} Added: trunk/libgui/src/main/java/org/jlink/libgui/RootFrame.java =================================================================== --- trunk/libgui/src/main/java/org/jlink/libgui/RootFrame.java (rev 0) +++ trunk/libgui/src/main/java/org/jlink/libgui/RootFrame.java 2006-10-24 17:21:13 UTC (rev 19) @@ -0,0 +1,86 @@ +/* + * RootFrame.java + * + * Created on 14. September 2006, 19:15 + * + * JLink: An Introversion Uplink Clone with multiplayer support. + * Copyright (C) 2006 Tassilo Schweyer + * + * This program 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 2 + * of the License, or (at your option) any later version. + * + * This program 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 this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package org.jlink.libgui; + +import java.awt.GraphicsEnvironment; +import java.awt.GraphicsDevice; + +import javax.swing.JFrame; +import javax.swing.JPanel; + +/** + * + * @author welterde + */ +public class RootFrame { + + /** Creates a new instance of RootFrame */ + public RootFrame(JPanel panel) { + if(panel == null) + throw new NullPointerException(); + this.comp_panel = panel; + this.comp_frame = new JFrame("JLink"); + this.comp_frame.add(this.comp_panel); + this.comp_frame.pack(); + } + + + public void show(boolean fullscreen) { + //try to do fullscreen + if(fullscreen) { + GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); + GraphicsDevice gs = ge.getDefaultScreenDevice(); + //check if we can switch to fullscreen + if (gs.isFullScreenSupported()) { + //TODO: write fullscreen code + fullscreen = false; + } else { + //if not, force fall over to windowed mode + fullscreen = false; + } + } + if(!fullscreen) { + this.comp_frame.setSize(1024, 768); + this.comp_frame.pack(); + this.comp_frame.setVisible(true); + } + } + public void unshow() { + this.comp_frame.setVisible(false); + } + public void dispose() { + this.comp_frame.dispose(); + } + + + + + + + + + + private JPanel comp_panel = null; + private JFrame comp_frame = null; +} Added: trunk/libgui/src/main/java/org/jlink/libgui/RootPane.java =================================================================== --- trunk/libgui/src/main/java/org/jlink/libgui/RootPane.java (rev 0) +++ trunk/libgui/src/main/java/org/jlink/libgui/RootPane.java 2006-10-24 17:21:13 UTC (rev 19) @@ -0,0 +1,67 @@ +/* + * RootPane.java + * + * Created on 13. September 2006, 21:28 + * + * JLink: An Introversion Uplink Clone with multiplayer support. + * Copyright (C) 2006 Tassilo Schweyer + * + * This program 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 2 + * of the License, or (at your option) any later version. + * + * This program 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 this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package org.jlink.libgui; + +import javax.swing.JPanel; +import javax.swing.JPopupMenu; +import javax.swing.JMenuItem; + +import org.apache.commons.configuration.Configuration; +import org.apache.commons.configuration.ConversionException; + +/** + * + * @author welterde + */ +public class RootPane extends JPanel { + + /** Creates a new instance of RootPane */ + public RootPane(Configuration conf) { + //try to get an default value for X + try { + this.win_default_x = conf.getInt("win_x", 768); + } catch(ConversionException exc) { + //TODO: log it + } + //set X for panel + //try to get an default value for Y + try { + this.win_default_y = conf.getInt("win_y", 768); + } catch(ConversionException exc) { + //TODO: log it + } + + } + + + + + + //Base configuration + private int win_default_x = 200; + private int win_default_y = 200; + + + +} Added: trunk/libgui/src/main/java/org/jlink/libgui/Window.java =================================================================== --- trunk/libgui/src/main/java/org/jlink/libgui/Window.java (rev 0) +++ trunk/libgui/src/main/java/org/jlink/libgui/Window.java 2006-10-24 17:21:13 UTC (rev 19) @@ -0,0 +1,57 @@ +/* + * Window.java + * + * Created on 14. September 2006, 15:16 + * + * JLink: An Introversion Uplink Clone with multiplayer support. + * Copyright (C) 2006 Tassilo Schweyer + * + * This program 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 2 + * of the License, or (at your option) any later version. + * + * This program 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 this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package org.jlink.libgui; + +import javax.swing.JInternalFrame; +import javax.swing.JPanel; +import javax.swing.JPopupMenu; + +/** + * TODO: add Popupmenu in titlebar + * TODO: add transparency + * @author welterde + */ +public abstract class Window extends JInternalFrame { + + /** + * Creates a new instance of Window + */ + public Window(String title, boolean resizable, boolean closeable, boolean maximizable, boolean iconifiable) { + super(title, resizable, closeable, maximizable, iconifiable); + this.pay_panel = this.getPanel(); + } + + + + //abstract methods + protected abstract JPanel getPanel(); + + protected void setModifiedState(boolean modified) { + //TODO: write modified code thingy + } + + + + private JPanel pay_panel = null; +} Added: trunk/libgui/src/main/java/org/jlink/libgui/WindowListener.java =================================================================== --- trunk/libgui/src/main/java/org/jlink/libgui/WindowListener.java (rev 0) +++ trunk/libgui/src/main/java/org/jlink/libgui/WindowListener.java 2006-10-24 17:21:13 UTC (rev 19) @@ -0,0 +1,41 @@ +/* + * WindowListener.java + * + * Created on 14. September 2006, 22:17 + * + * JLink: An Introversion Uplink Clone with multiplayer support. + * Copyright (C) 2006 Tassilo Schweyer + * + * This program 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 2 + * of the License, or (at your option) any later version. + * + * This program 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 this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package org.jlink.libgui; + +/** + * + * @author welterde + */ +public interface WindowListener { + //modified state change + public void modified(); + public void discarded();//spelled right? + public void saved(); + + //window itself + public void maximized(); + public void minimized(); + public void resized(int x, int y); + public void moved(int abs_x, int abs_y); +} Added: trunk/libgui/src/site/site.xml =================================================================== --- trunk/libgui/src/site/site.xml (rev 0) +++ trunk/libgui/src/site/site.xml 2006-10-24 17:21:13 UTC (rev 19) @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<project name="JLink libgui"> + <bannerRight> + <src>http://sflogo.sourceforge.net/sflogo.php?group_id=162264&type=3</src> + </bannerRight> + <body> + ${reports} + </body> +</project> Added: trunk/libnet/nbproject/mavencall.xml =================================================================== --- trunk/libnet/nbproject/mavencall.xml (rev 0) +++ trunk/libnet/nbproject/mavencall.xml 2006-10-24 17:21:13 UTC (rev 19) @@ -0,0 +1,42 @@ +<project name="client" default="build" basedir=".."> + <property file="nbproject/private/private.properties"/> + <property file="nbproject/project.properties"/> + <target name="build" description="Build"> + <exec dir="${basedir}" executable="${mvn.path}"> + <arg line="package"/> + </exec> + </target> + <target name="clean" description="Clean"> + <exec dir="${basedir}" executable="${mvn.path}"> + <arg line="clean:clean"/> + </exec> + </target> + <target name="javadoc" description="Javadoc"> + <exec dir="${basedir}" executable="${mvn.path}"> + <arg line="site:site"/> + </exec> + </target> + <target name="run" description="Install Locally"> + <exec dir="${basedir}" executable="${mvn.path}"> + <arg line="install"/> + </exec> + </target> + <target name="test" description="Test Project"> + <exec dir="${basedir}" executable="${mvn.path}"> + <arg line="test"/> + </exec> + </target> + <target name="jalopy" description="Format Code"> + <exec dir="${basedir}" executable="${mvn.path}"> + <arg line="jalopy:format"/> + </exec> + </target> + <target name="refresh-project" description="Refresh Project"> + <copy file="nbproject/mavencall.xml" tofile="nbproject/mavencall.xml.bak"/> + <exec dir="${basedir}" executable="${mvn.path}"> + <arg line="netbeans-freeform:generate-netbeans-project"/> + </exec> + <delete file="nbproject.xml"/> + <move file="nbproject/mavencall.xml.bak" tofile="nbproject/mavencall.xml"/> + </target> +</project> \ No newline at end of file Added: trunk/libnet/nbproject/private/private.properties =================================================================== --- trunk/libnet/nbproject/private/private.properties (rev 0) +++ trunk/libnet/nbproject/private/private.properties 2006-10-24 17:21:13 UTC (rev 19) @@ -0,0 +1,3 @@ +# Own settings for... +#... maven +mvn.path=/opt/local/bin/mvn Added: trunk/libnet/nbproject/private/private.xml =================================================================== --- trunk/libnet/nbproject/private/private.xml (rev 0) +++ trunk/libnet/nbproject/private/private.xml 2006-10-24 17:21:13 UTC (rev 19) @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project-private xmlns="http://www.netbeans.org/ns/project-private/1"> + <editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/1"/> +</project-private> Added: trunk/libnet/nbproject/project.properties =================================================================== --- trunk/libnet/nbproject/project.properties (rev 0) +++ trunk/libnet/nbproject/project.properties 2006-10-24 17:21:13 UTC (rev 19) @@ -0,0 +1,2 @@ +#The netbeans freeform property file +#Sun Sep 03 13:57:42 CEST 2006 Added: trunk/libnet/nbproject/project.xml =================================================================== --- trunk/libnet/nbproject/project.xml (rev 0) +++ trunk/libnet/nbproject/project.xml 2006-10-24 17:21:13 UTC (rev 19) @@ -0,0 +1,133 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://www.netbeans.org/ns/project/1"> + <type>org.netbeans.modules.ant.freeform</type> + <configuration> + <general-data xmlns="http://www.netbeans.org/ns/freeform-project/1"> + <name>JLink libnet</name> + <properties> + <property name="ant.script">nbproject/mavencall.xml</property> + <property-file>nbproject/project.properties</property-file> + </properties> + <folders> + <source-folder> + <label>src/main/java</label> + <type>java</type> + <location>src/main/java</location> + </source-folder> + <source-folder> + <label>src/test/java</label> + <type>java</type> + <location>src/test/java</location> + </source-folder> + </folders> + <ide-actions> + <action name="build"> + <script>${ant.script}</script> + <target>build</target> + </action> + <action name="clean"> + <script>${ant.script}</script> + <target>clean</target> + </action> + <action name="rebuild"> + <script>${ant.script}</script> + <target>clean</target> + <target>build</target> + </action> + <action name="javadoc"> + <script>${ant.script}</script> + <target>javadoc</target> + </action> + <action name="run"> + <script>${ant.script}</script> + <target>run</target> + </action> + <action name="test"> + <script>${ant.script}</script> + <target>test</target> + </action> + </ide-actions> + <export> + <type>folder</type> + <location>target/classes</location> + <script>${ant.script}</script> + <build-target>build</build-target> + </export> + <export> + <type>folder</type> + <location>target/test-classes</location> + <script>${ant.script}</script> + <build-target>build</build-target> + </export> + <view> + <items> + <source-folder style="packages"> + <label>src/main/java</label> + <location>src/main/java</location> + </source-folder> + <source-folder style="packages"> + <label>src/test/java</label> + <location>src/test/java</location> + </source-folder> + <source-file> + <label>pom</label> + <location>pom.xml</location> + </source-file> + <source-file> + <label>mavencall</label> + <location>nbproject/mavencall.xml</location> + </source-file> + <source-folder style="tree"> + <label>src/main/resources</label> + <location>src/main/resources</location> + </source-folder> + <source-folder style="tree"> + <label>src/test/resources</label> + <location>src/test/resources</location> + </source-folder> + <source-folder style="tree"> + <label>src/site</label> + <location>src/site</location> + </source-folder> + <source-folder style="tree"> + <label>target</label> + <location>target</location> + </source-folder> + </items> + <context-menu> + <action> + <script>${ant.script}</script> + <label>Refresh Project</label> + <target>refresh-project</target> + </action> + <ide-action name="build"/> + <ide-action name="clean"/> + <ide-action name="rebuild"/> + <ide-action name="javadoc"/> + <ide-action name="run"/> + <ide-action name="test"/> + <action> + <script>${ant.script}</script> + <label>Format Code</label> + <target>jalopy</target> + </action> + </context-menu> + </view> + <subprojects/> + </general-data> + <java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/2"> + <compilation-unit> + <package-root>src/main/java</package-root> + <built-to>target/classes</built-to> + <source-level>1.5</source-level> + </compilation-unit> + <compilation-unit> + <package-root>src/test/java</package-root> + <unit-tests/> + <classpath mode="compile">target/classes:${local.repository}/junit/junit/3.8.1/junit-3.8.1.jar</classpath> + <built-to>target/test-classes</built-to> + <source-level>1.5</source-level> + </compilation-unit> + </java-data> + </configuration> +</project> Added: trunk/libnet/pom.xml =================================================================== --- trunk/libnet/pom.xml (rev 0) +++ trunk/libnet/pom.xml 2006-10-24 17:21:13 UTC (rev 19) @@ -0,0 +1,111 @@ +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> +<!--//////////////////////////////////////// + /////////////General//////////////////// + /////////////////////////////////////--> + <modelVersion>4.0.0</modelVersion> + <groupId>org.jlink</groupId> + <artifactId>libnet</artifactId> + <packaging>jar</packaging> + <version>0.0.1-SNAPSHOT</version> + <name>JLink libnet</name> + <url>http://java-link.sf.net/</url> + <dependencies> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>3.8.1</version> + <scope>test</scope> + </dependency> + </dependencies> +<!--//////////////////////////////////////// + /////////////Reporting////////////////// + /////////////////////////////////////--> + <reporting> + <plugins> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>jxr-maven-plugin</artifactId> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-javadoc-plugin</artifactId> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-pmd-plugin</artifactId> + <configuration> + <rulesets> + <ruleset>/rulesets/basic.xml</ruleset> + <ruleset>/rulesets/braces.xml</ruleset> + <ruleset>/rulesets/codesize.xml</ruleset> + <ruleset>/rulesets/coupling.xml</ruleset> + <ruleset>... [truncated message content] |
From: <wel...@us...> - 2006-10-24 17:04:01
|
Revision: 18 http://svn.sourceforge.net/java-link/?rev=18&view=rev Author: welterde0 Date: 2006-10-24 10:03:49 -0700 (Tue, 24 Oct 2006) Log Message: ----------- removed branche, due conflict Removed Paths: ------------- branches/private_welterde0/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wel...@us...> - 2006-10-09 17:50:03
|
Revision: 16 http://svn.sourceforge.net/java-link/?rev=16&view=rev Author: welterde0 Date: 2006-10-09 10:49:22 -0700 (Mon, 09 Oct 2006) Log Message: ----------- added module libdb for server projects: added module libdb for server build(build.xml): added dep for jcr-1.0.jar of libdb fixed missing mkdirs in share and server deps server(pom.xml): added deb for libdb server: rewritten the Main class rewritten the Core added JMX support to Main Modified Paths: -------------- trunk/build.xml trunk/server/nbproject/project.xml trunk/server/pom.xml trunk/server/src/main/java/org/jlink/server/jmx/JMXAgent.java trunk/server/src/main/java/org/jlink/server/jmx/run.properties Added Paths: ----------- trunk/libdb/ trunk/libdb/nbproject/ trunk/libdb/nbproject/mavencall.xml trunk/libdb/nbproject/project.properties trunk/libdb/nbproject/project.xml trunk/libdb/pom.xml trunk/libdb/src/ trunk/libdb/src/main/ trunk/libdb/src/main/java/ trunk/libdb/src/main/java/org/ trunk/libdb/src/main/java/org/jlink/ trunk/libdb/src/main/java/org/jlink/server/ trunk/libdb/src/main/java/org/jlink/server/libdb/ trunk/libdb/src/main/java/org/jlink/server/libdb/StorageManager.java trunk/libdb/src/main/java/org/jlink/server/libdb/drivers/ trunk/libdb/src/main/java/org/jlink/server/libdb/drivers/Driver.java trunk/libdb/src/main/java/org/jlink/server/libdb/drivers/JackrabbitDriver.java trunk/libdb/src/main/resources/ trunk/libdb/src/site/ trunk/libdb/src/site/site.xml trunk/libdb/src/test/ trunk/libdb/src/test/java/ trunk/server/src/main/java/org/jlink/server/Main.java trunk/server/src/main/java/org/jlink/server/MainJMX.java trunk/server/src/main/java/org/jlink/server/MainJMXMBean.java Modified: trunk/build.xml =================================================================== --- trunk/build.xml 2006-10-08 19:29:46 UTC (rev 15) +++ trunk/build.xml 2006-10-09 17:49:22 UTC (rev 16) @@ -31,6 +31,7 @@ --> <!--Targets--> <target name="share-deps"> + <mkdir dir="tmp"/> <echo message="downloading dep client/jfunutil.jar"/> <get src="http://${sf.mirror}.dl.sourceforge.net/sourceforge/java-link/jfunutil-5.0.jar" dest="tmp/jfunutil.jar"/> <exec executable="mvn"> @@ -48,8 +49,21 @@ </target> - - <target name="server" depends="share"> + <target name="server-deps" depends="share"> + <mkdir dir="tmp"/> + <echo message="downloading dep server/jcr.jar"/> + <get src="http://${sf.mirror}.dl.sourceforge.net/sourceforge/java-link/jcr-1.0.jar" dest="tmp/jcr.jar"/> + <exec executable="mvn"> + <arg line="install:install-file -DgroupId=jsr170 -DartifactId=jcr -Dversion=1.0 -Dpackaging=jar -Dfile=tmp/jcr.jar"/> + </exec> + <echo message="[done]"/> + </target> + <target name="server-mods" depends="server-deps"> + <exec executable="mvn" dir="libdb" output="libdb.server.build.log"> + <arg value="install"/> + </exec> + </target> + <target name="server" depends="server-deps, server-mods"> <exec executable="mvn" dir="server" output="server.build.log"> <arg value="compile"/> </exec> Added: trunk/libdb/nbproject/mavencall.xml =================================================================== --- trunk/libdb/nbproject/mavencall.xml (rev 0) +++ trunk/libdb/nbproject/mavencall.xml 2006-10-09 17:49:22 UTC (rev 16) @@ -0,0 +1,42 @@ +<project name="client" default="build" basedir=".."> + <property file="nbproject/private/private.properties"/> + <property file="nbproject/project.properties"/> + <target name="build" description="Build"> + <exec dir="${basedir}" executable="${mvn.path}"> + <arg line="package"/> + </exec> + </target> + <target name="clean" description="Clean"> + <exec dir="${basedir}" executable="${mvn.path}"> + <arg line="clean:clean"/> + </exec> + </target> + <target name="javadoc" description="Javadoc"> + <exec dir="${basedir}" executable="${mvn.path}"> + <arg line="site:site"/> + </exec> + </target> + <target name="run" description="Install Locally"> + <exec dir="${basedir}" executable="${mvn.path}"> + <arg line="install"/> + </exec> + </target> + <target name="test" description="Test Project"> + <exec dir="${basedir}" executable="${mvn.path}"> + <arg line="test"/> + </exec> + </target> + <target name="jalopy" description="Format Code"> + <exec dir="${basedir}" executable="${mvn.path}"> + <arg line="jalopy:format"/> + </exec> + </target> + <target name="refresh-project" description="Refresh Project"> + <copy file="nbproject/mavencall.xml" tofile="nbproject/mavencall.xml.bak"/> + <exec dir="${basedir}" executable="${mvn.path}"> + <arg line="netbeans-freeform:generate-netbeans-project"/> + </exec> + <delete file="nbproject.xml"/> + <move file="nbproject/mavencall.xml.bak" tofile="nbproject/mavencall.xml"/> + </target> +</project> \ No newline at end of file Added: trunk/libdb/nbproject/project.properties =================================================================== --- trunk/libdb/nbproject/project.properties (rev 0) +++ trunk/libdb/nbproject/project.properties 2006-10-09 17:49:22 UTC (rev 16) @@ -0,0 +1,5 @@ +#The netbeans freeform property file +#Mon Oct 09 18:04:07 CEST 2006 +local.repository=/Users/welterde/.m2/repository +mvn.path=mvn +project.directory=/Users/welterde/Documents/dev/jlink/current_trunk/libdb Added: trunk/libdb/nbproject/project.xml =================================================================== --- trunk/libdb/nbproject/project.xml (rev 0) +++ trunk/libdb/nbproject/project.xml 2006-10-09 17:49:22 UTC (rev 16) @@ -0,0 +1,134 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://www.netbeans.org/ns/project/1"> + <type>org.netbeans.modules.ant.freeform</type> + <configuration> + <general-data xmlns="http://www.netbeans.org/ns/freeform-project/1"> + <name>JLink libdb</name> + <properties> + <property name="ant.script">nbproject/mavencall.xml</property> + <property-file>nbproject/project.properties</property-file> + </properties> + <folders> + <source-folder> + <label>src/main/java</label> + <type>java</type> + <location>src/main/java</location> + </source-folder> + <source-folder> + <label>src/test/java</label> + <type>java</type> + <location>src/test/java</location> + </source-folder> + </folders> + <ide-actions> + <action name="build"> + <script>${ant.script}</script> + <target>build</target> + </action> + <action name="clean"> + <script>${ant.script}</script> + <target>clean</target> + </action> + <action name="rebuild"> + <script>${ant.script}</script> + <target>clean</target> + <target>build</target> + </action> + <action name="javadoc"> + <script>${ant.script}</script> + <target>javadoc</target> + </action> + <action name="run"> + <script>${ant.script}</script> + <target>run</target> + </action> + <action name="test"> + <script>${ant.script}</script> + <target>test</target> + </action> + </ide-actions> + <export> + <type>folder</type> + <location>target/classes</location> + <script>${ant.script}</script> + <build-target>build</build-target> + </export> + <export> + <type>folder</type> + <location>target/test-classes</location> + <script>${ant.script}</script> + <build-target>build</build-target> + </export> + <view> + <items> + <source-folder style="packages"> + <label>src/main/java</label> + <location>src/main/java</location> + </source-folder> + <source-folder style="packages"> + <label>src/test/java</label> + <location>src/test/java</location> + </source-folder> + <source-file> + <label>pom</label> + <location>pom.xml</location> + </source-file> + <source-file> + <label>mavencall</label> + <location>nbproject/mavencall.xml</location> + </source-file> + <source-folder style="tree"> + <label>src/main/resources</label> + <location>src/main/resources</location> + </source-folder> + <source-folder style="tree"> + <label>src/test/resources</label> + <location>src/test/resources</location> + </source-folder> + <source-folder style="tree"> + <label>src/site</label> + <location>src/site</location> + </source-folder> + <source-folder style="tree"> + <label>target</label> + <location>target</location> + </source-folder> + </items> + <context-menu> + <action> + <script>${ant.script}</script> + <label>Refresh Project</label> + <target>refresh-project</target> + </action> + <ide-action name="build"/> + <ide-action name="clean"/> + <ide-action name="rebuild"/> + <ide-action name="javadoc"/> + <ide-action name="run"/> + <ide-action name="test"/> + <action> + <script>${ant.script}</script> + <label>Format Code</label> + <target>jalopy</target> + </action> + </context-menu> + </view> + <subprojects/> + </general-data> + <java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/2"> + <compilation-unit> + <package-root>src/main/java</package-root> + <classpath mode="compile">${local.repository}/concurrent/concurrent/1.3.4/concurrent-1.3.4.jar:${local.repository}/log4j/log4j/1.2.8/log4j-1.2.8.jar:${local.repository}/commons-beanutils/commons-beanutils/1.4/commons-beanutils-1.4.jar:${local.repository}/commons-lang/commons-lang/2.1/commons-lang-2.1.jar:${local.repository}/commons-collections/commons-collections/3.1/commons-collections-3.1.jar:${local.repository}/org/apache/derby/derby/10.1.1.0/derby-10.1.1.0.jar:${local.repository}/commons-jxpath/commons-jxpath/1.2/commons-jxpath-1.2.jar:${local.repository}/commons-digester/commons-digester/1.6/commons-digester-1.6.jar:${local.repository}/org/apache/jackrabbit/jackrabbit-core/1.0.1/jackrabbit-core-1.0.1.jar:${local.repository}/ant/ant-optional/1.5.1/ant-optional-1.5.1.jar:${local.repository}/lucene/lucene/1.4.3/lucene-1.4.3.jar:${local.repository}/commons-configuration/commons-configuration/1.3/commons-configuration-1.3.jar:${local.repository}/commons-logging/commons-logging/1.0/commons-logging-1.0.jar:${local.repository}/commons-codec/commons-codec/1.3/commons-codec-1.3.jar:${local.repository}/xerces/xercesImpl/2.2.1/xercesImpl-2.2.1.jar:${local.repository}/xerces/xerces/1.2.3/xerces-1.2.3.jar:${local.repository}/xalan/xalan/2.7.0/xalan-2.7.0.jar:${local.repository}/xerces/xmlParserAPIs/2.0.2/xmlParserAPIs-2.0.2.jar:${local.repository}/jdom/jdom/b9/jdom-b9.jar:${local.repository}/javax/servlet/servlet-api/2.2/servlet-api-2.2.jar:${local.repository}/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.jar:${local.repository}/commons-beanutils/commons-beanutils-core/1.7.0/commons-beanutils-core-1.7.0.jar:${local.repository}/commons-logging/commons-logging-api/1.0.4/commons-logging-api-1.0.4.jar:${local.repository}/org/slf4j/slf4j-log4j12/1.0/slf4j-log4j12-1.0.jar:${local.repository}/geronimo-spec/geronimo-spec-jta/1.0-M1/geronimo-spec-jta-1.0-M1.jar:${local.repository}/jsr170/jcr/1.0/jcr-1.0.jar</classpath> + <built-to>target/classes</built-to> + <source-level>1.5</source-level> + </compilation-unit> + <compilation-unit> + <package-root>src/test/java</package-root> + <unit-tests/> + <classpath mode="compile">target/classes:${local.repository}/concurrent/concurrent/1.3.4/concurrent-1.3.4.jar:${local.repository}/junit/junit/3.8.1/junit-3.8.1.jar:${local.repository}/log4j/log4j/1.2.8/log4j-1.2.8.jar:${local.repository}/commons-beanutils/commons-beanutils/1.4/commons-beanutils-1.4.jar:${local.repository}/commons-lang/commons-lang/2.1/commons-lang-2.1.jar:${local.repository}/commons-collections/commons-collections/3.1/commons-collections-3.1.jar:${local.repository}/org/apache/derby/derby/10.1.1.0/derby-10.1.1.0.jar:${local.repository}/commons-jxpath/commons-jxpath/1.2/commons-jxpath-1.2.jar:${local.repository}/commons-digester/commons-digester/1.6/commons-digester-1.6.jar:${local.repository}/org/apache/jackrabbit/jackrabbit-core/1.0.1/jackrabbit-core-1.0.1.jar:${local.repository}/ant/ant-optional/1.5.1/ant-optional-1.5.1.jar:${local.repository}/lucene/lucene/1.4.3/lucene-1.4.3.jar:${local.repository}/commons-configuration/commons-configuration/1.3/commons-configuration-1.3.jar:${local.repository}/commons-logging/commons-logging/1.0/commons-logging-1.0.jar:${local.repository}/commons-codec/commons-codec/1.3/commons-codec-1.3.jar:${local.repository}/xerces/xercesImpl/2.2.1/xercesImpl-2.2.1.jar:${local.repository}/xerces/xerces/1.2.3/xerces-1.2.3.jar:${local.repository}/xalan/xalan/2.7.0/xalan-2.7.0.jar:${local.repository}/xerces/xmlParserAPIs/2.0.2/xmlParserAPIs-2.0.2.jar:${local.repository}/jdom/jdom/b9/jdom-b9.jar:${local.repository}/javax/servlet/servlet-api/2.2/servlet-api-2.2.jar:${local.repository}/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.jar:${local.repository}/commons-beanutils/commons-beanutils-core/1.7.0/commons-beanutils-core-1.7.0.jar:${local.repository}/commons-logging/commons-logging-api/1.0.4/commons-logging-api-1.0.4.jar:${local.repository}/org/slf4j/slf4j-log4j12/1.0/slf4j-log4j12-1.0.jar:${local.repository}/geronimo-spec/geronimo-spec-jta/1.0-M1/geronimo-spec-jta-1.0-M1.jar:${local.repository}/jsr170/jcr/1.0/jcr-1.0.jar</classpath> + <built-to>target/test-classes</built-to> + <source-level>1.5</source-level> + </compilation-unit> + </java-data> + </configuration> +</project> Added: trunk/libdb/pom.xml =================================================================== --- trunk/libdb/pom.xml (rev 0) +++ trunk/libdb/pom.xml 2006-10-09 17:49:22 UTC (rev 16) @@ -0,0 +1,141 @@ +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> +<!--//////////////////////////////////////// + /////////////General//////////////////// + /////////////////////////////////////--> + <modelVersion>4.0.0</modelVersion> + <groupId>org.jlink</groupId> + <artifactId>libdb</artifactId> + <packaging>jar</packaging> + <version>0.0.1-SNAPSHOT</version> + <name>JLink libdb</name> + <url>http://java-link.sf.net/</url> + <dependencies> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>3.8.1</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>commons-configuration</groupId> + <artifactId>commons-configuration</artifactId> + <version>1.3</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>org.apache.jackrabbit</groupId> + <artifactId>jackrabbit-core</artifactId> + <version>1.0.1</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>jsr170</groupId> + <artifactId>jcr</artifactId> + <version>1.0</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + <version>1.2.13</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>commons-configuration</groupId> + <artifactId>commons-configuration</artifactId> + <version>1.3</version> + <scope>compile</scope> + </dependency> + </dependencies> +<!--//////////////////////////////////////// + /////////////Reporting////////////////// + /////////////////////////////////////--> + <reporting> + <plugins> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>jxr-maven-plugin</artifactId> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-javadoc-plugin</artifactId> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-pmd-plugin</artifactId> + <configuration> + <rulesets> + <ruleset>/rulesets/basic.xml</ruleset> + <ruleset>/rulesets/braces.xml</ruleset> + <ruleset>/rulesets/codesize.xml</ruleset> + <ruleset>/rulesets/coupling.xml</ruleset> + <ruleset>/rulesets/design.xml</ruleset> + <ruleset>/rulesets/finalizers.xml</ruleset> + <ruleset>/rulesets/imports.xml</ruleset> + <ruleset>/rulesets/javabeans.xml</ruleset> + <ruleset>/rulesets/logging-java.xml</ruleset> + <ruleset>/rulesets/naming.xml</ruleset> + <ruleset>/rulesets/optimizations.xml</ruleset> + <ruleset>/rulesets/strictexception.xml</ruleset> + <ruleset>/rulesets/strings.xml</ruleset> + <ruleset>/rulesets/sunsecure.xml</ruleset> + <ruleset>/rulesets/unusedcode.xml</ruleset> + </rulesets> + <linkXref>true</linkXref> + <sourceEncoding>utf-8</sourceEncoding> + <minimumTokens>100</minimumTokens> + <targetJdk>1.5</targetJdk> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-report-plugin</artifactId> + </plugin> + </plugins> + </reporting> +<!--//////////////////////////////////////// + /////////////Building/////////////////// + /////////////////////////////////////--> + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <configuration> + <source>1.5</source> + <target>1.5</target> + </configuration> + </plugin> + </plugins> + </build> +<!--//////////////////////////////////////// + /////////////Deploying////////////////// + /////////////////////////////////////--> + <distributionManagement> + <site> + <id>jlink-sf</id> + <url>scp://shell.sf.net/home/groups/j/ja/java-link/htdocs/maven2/libdb</url> + </site> + </distributionManagement> +<!--//////////////////////////////////////// + /////////////Include from root////////// + /////////////////////////////////////--> + <ciManagement> + <system>cruisecontrol</system> + <url>http://welterde.i2p/cruisecontrol/</url> + </ciManagement> + <issueManagement> + <system>sourceforge</system> + <url>http://sourceforge.net/tracker/?group_id=162264</url> + </issueManagement> + <developers> + <developer> + <id>welterde</id> + <email>wel...@ar...</email> + </developer> + </developers> + <scm> + <connection>scm:svn:https://svn.sourceforge.net/svnroot/javalink</connection> + <url>http://svn.sourceforge.net/viewcvs.cgi/java-link/</url> + </scm> +</project> Added: trunk/libdb/src/main/java/org/jlink/server/libdb/StorageManager.java =================================================================== --- trunk/libdb/src/main/java/org/jlink/server/libdb/StorageManager.java (rev 0) +++ trunk/libdb/src/main/java/org/jlink/server/libdb/StorageManager.java 2006-10-09 17:49:22 UTC (rev 16) @@ -0,0 +1,121 @@ +/* + * StorageManager.java + * + * Created on 10. September 2006, 11:13 + * + * JLink: An Introversion Uplink Clone with multiplayer support. + * Copyright (C) 2006 Tassilo Schweyer + * + * This program 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 2 + * of the License, or (at your option) any later version. + * + * This program 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 this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package org.jlink.server.libdb; + +import javax.jcr.Repository; +import javax.jcr.RepositoryException; +import org.apache.commons.configuration.Configuration; +import org.apache.log4j.Logger; + +import org.jlink.server.libdb.drivers.Driver; + +/** + * + * @author welterde + */ +public class StorageManager { + //Static Configuration + public static final String ENV_SEP = System.getProperty("file.separator"); + public static final String DB_HOME = System.getProperty("user.home") + + ENV_SEP + ".jlink" + ENV_SEP + "server" + ENV_SEP + "db"; + public static final String DB_CONF = DB_HOME + ENV_SEP + "config.xml"; + + /** Creates a new instance of StorageManager */ + public StorageManager() { + log.debug("Storagemanager created"); + } + + + //Lifecycle + /** + * + * + * + * called when game is started. + */ + public void init(Configuration conf) { + log.info("initing Storagemanger"); + //null check + if(conf == null) + throw new NullPointerException("the config may not be null"); + + // <editor-fold defaultstate="collapsed" desc=" create Driver "> + String driverClass = conf.getString("server.db.driver", "org.jlink." + + "server.libdb.drivers.JackrabbitDriver"); + log.info("creating DatabaseDriver: " + driverClass); + //try to create the driver wanted + try { + //load the class + Class driver = Class.forName(driverClass); + //ok, now create an instance of it + Object obj = driver.newInstance(); + //ok, everything went right, now lets cast it into an Driver and we + //are done here + this.db_driver = (Driver) obj; + + } catch(ClassNotFoundException exc) { + log.fatal("cannot create StorageManager Driver", exc); + //TODO: crash + } catch(InstantiationException exc) { + log.fatal("cannot create StorageManager Driver", exc); + //TODO: crash + } catch(IllegalAccessException exc) { + log.fatal("cannot create StorageManager Driver", exc); + //TODO: crash + } catch(ClassCastException exc) { + log.fatal("cannot create StorageManager Driver", exc); + //TODO: crash + } + // </editor-fold> + + // <editor-fold defaultstate="collapsed" desc=" init Driver "> + try { + String home = null; + String config = null; + + //load the strings from the config, with local defaults + home = conf.getString("server.db.home", "db"); + config = conf.getString("server.db.conf", "db/config.xml"); + this.db_driver.init(config, home); + } catch(RepositoryException exc) { + log.fatal("cannot init driver", exc); + //TODO: crash + } + // </editor-fold> + + } + public void destroy() { + + } + + + + + + + private Repository db_repo = null; + private Driver db_driver = null; + private Configuration conf = null; + private Logger log = Logger.getLogger(StorageManager.class); +} Added: trunk/libdb/src/main/java/org/jlink/server/libdb/drivers/Driver.java =================================================================== --- trunk/libdb/src/main/java/org/jlink/server/libdb/drivers/Driver.java (rev 0) +++ trunk/libdb/src/main/java/org/jlink/server/libdb/drivers/Driver.java 2006-10-09 17:49:22 UTC (rev 16) @@ -0,0 +1,52 @@ +/* + * Driver.java + * + * Created on 10. September 2006, 11:29 + * + * JLink: An Introversion Uplink Clone with multiplayer support. + * Copyright (C) 2006 Tassilo Schweyer + * + * This program 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 2 + * of the License, or (at your option) any later version. + * + * This program 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 this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package org.jlink.server.libdb.drivers; + +import java.io.File; +import java.io.IOException; + +import javax.jcr.Repository; +import javax.jcr.RepositoryException; + +/** + * + * @author welterde + */ +public interface Driver { + /** + * Create an Repository. + */ + public Repository init(String config, String home) throws RepositoryException; + + + + public void create(File home) throws RepositoryException; + + public void delete(File home) throws IOException; + + + + public void shutdown(Repository repo) throws RepositoryException; + +} Added: trunk/libdb/src/main/java/org/jlink/server/libdb/drivers/JackrabbitDriver.java =================================================================== --- trunk/libdb/src/main/java/org/jlink/server/libdb/drivers/JackrabbitDriver.java (rev 0) +++ trunk/libdb/src/main/java/org/jlink/server/libdb/drivers/JackrabbitDriver.java 2006-10-09 17:49:22 UTC (rev 16) @@ -0,0 +1,74 @@ +/* + * JackrabbitDriver.java + * + * Created on 10. September 2006, 12:01 + * + * JLink: An Introversion Uplink Clone with multiplayer support. + * Copyright (C) 2006 Tassilo Schweyer + * + * This program 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 2 + * of the License, or (at your option) any later version. + * + * This program 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 this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package org.jlink.server.libdb.drivers; + + +import java.io.File; +import java.io.IOException; + + +import javax.jcr.Repository; +import javax.jcr.RepositoryException; + +import org.apache.jackrabbit.core.RepositoryImpl; +import org.apache.jackrabbit.core.config.RepositoryConfig; + +/** + * + * @author welterde + */ +public class JackrabbitDriver implements Driver { + + /** Creates a new instance of JackrabbitDriver */ + public JackrabbitDriver() { + } + + public Repository init(String config, String home) throws RepositoryException { + Repository ret = null; + + //creating config object needed for creation of repo + RepositoryConfig conf = RepositoryConfig.create(config, home); + + //use the conf object to create the repo + ret = RepositoryImpl.create(conf); + + return ret; + } + + public void create(File home) throws RepositoryException { + //TODO: work this out + throw new UnsupportedOperationException("aehm... yeah... you have to configure the jackrabbit yourself"); + } + + public void delete(File home) throws IOException { + //TODO: work this out + throw new UnsupportedOperationException("aehm... yeah... you have also to delete it yourself"); + } + + public void shutdown(Repository repo) throws RepositoryException { + //FIXME: might cause an ClassCastException if this isnt an jackrabbit repo + ((org.apache.jackrabbit.core.RepositoryImpl) repo).shutdown(); + } + +} Property changes on: trunk/libdb/src/site ___________________________________________________________________ Name: svn:ignore + .DS_Store Added: trunk/libdb/src/site/site.xml =================================================================== --- trunk/libdb/src/site/site.xml (rev 0) +++ trunk/libdb/src/site/site.xml 2006-10-09 17:49:22 UTC (rev 16) @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<project name="JLink libdb"> + <bannerRight> + <src>http://sflogo.sourceforge.net/sflogo.php?group_id=162264&type=3</src> + </bannerRight> + <body> + ${reports} + </body> +</project> Modified: trunk/server/nbproject/project.xml =================================================================== --- trunk/server/nbproject/project.xml 2006-10-08 19:29:46 UTC (rev 15) +++ trunk/server/nbproject/project.xml 2006-10-09 17:49:22 UTC (rev 16) @@ -1,134 +1,121 @@ -<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://www.netbeans.org/ns/project/1"> - <type>org.netbeans.modules.ant.freeform</type> - <configuration> - <general-data xmlns="http://www.netbeans.org/ns/freeform-project/1"> - <name>JLink Server</name> - <properties> - <property name="ant.script">nbproject/mavencall.xml</property> - <property-file>nbproject/project.properties</property-file> - </properties> - <folders> - <source-folder> - <label>src/main/java</label> - <type>java</type> - <location>src/main/java</location> - </source-folder> - <source-folder> - <label>src/test/java</label> - <type>java</type> - <location>src/test/java</location> - </source-folder> - </folders> - <ide-actions> - <action name="build"> - <script>${ant.script}</script> - <target>build</target> - </action> - <action name="clean"> - <script>${ant.script}</script> - <target>clean</target> - </action> - <action name="rebuild"> - <script>${ant.script}</script> - <target>clean</target> - <target>build</target> - </action> - <action name="javadoc"> - <script>${ant.script}</script> - <target>javadoc</target> - </action> - <action name="run"> - <script>${ant.script}</script> - <target>run</target> - </action> - <action name="test"> - <script>${ant.script}</script> - <target>test</target> - </action> - </ide-actions> - <export> - <type>folder</type> - <location>target/classes</location> - <script>${ant.script}</script> - <build-target>build</build-target> - </export> - <export> - <type>folder</type> - <location>target/test-classes</location> - <script>${ant.script}</script> - <build-target>build</build-target> - </export> - <view> - <items> - <source-folder style="packages"> - <label>src/main/java</label> - <location>src/main/java</location> - </source-folder> - <source-folder style="packages"> - <label>src/test/java</label> - <location>src/test/java</location> - </source-folder> - <source-file> - <label>pom</label> - <location>pom.xml</location> - </source-file> - <source-file> - <label>mavencall</label> - <location>nbproject/mavencall.xml</location> - </source-file> - <source-folder style="tree"> - <label>src/main/resources</label> - <location>src/main/resources</location> - </source-folder> - <source-folder style="tree"> - <label>src/test/resources</label> - <location>src/test/resources</location> - </source-folder> - <source-folder style="tree"> - <label>src/site</label> - <location>src/site</location> - </source-folder> - <source-folder style="tree"> - <label>target</label> - <location>target</location> - </source-folder> - </items> - <context-menu> - <action> - <script>${ant.script}</script> - <label>Refresh Project</label> - <target>refresh-project</target> - </action> - <ide-action name="build"/> - <ide-action name="clean"/> - <ide-action name="rebuild"/> - <ide-action name="javadoc"/> - <ide-action name="run"/> - <ide-action name="test"/> - <action> - <script>${ant.script}</script> - <label>Format Code</label> - <target>jalopy</target> - </action> - </context-menu> - </view> - <subprojects/> - </general-data> - <java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/2"> - <compilation-unit> - <package-root>src/main/java</package-root> - <classpath mode="compile">${local.repository}/org/jlink/share/0.0.1-SNAPSHOT/share-0.0.1-SNAPSHOT.jar:${local.repository}/log4j/log4j/1.2.13/log4j-1.2.13.jar</classpath> - <built-to>target/classes</built-to> - <source-level>1.5</source-level> - </compilation-unit> - <compilation-unit> - <package-root>src/test/java</package-root> - <unit-tests/> - <classpath mode="compile">target/classes:${local.repository}/org/jlink/share/0.0.1-SNAPSHOT/share-0.0.1-SNAPSHOT.jar:${local.repository}/junit/junit/3.8.1/junit-3.8.1.jar:${local.repository}/log4j/log4j/1.2.13/log4j-1.2.13.jar</classpath> - <built-to>target/test-classes</built-to> - <source-level>1.5</source-level> - </compilation-unit> - </java-data> - </configuration> -</project> + <type>org.netbeans.modules.ant.freeform</type> + <configuration> + <general-data xmlns="http://www.netbeans.org/ns/freeform-project/1"> + <name>JLink Server</name> + <properties> + <property name="ant.script">nbproject/mavencall.xml</property> + <property-file>nbproject/project.properties</property-file> + </properties> + <folders> + <source-folder> + <label>src/main/java</label> + <type>java</type> + <location>src/main/java</location> + </source-folder> + <source-folder> + <label>src/test/java</label> + <type>java</type> + <location>src/test/java</location> + </source-folder> + </folders> + <ide-actions> + <action name="build"> + <script>${ant.script}</script> + <target>build</target> + </action> + <action name="clean"> + <script>${ant.script}</script> + <target>clean</target> + </action> + <action name="rebuild"> + <script>${ant.script}</script> + <target>clean</target> + <target>build</target> + </action> + <action name="javadoc"> + <script>${ant.script}</script> + <target>javadoc</target> + </action> + <action name="run"> + <script>${ant.script}</script> + <target>run</target> + </action> + <action name="test"> + <script>${ant.script}</script> + <target>test</target> + </action> + </ide-actions> + <view> + <items> + <source-file> + <label>pom</label> + <location>pom.xml</location> + </source-file> + <source-file> + <label>mavencall</label> + <location>nbproject/mavencall.xml</location> + </source-file> + <source-folder style="packages"> + <label>src/main/java</label> + <location>src/main/java</location> + </source-folder> + <source-folder style="packages"> + <label>src/test/java</label> + <location>src/test/java</location> + </source-folder> + <source-folder style="tree"> + <label>src/main/resources</label> + <location>src/main/resources</location> + </source-folder> + <source-folder style="tree"> + <label>src/test/resources</label> + <location>src/test/resources</location> + </source-folder> + <source-folder style="tree"> + <label>src/site</label> + <location>src/site</location> + </source-folder> + <source-folder style="tree"> + <label>target</label> + <location>target</location> + </source-folder> + </items> + <context-menu> + <action> + <script>${ant.script}</script> + <label>Refresh Project</label> + <target>refresh-project</target> + </action> + <ide-action name="build"/> + <ide-action name="clean"/> + <ide-action name="rebuild"/> + <ide-action name="javadoc"/> + <ide-action name="run"/> + <ide-action name="test"/> + <action> + <script>${ant.script}</script> + <label>Format Code</label> + <target>jalopy</target> + </action> + </context-menu> + </view> + <subprojects/> + </general-data> + <java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/2"> + <compilation-unit> + <package-root>src/main/java</package-root> + <classpath mode="compile">${local.repository}/commons-codec/commons-codec/1.3/commons-codec-1.3.jar:${local.repository}/commons-lang/commons-lang/1.0/commons-lang-1.0.jar:${local.repository}/commons-logging/commons-logging/1.0/commons-logging-1.0.jar:${local.repository}/xerces/xercesImpl/2.2.1/xercesImpl-2.2.1.jar:${local.repository}/org/jlink/share/0.0.1-SNAPSHOT/share-0.0.1-SNAPSHOT.jar:${local.repository}/xerces/xerces/1.2.3/xerces-1.2.3.jar:${local.repository}/commons-beanutils/commons-beanutils/1.4/commons-beanutils-1.4.jar:${local.repository}/xalan/xalan/2.7.0/xalan-2.7.0.jar:${local.repository}/log4j/log4j/1.2.13/log4j-1.2.13.jar:${local.repository}/commons-collections/commons-collections/3.1/commons-collections-3.1.jar:${local.repository}/jdom/jdom/b9/jdom-b9.jar:${local.repository}/commons-jxpath/commons-jxpath/1.2/commons-jxpath-1.2.jar:${local.repository}/javax/servlet/servlet-api/2.2/servlet-api-2.2.jar:${local.repository}/commons-digester/commons-digester/1.6/commons-digester-1.6.jar:${local.repository}/ant/ant-optional/1.5.1/ant-optional-1.5.1.jar:${local.repository}/commons-cli/commons-cli/1.0/commons-cli-1.0.jar:${local.repository}/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.jar:${local.repository}/commons-logging/commons-logging-api/1.0.4/commons-logging-api-1.0.4.jar:${local.repository}/commons-beanutils/commons-beanutils-core/1.7.0/commons-beanutils-core-1.7.0.jar:${local.repository}/commons-configuration/commons-configuration/1.3/commons-configuration-1.3.jar</classpath> + <built-to>target/classes</built-to> + <source-level>1.4</source-level> + </compilation-unit> + <compilation-unit> + <package-root>src/test/java</package-root> + <unit-tests/> + <classpath mode="compile">target/classes:${local.repository}/commons-codec/commons-codec/1.3/commons-codec-1.3.jar:${local.repository}/commons-lang/commons-lang/1.0/commons-lang-1.0.jar:${local.repository}/commons-logging/commons-logging/1.0/commons-logging-1.0.jar:${local.repository}/xerces/xercesImpl/2.2.1/xercesImpl-2.2.1.jar:${local.repository}/org/jlink/share/0.0.1-SNAPSHOT/share-0.0.1-SNAPSHOT.jar:${local.repository}/junit/junit/3.8.1/junit-3.8.1.jar:${local.repository}/xerces/xerces/1.2.3/xerces-1.2.3.jar:${local.repository}/commons-beanutils/commons-beanutils/1.4/commons-beanutils-1.4.jar:${local.repository}/xalan/xalan/2.7.0/xalan-2.7.0.jar:${local.repository}/log4j/log4j/1.2.13/log4j-1.2.13.jar:${local.repository}/commons-collections/commons-collections/3.1/commons-collections-3.1.jar:${local.repository}/jdom/jdom/b9/jdom-b9.jar:${local.repository}/commons-jxpath/commons-jxpath/1.2/commons-jxpath-1.2.jar:${local.repository}/javax/servlet/servlet-api/2.2/servlet-api-2.2.jar:${local.repository}/commons-digester/commons-digester/1.6/commons-digester-1.6.jar:${local.repository}/ant/ant-optional/1.5.1/ant-optional-1.5.1.jar:${local.repository}/commons-cli/commons-cli/1.0/commons-cli-1.0.jar:${local.repository}/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.jar:${local.repository}/commons-logging/commons-logging-api/1.0.4/commons-logging-api-1.0.4.jar:${local.repository}/commons-beanutils/commons-beanutils-core/1.7.0/commons-beanutils-core-1.7.0.jar:${local.repository}/commons-configuration/commons-configuration/1.3/commons-configuration-1.3.jar</classpath> + <built-to>target/test-classes</built-to> + <source-level>1.4</source-level> + </compilation-unit> + </java-data> + </configuration> +</project> \ No newline at end of file Modified: trunk/server/pom.xml =================================================================== --- trunk/server/pom.xml 2006-10-08 19:29:46 UTC (rev 15) +++ trunk/server/pom.xml 2006-10-09 17:49:22 UTC (rev 16) @@ -23,11 +23,29 @@ <scope>compile</scope> </dependency> <dependency> + <groupId>org.jlink</groupId> + <artifactId>libdb</artifactId> + <version>0.0.1-SNAPSHOT</version> + <scope>compile</scope> + </dependency> + <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>1.2.13</version> <scope>compile</scope> </dependency> + <dependency> + <groupId>commons-cli</groupId> + <artifactId>commons-cli</artifactId> + <version>1.0</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>commons-configuration</groupId> + <artifactId>commons-configuration</artifactId> + <version>1.3</version> + <scope>compile</scope> + </dependency> </dependencies> <!--//////////////////////////////////////// /////////////Reporting////////////////// Added: trunk/server/src/main/java/org/jlink/server/Main.java =================================================================== --- trunk/server/src/main/java/org/jlink/server/Main.java (rev 0) +++ trunk/server/src/main/java/org/jlink/server/Main.java 2006-10-09 17:49:22 UTC (rev 16) @@ -0,0 +1,198 @@ +/* + * Main.java + * + * Created on 8. Oktober 2006, 11:33 + * + * JLink: An Introversion Uplink Clone with multiplayer support. + * Copyright (C) 2006 Tassilo Schweyer + * + * This program 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 2 + * of the License, or (at your option) any later version. + * + * This program 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 this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package org.jlink.server; + +//imports +//imports::own +//imports::own::server +//imports::own::server::jmx +import org.jlink.server.jmx.JMXAgent; + +//imports::sys +//imports::sys::commons-cli +import org.apache.commons.cli.Option; +import org.apache.commons.cli.OptionBuilder; +import org.apache.commons.cli.Options; +import org.apache.commons.cli.GnuParser; +import org.apache.commons.cli.CommandLine; +import org.apache.commons.cli.HelpFormatter; +import org.apache.commons.cli.ParseException; +//import::sys::log4j +import org.apache.log4j.PropertyConfigurator; +import org.apache.log4j.xml.DOMConfigurator; +import org.apache.log4j.BasicConfigurator; +import org.apache.log4j.Logger; +//import::sys::commons-configuration +import org.apache.commons.configuration.Configuration; +import org.apache.commons.configuration.XMLConfiguration; +import org.apache.commons.configuration.ConfigurationException; + +/** + * + * @author welterde + */ +public class Main { + + /** Creates a new instance of Main */ + private Main() { + } + + /** + * @param args the command line arguments + */ + public static void main(String[] args) { + String conf_log = null; + String conf_srv = null; + + // <editor-fold defaultstate="collapsed" desc=" parse arguments "> + try { + //create options + // ...configs + Option opt_conf_srv = OptionBuilder.withArgName("config") + .hasArg() + .withDescription("The path to the server configuration") + .withLongOpt("config") + .create('C'); + Option opt_conf_log = OptionBuilder.withArgName("log") + .hasArg() + .withDescription("The path to the log4j configuration") + .withLongOpt("log") + .create('L'); + // ...ops + Option opt_op_help = new Option( "help", "print this message" ); + //asamble + Options opts = new Options(); + opts.addOption(opt_conf_srv); + opts.addOption(opt_conf_log); + opts.addOption(opt_op_help); + //parse + CommandLine cmd = new GnuParser().parse(opts, args); + //process + if(cmd.hasOption("help")) { + new HelpFormatter().printHelp("jlink", opts); + System.exit(0); + } + if(cmd.hasOption('C')) { + conf_srv = cmd.getOptionValue('C'); + } else { + //crash + System.err.println("missing server config, please refer to help"); + System.exit(1); + } + if(cmd.hasOption('L')) { + conf_log = cmd.getOptionValue('L'); + } else { + //crash + System.err.println("missing logging config, please refer to help"); + System.exit(1); + } + } catch(ParseException exc) { + throw new Error("error in cmd", exc); + } + // </editor-fold> + + // <editor-fold defaultstate="collapsed" desc=" init logging "> + //TODO: add existence check + if(conf_log.endsWith("properties") || conf_log.endsWith("cfg")) { + PropertyConfigurator.configure(conf_log); + } else if(conf_log.endsWith("xml")) { + DOMConfigurator.configure(conf_log); + } else { + //VOTE: shall we crash here or use simply BasicConf + BasicConfigurator.configure(); + //TODO: till when vote is over, add log message telling that init logging failed + } + log = Logger.getLogger(Main.class); + log.info("logging started"); + { + Logger sys = Logger.getLogger("jlink.init.sysinfo"); + sys.info("retrieving system information"); + sys.info("java.version: " + System.getProperty("java.version")); + sys.info("java.class.path: "+ System.getProperty("java.class.path")); + sys.info("System.compiler: " + System.getProperty("java.compiler")); + sys.info("os.name: " + System.getProperty("os.name")); + sys.info("os.arch: " + System.getProperty("os.arch")); + sys.info("os.version: " + System.getProperty("os.version")); + sys.info("user.dir: " + System.getProperty("user.dir")); + } + // </editor-fold> + + // <editor-fold defaultstate="collapsed" desc=" load config "> + //TODO: check existance of file + log.info("loading server configuration"); + try { + xconf = new XMLConfiguration(conf_srv); + log.debug("configuration loaded"); + } catch(ConfigurationException exc) { + log.fatal("cannot load server configuration", exc); + System.exit(1); + } + conf = xconf; + + // </editor-fold> + + // <editor-fold defaultstate="collapsed" desc=" startup "> + + // </editor-fold> + + // <editor-fold defaultstate="collapsed" desc=" JMX "> + JMXAgent agent = JMXAgent.getDefault(); + // </editor-fold> + + Core core = new Core(); + + core.start(); + + } + + + + public static void shutdown() { + log.info("shutdown requested"); + //TODO: shutdown everything + log.info("shutdown complete, exiting"); + System.exit(0); + } + + + + public static void confSave() { + //FIX: Threadsave? + log.debug("saving config"); + try { + xconf.save(); + log.trace("config saved"); + } catch (ConfigurationException exc) { + log.warn("couldnt save config", exc); + } + } + public static void confReload() { + //TODO: write this + } + + + private static Configuration conf = null; + private static XMLConfiguration xconf = null; + private static Logger log = null; +} Added: trunk/server/src/main/java/org/jlink/server/MainJMX.java =================================================================== --- trunk/server/src/main/java/org/jlink/server/MainJMX.java (rev 0) +++ trunk/server/src/main/java/org/jlink/server/MainJMX.java 2006-10-09 17:49:22 UTC (rev 16) @@ -0,0 +1,122 @@ +/* + * MainJMX.java + * + * Created on 8. Oktober 2006, 17:03 + * + * JLink: An Introversion Uplink Clone with multiplayer support. + * Copyright (C) 2006 Tassilo Schweyer + * + * This program 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 2 + * of the License, or (at your option) any later version. + * + * This program 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 this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package org.jlink.server; +import javax.management.*; +import java.util.Arrays; + +/** + * Dynamic MBean based on StandardMBean + * Class MainJMX + * Server Mainclass Controllbean + * @author welterde + */ +public class MainJMX extends javax.management.StandardMBean implements MainJMXMBean { + + public MainJMX() throws NotCompliantMBeanException { + super(MainJMXMBean.class); + } + + /** + * Next are the methods to compute MBeanInfo. + * You shouldn't update these methods. + */ + protected String getDescription(MBeanInfo info) { + return "Server Mainclass Controllbean"; + } + + protected String getDescription(MBeanAttributeInfo info) { + String description = null; + return description; + } + + protected String getDescription(MBeanOperationInfo op, + MBeanParameterInfo param, + int sequence) { + if (op.getName().equals("shutdown")) { + switch (sequence) { + default : return null; + } + } + return null; + } + + protected String getParameterName(MBeanOperationInfo op, + MBeanParameterInfo param, + int sequence) { + if (op.getName().equals("shutdown")) { + switch (sequence) { + default : return null; + } + } + return null; + } + + protected String getDescription(MBeanOperationInfo info) { + String description = null; + MBeanParameterInfo[] params = info.getSignature(); + String[] signature = new String[params.length]; + for (int i = 0; i < params.length; i++) + signature[i] = params[i].getType(); + String[] methodSignature; + + methodSignature = new String[] { + }; + if (info.getName().equals("shutdown") && Arrays.equals(signature, methodSignature)) { + description = "Operation exposed for management"; + } + + return description; + } + + public MBeanInfo getMBeanInfo() { + MBeanInfo mbinfo = super.getMBeanInfo(); + return new MBeanInfo(mbinfo.getClassName(), + mbinfo.getDescription(), + mbinfo.getAttributes(), + mbinfo.getConstructors(), + mbinfo.getOperations(), + getNotificationInfo()); + } + + public MBeanNotificationInfo[] getNotificationInfo() { + return new MBeanNotificationInfo[] {}; + } + + /** + * Operation exposed for management + */ + public void shutdown() { + Main.shutdown(); + } + + public void configSave() { + Main.confSave(); + } + + public void configReload() { + Main.confReload(); + } +} + + Added: trunk/server/src/main/java/org/jlink/server/MainJMXMBean.java =================================================================== --- trunk/server/src/main/java/org/jlink/server/MainJMXMBean.java (rev 0) +++ trunk/server/src/main/java/org/jlink/server/MainJMXMBean.java 2006-10-09 17:49:22 UTC (rev 16) @@ -0,0 +1,45 @@ +/* + * MainJMXMBean.java + * + * Created on 8. Oktober 2006, 17:03 + * + * JLink: An Introversion Uplink Clone with multiplayer support. + * Copyright (C) 2006 Tassilo Schweyer + * + * This program 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 2 + * of the License, or (at your option) any later version. + * + * This program 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 this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package org.jlink.server; + +/** + * Interface MainJMXMBean + * Server Mainclass Controllbean + * @author welterde + */ +public interface MainJMXMBean +{ + /** + * Operation exposed for management + */ + public void shutdown(); + + + public void configSave(); + + + public void configReload(); +} + + Modified: trunk/server/src/main/java/org/jlink/server/jmx/JMXAgent.java =================================================================== --- trunk/server/src/main/java/org/jlink/server/jmx/JMXAgent.java 2006-10-08 19:29:46 UTC (rev 15) +++ trunk/server/src/main/java/org/jlink/server/jmx/JMXAgent.java 2006-10-09 17:49:22 UTC (rev 16) @@ -25,12 +25,19 @@ //import //import::own +//import::own::server +import org.jlink.server.MainJMX; +//import::own::server::libdb +import org.jlink.server.libdb.StorageManagerJMX; //import::sys //import::sys::jmx import javax.management.ObjectName; import javax.management.MBeanServer; import java.lang.management.ManagementFactory; +//import::sys::log4j +import org.apache.log4j.Logger; + /** * JMX agent class. * @author tassilo @@ -40,6 +47,22 @@ * Instantiate and register your MBeans. */ public void init() throws Exception { + log.info("registering jmx objects"); + //Main::JMX::add() + { + log.debug("registering MainJMX"); + ObjectName name = new ObjectName("org.jlink.server:type=MainJMX"); + MainJMX obj = new MainJMX(); + this.mbs.registerMBean(obj, name); + log.debug("done"); + } +// { +// log.debug("registering StorageManagerJMX"); +// ObjectName name = new ObjectName("org.jlink.server.libdb:type=StorageManagerJMX"); +// StorageManagerJMX obj = new StorageManagerJMX(); +// this.mbs.registerMBean(obj, name); +// log.debug("done"); +// } //Core::JMX::add() //Database::JMX::add() @@ -73,6 +96,9 @@ private final MBeanServer mbs = ManagementFactory.getPlatformMBeanServer(); // Singleton instance private static JMXAgent singleton; + + + private Logger log = Logger.getLogger(JMXAgent.class); } Modified: trunk/server/src/main/java/org/jlink/server/jmx/run.properties =================================================================== --- trunk/server/src/main/java/org/jlink/server/jmx/run.properties 2006-10-08 19:29:46 UTC (rev 15) +++ trunk/server/src/main/java/org/jlink/server/jmx/run.properties 2006-10-09 17:49:22 UTC (rev 16) @@ -244,7 +244,7 @@ # # For a non-default password file location use the foll... [truncated message content] |
From: <wel...@us...> - 2006-10-08 19:29:54
|
Revision: 15 http://svn.sourceforge.net/java-link/?rev=15&view=rev Author: welterde0 Date: 2006-10-08 12:29:46 -0700 (Sun, 08 Oct 2006) Log Message: ----------- created private branche for welterde0 Added Paths: ----------- branches/private_welterde0/ Copied: branches/private_welterde0 (from rev 14, trunk) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wel...@us...> - 2006-10-08 19:15:48
|
Revision: 14 http://svn.sourceforge.net/java-link/?rev=14&view=rev Author: welterde0 Date: 2006-10-08 12:15:40 -0700 (Sun, 08 Oct 2006) Log Message: ----------- removed unused testing branche Removed Paths: ------------- branches/base_testing/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wel...@us...> - 2006-10-08 19:11:18
|
Revision: 13 http://svn.sourceforge.net/java-link/?rev=13&view=rev Author: welterde0 Date: 2006-10-08 12:11:09 -0700 (Sun, 08 Oct 2006) Log Message: ----------- deleted unused web dir Removed Paths: ------------- web/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wel...@us...> - 2006-10-07 21:44:33
|
Revision: 12 http://svn.sourceforge.net/java-link/?rev=12&view=rev Author: welterde0 Date: 2006-10-07 14:44:28 -0700 (Sat, 07 Oct 2006) Log Message: ----------- build(build.xml): fixed lib jfunutil-5.0, again(it wasnt 5.0 missing, it was somehow called substance.jar) Modified Paths: -------------- trunk/build.xml Modified: trunk/build.xml =================================================================== --- trunk/build.xml 2006-10-07 21:34:31 UTC (rev 11) +++ trunk/build.xml 2006-10-07 21:44:28 UTC (rev 12) @@ -32,9 +32,9 @@ <!--Targets--> <target name="share-deps"> <echo message="downloading dep client/jfunutil.jar"/> - <get src="http://${sf.mirror}.dl.sourceforge.net/sourceforge/java-link/jfunutil-5.0.jar" dest="tmp/substance.jar"/> + <get src="http://${sf.mirror}.dl.sourceforge.net/sourceforge/java-link/jfunutil-5.0.jar" dest="tmp/jfunutil.jar"/> <exec executable="mvn"> - <arg line="install:install-file -DgroupId=yan -DartifactId=jfunutil -Dversion=5.0 -Dpackaging=jar -Dfile=tmp/jfunutil-5.0.jar"/> + <arg line="install:install-file -DgroupId=yan -DartifactId=jfunutil -Dversion=5.0 -Dpackaging=jar -Dfile=tmp/jfunutil.jar"/> </exec> <echo message="[done]"/> </target> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wel...@us...> - 2006-10-07 21:34:39
|
Revision: 11 http://svn.sourceforge.net/java-link/?rev=11&view=rev Author: welterde0 Date: 2006-10-07 14:34:31 -0700 (Sat, 07 Oct 2006) Log Message: ----------- build(build.xml): fixed lib jfunutil-5.0(5.0 was missing) Modified Paths: -------------- trunk/build.xml Modified: trunk/build.xml =================================================================== --- trunk/build.xml 2006-10-07 21:28:11 UTC (rev 10) +++ trunk/build.xml 2006-10-07 21:34:31 UTC (rev 11) @@ -34,7 +34,7 @@ <echo message="downloading dep client/jfunutil.jar"/> <get src="http://${sf.mirror}.dl.sourceforge.net/sourceforge/java-link/jfunutil-5.0.jar" dest="tmp/substance.jar"/> <exec executable="mvn"> - <arg line="install:install-file -DgroupId=yan -DartifactId=jfunutil -Dversion=5.0 -Dpackaging=jar -Dfile=tmp/jfunutil.jar"/> + <arg line="install:install-file -DgroupId=yan -DartifactId=jfunutil -Dversion=5.0 -Dpackaging=jar -Dfile=tmp/jfunutil-5.0.jar"/> </exec> <echo message="[done]"/> </target> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wel...@us...> - 2006-10-07 21:28:32
|
Revision: 10 http://svn.sourceforge.net/java-link/?rev=10&view=rev Author: welterde0 Date: 2006-10-07 14:28:11 -0700 (Sat, 07 Oct 2006) Log Message: ----------- build(X/nbproject/build.xml): updated build scripts to backup themselfs before mvn update is run added link to nbproject/project.properties file with default setting for maven added link to nbproject/private/private.properties file for your own setting of maven path build(build.xml): added support for mirrors(actually just one heanet) added libs for share(jfunutil) added libs for client(swing-layout.jar, substance) config(X/pom.xml) fixed svn URL fixed server maven site config Modified Paths: -------------- trunk/build.xml trunk/client/nbproject/mavencall.xml trunk/client/pom.xml trunk/server/nbproject/mavencall.xml trunk/server/pom.xml trunk/share/nbproject/mavencall.xml trunk/share/pom.xml Modified: trunk/build.xml =================================================================== --- trunk/build.xml 2006-09-02 18:54:25 UTC (rev 9) +++ trunk/build.xml 2006-10-07 21:28:11 UTC (rev 10) @@ -24,8 +24,21 @@ <project name="jlink" default="default" basedir="."> <!--Global--> + <!--Sourceforge Mirrors; choose one if th other dont work--> + <property name="sf.mirror" value="heanet"/> + <!-- + TODO: other mirrors + --> <!--Targets--> - <target name="share"> + <target name="share-deps"> + <echo message="downloading dep client/jfunutil.jar"/> + <get src="http://${sf.mirror}.dl.sourceforge.net/sourceforge/java-link/jfunutil-5.0.jar" dest="tmp/substance.jar"/> + <exec executable="mvn"> + <arg line="install:install-file -DgroupId=yan -DartifactId=jfunutil -Dversion=5.0 -Dpackaging=jar -Dfile=tmp/jfunutil.jar"/> + </exec> + <echo message="[done]"/> + </target> + <target name="share" depends="share-deps"> <exec executable="mvn" dir="share" output="share.build.log" failonerror="true"> <arg value="compile"/> </exec> @@ -49,7 +62,7 @@ <mkdir dir="tmp"/> <echo message="downloading dep client/lafplugin.jar"/> - <get src="http://dl.sourceforge.net/java-link/lafplugin-0.1.jar" dest="tmp/lafplugin.jar"/> + <get src="http://${sf.mirror}.dl.sourceforge.net/sourceforge/java-link/lafplugin-0.1.jar" dest="tmp/lafplugin.jar"/> <echo message="installing it"/> <exec executable="mvn"> <arg line="install:install-file -DgroupId=org.jvnet -DartifactId=lafplugin -Dversion=0.1 -Dpackaging=jar -Dfile=tmp/lafplugin.jar"/> @@ -57,7 +70,25 @@ <echo message="[done]"/> <echo message="downloading dep client/nanoxml.jar"/> - <get src="http://dl.sourceforge.net/java-link/nanoxml_lite-2.2.3.jar" dest="tmp/nanoxml.jar"/> + <get src="http://${sf.mirror}.dl.sourceforge.net/sourceforge/java-link/nanoxml_lite-2.2.3.jar" dest="tmp/nanoxml.jar"/> + <exec executable="mvn"> + <arg line="install:install-file -DgroupId=nanoxml -DartifactId=nanoxml -Dversion=2.2.3 -Dpackaging=jar -Dfile=tmp/nanoxml.jar"/> + </exec> + <echo message="[done]"/> + + <echo message="downloading dep client/swing-layour.jar"/> + <get src="http://${sf.mirror}.dl.sourceforge.net/sourceforge/java-link/swing-layout-1.0.jar" dest="tmp/swing-layout.jar"/> + <exec executable="mvn"> + <arg line="install:install-file -DgroupId=org.jvnet.swing-layout -DartifactId=core -Dversion=1.0 -Dpackaging=jar -Dfile=tmp/swing-layout.jar"/> + </exec> + <echo message="[done]"/> + + <echo message="downloading dep client/substance.jar"/> + <get src="http://${sf.mirror}.dl.sourceforge.net/sourceforge/java-link/substance-2.2.02.jar" dest="tmp/substance.jar"/> + <exec executable="mvn"> + <arg line="install:install-file -DgroupId=org.jvnet.substance -DartifactId=core -Dversion=2.2.02 -Dpackaging=jar -Dfile=tmp/substance.jar"/> + </exec> + <echo message="[done]"/> </target> <target name="client" depends="client-deps"> Modified: trunk/client/nbproject/mavencall.xml =================================================================== --- trunk/client/nbproject/mavencall.xml 2006-09-02 18:54:25 UTC (rev 9) +++ trunk/client/nbproject/mavencall.xml 2006-10-07 21:28:11 UTC (rev 10) @@ -1,4 +1,6 @@ <project name="client" default="build" basedir=".."> + <property file="nbproject/private/private.properties"/> + <property file="nbproject/project.properties"/> <target name="build" description="Build"> <exec dir="${basedir}" executable="${mvn.path}"> <arg line="package"/> @@ -30,8 +32,11 @@ </exec> </target> <target name="refresh-project" description="Refresh Project"> + <copy file="nbproject/mavencall.xml" tofile="nbproject/mavencall.xml.bak"/> <exec dir="${basedir}" executable="${mvn.path}"> <arg line="netbeans-freeform:generate-netbeans-project"/> </exec> + <delete file="nbproject.xml"/> + <move file="nbproject/mavencall.xml.bak" tofile="nbproject/mavencall.xml"/> </target> </project> \ No newline at end of file Modified: trunk/client/pom.xml =================================================================== --- trunk/client/pom.xml 2006-09-02 18:54:25 UTC (rev 9) +++ trunk/client/pom.xml 2006-10-07 21:28:11 UTC (rev 10) @@ -10,6 +10,12 @@ <name>JLink Client</name> <url>http://java-link.sf.net/</url> <dependencies> + <dependency> + <groupId>commons-configuration</groupId> + <artifactId>commons-configuration</artifactId> + <version>1.2</version> + <scope>compile</scope> + </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> @@ -52,6 +58,12 @@ <version>1.0</version> <scope>compile</scope> </dependency> + <dependency> + <groupId>nanoxml</groupId> + <artifactId>nanoxml</artifactId> + <version>2.2.3</version> + <scope>compile</scope> + </dependency> </dependencies> <!--//////////////////////////////////////// /////////////Reporting////////////////// @@ -146,7 +158,7 @@ </developer> </developers> <scm> - <connection>scm:svn:https://svn.sourceforge.net/svnroot/javalink</connection> + <connection>scm:svn:https://svn.sourceforge.net/svnroot/java-link</connection> <url>http://svn.sourceforge.net/viewcvs.cgi/java-link/</url> </scm> </project> Modified: trunk/server/nbproject/mavencall.xml =================================================================== --- trunk/server/nbproject/mavencall.xml 2006-09-02 18:54:25 UTC (rev 9) +++ trunk/server/nbproject/mavencall.xml 2006-10-07 21:28:11 UTC (rev 10) @@ -1,4 +1,6 @@ -<project name="server" default="build" basedir=".."> +<project name="client" default="build" basedir=".."> + <property file="nbproject/private/private.properties"/> + <property file="nbproject/project.properties"/> <target name="build" description="Build"> <exec dir="${basedir}" executable="${mvn.path}"> <arg line="package"/> @@ -30,8 +32,11 @@ </exec> </target> <target name="refresh-project" description="Refresh Project"> + <copy file="nbproject/mavencall.xml" tofile="nbproject/mavencall.xml.bak"/> <exec dir="${basedir}" executable="${mvn.path}"> <arg line="netbeans-freeform:generate-netbeans-project"/> </exec> + <delete file="nbproject.xml"/> + <move file="nbproject/mavencall.xml.bak" tofile="nbproject/mavencall.xml"/> </target> </project> \ No newline at end of file Modified: trunk/server/pom.xml =================================================================== --- trunk/server/pom.xml 2006-09-02 18:54:25 UTC (rev 9) +++ trunk/server/pom.xml 2006-10-07 21:28:11 UTC (rev 10) @@ -123,7 +123,7 @@ </developer> </developers> <scm> - <connection>scm:svn:https://svn.sourceforge.net/svnroot/javalink</connection> + <connection>scm:svn:https://svn.sourceforge.net/svnroot/java-link</connection> <url>http://svn.sourceforge.net/viewcvs.cgi/java-link/</url> </scm> </project> Modified: trunk/share/nbproject/mavencall.xml =================================================================== --- trunk/share/nbproject/mavencall.xml 2006-09-02 18:54:25 UTC (rev 9) +++ trunk/share/nbproject/mavencall.xml 2006-10-07 21:28:11 UTC (rev 10) @@ -1,4 +1,6 @@ -<project name="share" default="build" basedir=".."> +<project name="client" default="build" basedir=".."> + <property file="nbproject/private/private.properties"/> + <property file="nbproject/project.properties"/> <target name="build" description="Build"> <exec dir="${basedir}" executable="${mvn.path}"> <arg line="package"/> @@ -30,8 +32,11 @@ </exec> </target> <target name="refresh-project" description="Refresh Project"> + <copy file="nbproject/mavencall.xml" tofile="nbproject/mavencall.xml.bak"/> <exec dir="${basedir}" executable="${mvn.path}"> <arg line="netbeans-freeform:generate-netbeans-project"/> </exec> + <delete file="nbproject.xml"/> + <move file="nbproject/mavencall.xml.bak" tofile="nbproject/mavencall.xml"/> </target> </project> \ No newline at end of file Modified: trunk/share/pom.xml =================================================================== --- trunk/share/pom.xml 2006-09-02 18:54:25 UTC (rev 9) +++ trunk/share/pom.xml 2006-10-07 21:28:11 UTC (rev 10) @@ -22,6 +22,18 @@ <version>1.2.13</version> <scope>compile</scope> </dependency> + <dependency> + <groupId>yan</groupId> + <artifactId>yan</artifactId> + <version>5.0</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>yan</groupId> + <artifactId>jfunutil</artifactId> + <version>5.0</version> + <scope>compile</scope> + </dependency> </dependencies> <!--//////////////////////////////////////// /////////////Reporting////////////////// @@ -117,7 +129,7 @@ </developer> </developers> <scm> - <connection>scm:svn:https://svn.sourceforge.net/svnroot/javalink</connection> + <connection>scm:svn:https://svn.sourceforge.net/svnroot/java-link</connection> <url>http://svn.sourceforge.net/viewcvs.cgi/java-link/</url> </scm> </project> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wel...@us...> - 2006-09-02 19:01:18
|
Revision: 9 http://svn.sourceforge.net/java-link/?rev=9&view=rev Author: welterde0 Date: 2006-09-02 11:54:25 -0700 (Sat, 02 Sep 2006) Log Message: ----------- added build file for unix(which installs ant and maven) and an ant buildfile(which may also work on windows) written some test case code added some Share::net::hl code added some Share::net::ll code written some Share::net::ll::xml code updated images and fonts updated world system added missing sflogo tags in the site code of share and server updated pom of client, share and server(all: removed root, tag; client: added compile scope to the deps(Bugfix) updated client nbproject updated laf code in client updated gui code in client Modified Paths: -------------- trunk/client/nbproject/project.xml trunk/client/pom.xml trunk/client/src/main/java/org/jlink/ClientFrontend.java trunk/server/pom.xml trunk/share/pom.xml trunk/share/src/main/java/org/jlink/net/hl/HLHandler.java trunk/share/src/main/java/org/jlink/net/hl/HLProtocol.java trunk/share/src/main/java/org/jlink/net/hl/HLRegistry.java trunk/share/src/main/java/org/jlink/net/ll/xml/XMLConfiguration.java trunk/share/src/main/java/org/jlink/world/Session.java trunk/share/src/test/java/org/jlink/net/ll/LLEventTest.java trunk/templates/maven2/pom.xml Added Paths: ----------- trunk/build.xml trunk/build_unix.sh trunk/client/src/main/java/org/jlink/client/Core.java trunk/client/src/main/java/org/jlink/client/Main.java trunk/client/src/main/java/org/jlink/gui/net/ trunk/client/src/main/java/org/jlink/gui/net/ll/ trunk/client/src/main/java/org/jlink/gui/net/ll/ConfigurationWrapper.java trunk/server/src/site/ trunk/server/src/site/site.xml trunk/share/src/main/java/org/jlink/ControllerSupport.java trunk/share/src/main/java/org/jlink/net/hl/HLEvent.java trunk/share/src/main/java/org/jlink/net/hl/sys/ trunk/share/src/main/java/org/jlink/net/ll/LLProtocol.java trunk/share/src/main/java/org/jlink/net/ll/xml/XMLProtocol.java trunk/share/src/main/java/org/jlink/world/AvatarController.java trunk/share/src/main/resources/ trunk/share/src/main/resources/org/ trunk/share/src/main/resources/org/jlink/ trunk/share/src/main/resources/org/jlink/resources/ trunk/share/src/main/resources/org/jlink/resources/fonts/ trunk/share/src/main/resources/org/jlink/resources/fonts/battle3.ttf trunk/share/src/main/resources/org/jlink/resources/theme/ trunk/share/src/main/resources/org/jlink/resources/theme/account-register.png trunk/share/src/main/resources/org/jlink/resources/theme/system-change_server.png trunk/share/src/main/resources/org/jlink/resources/theme/system-exit.png trunk/share/src/site/ trunk/share/src/site/site.xml trunk/util/ trunk/util/apache-ant-1.6.5-bin.tar.bz2 trunk/util/maven-2.0.4-bin.tar.bz2 Removed Paths: ------------- trunk/client/src/main/java/org/jlink/client/gui/Colors.java trunk/client/src/main/java/org/jlink/client/gui/MenuBean.java trunk/client/src/main/java/org/jlink/gui/JInternalFrameFactory.java trunk/client/src/main/java/org/jlink/gui/laf/ trunk/share/src/main/java/org/jlink/resources/fonts/ trunk/share/src/main/java/org/jlink/resources/theme/ Added: trunk/build.xml =================================================================== --- trunk/build.xml (rev 0) +++ trunk/build.xml 2006-09-02 18:54:25 UTC (rev 9) @@ -0,0 +1,77 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * build.xml + * + * Created on 04. August 2006, 14:53 + * + * JLink: An Introversion Uplink Clone with multiplayer support. + * Copyright (C) 2006 Tassilo Schweyer + * + * This program 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 2 + * of the License, or (at your option) any later version. + * + * This program 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 this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +--> +<project name="jlink" default="default" basedir="."> + <!--Global--> + + <!--Targets--> + <target name="share"> + <exec executable="mvn" dir="share" output="share.build.log" failonerror="true"> + <arg value="compile"/> + </exec> + <exec executable="mvn" dir="share" output="share.build.log" failonerror="true"> + <arg value="install"/> + </exec> + </target> + + + + <target name="server" depends="share"> + <exec executable="mvn" dir="server" output="server.build.log"> + <arg value="compile"/> + </exec> + <exec executable="mvn" dir="server" output="server.build.log"> + <arg value="assembly:assembly"/> + </exec> + </target> + + <target name="client-deps" depends="share"> + <mkdir dir="tmp"/> + + <echo message="downloading dep client/lafplugin.jar"/> + <get src="http://dl.sourceforge.net/java-link/lafplugin-0.1.jar" dest="tmp/lafplugin.jar"/> + <echo message="installing it"/> + <exec executable="mvn"> + <arg line="install:install-file -DgroupId=org.jvnet -DartifactId=lafplugin -Dversion=0.1 -Dpackaging=jar -Dfile=tmp/lafplugin.jar"/> + </exec> + <echo message="[done]"/> + + <echo message="downloading dep client/nanoxml.jar"/> + <get src="http://dl.sourceforge.net/java-link/nanoxml_lite-2.2.3.jar" dest="tmp/nanoxml.jar"/> + </target> + + <target name="client" depends="client-deps"> + <exec executable="mvn" dir="client" output="client.build.log"> + <arg value="compile"/> + </exec> + <exec executable="mvn" dir="client" output="client.build.log"> + <arg value="assembly:assembly"/> + </exec> + </target> + + + + <target name="default" depends="client, server"> + + </target> +</project> Added: trunk/build_unix.sh =================================================================== --- trunk/build_unix.sh (rev 0) +++ trunk/build_unix.sh 2006-09-02 18:54:25 UTC (rev 9) @@ -0,0 +1,55 @@ +#!/bin/sh + +export MVN_VERSION=2.0.4 +export MVN_FILE=maven-$MVN_VERSION-bin.tar.bz2 + +export ANT_VERSION=1.6.5 +export ANT_FILE=apache-ant-$ANT_VERSION-bin.tar.bz2 +export ANT_HOME=`pwd`/util/apache-ant-$ANT_VERSION + +export PATH=`pwd`/util/maven-$MVN_VERSION/bin:`pwd`/util/apache-ant-$ANT_VERSION/bin:$PATH + +function fail_mvn() { + echo "couldnt find maven and couldnt install it" + exit 1 +} + +function install_mvn() { + tar -xjC util -f util/$MVN_FILE +} + +function check_mvn() { + echo "checking maven2...." + mvn -version &> /dev/null || install_mvn + mvn -version &> /dev/null || fail_mvn + set_color GREEN && echo "[ok]" && set_color NORMAL + #TODO add color and right positon +} + +function fail_ant() { + echo "couldnt find ant and couldnt install it" + exit 1 +} + +function install_ant() { + tar -xjC util -f util/$ANT_FILE +} + +function check_ant() { + echo "checking ant...." + ant -version &> /dev/null || install_ant + ant -version &> /dev/null || fail_ant + set_color GREEN && echo "[ok]" && set_color NORMAL + #TODO add color and right positon +} + + + + + + +##The main code +check_mvn +check_ant + +ant Property changes on: trunk/build_unix.sh ___________________________________________________________________ Name: svn:executable + * Modified: trunk/client/nbproject/project.xml =================================================================== --- trunk/client/nbproject/project.xml 2006-05-15 18:34:32 UTC (rev 8) +++ trunk/client/nbproject/project.xml 2006-09-02 18:54:25 UTC (rev 9) @@ -1,121 +1,134 @@ +<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://www.netbeans.org/ns/project/1"> - <type>org.netbeans.modules.ant.freeform</type> - <configuration> - <general-data xmlns="http://www.netbeans.org/ns/freeform-project/1"> - <name>JLink Client</name> - <properties> - <property name="ant.script">nbproject/mavencall.xml</property> - <property-file>nbproject/project.properties</property-file> - </properties> - <folders> - <source-folder> - <label>src/main/java</label> - <type>java</type> - <location>src/main/java</location> - </source-folder> - <source-folder> - <label>src/test/java</label> - <type>java</type> - <location>src/test/java</location> - </source-folder> - </folders> - <ide-actions> - <action name="build"> - <script>${ant.script}</script> - <target>build</target> - </action> - <action name="clean"> - <script>${ant.script}</script> - <target>clean</target> - </action> - <action name="rebuild"> - <script>${ant.script}</script> - <target>clean</target> - <target>build</target> - </action> - <action name="javadoc"> - <script>${ant.script}</script> - <target>javadoc</target> - </action> - <action name="run"> - <script>${ant.script}</script> - <target>run</target> - </action> - <action name="test"> - <script>${ant.script}</script> - <target>test</target> - </action> - </ide-actions> - <view> - <items> - <source-file> - <label>pom</label> - <location>pom.xml</location> - </source-file> - <source-file> - <label>mavencall</label> - <location>nbproject/mavencall.xml</location> - </source-file> - <source-folder style="packages"> - <label>src/main/java</label> - <location>src/main/java</location> - </source-folder> - <source-folder style="packages"> - <label>src/test/java</label> - <location>src/test/java</location> - </source-folder> - <source-folder style="tree"> - <label>src/main/resources</label> - <location>src/main/resources</location> - </source-folder> - <source-folder style="tree"> - <label>src/test/resources</label> - <location>src/test/resources</location> - </source-folder> - <source-folder style="tree"> - <label>src/site</label> - <location>src/site</location> - </source-folder> - <source-folder style="tree"> - <label>target</label> - <location>target</location> - </source-folder> - </items> - <context-menu> - <action> - <script>${ant.script}</script> - <label>Refresh Project</label> - <target>refresh-project</target> - </action> - <ide-action name="build"/> - <ide-action name="clean"/> - <ide-action name="rebuild"/> - <ide-action name="javadoc"/> - <ide-action name="run"/> - <ide-action name="test"/> - <action> - <script>${ant.script}</script> - <label>Format Code</label> - <target>jalopy</target> - </action> - </context-menu> - </view> - <subprojects/> - </general-data> - <java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/2"> - <compilation-unit> - <package-root>src/main/java</package-root> - <classpath mode="compile">${local.repository}/org/jvnet/substance/core/2.2.02/core-2.2.02.jar:${local.repository}/jdom/jdom/1.0/jdom-1.0.jar:${local.repository}/org/jlink/share/0.0.1-SNAPSHOT/share-0.0.1-SNAPSHOT.jar:${local.repository}/org/jvnet/swing-layout/core/1.0/core-1.0.jar:${local.repository}/log4j/log4j/1.2.13/log4j-1.2.13.jar</classpath> - <built-to>target/classes</built-to> - <source-level>1.4</source-level> - </compilation-unit> - <compilation-unit> - <package-root>src/test/java</package-root> - <unit-tests/> - <classpath mode="compile">target/classes:${local.repository}/org/jvnet/substance/core/2.2.02/core-2.2.02.jar:${local.repository}/junit/junit/3.8.1/junit-3.8.1.jar:${local.repository}/jdom/jdom/1.0/jdom-1.0.jar:${local.repository}/org/jlink/share/0.0.1-SNAPSHOT/share-0.0.1-SNAPSHOT.jar:${local.repository}/org/jvnet/swing-layout/core/1.0/core-1.0.jar:${local.repository}/log4j/log4j/1.2.13/log4j-1.2.13.jar</classpath> - <built-to>target/test-classes</built-to> - <source-level>1.4</source-level> - </compilation-unit> - </java-data> - </configuration> -</project> \ No newline at end of file + <type>org.netbeans.modules.ant.freeform</type> + <configuration> + <general-data xmlns="http://www.netbeans.org/ns/freeform-project/1"> + <name>JLink Client</name> + <properties> + <property name="ant.script">nbproject/mavencall.xml</property> + <property-file>nbproject/project.properties</property-file> + </properties> + <folders> + <source-folder> + <label>src/main/java</label> + <type>java</type> + <location>src/main/java</location> + </source-folder> + <source-folder> + <label>src/test/java</label> + <type>java</type> + <location>src/test/java</location> + </source-folder> + </folders> + <ide-actions> + <action name="build"> + <script>${ant.script}</script> + <target>build</target> + </action> + <action name="clean"> + <script>${ant.script}</script> + <target>clean</target> + </action> + <action name="rebuild"> + <script>${ant.script}</script> + <target>clean</target> + <target>build</target> + </action> + <action name="javadoc"> + <script>${ant.script}</script> + <target>javadoc</target> + </action> + <action name="run"> + <script>${ant.script}</script> + <target>run</target> + </action> + <action name="test"> + <script>${ant.script}</script> + <target>test</target> + </action> + </ide-actions> + <export> + <type>folder</type> + <location>target/classes</location> + <script>${ant.script}</script> + <build-target>build</build-target> + </export> + <export> + <type>folder</type> + <location>target/test-classes</location> + <script>${ant.script}</script> + <build-target>build</build-target> + </export> + <view> + <items> + <source-folder style="packages"> + <label>src/main/java</label> + <location>src/main/java</location> + </source-folder> + <source-folder style="packages"> + <label>src/test/java</label> + <location>src/test/java</location> + </source-folder> + <source-file> + <label>pom</label> + <location>pom.xml</location> + </source-file> + <source-file> + <label>mavencall</label> + <location>nbproject/mavencall.xml</location> + </source-file> + <source-folder style="tree"> + <label>src/main/resources</label> + <location>src/main/resources</location> + </source-folder> + <source-folder style="tree"> + <label>src/test/resources</label> + <location>src/test/resources</location> + </source-folder> + <source-folder style="tree"> + <label>src/site</label> + <location>src/site</location> + </source-folder> + <source-folder style="tree"> + <label>target</label> + <location>target</location> + </source-folder> + </items> + <context-menu> + <action> + <script>${ant.script}</script> + <label>Refresh Project</label> + <target>refresh-project</target> + </action> + <ide-action name="build"/> + <ide-action name="clean"/> + <ide-action name="rebuild"/> + <ide-action name="javadoc"/> + <ide-action name="run"/> + <ide-action name="test"/> + <action> + <script>${ant.script}</script> + <label>Format Code</label> + <target>jalopy</target> + </action> + </context-menu> + </view> + <subprojects/> + </general-data> + <java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/2"> + <compilation-unit> + <package-root>src/main/java</package-root> + <classpath mode="compile">${local.repository}/org/jvnet/substance/core/2.2.02/core-2.2.02.jar:${local.repository}/jdom/jdom/1.0/jdom-1.0.jar:${local.repository}/org/jlink/share/0.0.1-SNAPSHOT/share-0.0.1-SNAPSHOT.jar:${local.repository}/org/jvnet/swing-layout/core/1.0/core-1.0.jar:${local.repository}/log4j/log4j/1.2.13/log4j-1.2.13.jar</classpath> + <built-to>target/classes</built-to> + <source-level>1.5</source-level> + </compilation-unit> + <compilation-unit> + <package-root>src/test/java</package-root> + <unit-tests/> + <classpath mode="compile">target/classes:${local.repository}/org/jvnet/substance/core/2.2.02/core-2.2.02.jar:${local.repository}/junit/junit/3.8.1/junit-3.8.1.jar:${local.repository}/jdom/jdom/1.0/jdom-1.0.jar:${local.repository}/org/jlink/share/0.0.1-SNAPSHOT/share-0.0.1-SNAPSHOT.jar:${local.repository}/org/jvnet/swing-layout/core/1.0/core-1.0.jar:${local.repository}/log4j/log4j/1.2.13/log4j-1.2.13.jar</classpath> + <built-to>target/test-classes</built-to> + <source-level>1.5</source-level> + </compilation-unit> + </java-data> + </configuration> +</project> Modified: trunk/client/pom.xml =================================================================== --- trunk/client/pom.xml 2006-05-15 18:34:32 UTC (rev 8) +++ trunk/client/pom.xml 2006-09-02 18:54:25 UTC (rev 9) @@ -2,11 +2,6 @@ <!--//////////////////////////////////////// /////////////General//////////////////// /////////////////////////////////////--> - <parent> - <artifactId>yamd-root</artifactId> - <groupId>org.welterde.yamd</groupId> - <version>0.0.1-SNAPSHOT</version> - </parent> <modelVersion>4.0.0</modelVersion> <groupId>org.jlink</groupId> <artifactId>client</artifactId> @@ -25,31 +20,37 @@ <groupId>org.jlink</groupId> <artifactId>share</artifactId> <version>0.0.1-SNAPSHOT</version> + <scope>compile</scope> </dependency> <dependency> <groupId>org.jvnet.substance</groupId> <artifactId>core</artifactId> <version>2.2.02</version> + <scope>compile</scope> </dependency> <dependency> <groupId>jdom</groupId> <artifactId>jdom</artifactId> <version>1.0</version> + <scope>compile</scope> </dependency> <dependency> <groupId>saxpath</groupId> <artifactId>saxpath</artifactId> <version>1.0-FCS</version> + <scope>compile</scope> </dependency> <dependency> <groupId>jaxen</groupId> <artifactId>jaxen</artifactId> <version>1.0-FCS</version> + <scope>compile</scope> </dependency> <dependency> <groupId>org.jvnet.swing-layout</groupId> <artifactId>core</artifactId> <version>1.0</version> + <scope>compile</scope> </dependency> </dependencies> <!--//////////////////////////////////////// Modified: trunk/client/src/main/java/org/jlink/ClientFrontend.java =================================================================== --- trunk/client/src/main/java/org/jlink/ClientFrontend.java 2006-05-15 18:34:32 UTC (rev 8) +++ trunk/client/src/main/java/org/jlink/ClientFrontend.java 2006-09-02 18:54:25 UTC (rev 9) @@ -32,8 +32,6 @@ import org.jlink.client.frontend.menu.MainMenuListener; import org.jlink.client.frontend.theme.ThemeManager; import org.jlink.client.frontend.theme.Theme; -//import::own::gui -import org.jlink.client.gui.MenuBean; //import::sys //import::sys::io import java.io.File; Added: trunk/client/src/main/java/org/jlink/client/Core.java =================================================================== --- trunk/client/src/main/java/org/jlink/client/Core.java (rev 0) +++ trunk/client/src/main/java/org/jlink/client/Core.java 2006-09-02 18:54:25 UTC (rev 9) @@ -0,0 +1,93 @@ +/* + * Core.java + * + * Created on 1. Juni 2006, 16:29 + * + * JLink: An Introversion Uplink Clone with multiplayer support. + * Copyright (C) 2006 Tassilo Schweyer + * + * This program 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 2 + * of the License, or (at your option) any later version. + * + * This program 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 this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package org.jlink.client; + +import org.jlink.Controller; +import org.jlink.ControllerSupport; + +/** + * + * @author tassilo + */ +public class Core implements Controller { + + /** Creates a new instance of Core */ + public Core() { + } + + public void init() { + } + + public void start() { + if(!this.statInit) + this.init(); + this.statRun = true; + this.run(); + } + + public void join() { + synchronized(this.callStop) { + try { + this.callStop.wait(); + } catch(InterruptedException exc) { + + } + } + } + + private void run() { + if(!this.statRun) + this.start(); + while(!this.doStop) { + try { + + + Thread.sleep(100); + } catch(InterruptedException exc) { + + } finally { + + } + } + //wake up all threads in join() + synchronized(this.callStop) { + this.callStop.notifyAll(); + } + } + + public void stop() { + this.doStop = true; + } + + public void destroy() { + } + + + private boolean doStop = false; + + private boolean statInit = false; + private boolean statRun = false; + + private Object callStop = new Object();//lock +} Added: trunk/client/src/main/java/org/jlink/client/Main.java =================================================================== --- trunk/client/src/main/java/org/jlink/client/Main.java (rev 0) +++ trunk/client/src/main/java/org/jlink/client/Main.java 2006-09-02 18:54:25 UTC (rev 9) @@ -0,0 +1,43 @@ +/* + * Main.java + * + * Created on 27. Mai 2006, 17:19 + * + * JLink: An Introversion Uplink Clone with multiplayer support. + * Copyright (C) 2006 Tassilo Schweyer + * + * This program 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 2 + * of the License, or (at your option) any later version. + * + * This program 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 this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package org.jlink.client; + +/** + * + * @author tassilo + */ +public class Main { + + /** Creates a new instance of Main */ + public Main() { + } + + /** + * @param args the command line arguments + */ + public static void main(String[] args) { + // TODO code application logic here + } + +} Deleted: trunk/client/src/main/java/org/jlink/client/gui/Colors.java =================================================================== --- trunk/client/src/main/java/org/jlink/client/gui/Colors.java 2006-05-15 18:34:32 UTC (rev 8) +++ trunk/client/src/main/java/org/jlink/client/gui/Colors.java 2006-09-02 18:54:25 UTC (rev 9) @@ -1,40 +0,0 @@ -/* - * Colors.java - * - * Created on 19. Februar 2006, 20:45 - * - * JLink: An Introversion Uplink Clone with multiplayer support. - * Copyright (C) 2006 Tassilo Schweyer - * - * This program 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 2 - * of the License, or (at your option) any later version. - * - * This program 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 this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -package org.jlink.client.gui; - -//import::sys -//import::sys::awt -import java.awt.Color; - -/** - * - * @author tassilo - */ -public class Colors { - private Colors() { - } - - public static final Color MAIN_MENU_BACKGROUND = Color.WHITE; - -} Deleted: trunk/client/src/main/java/org/jlink/client/gui/MenuBean.java =================================================================== --- trunk/client/src/main/java/org/jlink/client/gui/MenuBean.java 2006-05-15 18:34:32 UTC (rev 8) +++ trunk/client/src/main/java/org/jlink/client/gui/MenuBean.java 2006-09-02 18:54:25 UTC (rev 9) @@ -1,131 +0,0 @@ -/* - * MenuBean.java - * - * Created on 27. Februar 2006, 14:47 - * - * JLink: An Introversion Uplink Clone with multiplayer support. - * Copyright (C) 2006 Tassilo Schweyer - * - * This program 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 2 - * of the License, or (at your option) any later version. - * - * This program 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 this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -package org.jlink.client.gui; - -//import -//import::sys -//import::sys::awt -import java.awt.Color; -import java.awt.event.ActionListener; -//import::sys::swing -import javax.swing.JComponent; -import javax.swing.JButton; -import javax.swing.Icon; -//import::sys::util -import java.util.Map; -import java.util.HashMap; -//import::sys::log4j -import org.apache.log4j.Logger; - - - -/** - * - * @author tassilo - */ -public class MenuBean { - - /** Creates a new instance of MenuBean */ - public MenuBean(double mx, double my) { - this.c = new JComponent(){}; - this.c.setVisible(true); - this.db_buttons = new HashMap<String, JButton>(); - - this.mx = mx; - this.my = my; - } - public JComponent getComponent() { - return this.c; - } - - /////////////////////// - ////Core Operations//// - /////////////////////// - //Buttons - public void addButton(String id, Icon ico, int x, int y, int w, int h, String tooltip) { - Logger log = Logger.getLogger("jlink.gui.beans.menu"); - log.debug("addButton(...) called id=" + id); - JButton b = new JButton(ico); - b.setActionCommand(id); - log.debug("calculating"); - int x0 = (int) (x * mx); - log.debug("x, pre=" + x + ", suf=" + x0); - int x1 = (int) (w * mx); - log.debug("w pre=" + w + ", suf=" + x1); - int y0 = (int) (y * my); - log.debug("y pre=" + y + ", suf=" + y0); - int y1 = (int) (h * my); - log.debug("h pre=" + h + ", suf="+ y1); - b.setBounds(x0, y0, x1, y1); - b.setToolTipText(tooltip); - this.c.add(b); - this.c.validate(); - this.c.repaint(); - this.db_buttons.put(id, b); - // TODO: write remove Methode , on demand - } - - public void addButtonListener(String id, ActionListener l) { - JButton b = this.db_buttons.get(id); - b.addActionListener(l); - } - - //Style - public void setBGColor(Color c) { - this.c.setBackground(c); - this.c.repaint(); - this.c_bg = c; - } - - - - - - - - - - - - - - - - - - - - - - - - - - //Variables - private JComponent c = null; - private Color c_bg = Color.WHITE; - private Map<String, JButton> db_buttons = null; - private double mx = 1; - private double my = 1; -} Deleted: trunk/client/src/main/java/org/jlink/gui/JInternalFrameFactory.java =================================================================== --- trunk/client/src/main/java/org/jlink/gui/JInternalFrameFactory.java 2006-05-15 18:34:32 UTC (rev 8) +++ trunk/client/src/main/java/org/jlink/gui/JInternalFrameFactory.java 2006-09-02 18:54:25 UTC (rev 9) @@ -1,47 +0,0 @@ -/* - * JInternalFrameFactory.java - * - * Created on 23. März 2006, 21:51 - * - * JLink: An Introversion Uplink Clone with multiplayer support. - * Copyright (C) 2006 Tassilo Schweyer - * - * This program 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 2 - * of the License, or (at your option) any later version. - * - * This program 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 this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -package org.jlink.gui; - -import javax.swing.JInternalFrame; -import javax.swing.JPopupMenu; -import javax.swing.JComponent; -import javax.swing.plaf.basic.BasicInternalFrameUI; - -/** - * - * @author tassilo - */ -public class JInternalFrameFactory { - - public static void addPUMenuToIFrame(JInternalFrame f, JPopupMenu m) { - JComponent c = ((BasicInternalFrameUI) f.getUI()).getNorthPane(); - c.setComponentPopupMenu(m); - - } - - - - private JInternalFrameFactory() { - } -} Added: trunk/client/src/main/java/org/jlink/gui/net/ll/ConfigurationWrapper.java =================================================================== --- trunk/client/src/main/java/org/jlink/gui/net/ll/ConfigurationWrapper.java (rev 0) +++ trunk/client/src/main/java/org/jlink/gui/net/ll/ConfigurationWrapper.java 2006-09-02 18:54:25 UTC (rev 9) @@ -0,0 +1,57 @@ +/* + * ConfigurationWrapper.java + * + * Created on 27. Mai 2006, 14:12 + * + * JLink: An Introversion Uplink Clone with multiplayer support. + * Copyright (C) 2006 Tassilo Schweyer + * + * This program 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 2 + * of the License, or (at your option) any later version. + * + * This program 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 this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package org.jlink.gui.net.ll; + +//import +//import::own +import org.jlink.net.ll.LLConfiguration; +//import::sys +import javax.swing.JPanel; + + +/** + * + * @author tassilo + */ +public class ConfigurationWrapper { + public static ConfigurationWrapper create(LLConfiguration conf) { + + //TODO: write creation code + return null; + } + public LLConfiguration getConfig() { + return this.data_conf; + } + + + + + + + /** Creates a new instance of ConfigurationWrapper */ + private ConfigurationWrapper() { + } + + private LLConfiguration data_conf = null; +} Modified: trunk/server/pom.xml =================================================================== --- trunk/server/pom.xml 2006-05-15 18:34:32 UTC (rev 8) +++ trunk/server/pom.xml 2006-09-02 18:54:25 UTC (rev 9) @@ -2,11 +2,6 @@ <!--//////////////////////////////////////// /////////////General//////////////////// /////////////////////////////////////--> - <parent> - <artifactId>yamd-root</artifactId> - <groupId>org.welterde.yamd</groupId> - <version>0.0.1-SNAPSHOT</version> - </parent> <modelVersion>4.0.0</modelVersion> <groupId>org.jlink</groupId> <artifactId>server</artifactId> Added: trunk/server/src/site/site.xml =================================================================== --- trunk/server/src/site/site.xml (rev 0) +++ trunk/server/src/site/site.xml 2006-09-02 18:54:25 UTC (rev 9) @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<project name="JLink Client"> + <bannerRight> + <src>http://sflogo.sourceforge.net/sflogo.php?group_id=162264&type=3</src> + </bannerRight> + <body> + ${reports} + </body> +</project> Modified: trunk/share/pom.xml =================================================================== --- trunk/share/pom.xml 2006-05-15 18:34:32 UTC (rev 8) +++ trunk/share/pom.xml 2006-09-02 18:54:25 UTC (rev 9) @@ -2,11 +2,6 @@ <!--//////////////////////////////////////// /////////////General//////////////////// /////////////////////////////////////--> - <parent> - <artifactId>yamd-root</artifactId> - <groupId>org.welterde.yamd</groupId> - <version>0.0.1-SNAPSHOT</version> - </parent> <modelVersion>4.0.0</modelVersion> <groupId>org.jlink</groupId> <artifactId>share</artifactId> Added: trunk/share/src/main/java/org/jlink/ControllerSupport.java =================================================================== --- trunk/share/src/main/java/org/jlink/ControllerSupport.java (rev 0) +++ trunk/share/src/main/java/org/jlink/ControllerSupport.java 2006-09-02 18:54:25 UTC (rev 9) @@ -0,0 +1,79 @@ +/* + * ControllerSupport.java + * + * Created on 1. Juni 2006, 16:29 + * + * JLink: An Introversion Uplink Clone with multiplayer support. + * Copyright (C) 2006 Tassilo Schweyer + * + * This program 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 2 + * of the License, or (at your option) any later version. + * + * This program 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 this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package org.jlink; + +/** + * + * @author tassilo + */ +public class ControllerSupport implements Controller { + + /** Creates a new instance of ControllerSupport */ + public ControllerSupport() { + } + + public void init() { + if(this.valid) + ;//TODO: exception + this.valid = true; + } + + public void start() { + if(this.running) + ;//TODO: exception + this.running = true; + } + + public void join() { + synchronized(this.obj) { + try { + this.obj.wait(); + } catch(InterruptedException e) { + + } + } + } + + public void stop() { + if(!this.running) + ;//TODO: exception + this.running = false; + synchronized(this.obj) { + this.obj.notify(); + } + } + + public void destroy() { + if(!this.valid) + ;//TODO: exception + if(this.running) + ;//TODO: exception + this.valid = false; + } + + + private boolean valid = false; + private boolean running = false; + private Object obj = "sadfsd"; +} Added: trunk/share/src/main/java/org/jlink/net/hl/HLEvent.java =================================================================== --- trunk/share/src/main/java/org/jlink/net/hl/HLEvent.java (rev 0) +++ trunk/share/src/main/java/org/jlink/net/hl/HLEvent.java 2006-09-02 18:54:25 UTC (rev 9) @@ -0,0 +1,32 @@ +/* + * HLEvent.java + * + * Created on 27. Mai 2006, 12:41 + * + * JLink: An Introversion Uplink Clone with multiplayer support. + * Copyright (C) 2006 Tassilo Schweyer + * + * This program 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 2 + * of the License, or (at your option) any later version. + * + * This program 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 this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package org.jlink.net.hl; + +/** + * + * @author tassilo + */ +public interface HLEvent { + +} Modified: trunk/share/src/main/java/org/jlink/net/hl/HLHandler.java =================================================================== --- trunk/share/src/main/java/org/jlink/net/hl/HLHandler.java 2006-05-15 18:34:32 UTC (rev 8) +++ trunk/share/src/main/java/org/jlink/net/hl/HLHandler.java 2006-09-02 18:54:25 UTC (rev 9) @@ -23,10 +23,17 @@ package org.jlink.net.hl; +import org.jlink.net.ll.LLEvent; + /** * * @author tassilo */ public interface HLHandler { + public LLEvent encode(HLEvent evt); + public HLEvent decode(LLEvent evt); + public boolean handles(LLEvent evt); + public boolean handles(HLEvent evt); + public HLHandler getParent(); } Modified: trunk/share/src/main/java/org/jlink/net/hl/HLProtocol.java =================================================================== --- trunk/share/src/main/java/org/jlink/net/hl/HLProtocol.java 2006-05-15 18:34:32 UTC (rev 8) +++ trunk/share/src/main/java/org/jlink/net/hl/HLProtocol.java 2006-09-02 18:54:25 UTC (rev 9) @@ -23,6 +23,8 @@ package org.jlink.net.hl; +import org.jlink.net.ll.LLEvent; + /** * * @author tassilo Modified: trunk/share/src/main/java/org/jlink/net/hl/HLRegistry.java =================================================================== --- trunk/share/src/main/java/org/jlink/net/hl/HLRegistry.java 2006-05-15 18:34:32 UTC (rev 8) +++ trunk/share/src/main/java/org/jlink/net/hl/HLRegistry.java 2006-09-02 18:54:25 UTC (rev 9) @@ -33,4 +33,6 @@ public HLRegistry() { } + + } Added: trunk/share/src/main/java/org/jlink/net/ll/LLProtocol.java =================================================================== --- trunk/share/src/main/java/org/jlink/net/ll/LLProtocol.java (rev 0) +++ trunk/share/src/main/java/org/jlink/net/ll/LLProtocol.java 2006-09-02 18:54:25 UTC (rev 9) @@ -0,0 +1,34 @@ +/* + * LLProtocol.java + * + * Created on 27. Mai 2006, 13:02 + * + * JLink: An Introversion Uplink Clone with multiplayer support. + * Copyright (C) 2006 Tassilo Schweyer + * + * This program 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 2 + * of the License, or (at your option) any later version. + * + * This program 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 this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package org.jlink.net.ll; + +/** + * + * @author tassilo + */ +public interface LLProtocol { + public LLFactory createClient(); + + public LLServerFactory createServer(); +} Modified: trunk/share/src/main/java/org/jlink/net/ll/xml/XMLConfiguration.java =================================================================== --- trunk/share/src/main/java/org/jlink/net/ll/xml/XMLConfiguration.java 2006-05-15 18:34:32 UTC (rev 8) +++ trunk/share/src/main/java/org/jlink/net/ll/xml/XMLConfiguration.java 2006-09-02 18:54:25 UTC (rev 9) @@ -37,26 +37,45 @@ } public String[] getNames() { - return null; + return this.dat_names; } public String getDefault(int id) { - return null; + return this.dat_default[id]; } public String getValue(int id) { - return null; + return this.dat_values[id]; } - public String getDescription(int id, Locale l) { - return null; + public String getDescription(int id, final Locale l) { + return this.getDescription(id); } public String getDescription(int id) { - return null; + return this.dat_descs[id]; } public void setValue(int id, String val) { + this.dat_values[id] = val; } + + + private String[] dat_names = new String[] { + "Host", + "Port", + "compress" + }; + private String[] dat_default = new String[] { + "localhost", + "4236", + "true" + }; + private String[] dat_values = new String[3]; + private String[] dat_descs = new String[] { + "The Hostname of the remote host", + "The Port of the remote host", + "Should the Data be compressed(true/false)" + }; } Added: trunk/share/src/main/java/org/jlink/net/ll/xml/XMLProtocol.java =================================================================== --- trunk/share/src/main/java/org/jlink/net/ll/xml/XMLProtocol.java (rev 0) +++ trunk/share/src/main/java/org/jlink/net/ll/xml/XMLProtocol.java 2006-09-02 18:54:25 UTC (rev 9) @@ -0,0 +1,48 @@ +/* + * XMLProtocol.java + * + * Created on 27. Mai 2006, 13:05 + * + * JLink: An Introversion Uplink Clone with multiplayer support. + * Copyright (C) 2006 Tassilo Schweyer + * + * This program 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 2 + * of the License, or (at your option) any later version. + * + * This program 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 this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package org.jlink.net.ll.xml; + +import org.jlink.net.ll.LLFactory; +import org.jlink.net.ll.LLProtocol; +import org.jlink.net.ll.LLServerFactory; + +/** + * + * @author tassilo + */ +public class XMLProtocol implements LLProtocol { + + /** Creates a new instance of XMLProtocol */ + public XMLProtocol() { + } + + public LLFactory createClient() { + return new XMLFactory(); + } + + public LLServerFactory createServer() { + return null; + } + +} Added: trunk/share/src/main/java/org/jlink/world/AvatarController.java =================================================================== --- trunk/share/src/main/java/org/jlink/world/AvatarController.java (rev 0) +++ trunk/share/src/main/java/org/jlink/world/AvatarController.java 2006-09-02 18:54:25 UTC (rev 9) @@ -0,0 +1,35 @@ +/* + * AvatarController.java + * + * Created on 25. Juni 2006, 15:13 + * + * JLink: An Introversion Uplink Clone with multiplayer support. + * Copyright (C) 2006 Tassilo Schweyer + * + * This program 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 2 + * of the License, or (at your option) any later version. + * + * This program 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 this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package org.jlink.world; + +/** + * + * @author tassilo + */ +public interface AvatarController { + public Avatar get(String name) throws SessionException; + public Avatar[] list() throws SessionException; + public Avatar create(String name) throws SessionException; + public void delete(String name) throws SessionException; +} Modified: trunk/share/src/main/java/org/jlink/world/Session.java =================================================================== --- trunk/share/src/main/java/org/jlink/world/Session.java 2006-05-15 18:34:32 UTC (rev 8) +++ trunk/share/src/main/java/org/jlink/world/Session.java 2006-09-02 18:54:25 UTC (rev 9) @@ -37,4 +37,8 @@ public Avatar[] avatarList() throws SessionException; public Avatar avatarCreate(String name) throws SessionException; public void avatarDelete(String name) throws SessionException; + + //lookup + public Object lookup(String name); + public Object lookup(Class c); } Added: trunk/share/src/main/resources/org/jlink/resources/fonts/battle3.ttf =================================================================== (Binary files differ) Property changes on: trunk/share/src/main/resources/org/jlink/resources/fonts/battle3.ttf ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/share/src/main/resources/org/jlink/resources/theme/account-register.png =================================================================== (Binary files differ) Property changes on: trunk/share/src/main/resources/org/jlink/resources/theme/account-register.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/share/src/main/resources/org/jlink/resources/theme/system-change_server.png =================================================================== (Binary files differ) Property changes on: trunk/share/src/main/resources/org/jlink/resources/theme/system-change_server.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/share/src/main/resources/org/jlink/resources/theme/system-exit.png =================================================================== (Binary files differ) Property changes on: trunk/share/src/main/resources/org/jlink/resources/theme/system-exit.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/share/src/site/site.xml =================================================================== --- trunk/share/src/site/site.xml (rev 0) +++ trunk/share/src/site/site.xml 2006-09-02 18:54:25 UTC (rev 9) @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<project name="JLink Client"> + <bannerRight> + <src>http://sflogo.sourceforge.net/sflogo.php?group_id=162264&type=3</src> + </bannerRight> + <body> + ${reports} + </body> +</project> Modified: trunk/share/src/test/java/org/jlink/net/ll/LLEventTest.java =================================================================== --- trunk/share/src/test/java/org/jlink/net/ll/LLEventTest.java 2006-05-15 18:34:32 UTC (rev 8) +++ trunk/share/src/test/java/org/jlink/net/ll/LLEventTest.java 2006-09-02 18:54:25 UTC (rev 9) @@ -41,12 +41,9 @@ LLEvent instance = new LLEvent(); - int expResult = 0; + int expResult = -1; int result = instance.getMsgClass(); assertEquals(expResult, result); - - // TODO review the generated test code and remove the default call to fail. - fail("The test case is a prototype."); } /** @@ -59,9 +56,7 @@ LLEvent instance = new LLEvent(); instance.setMsgClass(c); - - // TODO review the generated test code and remove the default call to fail. - fail("The test case is a prototype."); + assertEquals(c, instance.getMsgClass()); } /** @@ -72,12 +67,9 @@ LLEvent instance = new LLEvent(); - long expResult = 0L; + long expResult = -1L; long result = instance.getMsgID(); assertEquals(expResult, result); - - // TODO review the generated test code and remove the default call to fail. - fail("The test case is a prototype."); } /** @@ -90,9 +82,13 @@ LLEvent instance = new LLEvent(); instance.setMsgID(id); - - // TODO review the generated test code and remove the default call to fail. - fail("The test case is a prototype."); + assertEquals(id, instance.getMsgID()); + id = 1L; + instance.setMsgID(id); + assertEquals(id, instance.getMsgID()); + id = -1L; + instance.setMsgID(id); + assertEquals(id, instance.getMsgID()); } /** @@ -103,12 +99,9 @@ LLEvent instance = new LLEvent(); - long expResult = 0L; + long expResult = -1L; long result = instance.getMsgReply(); assertEquals(expResult, result); - - // TODO review the generated test code and remove the default call to fail. - fail("The test case is a prototype."); } /** @@ -121,9 +114,13 @@ LLEvent instance = new LLEvent(); instance.setMsgReply(reply); - - // TODO review the generated test code and remove the default call to fail. - fail("The test case is a prototype."); + assertEquals(reply, instance.getMsgReply()); + reply = 1L; + instance.setMsgReply(reply); + assertEquals(reply, instance.getMsgReply()); + reply = -1L; + instance.setMsgReply(reply); + assertEquals(reply, instance.getMsgReply()); } /** @@ -149,14 +146,12 @@ */ public void testSetInt() { System.out.println("setInt"); - - int val = 0; LLEvent instance = new LLEvent(); - instance.setInt(val); - - // TODO review the generated test code and remove the default call to fail. - fail("The test case is a prototype."); + instance.setInt(1); + assertEquals(1, instance.getInt()); + instance.setInt(-1); + assertEquals(-1, instance.getInt()); } /** @@ -166,28 +161,22 @@ System.out.println("getMap"); LLEvent instance = new LLEvent(); - - Map expResult = null; - Map result = instance.getMap(); - assertEquals(expResult, result); - - // TODO review the generated test code and remove the default call to fail. - fail("The test case is a prototype."); + Map r1 = instance.getMap(); + assertNotNull(r1); + Map r2 = instance.getMap(); + assertEquals(r1, r2); } - /** * Test of setMap method, of class org.jlink.net.ll.LLEvent. */ public void testSetMap() { System.out.println("setMap"); - Map m = null; + Map m = new HashMap(); LLEvent instance = new LLEvent(); instance.setMap(m); - - // TODO review the generated test code and remove the default call to fail. - fail("The test case is a prototype."); + assertEquals(m, instance.getMap()); } /** Modified: trunk/templates/maven2/pom.xml =================================================================== --- trunk/templates/maven2/pom.xml 2006-05-15 18:34:32 UTC (rev 8) +++ trunk/templates/maven2/pom.xml 2006-09-02 18:54:25 UTC (rev 9) @@ -2,11 +2,6 @@ <!--//////////////////////////////////////// /////////////General//////////////////// /////////////////////////////////////--> - <parent> - <artifactId>yamd-root</artifactId> - <groupId>org.welterde.yamd</groupId> - <version>0.0.1-SNAPSHOT</version> - </parent> <modelVersion>4.0.0</modelVersion> <groupId>org.jlink</groupId> <artifactId>${name}</artifactId> Added: trunk/util/apache-ant-1.6.5-bin.tar.bz2 =================================================================== (Binary files differ) Property changes on: trunk/util/apache-ant-1.6.5-bin.tar.bz2 ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/util/maven-2.0.4-bin.tar.bz2 =================================================================== (Binary files differ) Property changes on: trunk/util/maven-2.0.4-bin.tar.bz2 ___________________________________________________________________ Name: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |