Package net.i2p.app
Class ClientAppManagerImpl
- java.lang.Object
- 
- net.i2p.app.ClientAppManagerImpl
 
- 
- All Implemented Interfaces:
- ClientAppManager
 - Direct Known Subclasses:
- RouterAppManager
 
 public class ClientAppManagerImpl extends Object implements ClientAppManager A simple ClientAppManager that supports register/unregister only, so that client apps may find each other in AppContext. See RouterAppManager for the real thing in RouterContext.- Since:
- 0.9.30
 
- 
- 
Field SummaryFields Modifier and Type Field Description protected ConcurrentHashMap<String,ClientApp>_registered
 - 
Constructor SummaryConstructors Constructor Description ClientAppManagerImpl(I2PAppContext ctx)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description ClientAppgetRegisteredApp(String name)Get a registered app.voidnotify(ClientApp app, ClientAppState state, String message, Exception e)Does nothing.booleanregister(ClientApp app)Register with the manager under the given name, so that other clients may find it.voidunregister(ClientApp app)Unregister with the manager.
 
- 
- 
- 
Field Detail- 
_registeredprotected final ConcurrentHashMap<String,ClientApp> _registered 
 
- 
 - 
Constructor Detail- 
ClientAppManagerImplpublic ClientAppManagerImpl(I2PAppContext ctx) 
 
- 
 - 
Method Detail- 
notifypublic void notify(ClientApp app, ClientAppState state, String message, Exception e) Does nothing.- Specified by:
- notifyin interface- ClientAppManager
- Parameters:
- app- non-null
- state- non-null
- message- may be null
- e- may be null
 
 - 
registerpublic boolean register(ClientApp app) Register with the manager under the given name, so that other clients may find it. Only required for apps used by other apps.- Specified by:
- registerin interface- ClientAppManager
- Parameters:
- app- non-null
- Returns:
- true if successful, false if duplicate name
 
 - 
unregisterpublic void unregister(ClientApp app) Unregister with the manager. Name must be the same as that from register(). Only required for apps used by other apps.- Specified by:
- unregisterin interface- ClientAppManager
- Parameters:
- app- non-null
 
 - 
getRegisteredApppublic ClientApp getRegisteredApp(String name) Get a registered app. Only used for apps finding other apps. Do not hold a static reference. If you only need to find a port, use the PortMapper instead.- Specified by:
- getRegisteredAppin interface- ClientAppManager
- Parameters:
- name- non-null
- Returns:
- client app or null
 
 
- 
 
-