[ 
https://issues.apache.org/jira/browse/IGNITE-12879?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Mikhail Petrov updated IGNITE-12879:
------------------------------------
    Description: 
It's needed to change DiscoveryHook class method naming to the following:
{code:java}
public void beforeDiscovery(DiscoverySpiCustomMessage msg)

public void afterDiscovery(DiscoverySpiCustomMessage msg)
{code}
It will help to clarify the purpose of the methods.

It's needed to add the ability to configure multiple DiscoveryHook instances 
through TestTcpDiscoverySpi for discovery messages interception. It helps to 
avoid redefinition of the TestTcpDiscoverySpi and its reconfiguration. The 
current approach is as follows:
{code:java}
TcpDiscoverySpi spi = new TestTcpDiscoverySpi() {
    @Override public void setListener(@Nullable DiscoverySpiListener lsnr) {
        super.setListener(DiscoverySpiListenerWrapper.wrap(lsnr, 
discoveryHook));
    }
};

spi.setIpFinder(((TcpDiscoverySpi)cfg.getDiscoverySpi()).getIpFinder());
{code}

  was:
It's needed to change DiscoveryHook class method naming to the following:
{code:java}
public void beforeDiscovery(DiscoverySpiCustomMessage msg)

public void afterDiscovery(DiscoverySpiCustomMessage msg)
{code}
It helps to clarify the purpose of the methods.

It's needed to add the ability to configure multiple DiscoveryHook instances 
through TestTcpDiscoverySpi for discovery messages interception. It helps to 
avoid redefinition of the TestTcpDiscoverySpi and its reconfiguration. The 
current approach is as follows:
{code:java}
TcpDiscoverySpi spi = new TestTcpDiscoverySpi() {
    @Override public void setListener(@Nullable DiscoverySpiListener lsnr) {
        super.setListener(DiscoverySpiListenerWrapper.wrap(lsnr, 
discoveryHook));
    }
};

spi.setIpFinder(((TcpDiscoverySpi)cfg.getDiscoverySpi()).getIpFinder());
{code}


> Refactor test configuration of discovery messages interceptors.
> ---------------------------------------------------------------
>
>                 Key: IGNITE-12879
>                 URL: https://issues.apache.org/jira/browse/IGNITE-12879
>             Project: Ignite
>          Issue Type: Improvement
>            Reporter: Mikhail Petrov
>            Assignee: Mikhail Petrov
>            Priority: Minor
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> It's needed to change DiscoveryHook class method naming to the following:
> {code:java}
> public void beforeDiscovery(DiscoverySpiCustomMessage msg)
> public void afterDiscovery(DiscoverySpiCustomMessage msg)
> {code}
> It will help to clarify the purpose of the methods.
> It's needed to add the ability to configure multiple DiscoveryHook instances 
> through TestTcpDiscoverySpi for discovery messages interception. It helps to 
> avoid redefinition of the TestTcpDiscoverySpi and its reconfiguration. The 
> current approach is as follows:
> {code:java}
> TcpDiscoverySpi spi = new TestTcpDiscoverySpi() {
>     @Override public void setListener(@Nullable DiscoverySpiListener lsnr) {
>         super.setListener(DiscoverySpiListenerWrapper.wrap(lsnr, 
> discoveryHook));
>     }
> };
> spi.setIpFinder(((TcpDiscoverySpi)cfg.getDiscoverySpi()).getIpFinder());
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to