public class InjvmExporterListener extends ExporterListenerAdapter
which is used to listen for changes to the InjvmExporter instances.
It maintains two ConcurrentHashMaps, one to keep track of the ExporterChangeListeners registered for each service,
and another to keep track of the currently exported services and their associated Exporter instances.
It overrides the exported and unexported methods to add or remove the corresponding Exporter instances to/from
the exporters ConcurrentHashMap, and to notify all registered ExporterChangeListeners of the change.
It also provides methods to add or remove ExporterChangeListeners for a specific service, and to retrieve the
currently exported Exporter instance for a given service.
| 构造器和说明 |
|---|
InjvmExporterListener() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addExporterChangeListener(ExporterChangeListener listener,
String serviceKey)
Adds an ExporterChangeListener for a specific service, and notifies the listener of the current Exporter instance
if it exists.
|
void |
exported(Exporter<?> exporter)
Overrides the exported method to add the given exporter to the exporters ConcurrentHashMap,
and to notify all registered ExporterChangeListeners of the export event.
|
void |
removeExporterChangeListener(ExporterChangeListener listener,
String listenerKey)
Removes an ExporterChangeListener for a specific service.
|
void |
unexported(Exporter<?> exporter)
Overrides the unexported method to remove the given exporter from the exporters ConcurrentHashMap,
and to notify all registered ExporterChangeListeners of the unexport event.
|
public void exported(Exporter<?> exporter) throws RpcException
and to notify all registered ExporterChangeListeners of the export event.
exported 在接口中 ExporterListenerexported 在类中 ExporterListenerAdapterexporter - The Exporter instance that has been exported.RpcException - If there is an error during the export process.Protocol.export(Invoker)public void unexported(Exporter<?> exporter) throws RpcException
and to notify all registered ExporterChangeListeners of the unexport event.
unexported 在接口中 ExporterListenerunexported 在类中 ExporterListenerAdapterexporter - The Exporter instance that has been unexported.RpcException - If there is an error during the unexport process.Exporter.unexport()public void addExporterChangeListener(ExporterChangeListener listener, String serviceKey)
if it exists.
listener - The ExporterChangeListener to add.serviceKey - The service key for the service to listen for changes on.public void removeExporterChangeListener(ExporterChangeListener listener, String listenerKey)
listener - The ExporterChangeListener to remove.listenerKey - The service key for the service to remove the listener from.Copyright © 2011–2020 The Apache Software Foundation. All rights reserved.