java.lang.Object
net.i2p.app.ClientAppManagerImpl
- All Implemented Interfaces:
ClientAppManager
- Direct Known Subclasses:
RouterAppManager
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.
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ConcurrentHashMap<String, ClientApp> Registered name to client.Constructor Summary
ConstructorsMethod Summary
All MethodsModifier and TypeMethodDescriptiongetRegisteredApp(String name) Get a registered app.voidnotify(ClientApp app, ClientAppState state, String message, Exception e) Does nothing.booleanRegister with the manager under the given name, so that other clients may find it.voidunregister(ClientApp app) Unregister with the manager.
Field Details
_registered
Registered name to client.
Constructor Details
ClientAppManagerImpl
Creates a new ClientAppManagerImpl.- Parameters:
ctx- the I2P app context
Method Details
notify
Does nothing.- Specified by:
notifyin interfaceClientAppManager- Parameters:
app- non-nullstate- non-nullmessage- may be nulle- may be null
register
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 interfaceClientAppManager- Parameters:
app- non-null- Returns:
- true if successful, false if duplicate name
unregister
Unregister with the manager. Name must be the same as that fromregister(ClientApp). Only required for apps used by other apps.- Specified by:
unregisterin interfaceClientAppManager- Parameters:
app- non-null
getRegisteredApp
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 interfaceClientAppManager- Parameters:
name- non-null- Returns:
- client app or null