Changeset 07b2e3e


Ignore:
Timestamp:
Jan 31, 2011 1:39:32 PM (9 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
e721ddd
Parents:
71dcbec (diff), 37fc448 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

merge of '5f4e1d5a5191ff6bd9063e019fc2b2be471e5e39'

and '86fb452a9d8592dad08f34af6d6517f6e18e3af8'

Files:
16 added
49 deleted
9 edited
4 moved

Legend:

Unmodified
Added
Removed
  • apps/desktopgui/build.xml

    r71dcbec r07b2e3e  
    11<?xml version="1.0" encoding="UTF-8"?>
    2 <!-- You may freely edit this file. See commented blocks below for -->
    3 <!-- some examples of how to customize the build. -->
    4 <!-- (If you delete it and reopen the project it will be recreated.) -->
    5 <!-- By default, only the Clean and Build commands use this build script. -->
    6 <!-- Commands such as Run, Debug, and Test only use this build script if -->
    7 <!-- the Compile on Save feature is turned off for the project. -->
    8 <!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
    9 <!-- in the project's Project Properties dialog box.-->
    10 <project name="desktopgui" default="default" basedir=".">
    11     <description>Builds, tests, and runs the project desktopgui.</description>
    12     <import file="nbproject/build-impl.xml"/>
    13     <!--
     2<project basedir="." default="all" name="desktopgui">
    143
    15     There exist several targets which are by default empty and which can be
    16     used for execution of your tasks. These targets are usually executed
    17     before and after some main targets. They are:
     4        <property name="src" value="src"/>
     5        <property name="build" value="build"/>
     6        <property name="dist"  location="dist"/>
     7        <property name="jar" value="desktopgui.jar"/>
     8        <property name="resources" value="resources"/>
     9    <property name="javadoc" value="javadoc"/>
    1810
    19       -pre-init:                 called before initialization of project properties
    20       -post-init:                called after initialization of project properties
    21       -pre-compile:              called before javac compilation
    22       -post-compile:             called after javac compilation
    23       -pre-compile-single:       called before javac compilation of single file
    24       -post-compile-single:      called after javac compilation of single file
    25       -pre-compile-test:         called before javac compilation of JUnit tests
    26       -post-compile-test:        called after javac compilation of JUnit tests
    27       -pre-compile-test-single:  called before javac compilation of single JUnit test
    28       -post-compile-test-single: called after javac compilation of single JUunit test
    29       -pre-jar:                  called before JAR building
    30       -post-jar:                 called after JAR building
    31       -post-clean:               called after cleaning build products
     11        <property name="javac.compilerargs" value=""/>
    3212
    33     (Targets beginning with '-' are not intended to be called on their own.)
     13        <target name="init">
     14                <mkdir dir="${build}"/>
     15        <mkdir dir="${build}/${resources}"/>
     16        <mkdir dir="${build}/${javadoc}"/>
     17                <mkdir dir="${dist}"/>
     18        </target>
    3419
    35     Example of inserting an obfuscator after compilation could look like this:
     20        <target name="clean">
     21                <delete dir="${build}"/>
     22                <delete dir="${dist}"/>
     23        </target>
    3624
    37         <target name="-post-compile">
    38             <obfuscate>
    39                 <fileset dir="${build.classes.dir}"/>
    40             </obfuscate>
    41         </target>
     25        <target name="compile" depends="init">
     26                <javac debug="true" deprecation="on" source="1.5" target="1.5"
     27                       srcdir="${src}" destdir="${build}">
     28            <compilerarg line="${javac.compilerargs}" />
     29            <classpath>
     30                <pathelement location="../../core/java/build/i2p.jar" />
     31                <!-- doesn't matter if we're not on win32, we just need the java classes, not the platform-dependent code -->
     32                <pathelement location="../../installer/lib/wrapper/win32/wrapper.jar" />
     33                <pathelement location="../../router/java/build/router.jar" />
     34            </classpath>
     35                </javac>
     36        <copy todir="${build}/desktopgui/${resources}">
     37            <fileset dir="${resources}" />
     38        </copy>
     39        </target>
    4240
    43     For list of available properties check the imported
    44     nbproject/build-impl.xml file.
     41        <target name="jar" depends="compile">
     42        <exec executable="sh" osfamily="unix" failifexecutionfails="true" >
     43            <arg value="./bundle-messages.sh" />
     44        </exec>
     45        <exec executable="sh" osfamily="mac" failifexecutionfails="true" >
     46            <arg value="./bundle-messages.sh" />
     47        </exec>
    4548
     49                <jar basedir="${build}" destfile="${dist}/${jar}">
     50                        <manifest>
     51                                <attribute name="Main-Class" value="net.i2p.desktopgui.Main"/>
     52                        </manifest>
     53                </jar>
     54        </target>
    4655
    47     Another way to customize the build is by overriding existing main targets.
    48     The targets of interest are:
    49 
    50       -init-macrodef-javac:     defines macro for javac compilation
    51       -init-macrodef-junit:     defines macro for junit execution
    52       -init-macrodef-debug:     defines macro for class debugging
    53       -init-macrodef-java:      defines macro for class execution
    54       -do-jar-with-manifest:    JAR building (if you are using a manifest)
    55       -do-jar-without-manifest: JAR building (if you are not using a manifest)
    56       run:                      execution of project
    57       -javadoc-build:           Javadoc generation
    58       test-report:              JUnit report generation
    59 
    60     An example of overriding the target for project execution could look like this:
    61 
    62         <target name="run" depends="BOB-impl.jar">
    63             <exec dir="bin" executable="launcher.exe">
    64                 <arg file="${dist.jar}"/>
    65             </exec>
    66         </target>
    67 
    68     Notice that the overridden target depends on the jar target and not only on
    69     the compile target as the regular run target does. Again, for a list of available
    70     properties which you can use, check the target you are overriding in the
    71     nbproject/build-impl.xml file.
    72 
    73     -->
    74     <property name="build_src" location="src"/>
    75     <property name="build_bin" location="bin"/>
    76     <property name="build_dist" location="dist"/>
    77     <property name="build_lib" location="lib"/>
    78     <property name="build_i2pref" location="../../build"/>
    79     <property name="build_routerconsole" location="../routerconsole/java/build/"/>
    80     <property name="build_i2ptunnel" location="../i2ptunnel/java/build/"/>
    81        
    82     <path id="build_classpath">
    83         <fileset dir="${build_lib}" includes="**/*.jar"/>
    84         <fileset dir="${build_i2pref}" includes="**/*.jar"/>
    85         <fileset dir="${build_routerconsole}" includes="**/*.jar"/>
    86         <fileset dir="${build_i2ptunnel}" includes="**/*.jar"/>
    87     </path>
    88     <target name="build_init">
    89         <!-- Create the time stamp -->
    90         <tstamp/>
    91             <mkdir dir="${build_dist}"/>
    92             <mkdir dir="${build_bin}"/>
    93     </target>
    94     <target name="build_compile" depends="build_init"
    95         description="compile the source " >
    96         <!-- Compile the java code from ${src} into ${bin} -->
    97         <javac srcdir="${build_src}" destdir="${build_bin}"  classpathref="build_classpath"/>
    98             <copy todir="${build_bin}">
    99                 <fileset dir="${build_src}">
    100                         <exclude name="**/*.java"/>
    101                 </fileset>
    102             </copy>
    103     </target>
    104     <target name="build_jar" depends="build_compile"
    105         description="generate the distribution" >
    106         <!-- Create the distribution directory -->
    107         <mkdir dir="${build_dist}/lib"/>
    108 
    109         <!-- Put everything in ${build} into the MyProject-${DSTAMP}.jar file -->
    110         <zip destfile="${build_dist}/desktopgui.jar" basedir="${build_bin}" />
     56    <target name="javadoc">
     57        <mkdir dir="${build}" />
     58        <mkdir dir="${build}/${javadoc}" />
     59        <javadoc
     60            sourcepath="${src}" destdir="${build}/${javadoc}"
     61            packagenames="*"
     62            use="true"
     63            splitindex="true"
     64            windowtitle="Desktopgui">
     65            <classpath>
     66                <pathelement location="../../router/java/build/router.jar" />
     67                <pathelement location="../../core/java/build/i2p.jar" />
     68            </classpath>
     69        </javadoc>
    11170    </target>
    11271
    113     <target name="build_clean"
    114         description="clean up" >
    115         <!-- Delete the ${build} and ${dist} directory trees -->
    116         <delete dir="${build_bin}"/>
    117         <delete dir="${build_dist}"/>
     72    <target name="poupdate">
     73        <exec executable="sh" osfamily="unix" failifexecutionfails="true" >
     74            <arg value="./bundle-messages.sh" />
     75            <arg value="-p" />
     76        </exec>
     77        <exec executable="sh" osfamily="mac" failifexecutionfails="true" >
     78            <arg value="./bundle-messages.sh" />
     79            <arg value="-p" />
     80        </exec>
    11881    </target>
     82
     83        <target name="dist" depends="jar" />   
     84        <target name="all" depends="jar" />
    11985</project>
     86
  • apps/routerconsole/java/build.xml

    r71dcbec r07b2e3e  
    2525                <pathelement location="../../systray/java/build/obj" />
    2626                <pathelement location="../../systray/java/lib/systray4j.jar" />
     27                <pathelement location="../../desktopgui/build" />
    2728                <pathelement location="../../../installer/lib/wrapper/win32/wrapper.jar" /> <!-- we dont care if we're not on win32 -->
    2829                <pathelement location="../../jrobin/jrobin-1.4.0.jar" />
     
    5556                <pathelement location="../../systray/java/build/systray.jar" />
    5657                <pathelement location="../../systray/java/lib/systray4j.jar" />
     58                <pathelement location="../../desktopgui/dist/desktopgui.jar" />
    5759                <pathelement location="../../../installer/lib/wrapper/win32/wrapper.jar" /> <!-- we dont care if we're not on win32 -->
    5860                <pathelement location="../../jrobin/jrobin-1.4.0.jar" />
     
    162164                <pathelement location="../../systray/java/build/obj" />
    163165                <pathelement location="../../systray/java/lib/systray4j.jar" />
     166                <pathelement location="../../desktopgui/dist/desktopgui.jar" />
    164167                <pathelement location="../../../installer/lib/wrapper/win32/wrapper.jar" />
    165168                <pathelement location="build/routerconsole.jar" />
     
    192195                <pathelement location="../../systray/java/build/obj" />
    193196                <pathelement location="../../systray/java/lib/systray4j.jar" />
     197                <pathelement location="../../desktopgui/dist/desktopgui.jar" />
    194198                <pathelement location="../../../installer/lib/wrapper/win32/wrapper.jar" />
    195199                <pathelement location="build/routerconsole.jar" />
     
    221225        <mkdir dir="./build/javadoc" />
    222226        <javadoc
    223             sourcepath="./src:../../../core/java/src:../../../router/java/src:../../systray/java/src" destdir="./build/javadoc"
     227            sourcepath="./src:../../../core/java/src:../../../router/java/src:../../systray/java/src:../../desktopgui/src" destdir="./build/javadoc"
    224228            packagenames="*"
    225229            use="true"
  • apps/routerconsole/java/src/net/i2p/router/web/ConfigServiceHandler.java

    r71dcbec r07b2e3e  
    8989            }
    9090            addFormNotice("Threads dumped to wrapper.log");
    91         } else if (_("Show systray icon").equals(_action)) {
    92             try {
    93                 SysTray tray = SysTray.getInstance();
    94                 if (tray != null) {
    95                     tray.show();
    96                     addFormNotice(_("System tray icon enabled."));
    97                 } else {
    98                     addFormNotice(_("System tray icon feature not supported on this platform. Sorry!"));
    99                 }
    100             } catch (Throwable t) {
    101                 addFormError(_("Warning: unable to contact the systray manager") + " - " + t.getMessage());
    102             }
    103         } else if (_("Hide systray icon").equals(_action)) {
    104             try {
    105                 SysTray tray = SysTray.getInstance();
    106                 if (tray != null) {
    107                     tray.hide();
    108                     addFormNotice(_("System tray icon disabled."));
    109                 } else {
    110                     addFormNotice(_("System tray icon feature not supported on this platform. Sorry!"));
    111                 }
    112             } catch (Throwable t) {
    113                 addFormError(_("Warning: unable to contact the systray manager") + " - " + t.getMessage());
    114             }
    11591        } else if (_("View console on startup").equals(_action)) {
    11692            browseOnStartup(true);
  • apps/routerconsole/java/src/net/i2p/router/web/ContentHelper.java

    r71dcbec r07b2e3e  
    1919        _startAtBeginning = Boolean.valueOf(""+moo).booleanValue();
    2020    }
    21     public void setLang(String l) { _lang = l; }
     21    public void setLang(String l) {
     22        if((_lang == null || !_lang.equals(l)) && (l != null)) {
     23            //Set language for router console
     24            _lang = l;
     25
     26            if(_context == null) {
     27                setContextId(null);
     28            }
     29
     30            //Set language persistently throughout I2P
     31            _context.router().setConfigSetting(Messages.PROP_LANG, _lang);
     32            _context.router().saveConfig();
     33            _context.setProperty(Messages.PROP_LANG, _lang);
     34        }
     35    }
    2236   
    2337    public void setMaxLines(String lines) {
  • apps/routerconsole/java/src/net/i2p/router/web/RouterConsoleRunner.java

    r71dcbec r07b2e3e  
    1111
    1212import net.i2p.I2PAppContext;
    13 import net.i2p.apps.systray.SysTray;
     13import net.i2p.desktopgui.Main;
    1414import net.i2p.data.Base32;
    1515import net.i2p.data.DataHelper;
     
    2020import net.i2p.util.SecureFileOutputStream;
    2121import net.i2p.util.ShellCommand;
     22import net.i2p.util.VersionComparator;
    2223
    2324import org.mortbay.http.DigestAuthenticator;
     
    302303
    303304        try {
    304             SysTray tray = SysTray.getInstance();
     305                //TODO: move away from routerconsole into a separate application.
     306                //ApplicationManager?
     307                VersionComparator v = new VersionComparator();
     308                if(v.compare(System.getProperty("java.runtime.version"), "1.6") >= 0) {
     309                String[] args = new String[0];
     310                net.i2p.desktopgui.Main.beginStartup(args);     
     311                }
    305312        } catch (Throwable t) {
    306313            t.printStackTrace();
  • apps/routerconsole/jsp/configservice.jsp

    r71dcbec r07b2e3e  
    4343
    4444 <% if ( (System.getProperty("os.name") != null) && (System.getProperty("os.name").startsWith("Win")) ) { %>
    45  <h3><%=intl._("Systray integration")%></h3>
    46  <p><%=intl._("On the windows platform, there is a small application to sit in the system tray, allowing you to view the router's status")%>
    47     <%=intl._("(later on, I2P client applications will be able to integrate their own functionality into the system tray as well).")%>
    48     <%=intl._("If you are on windows, you can either enable or disable that icon here.")%></p>
    49  <hr><div class="formaction">
    50  <input type="submit" name="action" value="<%=intl._("Show systray icon")%>" >
    51  <input type="submit" name="action" value="<%=intl._("Hide systray icon")%>" >
    52 </div><h3><%=intl._("Run on startup")%></h3>
     45 <h3><%=intl._("Run on startup")%></h3>
    5346 <p><%=intl._("You can control whether I2P is run on startup or not by selecting one of the following options - I2P will install (or remove) a service accordingly.")%>
    5447    <%=intl._("If you prefer the command line, you can also run the ")%> <code>install_i2p_service_winnt.bat</code> (<%=intl._("or")%>
  • build.xml

    r71dcbec r07b2e3e  
    3333        <echo message="  distclean: clean up all derived files" />
    3434        <echo message="  syndie:    generate a standalone syndie install" />
     35        <echo message="  desktopgui: generate a standalone desktopgui install" />
    3536        <echo message="  i2psnark:  generate a standalone i2psnark install" />
    3637        <echo message="  justBOB:  generate a standalone BOB-one.jar" />
     
    4142        <echo message="          (libc6-i686 and libc6-amd64 required, ant>=1.8 required)" />
    4243        <echo message="  debianrepo: build a Debian repository (reprepro required)" />
    43         <echo message="  updaterWithDesktopgui: tar the built files and desktopgui in an i2pupdate.zip" />
    44         <echo message="  pkgWithDesktopgui: distclean then package everything up with the desktopgui" />
    45         <echo message="  distWithDesktopgui: pkgWithDesktopgui and javadoc" />
    46         <echo message="  distcleanWithDesktopgui: clean up all derived files (including desktopgui files)" />
    4744        <echo message="  poupdate: update the .po files for translators" />
    4845    </target>
     
    6562    <target name="builddep" depends="builddepSmall, buildBOB, buildSAM, buildSusiMail, buildSusiDNS, buildI2PSnark" />
    6663
    67     <target name="builddepSmall" depends="buildrouter, buildSystray, buildRouterConsole, buildStreaming, buildI2PTunnel, buildAddressbook" />
     64    <target name="builddepSmall" depends="buildrouter, buildSystray, buildDesktopGui, buildRouterConsole, buildStreaming, buildI2PTunnel, buildAddressbook" />
    6865
    6966    <!-- start of buildX, one for each sub-build.xml.
     
    10198    </target>
    10299
    103     <target name="buildRouterConsole" depends="buildrouter, buildSystray, buildJetty" >
     100    <target name="buildDesktopGui" depends="buildCore, buildrouter" >
     101        <ant dir="apps/desktopgui" target="jar" />
     102    </target>
     103
     104    <target name="buildRouterConsole" depends="buildrouter, buildSystray, buildDesktopGui, buildJetty" >
    104105        <ant dir="apps/routerconsole/java/" target="jar" />
    105106    </target>
     
    169170            <manifest>
    170171             <attribute name="Main-Class" value="net.i2p.router.RouterLaunch" />
    171              <attribute name="Class-Path" value="lib/i2p.jar lib/router.jar lib/jbigi.jar lib/BOB.jar lib/sam.jar lib/mstreaming.jar lib/streaming.jar lib/routerconsole.jar lib/i2ptunnel.jar lib/org.mortbay.jetty.jar lib/javax.servlet.jar lib/jasper-compiler.jar lib/jasper-runtime.jar lib/commons-logging.jar lib/commons-el.jar lib/wrapper.jar lib/systray.jar lib/systray4j.jar" />
     172             <attribute name="Class-Path" value="lib/i2p.jar lib/router.jar lib/jbigi.jar lib/BOB.jar lib/sam.jar lib/mstreaming.jar lib/streaming.jar lib/routerconsole.jar lib/i2ptunnel.jar lib/org.mortbay.jetty.jar lib/javax.servlet.jar lib/jasper-compiler.jar lib/jasper-runtime.jar lib/commons-logging.jar lib/commons-el.jar lib/wrapper.jar lib/systray.jar lib/systray4j.jar lib/desktopgui.jar" />
    172173            </manifest>
    173174        </jar>
     
    196197        <copy file="apps/i2ptunnel/java/build/i2ptunnel.war" todir="build/" />
    197198        <copy file="apps/systray/java/build/systray.jar" todir="build/" />
     199        <copy file="apps/desktopgui/dist/desktopgui.jar" todir="build/" />
    198200        <copy file="installer/lib/jbigi/jbigi.jar" todir="build" />
    199201        <copy file="apps/addressbook/dist/addressbook.war" todir="build/" />
     
    205207        <ant dir="apps/i2ptunnel/java/" target="poupdate" />
    206208        <ant dir="apps/susidns/src/" target="poupdate" />
     209        <ant dir="apps/desktopgui" target="poupdate" />
    207210    </target>
    208211    <target name="javadoc">
     
    250253            <group title="SusiMail Application" packages="i2p.susi.webmail:i2p.susi.webmail.*:i2p.susi.debug:i2p.susi.util" />
    251254            <group title="Systray Application" packages="net.i2p.apps.systray" />
     255            <group title="Desktopgui Application" packages="net.i2p.desktopgui.*" />
    252256            <sourcepath>
    253257                <pathelement location="core/java/src" />
     
    259263                <pathelement location="apps/i2ptunnel/java/src" />
    260264                <pathelement location="apps/systray/java/src" />
     265                <pathelement location="apps/desktopgui/src" />
    261266                <pathelement location="apps/routerconsole/java/src" />
    262267                <pathelement location="apps/addressbook/java/src" />
     
    305310        <ant dir="apps/sam/java/" target="distclean" />
    306311        <ant dir="apps/BOB" target="clean" />
     312        <ant dir="apps/desktopgui" target="clean" />
    307313        <ant dir="apps/routerconsole/java/" target="distclean" />
    308314        <ant dir="apps/addressbook/" target="distclean" />
     
    436442        <copy file="build/org.mortbay.jetty.jar" todir="pkg-temp/lib/" />
    437443        <copy file="build/router.jar" todir="pkg-temp/lib/" />
     444        <copy file="build/desktopgui.jar" todir="pkg-temp/lib/" />
    438445        <copy file="build/routerconsole.jar" todir="pkg-temp/lib/" />
    439446        <!-- pulled out of routerconsole.jar in 0.7.12; name without version so we can overwrite if we upgrade  -->
     
    606613        <!-- include systray changes in 0.7.5 -->
    607614        <copy file="build/systray.jar" todir="pkg-temp/lib/" />
     615        <copy file="build/desktopgui.jar" todir="pkg-temp/lib/" />
    608616        <copy file="build/susimail.war" todir="pkg-temp/webapps/" />
    609617        <copy file="build/susidns.war" todir="pkg-temp/webapps/" />
     
    780788            <arg value="build/mstreaming.jar"/>
    781789            <arg value="build/router.jar/"/>
     790            <arg value="build/desktopgui.jar"/>
    782791            <arg value="build/routerconsole.jar"/>
    783792            <arg value="build/routerconsole.war"/>
     
    790799        <echo message="Findbugs output stored in i2p.fba" />
    791800        <echo message="Now run: findbugs i2p.fba" />
    792     </target>
    793     <target name="buildWithDesktopgui" depends="buildrouter,builddepSmall">
    794         <ant dir="apps/desktopgui" target="build_jar" />
    795     </target>
    796     <target name="preppkgWithDesktopgui" depends="buildWithDesktopgui,preppkg">
    797         <copy file="apps/desktopgui/dist/desktopgui.jar" todir="pkg-temp/lib/" />
    798         <copy file="apps/desktopgui/lib/swing-worker.jar" todir="pkg-temp/lib/" />
    799         <copy file="apps/desktopgui/lib/appframework.jar" todir="pkg-temp/lib/" />
    800         <mkdir dir="pkg-temp/desktopgui/resources/" />
    801         <copy todir="pkg-temp/desktopgui/resources/">
    802             <fileset dir="apps/desktopgui/desktopgui/resources/" />
    803         </copy>
    804     </target>
    805     <target name="installerWithDesktopgui" depends="preppkgWithDesktopgui,installer" />
    806     <target name="prepupdateWithDesktopgui" depends="buildWithDesktopgui,prepupdate">
    807         <copy file="apps/desktopgui/dist/desktopgui.jar" todir="pkg-temp/lib/" />
    808         <copy file="apps/desktopgui/lib/swing-worker.jar" todir="pkg-temp/lib/" />
    809         <copy file="apps/desktopgui/lib/appframework.jar" todir="pkg-temp/lib/" />
    810         <mkdir dir="pkg-temp/desktopgui/resources/" />
    811         <copy todir="pkg-temp/desktopgui/resources/">
    812             <fileset dir="apps/desktopgui/desktopgui/resources/" />
    813         </copy>
    814     </target>
    815     <target name="updaterWithDesktopgui" depends="prepupdateWithDesktopgui,updater" />
    816     <target name="pkgWithDesktopgui" depends="distclean, updaterWithDesktopgui, installerWithDesktopgui, preppkg" />
    817     <target name="distWithDesktopgui" depends="pkgWithDesktopgui, javadoc" />
    818     <target name="distcleanWithDesktopgui" depends="distclean">
    819         <ant dir="apps/desktopgui" target="build_clean" />
    820801    </target>
    821802
  • core/java/src/net/i2p/I2PAppContext.java

    r71dcbec r07b2e3e  
    3131import net.i2p.util.FileUtil;
    3232import net.i2p.util.FortunaRandomSource;
     33import net.i2p.util.I2PProperties;
    3334import net.i2p.util.KeyRing;
    3435import net.i2p.util.LogManager;
     
    3637import net.i2p.util.RandomSource;
    3738import net.i2p.util.SecureDirectory;
     39import net.i2p.util.I2PProperties.I2PPropertyCallback;
    3840
    3941/**
     
    6668    protected static I2PAppContext _globalAppContext;
    6769   
    68     private Properties _overrideProps;
     70    protected I2PProperties _overrideProps;
    6971   
    7072    private StatManager _statManager;
     
    169171            }
    170172        }
    171         _overrideProps = envProps;
     173        _overrideProps = new I2PProperties(envProps);
    172174        _statManager = null;
    173175        _sessionKeyManager = null;
     
    485487   
    486488    /**
     489     * Add a callback, which will fire upon changes in the property
     490     * given in the specific callback.
     491     * Unimplemented in I2PAppContext: this only makes sense in a router context.
     492     * @param callback The implementation of the callback.
     493     */
     494    public void addPropertyCallback(I2PPropertyCallback callback) {}
     495   
     496    /**
    487497     * The statistics component with which we can track various events
    488498     * over time.
  • router/java/src/net/i2p/router/RouterContext.java

    r71dcbec r07b2e3e  
    2525import net.i2p.util.Clock;
    2626import net.i2p.util.KeyRing;
     27import net.i2p.util.I2PProperties.I2PPropertyCallback;
    2728
    2829/**
     
    106107        return envProps;
    107108    }
     109   
     110    /**
     111     * Modify the configuration attributes of this context, changing
     112     * one of the properties provided during the context construction.
     113     * @param propName The name of the property.
     114     * @param value The new value for the property.
     115     */
     116    public void setProperty(String propName, String value) {
     117        if(_overrideProps != null) {
     118                _overrideProps.setProperty(propName, value);
     119        }
     120    }
     121
     122   
     123    public void addPropertyCallback(I2PPropertyCallback callback) {
     124        _overrideProps.addCallBack(callback);
     125    }
     126
    108127
    109128    public void initAll() {
Note: See TracChangeset for help on using the changeset viewer.