001    /**
002     * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.kernel.cluster;
016    
017    import java.util.List;
018    
019    /**
020     * @author Shuyang Zhou
021     */
022    public interface ClusterExecutor {
023    
024            public void addClusterEventListener(
025                    ClusterEventListener clusterEventListener);
026    
027            public void destroy();
028    
029            public FutureClusterResponses execute(ClusterRequest clusterRequest);
030    
031            public FutureClusterResponses execute(
032                    ClusterRequest clusterRequest,
033                    ClusterResponseCallback clusterResponseCallback);
034    
035            public List<ClusterEventListener> getClusterEventListeners();
036    
037            public List<Address> getClusterNodeAddresses();
038    
039            public List<ClusterNode> getClusterNodes();
040    
041            public ClusterNode getLocalClusterNode();
042    
043            public Address getLocalClusterNodeAddress();
044    
045            public void initialize();
046    
047            public boolean isClusterNodeAlive(Address address);
048    
049            public boolean isClusterNodeAlive(String clusterNodeId);
050    
051            public boolean isEnabled();
052    
053            public void removeClusterEventListener(
054                    ClusterEventListener clusterEventListener);
055    
056    }