diff --git a/i2p2www/pages/site/docs/applications/managed-clients.html b/i2p2www/pages/site/docs/applications/managed-clients.html new file mode 100644 index 0000000000000000000000000000000000000000..f22ac324dc1f5ddf8f3d2a91f95adb81b52158de --- /dev/null +++ b/i2p2www/pages/site/docs/applications/managed-clients.html @@ -0,0 +1,76 @@ +{% extends "global/layout.html" %} +{% block title %}{% trans %}Managed Clients{% endtrans %}{% endblock %} +{% block lastupdated %}{% trans %}February 2014{% endtrans %}{% endblock %} +{% block accuratefor %}0.9.11{% endblock %} +{% block content %} + +<h2>{% trans %}Overview{% endtrans %}</h2> +<p>{% trans configspec=site_url('docs/spec/configuration') -%} +Clients may be started directly by the router when they are listed +in the <a href="{{ configspec }}">clients.config</a> file. +These clients may be "managed" or "unmanaged". +This is handled by the ClientAppManager. +Additionally, managed or unmanaged clients may register with the +ClientAppManager so that other clients may retrieve a reference to them. +There is also a simple Port Mapper facility for clients to register an +internal port that other clients may look up. +{%- endtrans %}</p> + + +<h2>{% trans %}Managed Clients{% endtrans %}</h2> +<p>{% trans -%} +As of release 0.9.4, the router supports managed clients. +Managed clients are instantiated and started by the ClientAppManager. +The ClientAppManager maintains a reference to the client and receives updates on the client's state. +Managed clients are preferred, as it is much easier to implement state tracking +and to start and stop a client. It also is much easier to avoid static references in the client code +which could lead to excessive memory usage after a client is stopped. +Managed clients may be started and stopped by the user in the router console, +and are stopped at router shutdown. +{%- endtrans %}</p> +<p>{% trans -%} +Managed clients implement either the net.i2p.app.ClientApp or net.i2p.router.app.RouterApp interface. +Clients implementing the ClientApp interface must provide the following constructor: +{%- endtrans %}</p> +<pre> + public MyClientApp(I2PAppContext context, ClientAppManager listener, String[] args) +</pre> +<p>{% trans -%} +Clients implementing the RouterApp interface must provide the following constructor: +{%- endtrans %}</p> +<pre> + public MyClientApp(RouterContext context, ClientAppManager listener, String[] args) +</pre> +<p>{% trans -%} +The arguments provided are specified in the clients.config file. +{%- endtrans %}</p> + +<h2>{% trans %}Unmanaged Clients{% endtrans %}</h2> +<p>{% trans -%} +If the main class specified in the clients.config file does not implement a managed interface, +it will be started with main() with the arguments specified, +and stopped with main() with the arguments specified. +The router does not maintain a reference, since all interactions are via the static main() method. +The console cannot provide accurate state information to the user. +{%- endtrans %}</p> + +<h2>{% trans %}Registered Clients{% endtrans %}</h2> +<p>{% trans -%} +Clients, whether managed or unmanaged, may register with the ClientAppManager +so that other clients may retrieve a reference to them. +Registration is by name. +Known registered clients are: +{%- endtrans %}</p> +<pre> + console, i2ptunnel, Jetty, outproxy, update +</pre> + +<h2>{% trans %}Port Mapper{% endtrans %}</h2> +<p>{% trans -%} +The router also provides a simple mechanism for clients to find an internal socket service, +such as the HTTP proxy. This is provided by the Port Mapper. +Registration is by name. +Clients that register generally provide an internal emulated socket on that port. +{%- endtrans %}</p> + +{% endblock %} diff --git a/i2p2www/pages/site/docs/index.html b/i2p2www/pages/site/docs/index.html index 2901b17b551031c00eaf81c63c9dce614f12bcf1..c0ac6d866460f0e727f2f698a86c43ae51a8c2f5 100644 --- a/i2p2www/pages/site/docs/index.html +++ b/i2p2www/pages/site/docs/index.html @@ -41,6 +41,7 @@ If you find any inaccuracies in the documents linked below, please <li><a href="{{ site_url('docs/plugins') }}">{{ _('Plugins Overview') }}</a></li> <li><a href="{{ site_url('docs/spec/plugin') }}">{{ _('Plugin Specification') }}</a></li> <li><a href="{{ site_url('docs/spec/updates') }}">{{ _('Router software updates') }}</a></li> +<li><a href="{{ site_url('docs/applications/managed-clients') }}">{{ _('Managed Clients') }}</a></li> <li><a href="{{ site_url('docs/applications/bittorrent') }}">{{ _('Bittorrent over I2P') }}</a></li> <li><a href="{{ site_url('docs/api/i2pcontrol') }}">{{ _('I2PControl Plugin API') }}</a></li> <li><a href="{{ site_url('docs/spec/blockfile') }}">{{ _('hostsdb.blockfile Format') }}</a></li> diff --git a/i2p2www/pages/site/docs/spec/configuration.html b/i2p2www/pages/site/docs/spec/configuration.html index 26005cfc1cab060e601edca6841a418da56e4715..5b2ab5ce67312261131ab3e8d2e274af3d9c6da5 100644 --- a/i2p2www/pages/site/docs/spec/configuration.html +++ b/i2p2www/pages/site/docs/spec/configuration.html @@ -103,35 +103,6 @@ to the console. Clients may be "managed" or "unmanaged". </p> -<h4>Managed Clients</h4> -<p> -As of release 0.9.4, the router supports "managed" clients. -Managed clients are instantiated and started by the <code>ClientAppManager</code>. -The ClientAppManager maintains a reference to the client and receives updates on the client's state. -Managed clients are preferred, as it is much easier to implement state tracking -and to start and stop a client. It also is much easier to avoid static references in the client code -which could lead to excessive memory usage after a client is stopped. -</p> -<p> -Managed clients implement either the <code>net.i2p.app.ClientApp</code> or -<code>net.i2p.router.app.RouterApp</code> interface. -Clients implementing the ClientApp interface MUST provide the following constructor: -<pre> - public MyClientApp(I2PAppContext context, ClientAppManager listener, String[] args) -</pre> -Clients implementing the RouterApp interface MUST provide the following constructor: -<pre> - public MyClientApp(RouterContext context, ClientAppManager listener, String[] args) -</pre> -The args will be the arguments specified in the clients.config file. -</p> - -<h4>Unmanaged Clients</h4> -<p> -If the main class does not implement a managed interface, -it will be started with main() with the arguments specified, -and stopped with main() with the arguments specified. -</p> <h3>{% trans %}Logger{% endtrans %} (logger.config)</h3> <p>{% trans -%}