/** * Checks that if this region participates in a Gateway * and there is a hub * * @return true only if this region participates in a Gateway * and there is a hub */ protected boolean shouldNotifyGatewayHub() { if (!this.enableGateway) { return false; } return this.cache.getGatewayHubs().size() > 0; } /**
private void verifyConfiguration() { if(typeRegistryInUse) { return; } else { typeRegistryInUse = true; checkAllowed(!cache.getGatewayHubs().isEmpty()); } }
public void creatingPersistentRegion() { //Anything is allowed until the registry is in use. if(!typeRegistryInUse) { return; } checkAllowed(!cache.getGatewayHubs().isEmpty(),!cache.getGatewaySenders().isEmpty(), true); }
public void gatewaySenderStarted(GatewaySender gatewaySender) { if(!typeRegistryInUse || this.idToType == null) { return; } checkAllowed(!cache.getGatewayHubs().isEmpty(), !gatewaySender.isNonWanDispatcher(), !cache.listDiskStores().isEmpty()); }
/** * Check to see if the current member is a loner and we can't tell * if the user wants a peer or a client type registry. * @param cache * @return true if this member is a loner and we can't determine what * type of registry they want. */ public static boolean isIndeterminateLoner(GemFireCacheImpl cache) { boolean isLoner = cache.getDistributedSystem().isLoner(); boolean pdxConfigured = cache.getPdxPersistent(); boolean hasGateways = !cache.getGatewayHubs().isEmpty(); return isLoner && !pdxConfigured && !hasGateways; }
/** * Send out all of the initial types * we recover from disk or receive from peers to any existing gateways. */ private void initializeAllGateways() { for(GatewayHub hub : cache.getGatewayHubs()) { for(Gateway gateway : hub.getGateways()) { if(gateway.isRunning()) { initializeGateway((GatewayImpl) gateway); } } } }
void verifyConfiguration() { if(typeRegistryInUse) { return; } else { Collection<DiskStoreImpl> diskStores = cache.listDiskStoresIncludingRegionOwned(); boolean hasPersistentRegions = false; for(DiskStoreImpl store : diskStores) { hasPersistentRegions |= store.hasPersistedData(); } checkAllowed(!cache.getGatewayHubs().isEmpty(), !cache.getGatewaySenders().isEmpty(), hasPersistentRegions); for(Pool pool : PoolManager.getAll().values()) { if(!((PoolImpl) pool).isUsedByGateway()) { throw new PdxInitializationException("The PDX metadata has already been " + "created as a peer metadata region. " + "Please use ClientCacheFactory to create clients."); } } typeRegistryInUse = true; } }
public static void HydraTask_turnOnGatewayDraining() throws TestException { // Drain if configured for old WAN GemFireCacheImpl cache = GemFireCacheImpl.getInstance(); List<GatewayHub> hubs = cache.getGatewayHubs(); for(GatewayHub hub : hubs) { List<Gateway> gws = hub.getGateways(); for(Gateway gw : gws) { List<GatewayEventListener> lists = gw.getListeners(); for(GatewayEventListener gel : lists) { ((BlockingGListener)gel).setDraining(true); } } } // Drain if configured for new WAN Set<AsyncEventQueue> queues = cache.getAsyncEventQueues(); for (AsyncEventQueue queue : queues) { ((BlockingGListener) queue.getAsyncEventListener()).setDraining(true); } }
for (GatewayHub hub: getCache().getGatewayHubs()) { GatewayHubImpl hubImpl = (GatewayHubImpl)hub; if (shouldNotifyGatewayHub(hubImpl)) {
(this.enableGateway && (this.cache.getGatewayHubs().size() > 0))) { StateFlushOperation sfo = new StateFlushOperation(getDistributionManager()); try {