com.alibaba.dubbo.remoting.exchange.ExchangeClient Java Examples

The following examples show how to use com.alibaba.dubbo.remoting.exchange.ExchangeClient. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DubboInvoker.java    From dubbo3 with Apache License 2.0 6 votes vote down vote up
public void destroy() {
    //防止client被关闭多次.在connect per jvm的情况下,client.close方法会调用计数器-1,当计数器小于等于0的情况下,才真正关闭
    if (!super.isDestroyed()) {
        //dubbo check ,避免多次关闭
        destroyLock.lock();
        try {
            if (super.isDestroyed()) {
                return;
            }
            super.destroy();
            if (invokers != null) {
                invokers.remove(this);
            }
            for (ExchangeClient client : clients) {
                try {
                    client.close();
                } catch (Throwable t) {
                    logger.warn(t.getMessage(), t);
                }
            }

        } finally {
            destroyLock.unlock();
        }
    }
}
 
Example #2
Source File: ChanelHandlerTest.java    From dubbo-2.6.5 with Apache License 2.0 6 votes vote down vote up
@Test
public void testClient() throws Throwable {
    // read server info from property
    if (PerformanceUtils.getProperty("server", null) == null) {
        logger.warn("Please set -Dserver=127.0.0.1:9911");
        return;
    }
    final String server = System.getProperty("server", "127.0.0.1:9911");
    final String transporter = PerformanceUtils.getProperty(Constants.TRANSPORTER_KEY, Constants.DEFAULT_TRANSPORTER);
    final String serialization = PerformanceUtils.getProperty(Constants.SERIALIZATION_KEY, Constants.DEFAULT_REMOTING_SERIALIZATION);
    final int timeout = PerformanceUtils.getIntProperty(Constants.TIMEOUT_KEY, Constants.DEFAULT_TIMEOUT);
    int sleep = PerformanceUtils.getIntProperty("sleep", 60 * 1000 * 60);

    final String url = "exchange://" + server + "?transporter=" + transporter + "&serialization=" + serialization + "&timeout=" + timeout;
    ExchangeClient exchangeClient = initClient(url);
    Thread.sleep(sleep);
    closeClient(exchangeClient);
}
 
Example #3
Source File: DubboProtocol.java    From dubbox with Apache License 2.0 6 votes vote down vote up
private ExchangeClient[] getClients(URL url){
    //是否共享连接
    boolean service_share_connect = false;
    int connections = url.getParameter(Constants.CONNECTIONS_KEY, 0);
    //如果connections不配置,则共享连接,否则每服务每连接
    if (connections == 0){
        service_share_connect = true;
        connections = 1;
    }
    
    ExchangeClient[] clients = new ExchangeClient[connections];
    for (int i = 0; i < clients.length; i++) {
        if (service_share_connect){
            clients[i] = getSharedClient(url);
        } else {
            clients[i] = initClient(url);
        }
    }
    return clients;
}
 
Example #4
Source File: DubboProtocol.java    From dubbox-hystrix with Apache License 2.0 6 votes vote down vote up
private ExchangeClient[] getClients(URL url){
    //是否共享连接
    boolean service_share_connect = false;
    int connections = url.getParameter(Constants.CONNECTIONS_KEY, 0);
    //如果connections不配置,则共享连接,否则每服务每连接
    if (connections == 0){
        service_share_connect = true;
        connections = 1;
    }
    
    ExchangeClient[] clients = new ExchangeClient[connections];
    for (int i = 0; i < clients.length; i++) {
        if (service_share_connect){
            clients[i] = getSharedClient(url);
        } else {
            clients[i] = initClient(url);
        }
    }
    return clients;
}
 
Example #5
Source File: DubboProtocol.java    From dubbox with Apache License 2.0 6 votes vote down vote up
private ExchangeClient[] getClients(URL url){
    //是否共享连接
    boolean service_share_connect = false;
    int connections = url.getParameter(Constants.CONNECTIONS_KEY, 0);
    //如果connections不配置,则共享连接,否则每服务每连接
    if (connections == 0){
        service_share_connect = true;
        connections = 1;
    }
    
    ExchangeClient[] clients = new ExchangeClient[connections];
    for (int i = 0; i < clients.length; i++) {
        if (service_share_connect){
            clients[i] = getSharedClient(url);
        } else {
            clients[i] = initClient(url);
        }
    }
    return clients;
}
 
Example #6
Source File: ThriftInvoker.java    From dubbox with Apache License 2.0 6 votes vote down vote up
@Override
public boolean isAvailable() {

    if (!super.isAvailable()) {
        return false;
    }

    for (ExchangeClient client : clients){
        if (client.isConnected()
                && !client.hasAttribute(Constants.CHANNEL_ATTRIBUTE_READONLY_KEY)){
            //cannot write == not Available ?
            return true ;
        }
    }
    return false;
}
 
Example #7
Source File: ThriftInvoker.java    From dubbox with Apache License 2.0 6 votes vote down vote up
@Override
public boolean isAvailable() {

    if (!super.isAvailable()) {
        return false;
    }

    for (ExchangeClient client : clients){
        if (client.isConnected()
                && !client.hasAttribute(Constants.CHANNEL_ATTRIBUTE_READONLY_KEY)){
            //cannot write == not Available ?
            return true ;
        }
    }
    return false;
}
 
Example #8
Source File: ChanelHandlerTest.java    From dubbox with Apache License 2.0 6 votes vote down vote up
@Test
public void testClient() throws Throwable {
    // 读取参数
    if (PerformanceUtils.getProperty("server", null) == null) {
        logger.warn("Please set -Dserver=127.0.0.1:9911");
        return;
    }
    final String server = System.getProperty("server", "127.0.0.1:9911");
    final String transporter = PerformanceUtils.getProperty(Constants.TRANSPORTER_KEY, Constants.DEFAULT_TRANSPORTER);
    final String serialization = PerformanceUtils.getProperty(Constants.SERIALIZATION_KEY, Constants.DEFAULT_REMOTING_SERIALIZATION);
    final int timeout = PerformanceUtils.getIntProperty(Constants.TIMEOUT_KEY, Constants.DEFAULT_TIMEOUT);
    int sleep = PerformanceUtils.getIntProperty("sleep", 60*1000*60);
    
    final String url = "exchange://" + server + "?transporter=" + transporter + "&serialization=" + serialization + "&timeout=" + timeout;
    ExchangeClient exchangeClient =initClient(url);
    Thread.sleep(sleep);
    closeClient(exchangeClient);
}
 
Example #9
Source File: DubboProtocol.java    From dubbox with Apache License 2.0 6 votes vote down vote up
/**
     *获取共享连接 
     */
    private ExchangeClient getSharedClient(URL url){
        String key = url.getAddress();
        ReferenceCountExchangeClient client = referenceClientMap.get(key);
        if ( client != null ){
            if ( !client.isClosed()){
                client.incrementAndGetCount();
                return client;
            } else {
//                logger.warn(new IllegalStateException("client is closed,but stay in clientmap .client :"+ client));
                referenceClientMap.remove(key);
            }
        }
        ExchangeClient exchagneclient = initClient(url);
        
        client = new ReferenceCountExchangeClient(exchagneclient, ghostClientMap);
        referenceClientMap.put(key, client);
        ghostClientMap.remove(key);
        return client; 
    }
 
Example #10
Source File: RegistryProtocolTest.java    From dubbox with Apache License 2.0 6 votes vote down vote up
@Test
public void testExport() {
    RegistryProtocol registryProtocol = new RegistryProtocol();
    registryProtocol.setCluster(new FailfastCluster());
    registryProtocol.setRegistryFactory(ExtensionLoader.getExtensionLoader(RegistryFactory.class).getAdaptiveExtension());

    Protocol dubboProtocol = DubboProtocol.getDubboProtocol();
    registryProtocol.setProtocol(dubboProtocol);
    URL newRegistryUrl = registryUrl.addParameter(Constants.EXPORT_KEY, serviceUrl);
    DubboInvoker<DemoService> invoker = new DubboInvoker<DemoService>(DemoService.class,
            newRegistryUrl, new ExchangeClient[] { new MockedClient("10.20.20.20", 2222, true) });
    Exporter<DemoService> exporter = registryProtocol.export(invoker);
    Exporter<DemoService> exporter2 = registryProtocol.export(invoker);
    //同一个invoker,多次export的exporter不同
    Assert.assertNotSame(exporter, exporter2);
    exporter.unexport();
    exporter2.unexport();
    
}
 
Example #11
Source File: DubboProtocol.java    From dubbox-hystrix with Apache License 2.0 6 votes vote down vote up
/**
     *获取共享连接 
     */
    private ExchangeClient getSharedClient(URL url){
        String key = url.getAddress();
        ReferenceCountExchangeClient client = referenceClientMap.get(key);
        if ( client != null ){
            if ( !client.isClosed()){
                client.incrementAndGetCount();
                return client;
            } else {
//                logger.warn(new IllegalStateException("client is closed,but stay in clientmap .client :"+ client));
                referenceClientMap.remove(key);
            }
        }
        ExchangeClient exchagneclient = initClient(url);
        
        client = new ReferenceCountExchangeClient(exchagneclient, ghostClientMap);
        referenceClientMap.put(key, client);
        ghostClientMap.remove(key);
        return client; 
    }
 
Example #12
Source File: ChanelHandlerTest.java    From dubbo3 with Apache License 2.0 6 votes vote down vote up
@Test
public void testClient() throws Throwable {
    // 读取参数
    if (PerformanceUtils.getProperty("server", null) == null) {
        logger.warn("Please set -Dserver=127.0.0.1:9911");
        return;
    }
    final String server = System.getProperty("server", "127.0.0.1:9911");
    final String transporter = PerformanceUtils.getProperty(Constants.TRANSPORTER_KEY, Constants.DEFAULT_TRANSPORTER);
    final String serialization = PerformanceUtils.getProperty(Constants.SERIALIZATION_KEY, Constants.DEFAULT_REMOTING_SERIALIZATION);
    final int timeout = PerformanceUtils.getIntProperty(Constants.TIMEOUT_KEY, Constants.DEFAULT_TIMEOUT);
    int sleep = PerformanceUtils.getIntProperty("sleep", 60*1000*60);
    
    final String url = "exchange://" + server + "?transporter=" + transporter + "&serialization=" + serialization + "&timeout=" + timeout;
    ExchangeClient exchangeClient =initClient(url);
    Thread.sleep(sleep);
    closeClient(exchangeClient);
}
 
Example #13
Source File: RegistryProtocolTest.java    From dubbo-2.6.5 with Apache License 2.0 6 votes vote down vote up
@Test
public void testExport() {
    RegistryProtocol registryProtocol = new RegistryProtocol();
    registryProtocol.setCluster(new FailfastCluster());
    registryProtocol.setRegistryFactory(ExtensionLoader.getExtensionLoader(RegistryFactory.class).getAdaptiveExtension());

    Protocol dubboProtocol = DubboProtocol.getDubboProtocol();
    registryProtocol.setProtocol(dubboProtocol);
    URL newRegistryUrl = registryUrl.addParameter(Constants.EXPORT_KEY, serviceUrl);
    DubboInvoker<DemoService> invoker = new DubboInvoker<DemoService>(DemoService.class,
            newRegistryUrl, new ExchangeClient[]{new MockedClient("10.20.20.20", 2222, true)});
    Exporter<DemoService> exporter = registryProtocol.export(invoker);
    Exporter<DemoService> exporter2 = registryProtocol.export(invoker);
    //The same invoker, exporter that multiple exported are different
    Assert.assertNotSame(exporter, exporter2);
    exporter.unexport();
    exporter2.unexport();

}
 
Example #14
Source File: ChanelHandlerTest.java    From dubbox with Apache License 2.0 6 votes vote down vote up
@Test
public void testClient() throws Throwable {
    // 读取参数
    if (PerformanceUtils.getProperty("server", null) == null) {
        logger.warn("Please set -Dserver=127.0.0.1:9911");
        return;
    }
    final String server = System.getProperty("server", "127.0.0.1:9911");
    final String transporter = PerformanceUtils.getProperty(Constants.TRANSPORTER_KEY, Constants.DEFAULT_TRANSPORTER);
    final String serialization = PerformanceUtils.getProperty(Constants.SERIALIZATION_KEY, Constants.DEFAULT_REMOTING_SERIALIZATION);
    final int timeout = PerformanceUtils.getIntProperty(Constants.TIMEOUT_KEY, Constants.DEFAULT_TIMEOUT);
    int sleep = PerformanceUtils.getIntProperty("sleep", 60*1000*60);
    
    final String url = "exchange://" + server + "?transporter=" + transporter + "&serialization=" + serialization + "&timeout=" + timeout;
    ExchangeClient exchangeClient =initClient(url);
    Thread.sleep(sleep);
    closeClient(exchangeClient);
}
 
Example #15
Source File: ChanelHandlerTest.java    From dubbox with Apache License 2.0 6 votes vote down vote up
@Test
public void testClient() throws Throwable {
    // 读取参数
    if (PerformanceUtils.getProperty("server", null) == null) {
        logger.warn("Please set -Dserver=127.0.0.1:9911");
        return;
    }
    final String server = System.getProperty("server", "127.0.0.1:9911");
    final String transporter = PerformanceUtils.getProperty(Constants.TRANSPORTER_KEY, Constants.DEFAULT_TRANSPORTER);
    final String serialization = PerformanceUtils.getProperty(Constants.SERIALIZATION_KEY, Constants.DEFAULT_REMOTING_SERIALIZATION);
    final int timeout = PerformanceUtils.getIntProperty(Constants.TIMEOUT_KEY, Constants.DEFAULT_TIMEOUT);
    int sleep = PerformanceUtils.getIntProperty("sleep", 60*1000*60);
    
    final String url = "exchange://" + server + "?transporter=" + transporter + "&serialization=" + serialization + "&timeout=" + timeout;
    ExchangeClient exchangeClient =initClient(url);
    Thread.sleep(sleep);
    closeClient(exchangeClient);
}
 
Example #16
Source File: ThriftProtocol.java    From dubbox with Apache License 2.0 5 votes vote down vote up
private ExchangeClient[] getClients(URL url){

        int connections = url.getParameter(Constants.CONNECTIONS_KEY, 1);

        ExchangeClient[] clients = new ExchangeClient[connections];

        for (int i = 0; i < clients.length; i++) {
            clients[i] = initClient(url);
        }
        return clients;
    }
 
Example #17
Source File: ExchangeServerPeer.java    From dubbo-2.6.5 with Apache License 2.0 5 votes vote down vote up
@Override
public ExchangeChannel getExchangeChannel(InetSocketAddress remoteAddress) {
    String host = remoteAddress.getAddress() != null ? remoteAddress.getAddress().getHostAddress() : remoteAddress.getHostName();
    int port = remoteAddress.getPort();
    ExchangeChannel channel = super.getExchangeChannel(remoteAddress);
    if (channel == null) {
        for (Map.Entry<URL, ExchangeClient> entry : clients.entrySet()) {
            URL url = entry.getKey();
            if (url.getIp().equals(host) && url.getPort() == port) {
                return entry.getValue();
            }
        }
    }
    return channel;
}
 
Example #18
Source File: ExchangeClientFactory.java    From dubbox with Apache License 2.0 5 votes vote down vote up
protected ExchangeClient createClient(String targetIP, int targetPort, int connectTimeout) throws Exception {
    StringBuilder url = new StringBuilder();
    url.append("exchange://");
    url.append(targetIP);
    url.append(":");
    url.append(targetPort);
    url.append("?");
    url.append("timeout=");
    url.append(connectTimeout);
    return Exchangers.connect(url.toString());
}
 
Example #19
Source File: DubboInvoker.java    From dubbox-hystrix with Apache License 2.0 5 votes vote down vote up
@Override
public boolean isAvailable() {
    if (!super.isAvailable())
        return false;
    for (ExchangeClient client : clients){
        if (client.isConnected() && !client.hasAttribute(Constants.CHANNEL_ATTRIBUTE_READONLY_KEY)){
            //cannot write == not Available ?
            return true ;
        }
    }
    return false;
}
 
Example #20
Source File: ExchangeClientFactory.java    From dubbox with Apache License 2.0 5 votes vote down vote up
public void removeClient(String key, ExchangeClient ExchangeClient) {
    try {
        // TODO: Fix It
        clients.remove(key);
        // clients.get(key).get().remove(ExchangeClient);
        // clients.get(key)
        // .get()
        // .add(createClient(ExchangeClient.getServerIP(),
        // ExchangeClient.getServerPort(), ExchangeClient.getConnectTimeout(),
        // key));
    } catch (Exception e) {
        // IGNORE
    }
}
 
Example #21
Source File: DubboInvoker.java    From dubbox with Apache License 2.0 5 votes vote down vote up
public DubboInvoker(Class<T> serviceType, URL url, ExchangeClient[] clients, Set<Invoker<?>> invokers){
    super(serviceType, url, new String[] {Constants.INTERFACE_KEY, Constants.GROUP_KEY, Constants.TOKEN_KEY, Constants.TIMEOUT_KEY});
    this.clients = clients;
    // get version.
    this.version = url.getParameter(Constants.VERSION_KEY, "0.0.0");
    this.invokers = invokers; 
}
 
Example #22
Source File: ExchangeClientFactory.java    From dubbox with Apache License 2.0 5 votes vote down vote up
public void removeClient(String key, ExchangeClient ExchangeClient) {
    try {
        // TODO: Fix It
        clients.remove(key);
        // clients.get(key).get().remove(ExchangeClient);
        // clients.get(key)
        // .get()
        // .add(createClient(ExchangeClient.getServerIP(),
        // ExchangeClient.getServerPort(), ExchangeClient.getConnectTimeout(),
        // key));
    } catch (Exception e) {
        // IGNORE
    }
}
 
Example #23
Source File: ExchangeServerPeer.java    From dubbox with Apache License 2.0 5 votes vote down vote up
@Override
public ExchangeChannel getExchangeChannel(InetSocketAddress remoteAddress) {
    String host = remoteAddress.getAddress() != null ? remoteAddress.getAddress().getHostAddress() : remoteAddress.getHostName();
    int port = remoteAddress.getPort();
    ExchangeChannel channel = super.getExchangeChannel(remoteAddress);
    if (channel == null) {
        for (Map.Entry<URL, ExchangeClient> entry : clients.entrySet()) {
            URL url = entry.getKey();
            if (url.getIp().equals(host) && url.getPort() == port) {
                return entry.getValue();
            }
        }
    }
    return channel;
}
 
Example #24
Source File: RegistryProtocolTest.java    From dubbox with Apache License 2.0 5 votes vote down vote up
@Test(expected = IllegalArgumentException.class)
public void testExportUrlNull() {
    RegistryProtocol registryProtocol = new RegistryProtocol();
    registryProtocol.setCluster(new FailfastCluster());

    Protocol dubboProtocol = DubboProtocol.getDubboProtocol();
    registryProtocol.setProtocol(dubboProtocol);
    Invoker<DemoService> invoker = new DubboInvoker<DemoService>(DemoService.class,
            registryUrl, new ExchangeClient[] { new MockedClient("10.20.20.20", 2222, true) });
    registryProtocol.export(invoker);
}
 
Example #25
Source File: PortTelnetHandlerTest.java    From dubbo3 with Apache License 2.0 5 votes vote down vote up
@Test
public void testListClient() throws Exception {
    ExchangeClient client1 = Exchangers.connect("dubbo://127.0.0.1:20887/demo");
    ExchangeClient client2 = Exchangers.connect("dubbo://127.0.0.1:20887/demo");
    Thread.sleep(5000);
    String result = port.telnet(null, "-l 20887");
    String client1Addr = client1.getLocalAddress().toString();
    String client2Addr = client2.getLocalAddress().toString();
    System.out.printf("Result: %s %n", result);
    System.out.printf("Client 1 Address %s %n", client1Addr);
    System.out.printf("Client 2 Address %s %n", client2Addr);
    assertTrue(result.contains(client1Addr));
    assertTrue(result.contains(client2Addr));

}
 
Example #26
Source File: ReferenceCountExchangeClient.java    From dubbox with Apache License 2.0 5 votes vote down vote up
public ReferenceCountExchangeClient(ExchangeClient client, ConcurrentMap<String, LazyConnectExchangeClient> ghostClientMap) {
    this.client = client;
    refenceCount.incrementAndGet();
    this.url = client.getUrl();
    if (ghostClientMap == null){
        throw new IllegalStateException("ghostClientMap can not be null, url: " + url);
    }
    this.ghostClientMap = ghostClientMap;
}
 
Example #27
Source File: ChanelHandlerTest.java    From dubbox with Apache License 2.0 5 votes vote down vote up
public static  ExchangeClient initClient(String url){
    // 创建客户端
    ExchangeClient exchangeClient  = null;
    PeformanceTestHandler handler = new PeformanceTestHandler(url);
    boolean run = true;
    while(run){
        try{
            exchangeClient= Exchangers.connect(url,handler);
        } catch (Throwable t){
            
            if(t!=null && t.getCause()!=null && t.getCause().getClass()!=null && (t.getCause().getClass()==java.net.ConnectException.class 
                    || t.getCause().getClass()== java.net.ConnectException.class)){
                
            }else {
                t.printStackTrace();
            }
            
            try {
                Thread.sleep(50);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
        if (exchangeClient != null) {
            run = false;
        }
    }
    return exchangeClient;
}
 
Example #28
Source File: DubboProtocol.java    From dubbox-hystrix with Apache License 2.0 5 votes vote down vote up
/**
 * 创建新连接.
 */
private ExchangeClient initClient(URL url) {
    
    // client type setting.
    String str = url.getParameter(Constants.CLIENT_KEY, url.getParameter(Constants.SERVER_KEY, Constants.DEFAULT_REMOTING_CLIENT));

    String version = url.getParameter(Constants.DUBBO_VERSION_KEY);
    boolean compatible = (version != null && version.startsWith("1.0."));
    url = url.addParameter(Constants.CODEC_KEY, Version.isCompatibleVersion() && compatible ? COMPATIBLE_CODEC_NAME : DubboCodec.NAME);
    //默认开启heartbeat
    url = url.addParameterIfAbsent(Constants.HEARTBEAT_KEY, String.valueOf(Constants.DEFAULT_HEARTBEAT));
    
    // BIO存在严重性能问题,暂时不允许使用
    if (str != null && str.length() > 0 && ! ExtensionLoader.getExtensionLoader(Transporter.class).hasExtension(str)) {
        throw new RpcException("Unsupported client type: " + str + "," +
                " supported client type is " + StringUtils.join(ExtensionLoader.getExtensionLoader(Transporter.class).getSupportedExtensions(), " "));
    }
    
    ExchangeClient client ;
    try {
        //设置连接应该是lazy的 
        if (url.getParameter(Constants.LAZY_CONNECT_KEY, false)){
            client = new LazyConnectExchangeClient(url ,requestHandler);
        } else {
            client = Exchangers.connect(url ,requestHandler);
        }
    } catch (RemotingException e) {
        throw new RpcException("Fail to create remoting client for service(" + url
                + "): " + e.getMessage(), e);
    }
    return client;
}
 
Example #29
Source File: ChanelHandlerTest.java    From dubbox-hystrix with Apache License 2.0 5 votes vote down vote up
public static  ExchangeClient initClient(String url){
    // 创建客户端
    ExchangeClient exchangeClient  = null;
    PeformanceTestHandler handler = new PeformanceTestHandler(url);
    boolean run = true;
    while(run){
        try{
            exchangeClient= Exchangers.connect(url,handler);
        } catch (Throwable t){
            
            if(t!=null && t.getCause()!=null && t.getCause().getClass()!=null && (t.getCause().getClass()==java.net.ConnectException.class 
                    || t.getCause().getClass()== java.net.ConnectException.class)){
                
            }else {
                t.printStackTrace();
            }
            
            try {
                Thread.sleep(50);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
        if (exchangeClient != null) {
            run = false;
        }
    }
    return exchangeClient;
}
 
Example #30
Source File: ThriftInvoker.java    From dubbox with Apache License 2.0 5 votes vote down vote up
public void destroy() {
    //防止client被关闭多次.在connect per jvm的情况下,client.close方法会调用计数器-1,当计数器小于等于0的情况下,才真正关闭
    if (super.isDestroyed()){
        return ;
    } else {
        //dubbo check ,避免多次关闭
        destroyLock.lock();

        try{

            if (super.isDestroyed()){
                return ;
            }

            super.destroy();

            if(invokers != null) {
                invokers.remove(this);
            }

            for (ExchangeClient client : clients) {

                try {
                    client.close();
                } catch (Throwable t) {
                    logger.warn(t.getMessage(), t);
                }

            }

        }finally {
            destroyLock.unlock();
        }

    }

}