http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/GemFireMemberStatus.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/GemFireMemberStatus.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/GemFireMemberStatus.java new file mode 100755 index 0000000..6bac386 --- /dev/null +++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/GemFireMemberStatus.java @@ -0,0 +1,670 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.apache.geode.internal.admin.api; + +import org.apache.geode.cache.Cache; +import org.apache.geode.cache.Region; +import org.apache.geode.cache.client.PoolManager; +import org.apache.geode.cache.server.CacheServer; +import org.apache.geode.distributed.DistributedSystem; +import org.apache.geode.distributed.Locator; +import org.apache.geode.distributed.internal.DM; +import org.apache.geode.distributed.internal.DistributionConfig; +import org.apache.geode.distributed.internal.InternalDistributedSystem; +import org.apache.geode.distributed.internal.membership.InternalDistributedMember; +import org.apache.geode.internal.net.SocketCreator; +import org.apache.geode.internal.admin.ClientHealthMonitoringRegion; +import org.apache.geode.internal.admin.remote.ClientHealthStats; +import org.apache.geode.internal.cache.*; +import org.apache.geode.internal.cache.tier.InternalClientMembership; +import org.apache.geode.internal.cache.tier.sockets.ClientProxyMembershipID; + +import java.io.IOException; +import java.io.Serializable; +import java.net.InetAddress; +import java.util.*; + +/** + * Class <code>GemFireMemberStatus</code> provides the status of a specific GemFire member VM. This + * VM can be a peer, a client, a server and/or a gateway. + * + * @deprecated as of 7.0 use the <code><a href= + * "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code> + * package instead + */ +public class GemFireMemberStatus implements Serializable { + private static final long serialVersionUID = 3389997790525991310L; + + /** + * Notifies whether this member is a client to a cache server. + */ + protected boolean _isClient; + + /** + * Notifies whether this member is a cache server. + */ + protected boolean _isServer; + + /** + * Notifies whether this member is a hub for WAN gateways. + */ + protected boolean _isGatewayHub; + + /** + * Notifies whether this member is a locator. + */ + protected boolean _isLocator; + + protected boolean _isPrimaryGatewayHub; + + protected Object/* GatewayHubStatus */ _gatewayHubStatus; + + protected boolean _isConnected; + protected Serializable _memberId; + protected Set _connectedPeers; + protected Set _connectedServers; + protected Set _unconnectedServers; + protected Set _connectedClients; + protected Map _connectedIncomingGateways; + protected Map _outgoingGateways; + + protected Map _clientHostNames; + protected Map _clientQueueSizes; + protected Map _gatewayQueueSizes; + protected Map _regionStatuses; + protected Map _clientHealthStats; + + protected String _memberName; + protected int _mcastPort; + protected int _serverPort; + protected InetAddress _mcastAddress; + protected String _bindAddress; + protected String _locators; + protected InetAddress _hostAddress; + + protected long _maximumHeapSize; + protected long _freeHeapSize; + + protected long upTime = -1; + + protected transient final Cache cache; + + public GemFireMemberStatus() { + this(null); + } + + public GemFireMemberStatus(Cache cache) { + this.cache = cache; + DistributedSystem ds = null; + if (cache != null) { + ds = cache.getDistributedSystem(); + } + initialize(ds); + } + + public boolean getIsConnected() { + return this._isConnected; + } + + protected void setIsConnected(boolean isConnected) { + this._isConnected = isConnected; + } + + /** + * Returns whether this member is a client to a cache server + * + * @return whether this member is a client to a cache server + */ + public boolean getIsClient() { + return this._isClient; + } + + /** + * Sets whether this member is a client to a cache server + * + * @param isClient Boolean defining whether this member is a client to a cache server + */ + protected void setIsClient(boolean isClient) { + this._isClient = isClient; + } + + /** + * Returns whether this member is a cache server + * + * @return whether this member is a cache server + */ + public boolean getIsServer() { + return this._isServer; + } + + /** + * Sets whether this member is a cache server + * + * @param isServer Boolean defining whether this member is a cache server + */ + protected void setIsServer(boolean isServer) { + this._isServer = isServer; + } + + public int getServerPort() { + return this._serverPort; + } + + protected void setServerPort(int port) { + this._serverPort = port; + } + + /** + * Returns whether this member is a hub for WAN gateways + * + * @return whether this member is a hub for WAN gateways + */ + public boolean getIsGatewayHub() { + return this._isGatewayHub; + } + + /** + * Sets whether this member is a cache server + * + * @param isGatewayHub Boolean defining whether this member is a hub for WAN gateways + */ + protected void setIsGatewayHub(boolean isGatewayHub) { + this._isGatewayHub = isGatewayHub; + } + + public boolean getIsLocator() { + return this._isLocator; + } + + protected void setIsLocator(boolean isLocator) { + this._isLocator = isLocator; + } + + public boolean getIsPrimaryGatewayHub() { + return this._isPrimaryGatewayHub; + } + + protected void setIsPrimaryGatewayHub(boolean isPrimaryGatewayHub) { + this._isPrimaryGatewayHub = isPrimaryGatewayHub; + } + + /** + * For internal use only + * + * @return status of the gateway hub + */ + public Object/* GatewayHubStatus */ getGatewayHubStatus() { + return this._gatewayHubStatus; + } + + // protected void setGatewayHubStatus(GatewayHubStatus gatewayHubStatus) { + // this._gatewayHubStatus = gatewayHubStatus; + // } + + public boolean getIsSecondaryGatewayHub() { + return !this._isPrimaryGatewayHub; + } + + public Set getConnectedPeers() { + return this._connectedPeers; + } + + protected void setConnectedPeers(Set connectedPeers) { + this._connectedPeers = connectedPeers; + } + + public Set getConnectedServers() { + return this._connectedServers; + } + + protected void setConnectedServers(Set connectedServers) { + this._connectedServers = connectedServers; + } + + protected void addConnectedServer(String connectedServer) { + this._connectedServers.add(connectedServer); + } + + public Set getUnconnectedServers() { + return this._unconnectedServers; + } + + protected void setUnconnectedServers(Set unconnectedServers) { + this._unconnectedServers = unconnectedServers; + } + + protected void addUnconnectedServer(String unconnectedServer) { + this._unconnectedServers.add(unconnectedServer); + } + + public Set getConnectedClients() { + return this._connectedClients; + } + + protected void addConnectedClient(String connectedClient) { + this._connectedClients.add(connectedClient); + } + + public Map getOutgoingGateways() { + return this._outgoingGateways; + } + + public Map getConnectedIncomingGateways() { + return this._connectedIncomingGateways; + } + + protected void setConnectedIncomingGateways(Map connectedIncomingGateways) { + this._connectedIncomingGateways = connectedIncomingGateways; + } + + public Map getClientQueueSizes() { + return this._clientQueueSizes; + } + + protected void setClientQueueSizes(Map clientQueueSizes) { + this._clientQueueSizes = clientQueueSizes; + } + + public int getClientQueueSize(String clientMemberId) { + Integer clientQueueSize = (Integer) getClientQueueSizes().get(clientMemberId); + return clientQueueSize == null ? 0 : clientQueueSize.intValue(); + } + + protected void putClientQueueSize(String clientMemberId, int size) { + getClientQueueSizes().put(clientMemberId, Integer.valueOf(size)); + } + + public Map getClientHealthStats() { + return this._clientHealthStats; + } + + protected void setClientHealthStats(Map stats) { + this._clientHealthStats = stats; + } + + /** + * For internal use only + * + * @param clientID client for health + * @return the client's health + */ + public Object/* ClientHealthStats */ getClientHealthStats(String clientID) { + return this._clientHealthStats.get(clientID); + } + + protected void setClientHealthStats(String clientID, ClientHealthStats stats) { + this._clientHealthStats.put(clientID, stats); + } + + protected void putClientHostName(String clientId, String hostName) { + this._clientHostNames.put(clientId, hostName); + } + + public String getClientHostName(String clientId) { + return (String) this._clientHostNames.get(clientId); + } + + public Map getRegionStatuses() { + return this._regionStatuses; + } + + /** + * For internal use only + * + * @param fullRegionPath region path + * @return status for the region + */ + public Object/* RegionStatus */ getRegionStatus(String fullRegionPath) { + return getRegionStatuses().get(fullRegionPath); + } + + protected void putRegionStatus(String fullRegionPath, RegionStatus status) { + getRegionStatuses().put(fullRegionPath, status); + } + + public Serializable getMemberId() { + return this._memberId; + } + + protected void setMemberId(Serializable memberId) { + this._memberId = memberId; + } + + public String getMemberName() { + return this._memberName; + } + + protected void setMemberName(String memberName) { + this._memberName = memberName; + } + + public int getMcastPort() { + return this._mcastPort; + } + + protected void setMcastPort(int mcastPort) { + this._mcastPort = mcastPort; + } + + public InetAddress getMcastAddress() { + return this._mcastAddress; + } + + protected void setMcastAddress(InetAddress mcastAddress) { + this._mcastAddress = mcastAddress; + } + + public InetAddress getHostAddress() { + return this._hostAddress; + } + + protected void setHostAddress(InetAddress hostAddress) { + this._hostAddress = hostAddress; + } + + public String getBindAddress() { + return this._bindAddress; + } + + protected void setBindAddress(String bindAddress) { + this._bindAddress = bindAddress; + } + + public String getLocators() { + return this._locators; + } + + protected void setLocators(String locators) { + this._locators = locators; + } + + public long getMaximumHeapSize() { + return this._maximumHeapSize; + } + + protected void setMaximumHeapSize(long size) { + this._maximumHeapSize = size; + } + + public long getFreeHeapSize() { + return this._freeHeapSize; + } + + protected void setFreeHeapSize(long size) { + this._freeHeapSize = size; + } + + public long getUsedHeapSize() { + return getMaximumHeapSize() - getFreeHeapSize(); + } + + public long getUpTime() { + return upTime; + } + + public void setUpTime(long upTime) { + this.upTime = upTime; + } + + @Override + public String toString() { + StringBuffer buffer = new StringBuffer(); + buffer.append("GemFireMemberStatus[").append("isConnected=").append(this._isConnected) + .append("; memberName=").append(this._memberName).append("; memberId=") + .append(this._memberId).append("; hostAddress=").append(this._hostAddress) + .append("; mcastPort=").append(this._mcastPort).append("; mcastAddress=") + .append(this._mcastAddress).append("; bindAddress=").append(this._bindAddress) + .append("; serverPort=").append(this._serverPort).append("; locators=") + .append(this._locators).append("; isClient=").append(this._isClient).append("; isServer=") + .append(this._isServer).append("; isGatewayHub=").append(this._isGatewayHub) + .append("; isLocator=").append(this._isLocator).append("; isPrimaryGatewayHub=") + .append(this._isPrimaryGatewayHub).append("; gatewayHubStatus=") + .append(this._gatewayHubStatus).append("; connectedPeers=").append(this._connectedPeers) + .append("; connectedServers=").append(this._connectedServers) + .append("; unconnectedServers=").append(this._unconnectedServers) + .append("; connectedClients=").append(this._connectedClients).append("; clientHostNames=") + .append(this._clientHostNames).append("; clientQueueSizes=").append(this._clientQueueSizes) + .append("; clientHealthStats=").append(this._clientHealthStats) + .append("; gatewayQueueSizes=").append(this._gatewayQueueSizes).append("; regionStatuses=") + .append(this._regionStatuses).append("; maximumHeapSize=").append(this._maximumHeapSize) + .append("; freeHeapSize=").append(this._freeHeapSize).append("; upTime=") + .append(this.upTime).append("]"); + return buffer.toString(); + } + + protected void initialize(DistributedSystem distributedSystem) { + // Initialize instance variables + initializeInstanceVariables(); + + // If the cache is set, initialize the status. + // If the cache is not set, then this is most + // likely an unconnected status. + if (cache != null) { + // Initialize server + initializeServer(); + + // Initialize client + initializeClient(); + + // Initialize region sizes + initializeRegionSizes(); + } + + if (distributedSystem != null) { + // Initialize all + initializeAll(distributedSystem); + } + + // If this is a locator, initialize the locator status + if (Locator.getLocators().size() > 0) { + setIsLocator(true); + } + } + + protected void initializeInstanceVariables() { + // Variables for servers + this._connectedClients = new HashSet(); + this._clientQueueSizes = new HashMap(); + this._clientHealthStats = new HashMap(); + this._clientHostNames = new HashMap(); + + // Variables for gateway hubs + this._outgoingGateways = new HashMap(); + // this._connectedOutgoingGateways = new HashSet(); + // this._unconnectedOutgoingGateways = new HashSet(); + this._connectedIncomingGateways = new HashMap(); + this._gatewayQueueSizes = new HashMap(); + + // Variables for clients + this._connectedServers = new HashSet(); + this._unconnectedServers = new HashSet(); + + // Variables for all + this._connectedPeers = new HashSet(); + this._regionStatuses = new HashMap(); + } + + protected void initializeServer() { + Collection servers = cache.getCacheServers(); + if (servers.size() == 0) { + setIsServer(false); + } else { + setIsServer(true); + + // Get connected clients. + // The following method returns a map of client member id to a cache + // client info. For now, keep track of the member ids in the set of + // _connectedClients. + Map allConnectedClients = + InternalClientMembership.getStatusForAllClientsIgnoreSubscriptionStatus(); + Iterator allConnectedClientsIterator = allConnectedClients.values().iterator(); + while (allConnectedClientsIterator.hasNext()) { + CacheClientStatus ccs = (CacheClientStatus) allConnectedClientsIterator.next(); + addConnectedClient(ccs.getMemberId()); + // host address is available directly by id, hence CacheClientStatus need not be populated + putClientHostName(ccs.getMemberId(), ccs.getHostAddress()); + } + + // Get client queue sizes + Map clientQueueSize = getClientIDMap(InternalClientMembership.getClientQueueSizes()); + setClientQueueSizes(clientQueueSize); + + // Set server acceptor port (set it based on the first CacheServer) + CacheServer server = (CacheServer) servers.toArray()[0]; + setServerPort(server.getPort()); + + // Get Client Health Stats + // Assert.assertTrue(cache != null); (cannot be null) + Region clientHealthMonitoringRegion = + ClientHealthMonitoringRegion.getInstance((GemFireCacheImpl) cache); + if (clientHealthMonitoringRegion != null) { + String[] clients = (String[]) clientHealthMonitoringRegion.keySet().toArray(new String[0]); + for (int i = 0; i < clients.length; i++) { + String clientId = clients[i]; + ClientHealthStats stats = (ClientHealthStats) clientHealthMonitoringRegion.get(clientId); + setClientHealthStats(clientId, stats); + } + } + } + } + + /** + * returning Map of client queue size against client Id + * + * param clientMap is a Map of client queue size against ClientProxyMembershipID + */ + private Map getClientIDMap(Map ClientProxyMembershipIDMap) { + Map clientIdMap = new HashMap(); + Set entrySet = ClientProxyMembershipIDMap.entrySet(); + Iterator entries = entrySet.iterator(); + while (entries.hasNext()) { + Map.Entry entry = (Map.Entry) entries.next(); + ClientProxyMembershipID key = (ClientProxyMembershipID) entry.getKey(); + Integer size = (Integer) entry.getValue(); + clientIdMap.put(key.getDSMembership(), size); + } + return clientIdMap; + } + + protected void initializeClient() { + Map poolMap = PoolManager.getAll(); + if (poolMap.size() == 0) { + setIsClient(false); + } else { + setIsClient(true); + + // Get connected servers. + // The following method returns a map of server name to a count of logical + // connections. A logical connection will be made for each region that + // references the live server. If the client is not connected to the server, + // the logical connections for that server will be 0. For now, keep track + // of the keys (server names) of this map in the sets of _connectedServers + // and _unconnectedServers. + Map connectedServers = InternalClientMembership.getConnectedServers(); + if (!connectedServers.isEmpty()) { + Iterator connected = connectedServers.entrySet().iterator(); + while (connected.hasNext()) { + Map.Entry entry = (Map.Entry) connected.next(); + String server = (String) entry.getKey(); + // Integer connections = (Integer) entry.getValue(); + // if (connections.intValue()==0) { + // addUnconnectedServer(server); + // } else { + addConnectedServer(server); + // } + // System.out.println(connections.size() + " logical connnections to server " + server); + } + } + } + } + + protected void initializeAll(DistributedSystem distributedSystem) { + // Initialize isConnected + setIsConnected(true); + + // Initialize distributed system status + initializeDistributedSystem(distributedSystem); + + // Initialize peers + initializePeers(distributedSystem); + + // Initialize memory + initializeMemory(); + } + + protected void initializeDistributedSystem(DistributedSystem distributedSystem) { + InternalDistributedSystem ids = (InternalDistributedSystem) distributedSystem; + setMemberId(ids.getMemberId()); + DistributionConfig config = ids.getConfig(); + setMemberName(config.getName()); + setMcastPort(config.getMcastPort()); + setMcastAddress(config.getMcastAddress()); + String bindAddress = config.getBindAddress(); + setBindAddress(bindAddress); + setLocators(config.getLocators()); + setUpTime(System.currentTimeMillis() - ids.getStartTime()); + try { + setHostAddress((bindAddress != null && bindAddress.length() > 0) + ? InetAddress.getByName(bindAddress) : SocketCreator.getLocalHost()); + } catch (IOException e) { + /* ignore - leave null host address */} + } + + protected void initializePeers(DistributedSystem distributedSystem) { + InternalDistributedSystem ids = (InternalDistributedSystem) distributedSystem; + DM dm = ids.getDistributionManager(); + Set connections = dm.getOtherNormalDistributionManagerIds(); + Set connectionsIDs = new HashSet(connections.size()); + for (Iterator iter = connections.iterator(); iter.hasNext();) { + InternalDistributedMember idm = (InternalDistributedMember) iter.next(); + connectionsIDs.add(idm.getId()); + } + setConnectedPeers(connectionsIDs); + } + + protected void initializeMemory() { + // InternalDistributedSystem system = (InternalDistributedSystem) + // region.getCache().getDistributedSystem(); + // GemFireStatSampler sampler = system.getStatSampler(); + // VMStatsContract statsContract = sampler.getVMStats(); + + Runtime rt = Runtime.getRuntime(); + setMaximumHeapSize(rt.maxMemory()); + setFreeHeapSize(rt.freeMemory()); + } + + protected void initializeRegionSizes() { + Iterator rootRegions = cache.rootRegions().iterator(); + + while (rootRegions.hasNext()) { + LocalRegion rootRegion = (LocalRegion) rootRegions.next(); + if (!(rootRegion instanceof HARegion)) { + RegionStatus rootRegionStatus = rootRegion instanceof PartitionedRegion + ? new PartitionedRegionStatus((PartitionedRegion) rootRegion) + : new RegionStatus(rootRegion); + putRegionStatus(rootRegion.getFullPath(), rootRegionStatus); + Iterator subRegions = rootRegion.subregions(true).iterator(); + while (subRegions.hasNext()) { + LocalRegion subRegion = (LocalRegion) subRegions.next(); + RegionStatus subRegionStatus = subRegion instanceof PartitionedRegion + ? new PartitionedRegionStatus((PartitionedRegion) subRegion) + : new RegionStatus(subRegion); + putRegionStatus(subRegion.getFullPath(), subRegionStatus); + } + } + } + } +} +
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/ManagedEntity.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/ManagedEntity.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/ManagedEntity.java new file mode 100644 index 0000000..2e823d0 --- /dev/null +++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/ManagedEntity.java @@ -0,0 +1,100 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.apache.geode.internal.admin.api; + +/** + * A entity that can be managed with the GemFire administration API. + * + * @see ManagedEntityConfig + * + * @since GemFire 4.0 + * @deprecated as of 7.0 use the <code><a href= + * "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code> + * package instead + */ +public interface ManagedEntity { + + /** + * Starts this managed entity. Note that this method may return before the managed entity is + * actually started. + * + * @throws AdminException If a problem is encountered while starting this managed entity. + * @throws IllegalStateException If this managed entity resides on a remote machine and a + * <code>null</code> or empty (<code>""</code>) + * {@linkplain ManagedEntityConfig#getRemoteCommand remote command} has been specified. + * + * @see #waitToStart + */ + public void start() throws AdminException; + + /** + * Stops this managed entity. Note that this method may return before the managed entity is + * actually stopped. + * + * @throws AdminException If a problem is encountered while stopping this managed entity. + * @throws IllegalStateException If this managed entity resides on a remote machine and a + * <code>null</code> or empty (<code>""</code>) + * {@linkplain ManagedEntityConfig#getRemoteCommand remote command} has been specified. + * + * @see #waitToStop + */ + public void stop() throws AdminException; + + /** + * Waits for up to a given number of milliseconds for this managed entity to {@linkplain #start + * start}. + * + * @param timeout The number of milliseconds to wait for this managed entity to start. + * + * @return Whether or not the entity has started. <code>false</code>, if the method times out. + * + * @throws InterruptedException If the thread invoking this method is interrupted while waiting. + */ + public boolean waitToStart(long timeout) throws InterruptedException; + + /** + * Waits for up to a given number of milliseconds for this managed entity to {@linkplain #stop + * stop}. + * + * @param timeout The number of milliseconds to wait for this managed entity to stop. + * + * @return Whether or not the entity has stopped. <code>false</code>, if the method times out. + * + * @throws InterruptedException If the thread invoking this method is interrupted while waiting. + */ + public boolean waitToStop(long timeout) throws InterruptedException; + + /** + * Returns whether or not this managed entity is running. Note that this operation may attempt to + * contact the managed entity. + * + * @throws IllegalStateException If this managed entity resides on a remote machine and a + * <code>null</code> or empty (<code>""</code>) + * {@linkplain ManagedEntityConfig#getRemoteCommand remote command} has been specified. + */ + public boolean isRunning(); + + /** + * Returns the tail of this manage entity's log file. Note that not all managed entities implement + * this functionality. + * + * @throws AdminException If a problem is encountered while getting the log of this managed + * entity. + * @throws UnsupportedOperationException If this managed entity does not support retrieving its + * log. + */ + public String getLog() throws AdminException; + +} http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/ManagedEntityConfig.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/ManagedEntityConfig.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/ManagedEntityConfig.java new file mode 100644 index 0000000..8154988 --- /dev/null +++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/ManagedEntityConfig.java @@ -0,0 +1,88 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.apache.geode.internal.admin.api; + +/** + * Common configuration for all entities that can be managed using the GemFire administration API. + * Note that once a managed entity has been {@linkplain ManagedEntity#start started}, attempts to + * modify its configuration will cause an {@link IllegalStateException} to be thrown. + * + * @see ManagedEntity + * + * @since GemFire 4.0 + * @deprecated as of 7.0 use the <code><a href= + * "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code> + * package instead + */ +public interface ManagedEntityConfig extends Cloneable { + + /** + * Returns the name of the host on which the managed entity runs or will run. + */ + public String getHost(); + + /** + * Sets the name of the host on which the managed entity will run. + */ + public void setHost(String host); + + /** + * Returns the name of the working directory in which the managed entity runs or will run. + */ + public String getWorkingDirectory(); + + /** + * Sets the name of the working directory in which the managed entity will run. + */ + public void setWorkingDirectory(String dir); + + /** + * Returns the name of the GemFire product directory to use when administering the managed entity. + */ + public String getProductDirectory(); + + /** + * Sets the name of the GemFire product directory to use when administering the managed entity. + */ + public void setProductDirectory(String dir); + + /** + * Returns the command prefix used to administer a managed entity that is hosted on a remote + * machine. If the remote command is <code>null</code> (the default value), then the remote + * command associated with the {@linkplain AdminDistributedSystem#getRemoteCommand() distributed + * system} will be used. + */ + public String getRemoteCommand(); + + /** + * Sets the command prefix used to administer a managed entity that is hosted on a remote machine. + */ + public void setRemoteCommand(String remoteCommand); + + /** + * Validates this configuration. + * + * @throws IllegalStateException If a managed entity cannot be administered using this + * configuration + */ + public void validate(); + + /** + * Returns a new <code>ManagedEntityConfig</code> with the same configuration as this + * <code>ManagedEntityConfig</code>. + */ + public Object clone() throws CloneNotSupportedException; + +} http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/MemberHealthConfig.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/MemberHealthConfig.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/MemberHealthConfig.java new file mode 100644 index 0000000..30bfce4 --- /dev/null +++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/MemberHealthConfig.java @@ -0,0 +1,142 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.apache.geode.internal.admin.api; + +/** + * Provides configuration information relating to the health of a member of a GemFire distributed + * system. + * + * <P> + * + * If any of the following criteria is true, then a member is considered to be in + * {@link GemFireHealth#OKAY_HEALTH OKAY_HEALTH}. + * + * <UL> + * + * <LI>The size of the {@linkplain #getMaxVMProcessSize VM process} is too large.</LI> + * + * <LI>There are too many {@linkplain #getMaxMessageQueueSize enqueued} incoming/outgoing + * messages.</LI> + * + * <LI>Too many message sends {@link #getMaxReplyTimeouts timeout} while waiting for a reply.</LI> + * + * </UL> + * + * If any of the following criteria is true, then a member is considered to be in + * {@link GemFireHealth#POOR_HEALTH POOR_HEALTH}. + * + * <UL> + * + * </UL> + * + * + * @since GemFire 3.5 + * @deprecated as of 7.0 use the <code><a href= + * "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code> + * package instead + */ +public interface MemberHealthConfig { + + /** + * The default maximum VM process size (in megabytes) of a health member of the distributed + * system. The default value is 1000. + */ + public static final long DEFAULT_MAX_VM_PROCESS_SIZE = 1000; + + /** + * The default maximum number of enqueued incoming or outgoing messages that a healthy member of a + * distributed system can have. The default value is 1000. + */ + public static final long DEFAULT_MAX_MESSAGE_QUEUE_SIZE = 1000; + + /** + * The default maximum number of message reply timeouts that can occur in a given health + * monitoring interval. The default value is zero. + */ + public static final long DEFAULT_MAX_REPLY_TIMEOUTS = 0; + + /** + * The default maximum multicast retransmission ratio. The default value is 0.20 (twenty percent + * of messages retransmitted) + */ + public static final double DEFAULT_MAX_RETRANSMISSION_RATIO = 0.20; + + /////////////////////// Instance Methods /////////////////////// + + /** + * Returns the maximum VM process size (in megabytes) of a healthy member of the distributed + * system. + * + * @see #DEFAULT_MAX_VM_PROCESS_SIZE + */ + public long getMaxVMProcessSize(); + + /** + * Sets the maximum VM process size (in megabytes) of a healthy member of the distributed system. + * + * @see #getMaxVMProcessSize + */ + public void setMaxVMProcessSize(long size); + + /** + * Returns the maximum number of enqueued incoming or outgoing messages that a healthy member of a + * distributed system can have. + * + * @see #DEFAULT_MAX_MESSAGE_QUEUE_SIZE + */ + public long getMaxMessageQueueSize(); + + /** + * Sets the maximum number of enqueued incoming or outgoing messages that a healthy member of a + * distributed system can have. + * + * @see #getMaxMessageQueueSize + */ + public void setMaxMessageQueueSize(long maxMessageQueueSize); + + /** + * Returns the maximum number message replies that can timeout in a healthy member. + * + * @see #DEFAULT_MAX_REPLY_TIMEOUTS + */ + public long getMaxReplyTimeouts(); + + /** + * Sets the maximum number message replies that can timeout in a healthy member. + * + * @see #getMaxReplyTimeouts + */ + public void setMaxReplyTimeouts(long maxReplyTimeouts); + + /** + * Returns the maximum ratio of multicast retransmissions / total multicast messages. + * Retransmissions are requestor-specific (i.e., unicast), so a single lost message may result in + * multiple retransmissions. + * <p> + * A high retransmission ratio may indicate poor network conditions requiring reduced flow-control + * settings, a udp-fragment-size setting that is too high. + * + * @see #DEFAULT_MAX_RETRANSMISSION_RATIO + */ + public double getMaxRetransmissionRatio(); + + /** + * Sets the maximum ratio of multicast retransmissions / total multicast messages. + * + * @see #getMaxRetransmissionRatio + */ + public void setMaxRetransmissionRatio(double ratio); + +} http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/OperationCancelledException.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/OperationCancelledException.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/OperationCancelledException.java new file mode 100644 index 0000000..4c78a90 --- /dev/null +++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/OperationCancelledException.java @@ -0,0 +1,47 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.apache.geode.internal.admin.api; + +// import org.apache.geode.GemFireException; + +/** + * Thrown when an administration operation that accesses information in a remote system member is + * cancelled. The cancelation may occur because the system member has left the distributed system. + * + * @since GemFire 3.5 + * @deprecated as of 7.0 use the <code><a href= + * "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code> + * package instead + */ +public class OperationCancelledException extends RuntimeAdminException { + private static final long serialVersionUID = 5474068770227602546L; + + public OperationCancelledException() { + super(); + } + + public OperationCancelledException(String message) { + super(message); + } + + public OperationCancelledException(Throwable cause) { + super(cause); + } + + public OperationCancelledException(String message, Throwable cause) { + super(message, cause); + } +} http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/RegionNotFoundException.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/RegionNotFoundException.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/RegionNotFoundException.java new file mode 100644 index 0000000..4b452ea --- /dev/null +++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/RegionNotFoundException.java @@ -0,0 +1,39 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.apache.geode.internal.admin.api; + +// import org.apache.geode.cache.CacheException; +import org.apache.geode.cache.CacheRuntimeException; + +/** + * Thrown by the administration API when the region administered by a {@link SystemMemberRegion} has + * been closed or destroyed in system member. + * <P> + * Also thrown by {@link org.apache.geode.DataSerializer#readRegion(java.io.DataInput)} if the named + * region no longer exists. + * + * @since GemFire 3.5 + * @deprecated as of 7.0 use the <code><a href= + * "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code> + * package instead + */ +public class RegionNotFoundException extends CacheRuntimeException { + private static final long serialVersionUID = 1758668137691463909L; + + public RegionNotFoundException(String message) { + super(message); + } + +} http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/RegionSubRegionSnapshot.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/RegionSubRegionSnapshot.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/RegionSubRegionSnapshot.java new file mode 100644 index 0000000..d6b32fe --- /dev/null +++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/RegionSubRegionSnapshot.java @@ -0,0 +1,183 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.apache.geode.internal.admin.api; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Set; + +import org.apache.geode.DataSerializable; +import org.apache.geode.DataSerializer; +import org.apache.geode.cache.Region; +import org.apache.geode.i18n.LogWriterI18n; +import org.apache.geode.internal.cache.PartitionedRegion; + +/** + * Class <code>RegionSubRegionSnapshot</code> provides information about <code>Region</code>s. This + * also provides the information about sub regions This class is used by the monitoring tool. + * + * + * @since GemFire 5.7 + * @deprecated as of 7.0 use the <code><a href= + * "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code> + * package instead + */ +public class RegionSubRegionSnapshot implements DataSerializable { + private static final long serialVersionUID = -8052137675270041871L; + + public RegionSubRegionSnapshot() { + this.parent = null; + this.subRegionSnapshots = new HashSet(); + } + + public RegionSubRegionSnapshot(Region reg) { + this(); + this.name = reg.getName(); + if (reg instanceof PartitionedRegion) { + PartitionedRegion p_reg = (PartitionedRegion) reg; + this.entryCount = p_reg.entryCount(true); + } else { + this.entryCount = reg.entrySet().size(); + } + final LogWriterI18n logger = reg.getCache().getLoggerI18n(); + if ((logger != null) && logger.fineEnabled()) { + logger.fine("RegionSubRegionSnapshot Region entry count =" + this.entryCount + " for region =" + + this.name); + } + } + + /** + * add the snapshot of sub region + * + * @param snap snapshot of sub region + * @return true if operation is successful + */ + public boolean addSubRegion(RegionSubRegionSnapshot snap) { + if (subRegionSnapshots.contains(snap)) { + return true; + } + + if (subRegionSnapshots.add(snap)) { + snap.setParent(this); + return true; + } + + return false; + } + + /** + * @return get entry count of region + */ + public final int getEntryCount() { + return entryCount; + } + + /** + * @param entryCount entry count of region + */ + public final void setEntryCount(int entryCount) { + this.entryCount = entryCount; + } + + /** + * @return name of region + */ + public final String getName() { + return name; + } + + /** + * @param name name of region + */ + public final void setName(String name) { + this.name = name; + } + + /** + * @return subRegionSnapshots of all the sub regions + */ + public final Set getSubRegionSnapshots() { + return subRegionSnapshots; + } + + /** + * @param subRegionSnapshots subRegionSnapshots of all the sub regions + */ + public final void setSubRegionSnapshots(Set subRegionSnapshots) { + this.subRegionSnapshots = subRegionSnapshots; + } + + /** + * @return snapshot of parent region + */ + public final RegionSubRegionSnapshot getParent() { + return parent; + } + + /** + * @param parent snapshot of parent region + */ + public final void setParent(RegionSubRegionSnapshot parent) { + this.parent = parent; + } + + /** + * + * @return full path of region + */ + public String getFullPath() { + return (getParent() == null ? "/" : getParent().getFullPath()) + getName() + "/"; + } + + public void toData(DataOutput out) throws IOException { + DataSerializer.writeString(this.name, out); + out.writeInt(this.entryCount); + DataSerializer.writeHashSet((HashSet) this.subRegionSnapshots, out); + } + + public void fromData(DataInput in) throws IOException, ClassNotFoundException { + this.name = DataSerializer.readString(in); + this.entryCount = in.readInt(); + this.subRegionSnapshots = DataSerializer.readHashSet(in); + for (Iterator iter = this.subRegionSnapshots.iterator(); iter.hasNext();) { + ((RegionSubRegionSnapshot) iter.next()).setParent(this); + } + } + + @Override + public String toString() { + String toStr = "RegionSnapshot [" + "path=" + this.getFullPath() + ",parent=" + + (this.parent == null ? "null" : this.parent.name) + ", entryCount=" + this.entryCount + + ", subRegionCount=" + this.subRegionSnapshots.size() + "<<"; + + for (Iterator iter = subRegionSnapshots.iterator(); iter.hasNext();) { + toStr = toStr + ((RegionSubRegionSnapshot) iter.next()).getName() + ", "; + } + + toStr = toStr + ">>" + "]"; + return toStr; + } + + protected String name; + + protected int entryCount; + + protected RegionSubRegionSnapshot parent; + + protected Set subRegionSnapshots; +} http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/RuntimeAdminException.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/RuntimeAdminException.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/RuntimeAdminException.java new file mode 100755 index 0000000..6504957 --- /dev/null +++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/RuntimeAdminException.java @@ -0,0 +1,48 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.apache.geode.internal.admin.api; + +/** + * A <code>RuntimeAdminException</code> is thrown when a runtime errors occurs during administration + * or monitoring of GemFire. + * + * @since GemFire 3.5 + * + * @deprecated as of 7.0 use the <code><a href= + * "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code> + * package instead + */ +public class RuntimeAdminException extends org.apache.geode.GemFireException { + + private static final long serialVersionUID = -7512771113818634005L; + + public RuntimeAdminException() { + super(); + } + + public RuntimeAdminException(String message) { + super(message); + } + + public RuntimeAdminException(String message, Throwable cause) { + super(message, cause); + } + + public RuntimeAdminException(Throwable cause) { + super(cause); + } + +} http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/Statistic.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/Statistic.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/Statistic.java new file mode 100755 index 0000000..95d3ef0 --- /dev/null +++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/Statistic.java @@ -0,0 +1,64 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.apache.geode.internal.admin.api; + +/** + * Interface to represent a single statistic of a <code>StatisticResource</code> + * + * @since GemFire 3.5 + * + * @deprecated as of 7.0 use the <code><a href= + * "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code> + * package instead + */ +public interface Statistic extends java.io.Serializable { + + /** + * Gets the identifying name of this statistic. + * + * @return the identifying name of this statistic + */ + public String getName(); + + /** + * Gets the value of this statistic as a <code>java.lang.Number</code>. + * + * @return the value of this statistic + */ + public Number getValue(); + + /** + * Gets the unit of measurement (if any) this statistic represents. + * + * @return the unit of measurement (if any) this statistic represents + */ + public String getUnits(); + + /** + * Returns true if this statistic represents a numeric value which always increases. + * + * @return true if this statistic represents a value which always increases + */ + public boolean isCounter(); + + /** + * Gets the full description of this statistic. + * + * @return the full description of this statistic + */ + public String getDescription(); +} + http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/StatisticResource.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/StatisticResource.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/StatisticResource.java new file mode 100755 index 0000000..8b698dc --- /dev/null +++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/StatisticResource.java @@ -0,0 +1,82 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.apache.geode.internal.admin.api; + +/** + * Adminitrative interface for monitoring a statistic resource in a GemFire system member. A + * resource is comprised of one or many <code>Statistics</code>. + * + * @since GemFire 3.5 + * + * @deprecated as of 7.0 use the <code><a href= + * "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code> + * package instead + */ +public interface StatisticResource { + + /** + * Gets the identifying name of this resource. + * + * @return the identifying name of this resource + */ + public String getName(); + + /** + * Gets the full description of this resource. + * + * @return the full description of this resource + */ + public String getDescription(); + + /** + * Gets the classification type of this resource. + * + * @return the classification type of this resource + * @since GemFire 5.0 + */ + public String getType(); + + /** + * Returns a display string of the {@link SystemMember} owning this resource. + * + * @return a display string of the owning {@link SystemMember} + */ + public String getOwner(); + + /** + * Returns an ID that uniquely identifies the resource within the {@link SystemMember} it belongs + * to. + * + * @return unique id within the owning {@link SystemMember} + */ + public long getUniqueId(); + + /** + * Returns a read-only array of every {@link Statistic} in this resource. + * + * @return read-only array of every {@link Statistic} in this resource + */ + public Statistic[] getStatistics(); + + /** + * Refreshes the values of every {@link Statistic} in this resource by retrieving them from the + * member's VM. + * + * @throws AdminException if unable to refresh statistic values + */ + public void refresh() throws AdminException; + +} + http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/SystemMember.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/SystemMember.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/SystemMember.java new file mode 100755 index 0000000..98bf598 --- /dev/null +++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/SystemMember.java @@ -0,0 +1,144 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.apache.geode.internal.admin.api; + +import org.apache.geode.distributed.DistributedMember; + +import java.net.InetAddress; + +/** + * Administrative interface for monitoring a GemFire system member. + * + * @since GemFire 3.5 + * + * @deprecated as of 7.0 use the <code><a href= + * "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code> + * package instead + */ +public interface SystemMember { + + /** Gets the {@link AdminDistributedSystem} this member belongs to. */ + public AdminDistributedSystem getDistributedSystem(); + + /** + * Gets identifying name of this member. For applications this is the string form of + * {@link #getDistributedMember}. For cache servers it is a unique cache server string. + */ + public String getId(); + + /** + * Retrieves display friendly name for this member. If this member defined an optional name for + * its connection to the distributed system, that name will be returned. Otherwise the returned + * value will be {@link SystemMember#getId}. + * + * @see org.apache.geode.distributed.DistributedSystem#connect + * @see org.apache.geode.distributed.DistributedSystem#getName + */ + public String getName(); + + /** Gets the type of {@link SystemMemberType} this member is. */ + public SystemMemberType getType(); + + /** Gets host name of the machine this member resides on. */ + public String getHost(); + + /** Gets the host of this member as an <code>java.net.InetAddress<code>. */ + public InetAddress getHostAddress(); + + /** Retrieves the log for this member. */ + public String getLog(); + + /** + * Returns the GemFire license this member is using. + * + * @deprecated Removed licensing in 8.0. + */ + @Deprecated + public java.util.Properties getLicense(); + + /** Returns this member's GemFire version information. */ + public String getVersion(); + + /** + * Gets the configuration parameters for this member. + */ + public ConfigurationParameter[] getConfiguration(); + + /** + * Sets the configuration of this member. The argument is an array of any and all configuration + * parameters that are to be updated in the member. + * <p> + * The entire array of configuration parameters is then returned. + * + * @param parms subset of the configuration parameters to be changed + * @return all configuration parameters including those that were changed + * @throws AdminException if this fails to make the configuration changes + */ + public ConfigurationParameter[] setConfiguration(ConfigurationParameter[] parms) + throws AdminException; + + /** Refreshes this member's configuration from the member or it's properties */ + public void refreshConfig() throws AdminException; + + /** + * Retrieves this members statistic resources. If the member is not running then an empty array is + * returned. + * + * @param statisticsTypeName String ame of the Statistics Type + * @return array of runtime statistic resources owned by this member + * @since GemFire 5.7 + */ + public StatisticResource[] getStat(String statisticsTypeName) throws AdminException; + + /** + * Retrieves this members statistic resources. If the member is not running then an empty array is + * returned. All Stats are returned + * + * @return array of runtime statistic resources owned by this member + */ + public StatisticResource[] getStats() throws AdminException; + + /** + * Returns whether or not this system member hosts a GemFire {@link org.apache.geode.cache.Cache + * Cache}. + * + * @see #getCache + */ + public boolean hasCache() throws AdminException; + + /** + * Returns an object that provides admin access to this member's cache. If the member currently + * has no cache then <code>null</code> is returned. + */ + public SystemMemberCache getCache() throws AdminException; + + /** + * Returns the names of the membership roles filled by this member. + * + * @return array of string membership role names + * @since GemFire 5.0 + */ + public String[] getRoles(); + + /** + * Returns the {@link org.apache.geode.distributed.DistributedMember} that represents this system + * member. + * + * @return DistributedMember instance representing this system member + * @since GemFire 5.0 + */ + public DistributedMember getDistributedMember(); +} + http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/SystemMemberBridgeServer.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/SystemMemberBridgeServer.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/SystemMemberBridgeServer.java new file mode 100644 index 0000000..56ed17a --- /dev/null +++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/SystemMemberBridgeServer.java @@ -0,0 +1,307 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.apache.geode.internal.admin.api; + +import org.apache.geode.cache.server.ServerLoadProbe; + +/** + * Administrative interface that represents a CacheServer that serves the contents of a system + * member's cache. + * + * @see SystemMemberCache#addCacheServer + * + * @since GemFire 4.0 + * @deprecated as of 5.7 use {@link SystemMemberCacheServer} instead. + */ +@Deprecated +public interface SystemMemberBridgeServer { + + /** + * Returns the port on which this bridge server listens for bridge clients to connect. + */ + public int getPort(); + + /** + * Sets the port on which this bridge server listens for bridge clients to connect. + * + * @throws AdminException If this bridge server is running + */ + public void setPort(int port) throws AdminException; + + /** + * Starts this bridge server. Once the server is running, its configuration cannot be changed. + * + * @throws AdminException If an error occurs while starting the bridge server + */ + public void start() throws AdminException; + + /** + * Returns whether or not this bridge server is running + */ + public boolean isRunning(); + + /** + * Stops this bridge server. Note that the <code>BridgeServer</code> can be reconfigured and + * restarted if desired. + */ + public void stop() throws AdminException; + + /** + * Updates the information about this bridge server. + */ + public void refresh(); + + /** + * Returns a string representing the ip address or host name that this server will listen on. + * + * @return the ip address or host name that this server is to listen on + * @since GemFire 5.7 + */ + public String getBindAddress(); + + /** + * Sets the ip address or host name that this server is to listen on for client connections. + * <p> + * Setting a specific bind address will cause the bridge server to always use this address and + * ignore any address specified by "server-bind-address" or "bind-address" in the + * <code>gemfire.properties</code> file (see + * {@link org.apache.geode.distributed.DistributedSystem} for a description of these properties). + * <p> + * A <code>null</code> value will be treated the same as the default "". + * <p> + * The default value does not override the gemfire.properties. If you wish to override the + * properties and want to have your server bind to all local addresses then use this string + * <code>"0.0.0.0"</code>. + * + * @param address the ip address or host name that this server is to listen on + * @throws AdminException if this bridge server is running + * @since GemFire 5.7 + */ + public void setBindAddress(String address) throws AdminException; + + /** + * Returns a string representing the ip address or host name that server locators will tell + * clients that this server is listening on. + * + * @return the ip address or host name to give to clients so they can connect to this server + * @since GemFire 5.7 + */ + public String getHostnameForClients(); + + /** + * Sets the ip address or host name that this server is to listen on for client connections. + * <p> + * Setting a specific hostname-for-clients will cause server locators to use this value when + * telling clients how to connect to this server. + * <p> + * The default value causes the bind-address to be given to clients + * <p> + * A <code>null</code> value will be treated the same as the default "". + * + * @param name the ip address or host name that will be given to clients so they can connect to + * this server + * @throws AdminException if this bridge server is running + * @since GemFire 5.7 + */ + public void setHostnameForClients(String name) throws AdminException; + + /** + * Sets whether or not this bridge server should notify clients based on key subscription. + * + * If false, then an update to any key on the server causes an update to be sent to all clients. + * This update does not push the actual data to the clients. Instead, it causes the client to + * locally invalidate or destroy the corresponding entry. The next time the client requests the + * key, it goes to the bridge server for the value. + * + * If true, then an update to any key on the server causes an update to be sent to only those + * clients who have registered interest in that key. Other clients are not notified of the change. + * In addition, the actual value is pushed to the client. The client does not need to request the + * new value from the bridge server. + * + * @throws AdminException if this bridge server is running + * @since GemFire 5.7 + */ + public void setNotifyBySubscription(boolean b) throws AdminException; + + /** + * Answers whether or not this bridge server should notify clients based on key subscription. + * + * @since GemFire 5.7 + */ + public boolean getNotifyBySubscription(); + + /** + * Sets the buffer size in bytes of the socket connection for this <code>BridgeServer</code>. The + * default is 32768 bytes. + * + * @param socketBufferSize The size in bytes of the socket buffer + * @throws AdminException if this bridge server is running + * @since GemFire 5.7 + */ + public void setSocketBufferSize(int socketBufferSize) throws AdminException; + + /** + * Returns the configured buffer size of the socket connection for this <code>BridgeServer</code>. + * The default is 32768 bytes. + * + * @return the configured buffer size of the socket connection for this <code>BridgeServer</code> + * @since GemFire 5.7 + */ + public int getSocketBufferSize(); + + /** + * Sets the maximum amount of time between client pings. This value is used by the + * <code>ClientHealthMonitor</code> to determine the health of this <code>BridgeServer</code>'s + * clients. The default is 60000 ms. + * + * @param maximumTimeBetweenPings The maximum amount of time between client pings + * @throws AdminException if this bridge server is running + * @since GemFire 5.7 + */ + public void setMaximumTimeBetweenPings(int maximumTimeBetweenPings) throws AdminException; + + /** + * Returns the maximum amount of time between client pings. This value is used by the + * <code>ClientHealthMonitor</code> to determine the health of this <code>BridgeServer</code>'s + * clients. The default is 60000 ms. + * + * @return the maximum amount of time between client pings. + * @since GemFire 5.7 + */ + public int getMaximumTimeBetweenPings(); + + /** + * Returns the maximum allowed client connections + * + * @since GemFire 5.7 + */ + public int getMaxConnections(); + + /** + * Sets the maxium number of client connections allowed. When the maximum is reached the server + * will stop accepting connections. + * + * @throws AdminException if this bridge server is running + * @since GemFire 5.7 + */ + public void setMaxConnections(int maxCons) throws AdminException; + + /** + * Returns the maxium number of threads allowed in this server to service client requests. The + * default of <code>0</code> causes the server to dedicate a thread for every client connection. + * + * @since GemFire 5.7 + */ + public int getMaxThreads(); + + /** + * Sets the maxium number of threads allowed in this server to service client requests. The + * default of <code>0</code> causes the server to dedicate a thread for every client connection. + * + * @throws AdminException if this bridge server is running + * @since GemFire 5.7 + */ + public void setMaxThreads(int maxThreads) throws AdminException; + + /** + * Returns the maximum number of messages that can be enqueued in a client-queue. + * + * @since GemFire 5.7 + */ + public int getMaximumMessageCount(); + + /** + * Sets maximum number of messages that can be enqueued in a client-queue. + * + * @throws AdminException if this bridge server is running + * @since GemFire 5.7 + */ + public void setMaximumMessageCount(int maxMessageCount) throws AdminException; + + /** + * Returns the time (in seconds ) after which a message in the client queue will expire. + * + * @since GemFire 5.7 + */ + public int getMessageTimeToLive(); + + /** + * Sets the time (in seconds ) after which a message in the client queue will expire. + * + * @throws AdminException if this bridge server is running + * @since GemFire 5.7 + */ + public void setMessageTimeToLive(int messageTimeToLive) throws AdminException; + + /** + * Sets the list of server groups this bridge server will belong to. By default bridge servers + * belong to the default global server group which all bridge servers always belong to. + * + * @param groups possibly empty array of <code>String</code> where each string is a server groups + * that this bridge server will be a member of. + * @throws AdminException if this bridge server is running + * @since GemFire 5.7 + */ + public void setGroups(String[] groups) throws AdminException; + + /** + * Returns the list of server groups that this bridge server belongs to. + * + * @return a possibly empty array of <code>String</code>s where each string is a server group. + * Modifying this array will not change the server groups that this bridge server belongs + * to. + * @since GemFire 5.7 + */ + public String[] getGroups(); + + /** + * Get a description of the load probe for this bridge server. {@link ServerLoadProbe} for details + * on the load probe. + * + * @return the load probe used by this bridge server. + * @since GemFire 5.7 + */ + public String getLoadProbe(); + + /** + * Set the load probe for this bridge server. See {@link ServerLoadProbe} for details on how to + * implement a load probe. + * + * The load probe should implement DataSerializable if it is used with this interface, because it + * will be sent to the remote VM. + * + * @param loadProbe the load probe to use for this bridge server. + * @throws AdminException if the bridge server is running + * @since GemFire 5.7 + */ + public void setLoadProbe(ServerLoadProbe loadProbe) throws AdminException; + + /** + * Get the frequency in milliseconds to poll the load probe on this bridge server. + * + * @return the frequency in milliseconds that we will poll the load probe. + */ + public long getLoadPollInterval(); + + /** + * Set the frequency in milliseconds to poll the load probe on this bridge server + * + * @param loadPollInterval the frequency in milliseconds to poll the load probe. Must be greater + * than 0. + * @throws AdminException if the bridge server is running + */ + public void setLoadPollInterval(long loadPollInterval) throws AdminException; + +} http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/SystemMemberCache.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/SystemMemberCache.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/SystemMemberCache.java new file mode 100644 index 0000000..092a17a --- /dev/null +++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/SystemMemberCache.java @@ -0,0 +1,183 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.apache.geode.internal.admin.api; + +import org.apache.geode.cache.RegionAttributes; + +/** + * Administrative interface that represent's the {@link SystemMember}'s view of its + * {@link org.apache.geode.cache.Cache}. + * + * @since GemFire 3.5 + * @deprecated as of 7.0 use the <code><a href= + * "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code> + * package instead + */ +public interface SystemMemberCache { + // attributes + /** + * The name of the cache. + */ + public String getName(); + + /** + * Value that uniquely identifies an instance of a cache for a given member. + */ + public int getId(); + + /** + * Indicates if this cache has been closed. + * + * @return true, if this cache is closed; false, otherwise + */ + public boolean isClosed(); + + /** + * Gets the number of seconds a cache operation will wait to obtain a distributed lock lease. + */ + public int getLockTimeout(); + + /** + * Sets the number of seconds a cache operation may wait to obtain a distributed lock lease before + * timing out. + * + * @throws AdminException If a problem is encountered while setting the lock timeout + * + * @see org.apache.geode.cache.Cache#setLockTimeout + */ + public void setLockTimeout(int seconds) throws AdminException; + + /** + * Gets the length, in seconds, of distributed lock leases obtained by this cache. + */ + public int getLockLease(); + + /** + * Sets the length, in seconds, of distributed lock leases obtained by this cache. + * + * @throws AdminException If a problem is encountered while setting the lock lease + * + * @see org.apache.geode.cache.Cache#setLockLease + */ + public void setLockLease(int seconds) throws AdminException; + + /** + * Gets the number of seconds a cache {@link org.apache.geode.cache.Region#get(Object) get} + * operation can spend searching for a value before it times out. The search includes any time + * spent loading the object. When the search times out it causes the get to fail by throwing an + * exception. + */ + public int getSearchTimeout(); + + /** + * Sets the number of seconds a cache get operation can spend searching for a value. + * + * @throws AdminException If a problem is encountered while setting the search timeout + * + * @see org.apache.geode.cache.Cache#setSearchTimeout + */ + public void setSearchTimeout(int seconds) throws AdminException; + + /** + * Returns number of seconds since this member's cache has been created. Returns <code>-1</code> + * if this member does not have a cache or its cache has been closed. + */ + public int getUpTime(); + + /** + * Returns the names of all the root regions currently in this cache. + */ + public java.util.Set getRootRegionNames(); + + // operations + + /** + * Returns statistics related to this cache's performance. + */ + public Statistic[] getStatistics(); + + /** + * Return the existing region (or subregion) with the specified path that already exists in the + * cache. Whether or not the path starts with a forward slash it is interpreted as a full path + * starting at a root. + * + * @param path the path to the region + * @return the Region or null if not found + * @throws IllegalArgumentException if path is null, the empty string, or "/" + */ + public SystemMemberRegion getRegion(String path) throws AdminException; + + /** + * Creates a VM root <code>Region</code> in this cache. + * + * @param name The name of the region to create + * @param attrs The attributes of the root region + * + * @throws AdminException If the region cannot be created + * + * @since GemFire 4.0 + * @deprecated as of GemFire 5.0, use {@link #createRegion} instead + */ + @Deprecated + public SystemMemberRegion createVMRegion(String name, RegionAttributes attrs) + throws AdminException; + + /** + * Creates a root <code>Region</code> in this cache. + * + * @param name The name of the region to create + * @param attrs The attributes of the root region + * + * @throws AdminException If the region cannot be created + * + * @since GemFire 5.0 + */ + public SystemMemberRegion createRegion(String name, RegionAttributes attrs) throws AdminException; + + /** + * Updates the state of this cache instance. Note that once a cache instance is closed refresh + * will never change the state of that instance. + */ + public void refresh(); + + /** + * Adds a new, unstarted cache server that will serve the contents of this cache to clients. + * + * @see org.apache.geode.cache.Cache#addCacheServer + * + * @since GemFire 5.7 + */ + public SystemMemberCacheServer addCacheServer() throws AdminException; + + /** + * Returns the cache servers that run in this member's VM. Note that this list will not be updated + * until {@link #refresh} is called. + * + * @see org.apache.geode.cache.Cache#getCacheServers + * + * @since GemFire 5.7 + */ + public SystemMemberCacheServer[] getCacheServers() throws AdminException; + + /** + * Returns whether or not this cache acts as a server. This method will always return + * <code>true</code> for the <code>SystemMemberCache</code> obtained from a {@link CacheServer}. + * Note that this value will not be updated until {@link #refresh} is invoked. + * + * @since GemFire 4.0 + */ + public boolean isServer() throws AdminException; +} + http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/SystemMemberCacheEvent.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/SystemMemberCacheEvent.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/SystemMemberCacheEvent.java new file mode 100644 index 0000000..d90400e --- /dev/null +++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/SystemMemberCacheEvent.java @@ -0,0 +1,33 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.apache.geode.internal.admin.api; + +import org.apache.geode.cache.Operation; + +/** + * An event that describes an operation on a cache. Instances of this are delivered to a + * {@link SystemMemberCacheListener} when a a cache is created or closed. + * + * @since GemFire 5.0 + * @deprecated as of 7.0 use the <code><a href= + * "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code> + * package instead + */ +public interface SystemMemberCacheEvent extends SystemMembershipEvent { + /** + * Returns the actual operation that caused this event. + */ + public Operation getOperation(); +} http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/20a32286/geode-core/src/main/java/org/apache/geode/internal/admin/api/SystemMemberCacheListener.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/api/SystemMemberCacheListener.java b/geode-core/src/main/java/org/apache/geode/internal/admin/api/SystemMemberCacheListener.java new file mode 100644 index 0000000..af949b3 --- /dev/null +++ b/geode-core/src/main/java/org/apache/geode/internal/admin/api/SystemMemberCacheListener.java @@ -0,0 +1,76 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.apache.geode.internal.admin.api; + +import org.apache.geode.cache.*; + +/** + * A listener whose callback methods can be used to track the lifecycle of {@link Cache caches} and + * {@link Region regions} in the GemFire distributed system. + * + * @see AdminDistributedSystem#addCacheListener + * @see AdminDistributedSystem#removeCacheListener + * + * @since GemFire 5.0 + * @deprecated as of 7.0 use the <code><a href= + * "{@docRoot}/org/apache/geode/management/package-summary.html">management</a></code> + * package instead + */ +public interface SystemMemberCacheListener { + + /** + * Invoked after a region is created in any node of distributed system. + * + * @param event describes the region that was created. + * @see CacheFactory#create + * @see Cache#createRegion + * @see Region#createSubregion + */ + public void afterRegionCreate(SystemMemberRegionEvent event); + + /** + * Invoked when a region is destroyed or closed in any node of distributed system. + * + * @param event describes the region that was lost. The operation on this event can be used to + * determine the actual operation that caused the loss. Note that {@link Cache#close()} + * invokes this callback with <code>Operation.CACHE_CLOSE</code> for each region in the + * closed cache and it invokes {@link #afterCacheClose}. + * + * @see Cache#close() + * @see Region#close + * @see Region#localDestroyRegion() + * @see Region#destroyRegion() + */ + public void afterRegionLoss(SystemMemberRegionEvent event); + + /** + * Invoked after a cache is created in any node of a distributed system. Note that this callback + * will be done before any regions are created in the cache. + * + * @param event describes the member that created the cache. + * @see CacheFactory#create + */ + public void afterCacheCreate(SystemMemberCacheEvent event); + + /** + * Invoked after a cache is closed in any node of a distributed system. This callback is done + * after those done for each region in the cache. This callback is not done if the distributed + * member that has a cache crashes. + * + * @param event describes the member that closed its cache. + * @see Cache#close() + */ + public void afterCacheClose(SystemMemberCacheEvent event); +}
