Class ScopeClusterInvoker<T>
java.lang.Object
org.apache.dubbo.rpc.cluster.support.wrapper.ScopeClusterInvoker<T>
- Type Parameters:
T- the type of service interface
- All Implemented Interfaces:
org.apache.dubbo.common.Node,ClusterInvoker<T>,Invoker<T>,ExporterChangeListener
public class ScopeClusterInvoker<T>
extends Object
implements ClusterInvoker<T>, ExporterChangeListener
ScopeClusterInvoker is a cluster invoker which handles the invocation logic of a single service in a specific scope.
It selects between local and remote invoker at runtime.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddestroy()Invoker<?> org.apache.dubbo.common.URLorg.apache.dubbo.common.URLgetUrl()invoke(Invocation invocation) Checks if the current ScopeClusterInvoker is exported to the local JVM and invokes the corresponding Invoker.booleanbooleanvoidonExporterChangeExport(Exporter<?> exporter) voidonExporterChangeUnExport(Exporter<?> exporter) toString()Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.dubbo.rpc.cluster.ClusterInvoker
hasProxyInvokers, isServiceDiscovery
-
Constructor Details
-
ScopeClusterInvoker
-
-
Method Details
-
getUrl
public org.apache.dubbo.common.URL getUrl()- Specified by:
getUrlin interfaceorg.apache.dubbo.common.Node
-
getRegistryUrl
public org.apache.dubbo.common.URL getRegistryUrl()- Specified by:
getRegistryUrlin interfaceClusterInvoker<T>
-
getDirectory
- Specified by:
getDirectoryin interfaceClusterInvoker<T>
-
isDestroyed
public boolean isDestroyed()- Specified by:
isDestroyedin interfaceClusterInvoker<T>
-
isAvailable
public boolean isAvailable()- Specified by:
isAvailablein interfaceorg.apache.dubbo.common.Node
-
destroy
public void destroy()- Specified by:
destroyin interfaceorg.apache.dubbo.common.Node
-
getInterface
- Specified by:
getInterfacein interfaceInvoker<T>
-
invoke
Checks if the current ScopeClusterInvoker is exported to the local JVM and invokes the corresponding Invoker. If it's not exported locally, then it delegates the invocation to the original Invoker.- Specified by:
invokein interfaceInvoker<T>- Parameters:
invocation- the invocation to be performed- Returns:
- the result of the invocation
- Throws:
RpcException- if there was an error during the invocation
-
onExporterChangeExport
- Specified by:
onExporterChangeExportin interfaceExporterChangeListener
-
onExporterChangeUnExport
- Specified by:
onExporterChangeUnExportin interfaceExporterChangeListener
-
getInvoker
-
toString
-