http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/geode-core/src/main/java/org/apache/geode/cache/DynamicRegionFactory.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/org/apache/geode/cache/DynamicRegionFactory.java b/geode-core/src/main/java/org/apache/geode/cache/DynamicRegionFactory.java index a4d84a6..57a1a46 100644 --- a/geode-core/src/main/java/org/apache/geode/cache/DynamicRegionFactory.java +++ b/geode-core/src/main/java/org/apache/geode/cache/DynamicRegionFactory.java @@ -1,18 +1,16 @@ /* - * 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 + * 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 + * 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. + * 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.cache; @@ -53,97 +51,100 @@ import org.apache.geode.security.GemFireSecurityException; /** - * DynamicRegionFactory provides a distributed region creation service. - * Any other member of the GemFire DistributedSystem that has created - * an instance of this class will automatically instantiate regions created - * through the factory from anywhere else in the DistributedSystem. - * <p><p> + * DynamicRegionFactory provides a distributed region creation service. Any other member of the + * GemFire DistributedSystem that has created an instance of this class will automatically + * instantiate regions created through the factory from anywhere else in the DistributedSystem. + * <p> + * <p> * Instructions for Use:<br> * <ul> - * <li> If your application is a client in a client/server installation, - * either specify the pool name in the - * {@link DynamicRegionFactory.Config} you'll use to create a - * DynamicRegionFactory <i>or</i> specify it - * in a dynamic-region-factory element in your cache.xml. + * <li>If your application is a client in a client/server installation, either specify the pool name + * in the {@link DynamicRegionFactory.Config} you'll use to create a DynamicRegionFactory <i>or</i> + * specify it in a dynamic-region-factory element in your cache.xml. * - * <li> Before you've created a GemFire Cache in your application, add a - * line of code as follows:<br> - * <pre><code> DynamicRegionFactory factory = DynamicRegionFactory.get(); - * factory.open(config);</code></pre> - * <pre><code> DynamicRegionFactory myFactoryHandle = DynamicRegionFactory.get().open(config);</code></pre> + * <li>Before you've created a GemFire Cache in your application, add a line of code as follows:<br> + * + * <pre> + * <code> DynamicRegionFactory factory = DynamicRegionFactory.get(); + * factory.open(config);</code> + * </pre> + * + * <pre> + * <code> DynamicRegionFactory myFactoryHandle = DynamicRegionFactory.get().open(config);</code> + * </pre> + * * or just use a dynamic-region-factory element in the cache.xml. * - * <li> Create the GemFire Cache. During cache creation, the list of dynamic Regions will either be discovered - * by recovering - * their names from disk (see {@link DynamicRegionFactory.Config#persistBackup}) or from other members of the - * distributed system. - * These dynamic Regions will be created before Cache creation completes. + * <li>Create the GemFire Cache. During cache creation, the list of dynamic Regions will either be + * discovered by recovering their names from disk (see + * {@link DynamicRegionFactory.Config#persistBackup}) or from other members of the distributed + * system. These dynamic Regions will be created before Cache creation completes. * - * <li> Thereafter, when you want to create dynamic distributed Regions, - * create them using the {@link #createDynamicRegion}. Regions created with the factory will - * inherit their RegionAttributes from their parent Region, though you can override - * callbacks when you configure the factory. + * <li>Thereafter, when you want to create dynamic distributed Regions, create them using the + * {@link #createDynamicRegion}. Regions created with the factory will inherit their + * RegionAttributes from their parent Region, though you can override callbacks when you configure + * the factory. * - * <p>All other instances of GemFire across the distributed system that - * instantiate and open a DynamicRegionFactory will also get the dynamic distributed Regions. + * <p> + * All other instances of GemFire across the distributed system that instantiate and open a + * DynamicRegionFactory will also get the dynamic distributed Regions. * * <li>Non-dynamic parent Regions should be declared in cache.xml so that they can be created before - * the dynamic Region factory goes active and starts creating Regions. You will have cache creation + * the dynamic Region factory goes active and starts creating Regions. You will have cache creation * problems if this isn't done. * - * <li>A DynamicRegionListener can be registered before open is called and before cache creation - * so that the listener will be called if dynamic Regions are created during cache creation. + * <li>A DynamicRegionListener can be registered before open is called and before cache creation so + * that the listener will be called if dynamic Regions are created during cache creation. * * </ul> - * <p>Saving the factory on disk: - * If {@link DynamicRegionFactory.Config#persistBackup} is configured for the factory, dynamic Region information - * is written to disk for recovery. - * By default the current directory is used for this information. The {@link DynamicRegionFactory.Config#diskDir} + * <p> + * Saving the factory on disk: If {@link DynamicRegionFactory.Config#persistBackup} is configured + * for the factory, dynamic Region information is written to disk for recovery. By default the + * current directory is used for this information. The {@link DynamicRegionFactory.Config#diskDir} * can be used to change this default. * <p> - * Registering interest in cache server information: The {@link DynamicRegionFactory.Config#registerInterest} - * setting determines whether clients will register interest in server keys or not. You will generally want - * this to be turned on so that clients will see updates made to servers. In server processes, DynamicRegionFactory - * forces use of NotifyBySubscription. + * Registering interest in cache server information: The + * {@link DynamicRegionFactory.Config#registerInterest} setting determines whether clients will + * register interest in server keys or not. You will generally want this to be turned on so that + * clients will see updates made to servers. In server processes, DynamicRegionFactory forces use of + * NotifyBySubscription. * </ul> * <p> * Notes: * <ul> * <li>DynamicRegionFactories in non-client VMs must not be configured with a pool. - * <li>If {@link #open()} is called before cache creation and the cache.xml has a dynamic-region-factory - * element then the cache.xml will override the open call's configuration. + * <li>If {@link #open()} is called before cache creation and the cache.xml has a + * dynamic-region-factory element then the cache.xml will override the open call's configuration. * - * <li>Since the RegionAttributes of a dynamically created Region are copied - * from the parent Region, any callbacks, ({@link CacheListener}, - * {@link CacheWriter}, and {@link CacheLoader} - * are shared by the parent and all its dynamic children - * so make sure the callback is thread-safe and that its - * {@link CacheCallback#close} implementation does not stop it from functioning. - * However the products LRUAlgorithm instances will - * be cloned so that each dynamic Region has its own callback. + * <li>Since the RegionAttributes of a dynamically created Region are copied from the parent Region, + * any callbacks, ({@link CacheListener}, {@link CacheWriter}, and {@link CacheLoader} are shared by + * the parent and all its dynamic children so make sure the callback is thread-safe and that its + * {@link CacheCallback#close} implementation does not stop it from functioning. However the + * products LRUAlgorithm instances will be cloned so that each dynamic Region has its own callback. * - * <li>The root Region name "DynamicRegions" is reserved. The factory creates a root Region of - * that name and uses it to keep track of what dynamic Regions exist. Applications should - * not directly access this Region; instead use the methods on this factory. + * <li>The root Region name "DynamicRegions" is reserved. The factory creates a root Region of that + * name and uses it to keep track of what dynamic Regions exist. Applications should not directly + * access this Region; instead use the methods on this factory. * </ul> + * * @since GemFire 4.3 - * @deprecated This class is deprecated. Use {@link FunctionService} to create regions on - * other members instead. + * @deprecated This class is deprecated. Use {@link FunctionService} to create regions on other + * members instead. * */ @SuppressWarnings("deprecation") @Deprecated -public abstract class DynamicRegionFactory { +public abstract class DynamicRegionFactory { public static final String dynamicRegionListName = "__DynamicRegions"; private Region dynamicRegionList = null; /** - * This controls the delay introduced to try and avoid any race conditions - * between propagation of newly created Dynamic Regions - * and the Entries put into them. + * This controls the delay introduced to try and avoid any race conditions between propagation of + * newly created Dynamic Regions and the Entries put into them. */ - private static final long regionCreateSleepMillis = Long.getLong("DynamicRegionFactory.msDelay", 250).longValue(); - private static DynamicRegionFactory singleInstance = new DynamicRegionFactoryImpl ( ); + private static final long regionCreateSleepMillis = + Long.getLong("DynamicRegionFactory.msDelay", 250).longValue(); + private static DynamicRegionFactory singleInstance = new DynamicRegionFactoryImpl(); GemFireCacheImpl c = null; Config config = null; @@ -159,36 +160,40 @@ public abstract class DynamicRegionFactory { } /** - * Opens the factory with the given settings. - * This should be sent to the factory before creating a cache. The cache - * will otherwise open a factory with default settings. - * This does not need to be sent if the cache.xml declares the use of dynamic regions. + * Opens the factory with the given settings. This should be sent to the factory before creating a + * cache. The cache will otherwise open a factory with default settings. This does not need to be + * sent if the cache.xml declares the use of dynamic regions. + * * @param conf the configuration for this factory. */ public void open(Config conf) { this.config = new Config(conf); } + /** - * Closes the dynamic region factory, disabling any further creation or - * destruction of dynamic regions in this cache. + * Closes the dynamic region factory, disabling any further creation or destruction of dynamic + * regions in this cache. */ protected void _close() { this.config = null; this.c = null; } + /** * Returns true if dynamic region factory is open; false if closed. */ public boolean isOpen() { return getConfig() != null; } + /** - * Returns true if this factory is open and can produce dynamic regions. - * Factories are only active after their cache has been created. + * Returns true if this factory is open and can produce dynamic regions. Factories are only active + * after their cache has been created. */ public boolean isActive() { return isOpen() && this.c != null; } + /** * Returns true if dynamic region factory is closed. */ @@ -197,8 +202,7 @@ public abstract class DynamicRegionFactory { } /** - * Returns the configuration for this factory. - * Returns null if the factory is closed; + * Returns the configuration for this factory. Returns null if the factory is closed; */ public Config getConfig() { if (this.config == null) @@ -213,53 +217,53 @@ public abstract class DynamicRegionFactory { /** * The method is for internal use only. It is called implicitly during cache creation. + * * @param theCache The GemFire <code>Cache</code> * @throws CacheException */ - protected void _internalInit ( GemFireCacheImpl theCache ) throws CacheException - { + protected void _internalInit(GemFireCacheImpl theCache) throws CacheException { if (isClosed()) { // DynamicRegions are not enabled in this vm. Just return. return; } /** - * This method is called internally during cache initialization at the correct time. - * Initialize the factory with a GemFire Cache. We create the metadata Region which holds all our + * This method is called internally during cache initialization at the correct time. Initialize + * the factory with a GemFire Cache. We create the metadata Region which holds all our * dynamically created regions. */ try { this.c = theCache; this.dynamicRegionList = theCache.getRegion(dynamicRegionListName); - final boolean isClient = this.config.getPoolName()!=null; + final boolean isClient = this.config.getPoolName() != null; if (this.dynamicRegionList == null) { - InternalRegionArguments ira = new InternalRegionArguments() - .setDestroyLockFlag(true) - .setInternalRegion(true) - .setSnapshotInputStream(null) - .setImageTarget(null); - AttributesFactory af = new AttributesFactory (); + InternalRegionArguments ira = new InternalRegionArguments().setDestroyLockFlag(true) + .setInternalRegion(true).setSnapshotInputStream(null).setImageTarget(null); + AttributesFactory af = new AttributesFactory(); if (this.config.getPersistBackup()) { af.setDataPolicy(DataPolicy.PERSISTENT_REPLICATE); af.setDiskWriteAttributes(new DiskWriteAttributesFactory().create()); if (this.config.getDiskDir() != null) { - af.setDiskDirs(new File[]{this.config.getDiskDir()}); + af.setDiskDirs(new File[] {this.config.getDiskDir()}); } } if (isClient) { af.setScope(Scope.LOCAL); - af.setDataPolicy(DataPolicy.NORMAL); //MirrorType(MirrorType.NONE); + af.setDataPolicy(DataPolicy.NORMAL); // MirrorType(MirrorType.NONE); af.setStatisticsEnabled(true); String cpName = this.config.getPoolName(); if (cpName != null) { Pool cp = PoolManager.find(cpName); - if(cp==null) { - throw new IllegalStateException("Invalid pool name specified. This pool is not registered with the cache: " + cpName); + if (cp == null) { + throw new IllegalStateException( + "Invalid pool name specified. This pool is not registered with the cache: " + + cpName); } else { if (!cp.getSubscriptionEnabled()) { - throw new IllegalStateException("The client pool of a DynamicRegionFactory must be configured with queue-enabled set to true."); + throw new IllegalStateException( + "The client pool of a DynamicRegionFactory must be configured with queue-enabled set to true."); } af.setPoolName(cpName); } @@ -267,9 +271,10 @@ public abstract class DynamicRegionFactory { ira.setInternalMetaRegion(new LocalMetaRegion(af.create(), ira)); } else { af.setScope(Scope.DISTRIBUTED_ACK); - if (!this.config.getPersistBackup()) { // if persistBackup, the data policy has already been set - af.setDataPolicy(DataPolicy.REPLICATE); //setMirrorType(MirrorType.KEYS_VALUES); - } + if (!this.config.getPersistBackup()) { // if persistBackup, the data policy has already + // been set + af.setDataPolicy(DataPolicy.REPLICATE); // setMirrorType(MirrorType.KEYS_VALUES); + } for (GatewaySender gs : c.getGatewaySenders()) { if (!gs.isParallel()) @@ -277,19 +282,19 @@ public abstract class DynamicRegionFactory { } ira.setInternalMetaRegion(new DistributedMetaRegion(af.create())); // bug fix 35432 } - - try { - dynamicRegionList = theCache.createVMRegion(dynamicRegionListName, af.create(), ira); - } - catch (IOException e) { + + try { + dynamicRegionList = theCache.createVMRegion(dynamicRegionListName, af.create(), ira); + } catch (IOException e) { // only if loading snapshot, not here - InternalGemFireError assErr = new InternalGemFireError(LocalizedStrings.DynamicRegionFactory_UNEXPECTED_EXCEPTION.toLocalizedString()); + InternalGemFireError assErr = new InternalGemFireError( + LocalizedStrings.DynamicRegionFactory_UNEXPECTED_EXCEPTION.toLocalizedString()); assErr.initCause(e); throw assErr; - } - catch (ClassNotFoundException e) { + } catch (ClassNotFoundException e) { // only if loading snapshot, not here - InternalGemFireError assErr = new InternalGemFireError(LocalizedStrings.DynamicRegionFactory_UNEXPECTED_EXCEPTION.toLocalizedString()); + InternalGemFireError assErr = new InternalGemFireError( + LocalizedStrings.DynamicRegionFactory_UNEXPECTED_EXCEPTION.toLocalizedString()); assErr.initCause(e); throw assErr; } @@ -305,40 +310,41 @@ public abstract class DynamicRegionFactory { } } - createDefinedDynamicRegions ( ); + createDefinedDynamicRegions(); - } catch ( CacheException e ) { + } catch (CacheException e) { // - theCache.getLoggerI18n().warning(LocalizedStrings.DynamicRegionFactory_ERROR_INITIALIZING_DYNAMICREGIONFACTORY, e); + theCache.getLoggerI18n().warning( + LocalizedStrings.DynamicRegionFactory_ERROR_INITIALIZING_DYNAMICREGIONFACTORY, e); throw e; } } /** - * This creates Dynamic Regions that already exist in other publishing processes + * This creates Dynamic Regions that already exist in other publishing processes * */ - private void createDefinedDynamicRegions ( ) throws CacheException { + private void createDefinedDynamicRegions() throws CacheException { // TODO: perhaps add some logic here to avoid the possiblity of synchronization issues . . . . - Set s = dynamicRegionList.entrySet( false ); + Set s = dynamicRegionList.entrySet(false); Iterator i = s.iterator(); TreeMap sorted = new TreeMap(); // sort by region name before creating (bug 35528) - while ( i.hasNext() ) { - Region.Entry e = (Region.Entry)i.next(); - DynamicRegionAttributes dda = (DynamicRegionAttributes)e.getValue(); + while (i.hasNext()) { + Region.Entry e = (Region.Entry) i.next(); + DynamicRegionAttributes dda = (DynamicRegionAttributes) e.getValue(); sorted.put(dda.rootRegionName + "/" + dda.name, dda); } i = sorted.values().iterator(); - - while ( i.hasNext() ) { - DynamicRegionAttributes dda = (DynamicRegionAttributes)i.next(); - doBeforeRegionCreated ( dda.rootRegionName, dda.name, null ); - Region region = createDynamicRegionImpl ( dda.rootRegionName, dda.name, false ); - doAfterRegionCreated ( region, false, false, null ); + while (i.hasNext()) { + DynamicRegionAttributes dda = (DynamicRegionAttributes) i.next(); + + doBeforeRegionCreated(dda.rootRegionName, dda.name, null); + Region region = createDynamicRegionImpl(dda.rootRegionName, dda.name, false); + doAfterRegionCreated(region, false, false, null); } @@ -346,6 +352,7 @@ public abstract class DynamicRegionFactory { /** * Returns the <code>DynamicRegionFactory</code> singleton instance. + * * @return the <code>DynamicRegionFactory</code> singleton instance */ public static DynamicRegionFactory get() { @@ -354,6 +361,7 @@ public abstract class DynamicRegionFactory { /** * Registers a <code>DynamicRegionListener</code> for callbacks. + * * @param listener The <code>DynamicRegionListener</code> to be registered */ public void registerDynamicRegionListener(DynamicRegionListener listener) { @@ -369,6 +377,7 @@ public abstract class DynamicRegionFactory { /** * Unregisters a <code>DynamicRegionListener</code> for callbacks. + * * @param listener The <code>DynamicRegionListener</code> to be unregistered */ public void unregisterDynamicRegionListener(DynamicRegionListener listener) { @@ -383,192 +392,200 @@ public abstract class DynamicRegionFactory { } } - private void doBeforeRegionCreated( String parentRegion, String regionName, DistributedMember mbr ) { - for ( Iterator i = regionListeners.iterator(); i.hasNext(); ) { - DynamicRegionListener listener = ( DynamicRegionListener ) i.next(); + private void doBeforeRegionCreated(String parentRegion, String regionName, + DistributedMember mbr) { + for (Iterator i = regionListeners.iterator(); i.hasNext();) { + DynamicRegionListener listener = (DynamicRegionListener) i.next(); try { - listener.beforeRegionCreate( parentRegion, regionName ); - } - catch (VirtualMachineError err) { + listener.beforeRegionCreate(parentRegion, regionName); + } catch (VirtualMachineError err) { SystemFailure.initiateFailure(err); - // If this ever returns, rethrow the error. We're poisoned + // If this ever returns, rethrow the error. We're poisoned // now, so don't let this thread continue. throw err; - } - catch (Throwable t) { + } catch (Throwable t) { // Whenever you catch Error or Throwable, you must also - // catch VirtualMachineError (see above). However, there is + // catch VirtualMachineError (see above). However, there is // _still_ a possibility that you are dealing with a cascading // error condition, so you also need to check to see if the JVM // is still usable: SystemFailure.checkFailure(); - this.c.getLoggerI18n().warning(LocalizedStrings.DynamicRegionFactory_DYNAMICREGIONLISTENER__0__THREW_EXCEPTION_ON_BEFOREREGIONCREATED, listener, t); + this.c.getLoggerI18n().warning( + LocalizedStrings.DynamicRegionFactory_DYNAMICREGIONLISTENER__0__THREW_EXCEPTION_ON_BEFOREREGIONCREATED, + listener, t); } } } - private void doAfterRegionCreated( Region region, boolean distributed, boolean isOriginRemote, DistributedMember mbr ) { - RegionEvent event = new RegionEventImpl(region, Operation.REGION_CREATE, null, isOriginRemote, getMember(mbr)); - for ( Iterator i = regionListeners.iterator(); i.hasNext(); ) { - DynamicRegionListener listener = ( DynamicRegionListener ) i.next(); + private void doAfterRegionCreated(Region region, boolean distributed, boolean isOriginRemote, + DistributedMember mbr) { + RegionEvent event = + new RegionEventImpl(region, Operation.REGION_CREATE, null, isOriginRemote, getMember(mbr)); + for (Iterator i = regionListeners.iterator(); i.hasNext();) { + DynamicRegionListener listener = (DynamicRegionListener) i.next(); try { - listener.afterRegionCreate( event /*region*/ ); - } - catch (VirtualMachineError err) { + listener.afterRegionCreate(event /* region */ ); + } catch (VirtualMachineError err) { SystemFailure.initiateFailure(err); - // If this ever returns, rethrow the error. We're poisoned + // If this ever returns, rethrow the error. We're poisoned // now, so don't let this thread continue. throw err; - } - catch (Throwable t) { + } catch (Throwable t) { // Whenever you catch Error or Throwable, you must also - // catch VirtualMachineError (see above). However, there is + // catch VirtualMachineError (see above). However, there is // _still_ a possibility that you are dealing with a cascading // error condition, so you also need to check to see if the JVM // is still usable: SystemFailure.checkFailure(); - this.c.getLoggerI18n().warning(LocalizedStrings.DynamicRegionFactory_DYNAMICREGIONLISTENER__0__THREW_EXCEPTION_ON_AFTERREGIONCREATED, listener, t); + this.c.getLoggerI18n().warning( + LocalizedStrings.DynamicRegionFactory_DYNAMICREGIONLISTENER__0__THREW_EXCEPTION_ON_AFTERREGIONCREATED, + listener, t); } } } - private void doBeforeRegionDestroyed( Region region, boolean distributed, boolean isOriginRemote, boolean expiration, DistributedMember mbr ) { + private void doBeforeRegionDestroyed(Region region, boolean distributed, boolean isOriginRemote, + boolean expiration, DistributedMember mbr) { final Operation op; if (!distributed && !isOriginRemote) { - op = expiration? Operation.REGION_EXPIRE_LOCAL_DESTROY : Operation.REGION_LOCAL_DESTROY; - } - else { - op = expiration? Operation.REGION_EXPIRE_DESTROY : Operation.REGION_DESTROY; + op = expiration ? Operation.REGION_EXPIRE_LOCAL_DESTROY : Operation.REGION_LOCAL_DESTROY; + } else { + op = expiration ? Operation.REGION_EXPIRE_DESTROY : Operation.REGION_DESTROY; } RegionEvent event = new RegionEventImpl(region, op, null, isOriginRemote, getMember(mbr)); - for ( Iterator i = regionListeners.iterator(); i.hasNext(); ) { - DynamicRegionListener listener = ( DynamicRegionListener ) i.next(); + for (Iterator i = regionListeners.iterator(); i.hasNext();) { + DynamicRegionListener listener = (DynamicRegionListener) i.next(); try { - listener.beforeRegionDestroy( event /*fullRegionName*/ ); - } - catch (VirtualMachineError err) { + listener.beforeRegionDestroy(event /* fullRegionName */ ); + } catch (VirtualMachineError err) { SystemFailure.initiateFailure(err); - // If this ever returns, rethrow the error. We're poisoned + // If this ever returns, rethrow the error. We're poisoned // now, so don't let this thread continue. throw err; - } - catch (Throwable t) { + } catch (Throwable t) { // Whenever you catch Error or Throwable, you must also - // catch VirtualMachineError (see above). However, there is + // catch VirtualMachineError (see above). However, there is // _still_ a possibility that you are dealing with a cascading // error condition, so you also need to check to see if the JVM // is still usable: SystemFailure.checkFailure(); - this.c.getLoggerI18n().warning(LocalizedStrings.DynamicRegionFactory_DYNAMICREGIONLISTENER__0__THREW_EXCEPTION_ON_BEFOREREGIONDESTROYED, listener, t); + this.c.getLoggerI18n().warning( + LocalizedStrings.DynamicRegionFactory_DYNAMICREGIONLISTENER__0__THREW_EXCEPTION_ON_BEFOREREGIONDESTROYED, + listener, t); } } } - private void doAfterRegionDestroyed( Region region, boolean distributed, boolean isOriginRemote, boolean expiration, DistributedMember mbr ) { + private void doAfterRegionDestroyed(Region region, boolean distributed, boolean isOriginRemote, + boolean expiration, DistributedMember mbr) { final Operation op; if (!distributed && !isOriginRemote) { - op = expiration? Operation.REGION_EXPIRE_LOCAL_DESTROY : Operation.REGION_LOCAL_DESTROY; - } - else { - op = expiration? Operation.REGION_EXPIRE_DESTROY : Operation.REGION_DESTROY; + op = expiration ? Operation.REGION_EXPIRE_LOCAL_DESTROY : Operation.REGION_LOCAL_DESTROY; + } else { + op = expiration ? Operation.REGION_EXPIRE_DESTROY : Operation.REGION_DESTROY; } RegionEvent event = new RegionEventImpl(region, op, null, isOriginRemote, getMember(mbr)); - for ( Iterator i = regionListeners.iterator(); i.hasNext(); ) { - DynamicRegionListener listener = ( DynamicRegionListener ) i.next(); + for (Iterator i = regionListeners.iterator(); i.hasNext();) { + DynamicRegionListener listener = (DynamicRegionListener) i.next(); try { - listener.afterRegionDestroy( event /*fullRegionName*/ ); - } - catch (VirtualMachineError err) { + listener.afterRegionDestroy(event /* fullRegionName */ ); + } catch (VirtualMachineError err) { SystemFailure.initiateFailure(err); - // If this ever returns, rethrow the error. We're poisoned + // If this ever returns, rethrow the error. We're poisoned // now, so don't let this thread continue. throw err; - } - catch (Throwable t) { + } catch (Throwable t) { // Whenever you catch Error or Throwable, you must also - // catch VirtualMachineError (see above). However, there is + // catch VirtualMachineError (see above). However, there is // _still_ a possibility that you are dealing with a cascading // error condition, so you also need to check to see if the JVM // is still usable: SystemFailure.checkFailure(); - this.c.getLoggerI18n().warning(LocalizedStrings.DynamicRegionFactory_DYNAMICREGIONLISTENER__0__THREW_EXCEPTION_ON_AFTERREGIONDESTROYED, listener, t); + this.c.getLoggerI18n().warning( + LocalizedStrings.DynamicRegionFactory_DYNAMICREGIONLISTENER__0__THREW_EXCEPTION_ON_AFTERREGIONDESTROYED, + listener, t); } } } - + /** return the argument, or if null the DistributedMember id of this vm */ private DistributedMember getMember(DistributedMember mbr) { if (mbr == null) { return InternalDistributedSystem.getAnyInstance().getDistributedMember(); - } - else { - return null; + } else { + return null; } } - + /** - * Creates the dynamic Region in the local cache and distributes the - * creation to other caches. + * Creates the dynamic Region in the local cache and distributes the creation to other caches. * * @param parentRegionName the new region is created as a subregion of the region having this path * @param regionName the name of the new subregion * @return the <code>Region</code> created * @throws CacheException */ - public Region createDynamicRegion ( String parentRegionName, String regionName ) throws CacheException { + public Region createDynamicRegion(String parentRegionName, String regionName) + throws CacheException { if (isClosed()) { throw new IllegalStateException("Dynamic region factory is closed"); } - doBeforeRegionCreated ( parentRegionName, regionName, null ); - Region region = createDynamicRegionImpl ( parentRegionName, regionName, true ); - doAfterRegionCreated ( region, false, false, null ); + doBeforeRegionCreated(parentRegionName, regionName, null); + Region region = createDynamicRegionImpl(parentRegionName, regionName, true); + doAfterRegionCreated(region, false, false, null); return region; } /** - * Destroys the dynamic Region in the local cache and distributes the - * destruction to other caches. - * @param fullRegionName The full path of the <code>Region</code> to be - * dynamically destroyed + * Destroys the dynamic Region in the local cache and distributes the destruction to other caches. + * + * @param fullRegionName The full path of the <code>Region</code> to be dynamically destroyed * @throws CacheException - * @throws RegionDestroyedException if the dynamic region was never created - * or has already been destroyed + * @throws RegionDestroyedException if the dynamic region was never created or has already been + * destroyed */ - public void destroyDynamicRegion ( String fullRegionName ) throws CacheException { + public void destroyDynamicRegion(String fullRegionName) throws CacheException { if (!dynamicRegionList.containsKey(fullRegionName)) { - throw new RegionDestroyedException(LocalizedStrings.DynamicRegionFactory_DYNAMIC_REGION_0_HAS_NOT_BEEN_CREATED.toLocalizedString(fullRegionName), fullRegionName); + throw new RegionDestroyedException( + LocalizedStrings.DynamicRegionFactory_DYNAMIC_REGION_0_HAS_NOT_BEEN_CREATED + .toLocalizedString(fullRegionName), + fullRegionName); } if (isClosed()) { throw new IllegalStateException("Dynamic region factory is closed"); } // Retrieve the region to destroy - Region region = c.getRegion( fullRegionName ); + Region region = c.getRegion(fullRegionName); if (region != null) { DistributedMember mbr = getMember(null); - doBeforeRegionDestroyed ( region, false, false, false, mbr ); + doBeforeRegionDestroyed(region, false, false, false, mbr); // Locally destroy the region. Let the dynamicRegionList handle distributing // the destroy. region.localDestroyRegion(); destroyDynamicRegionImpl(fullRegionName); - doAfterRegionDestroyed ( region, false, false, false, mbr ); + doAfterRegionDestroyed(region, false, false, false, mbr); } else { // make sure meta region is cleaned up locally and remotely destroyDynamicRegionImpl(fullRegionName); } } - private Region createDynamicRegionImpl ( String parentRegionName, String newRegionName, boolean addEntry ) - throws CacheException { + private Region createDynamicRegionImpl(String parentRegionName, String newRegionName, + boolean addEntry) throws CacheException { - Region parentRegion = c.getRegion ( parentRegionName ); + Region parentRegion = c.getRegion(parentRegionName); Region newRegion = null; - if ( parentRegion == null ) { - String errMsg = LocalizedStrings.DynamicRegionFactory_ERROR__COULD_NOT_FIND_A_REGION_NAMED___0_.toLocalizedString(parentRegionName); + if (parentRegion == null) { + String errMsg = + LocalizedStrings.DynamicRegionFactory_ERROR__COULD_NOT_FIND_A_REGION_NAMED___0_ + .toLocalizedString(parentRegionName); RegionDestroyedException e = new RegionDestroyedException(errMsg, parentRegionName); - c.getLoggerI18n().warning(LocalizedStrings.DynamicRegionFactory_ERROR__COULD_NOT_FIND_A_REGION_NAMED___0_, parentRegionName, e); + c.getLoggerI18n().warning( + LocalizedStrings.DynamicRegionFactory_ERROR__COULD_NOT_FIND_A_REGION_NAMED___0_, + parentRegionName, e); throw e; } @@ -576,12 +593,12 @@ public abstract class DynamicRegionFactory { RegionAttributes rra = parentRegion.getAttributes(); RegionAttributes newRegionAttributes = null; - AttributesFactory af = new AttributesFactory( rra ); + AttributesFactory af = new AttributesFactory(rra); { EvictionAttributes ev = rra.getEvictionAttributes(); if (ev != null && ev.getAlgorithm().isLRU()) { - EvictionAttributes rev = new EvictionAttributesImpl( (EvictionAttributesImpl)ev ); - af.setEvictionAttributes( rev ); + EvictionAttributes rev = new EvictionAttributesImpl((EvictionAttributesImpl) ev); + af.setEvictionAttributes(rev); } } @@ -591,105 +608,112 @@ public abstract class DynamicRegionFactory { if (newRegionName.endsWith("_PRTEST_")) { af.setPartitionAttributes((new PartitionAttributesFactory()).create()); } - + newRegionAttributes = af.create(); try { - newRegion = parentRegion.createSubregion( newRegionName, newRegionAttributes ); + newRegion = parentRegion.createSubregion(newRegionName, newRegionAttributes); c.getLoggerI18n().fine("Created dynamic region " + newRegion); } catch (RegionExistsException ex) { // a race condition exists that can cause this so just fine log it - c.getLoggerI18n().fine("DynamicRegion " + newRegionName + " in parent " + parentRegionName + " already existed"); + c.getLoggerI18n().fine( + "DynamicRegion " + newRegionName + " in parent " + parentRegionName + " already existed"); newRegion = ex.getRegion(); -// } catch ( CacheException e ) { -// c.getLoggerI18n().warning ( "Error creating new Dynamic Region '" + newRegionName, e ); -// throw e; + // } catch ( CacheException e ) { + // c.getLoggerI18n().warning ( "Error creating new Dynamic Region '" + newRegionName, e ); + // throw e; } if (addEntry) { - DynamicRegionAttributes dra = new DynamicRegionAttributes ( ); + DynamicRegionAttributes dra = new DynamicRegionAttributes(); dra.name = newRegionName; dra.rootRegionName = parentRegion.getFullPath(); if (c.getLoggerI18n().fineEnabled()) { - c.getLoggerI18n().fine ("Putting entry into dynamic region list at key: " + newRegion.getFullPath()); + c.getLoggerI18n() + .fine("Putting entry into dynamic region list at key: " + newRegion.getFullPath()); } - dynamicRegionList.put ( newRegion.getFullPath(), dra ); + dynamicRegionList.put(newRegion.getFullPath(), dra); } if (config.getRegisterInterest()) { - ServerRegionProxy proxy = ((LocalRegion)newRegion).getServerProxy(); + ServerRegionProxy proxy = ((LocalRegion) newRegion).getServerProxy(); if (proxy != null) { - if (((Pool)proxy.getPool()).getSubscriptionEnabled()) { + if (((Pool) proxy.getPool()).getSubscriptionEnabled()) { try { newRegion.registerInterest("ALL_KEYS"); - } - catch (GemFireSecurityException ex) { + } catch (GemFireSecurityException ex) { // Ignore security exceptions here c.getSecurityLoggerI18n().warning( - LocalizedStrings.DynamicRegionFactory_EXCEPTION_WHEN_REGISTERING_INTEREST_FOR_ALL_KEYS_IN_DYNAMIC_REGION_0_1, - new Object[] {newRegion.getFullPath(), ex}); + LocalizedStrings.DynamicRegionFactory_EXCEPTION_WHEN_REGISTERING_INTEREST_FOR_ALL_KEYS_IN_DYNAMIC_REGION_0_1, + new Object[] {newRegion.getFullPath(), ex}); } } } } - + if (regionCreateSleepMillis > 0) { try { - Thread.sleep( regionCreateSleepMillis ); - } catch ( InterruptedException e ) { + Thread.sleep(regionCreateSleepMillis); + } catch (InterruptedException e) { Thread.currentThread().interrupt(); } } if (c.getLoggerI18n().fineEnabled()) { - c.getLoggerI18n().fine ( "Created Dynamic Region " + newRegion.getFullPath() ); + c.getLoggerI18n().fine("Created Dynamic Region " + newRegion.getFullPath()); } return newRegion; } - private void destroyDynamicRegionImpl(String fullRegionName) - throws CacheException { + private void destroyDynamicRegionImpl(String fullRegionName) throws CacheException { // Destroy the entry in the dynamicRegionList try { if (c.getLoggerI18n().fineEnabled()) { - c.getLoggerI18n().fine ("Destroying entry from dynamic region list at key: " + fullRegionName); + c.getLoggerI18n() + .fine("Destroying entry from dynamic region list at key: " + fullRegionName); } - dynamicRegionList.destroy ( fullRegionName ); + dynamicRegionList.destroy(fullRegionName); } catch (CacheException e) { - c.getLoggerI18n().warning(LocalizedStrings.DynamicRegionFactory_ERROR_DESTROYING_DYNAMIC_REGION__0, fullRegionName, e); + c.getLoggerI18n().warning( + LocalizedStrings.DynamicRegionFactory_ERROR_DESTROYING_DYNAMIC_REGION__0, fullRegionName, + e); throw e; } if (c.getLoggerI18n().fineEnabled()) { - c.getLoggerI18n().fine ( "Destroyed Dynamic Region " + fullRegionName ); + c.getLoggerI18n().fine("Destroyed Dynamic Region " + fullRegionName); } } /** - * Configuration for dynamic region factory. - * The default attributes are: + * Configuration for dynamic region factory. The default attributes are: * <ul> * <li>diskDir: <code>null</code> * <li>poolName: <code>null</code> * <li>persistBackup: <code>true</code> * <li>registerInterest: <code>true</code> * </ul> + * * @since GemFire 4.3 */ - public static class Config { - private static final boolean DISABLE_REGISTER_INTEREST = Boolean.getBoolean("DynamicRegionFactory.disableRegisterInterest"); - private static final boolean DISABLE_PERSIST_BACKUP = Boolean.getBoolean("DynamicRegionFactory.disablePersistence"); + public static class Config { + private static final boolean DISABLE_REGISTER_INTEREST = + Boolean.getBoolean("DynamicRegionFactory.disableRegisterInterest"); + private static final boolean DISABLE_PERSIST_BACKUP = + Boolean.getBoolean("DynamicRegionFactory.disablePersistence"); - /** Causes the factory to be persisted on disk. See {@link #diskDir} */ + /** Causes the factory to be persisted on disk. See {@link #diskDir} */ public final boolean persistBackup; /** The directory where the factory's {@link #persistBackup} files are placed */ public final File diskDir; - /** Causes regions created by the factory to register interest in all keys in a corresponding server cache region */ + /** + * Causes regions created by the factory to register interest in all keys in a corresponding + * server cache region + */ public final boolean registerInterest; - + /** - * The ${link Pool} to be used by a client factory to communicate with - * the server-side factory. + * The ${link Pool} to be used by a client factory to communicate with the server-side factory. */ public final String poolName; @@ -706,15 +730,11 @@ public abstract class DynamicRegionFactory { public Config(File diskDir, String poolName) { this(diskDir, poolName, !DISABLE_PERSIST_BACKUP, !DISABLE_REGISTER_INTEREST); } + /** * Creates a configuration with the given attributes */ - public Config( - File diskDir, - String poolName, - boolean persistBackup, - boolean registerInterest) - { + public Config(File diskDir, String poolName, boolean persistBackup, boolean registerInterest) { this.registerInterest = registerInterest; this.persistBackup = persistBackup; this.diskDir = diskDir; @@ -764,34 +784,33 @@ public abstract class DynamicRegionFactory { public boolean getPersistBackup() { return this.persistBackup; } - + /** - * Returns true if the region will register interest in all keys of a corresponding - * server cache region + * Returns true if the region will register interest in all keys of a corresponding server cache + * region */ public boolean getRegisterInterest() { return this.registerInterest; } - + /** - * Returns the disk directory that the dynamic region factory data - * will be written to. - * Returns null if no directory has been specified. - * The diskDir is only used if <code>persistBackup</code> is true. + * Returns the disk directory that the dynamic region factory data will be written to. Returns + * null if no directory has been specified. The diskDir is only used if + * <code>persistBackup</code> is true. */ public File getDiskDir() { return this.diskDir; } - - + + /** - * Returns the name of the {@link Pool} associated with the dynamic region factory. - * Returns null if there is no connection pool for dynamic regions. + * Returns the name of the {@link Pool} associated with the dynamic region factory. Returns null + * if there is no connection pool for dynamic regions. */ public String getPoolName() { return this.poolName; } - + /** create a new Config with settings from another one */ Config(Config conf) { this.diskDir = conf.diskDir; @@ -800,28 +819,31 @@ public abstract class DynamicRegionFactory { this.poolName = conf.poolName; } } - + protected void buildDynamicRegion(EntryEvent event) { if (!DynamicRegionFactory.this.isOpen()) return; - + // Ignore the callback if it originated in this process (because the region // will already have been created) and the event is not a client event - if ( !event.isOriginRemote() && !event.isBridgeEvent() ) return; + if (!event.isOriginRemote() && !event.isBridgeEvent()) + return; // - DynamicRegionAttributes dra = (DynamicRegionAttributes)event.getNewValue(); + DynamicRegionAttributes dra = (DynamicRegionAttributes) event.getNewValue(); String parentRegionName = dra.rootRegionName; String newRegionName = dra.name; try { - doBeforeRegionCreated ( parentRegionName, newRegionName, event.getDistributedMember() ); - Region region = createDynamicRegionImpl ( parentRegionName, newRegionName, false); - doAfterRegionCreated ( region, true, true, event.getDistributedMember() ); - } catch ( Exception e ) { - c.getLoggerI18n().warning(LocalizedStrings.DynamicRegionFactory_ERROR_ATTEMPTING_TO_LOCALLY_CREATE_DYNAMIC_REGION__0, newRegionName, e); + doBeforeRegionCreated(parentRegionName, newRegionName, event.getDistributedMember()); + Region region = createDynamicRegionImpl(parentRegionName, newRegionName, false); + doAfterRegionCreated(region, true, true, event.getDistributedMember()); + } catch (Exception e) { + c.getLoggerI18n().warning( + LocalizedStrings.DynamicRegionFactory_ERROR_ATTEMPTING_TO_LOCALLY_CREATE_DYNAMIC_REGION__0, + newRegionName, e); } } - + protected void razeDynamicRegion(EntryEvent event) { if (!DynamicRegionFactory.this.isOpen()) return; @@ -830,65 +852,69 @@ public abstract class DynamicRegionFactory { // "local" events. If this is a true local then c.getRegion will return // null and this code will do nothing. // When bug 35644 fixed the following "if" can be uncommented. -// // Ignore the callback if it originated in this process (because the region -// // will already have been destroyed) -// if ( !event.isOriginRemote() && !(event instanceof BridgeEntryEventImpl)) return; + // // Ignore the callback if it originated in this process (because the region + // // will already have been destroyed) + // if ( !event.isOriginRemote() && !(event instanceof BridgeEntryEventImpl)) return; - String fullRegionName = ( String ) event.getKey(); - Region drRegion = c.getRegion( fullRegionName ); + String fullRegionName = (String) event.getKey(); + Region drRegion = c.getRegion(fullRegionName); if (drRegion != null) { try { - doBeforeRegionDestroyed ( drRegion, true, event.getOperation().isDistributed(), event.getOperation().isExpiration(), event.getDistributedMember() ); + doBeforeRegionDestroyed(drRegion, true, event.getOperation().isDistributed(), + event.getOperation().isExpiration(), event.getDistributedMember()); drRegion.localDestroyRegion(); - doAfterRegionDestroyed ( drRegion, true, event.getOperation().isDistributed(), event.getOperation().isExpiration(), event.getDistributedMember() ); - } catch ( Exception e ) { - c.getLoggerI18n().warning(LocalizedStrings.DynamicRegionFactory_ERROR_ATTEMPTING_TO_LOCALLY_DESTROY_DYNAMIC_REGION__0, fullRegionName, e); + doAfterRegionDestroyed(drRegion, true, event.getOperation().isDistributed(), + event.getOperation().isExpiration(), event.getDistributedMember()); + } catch (Exception e) { + c.getLoggerI18n().warning( + LocalizedStrings.DynamicRegionFactory_ERROR_ATTEMPTING_TO_LOCALLY_DESTROY_DYNAMIC_REGION__0, + fullRegionName, e); } } } - -// private class DRListener implements CacheListener { -// public void afterCreate(EntryEvent arg0) { -// buildDynamicRegion(arg0); -// } -// -// public void afterDestroy(EntryEvent arg0) { -// razeDynamicRegion(arg0); -// } -// -// public void afterInvalidate(EntryEvent arg0) { -// // Stub, nothing to do. -// } -// -// public void afterRegionDestroy(RegionEvent arg0) { -// // Stub, nothing to do. -// } -// -// public void afterRegionInvalidate(RegionEvent arg0) { -// // Stub, nothing to do. -// } -// -// public void afterUpdate(EntryEvent arg0) { -// // Stub, nothing to do. -// } -// -// public void close() { -// // Stub, nothing to do. -// } -// } - - // Introduced to keep symmetry with DistributedMetaRegion and potentially provide improved control of + + // private class DRListener implements CacheListener { + // public void afterCreate(EntryEvent arg0) { + // buildDynamicRegion(arg0); + // } + // + // public void afterDestroy(EntryEvent arg0) { + // razeDynamicRegion(arg0); + // } + // + // public void afterInvalidate(EntryEvent arg0) { + // // Stub, nothing to do. + // } + // + // public void afterRegionDestroy(RegionEvent arg0) { + // // Stub, nothing to do. + // } + // + // public void afterRegionInvalidate(RegionEvent arg0) { + // // Stub, nothing to do. + // } + // + // public void afterUpdate(EntryEvent arg0) { + // // Stub, nothing to do. + // } + // + // public void close() { + // // Stub, nothing to do. + // } + // } + + // Introduced to keep symmetry with DistributedMetaRegion and potentially provide improved control + // of // the meta data - private class LocalMetaRegion extends LocalRegion { + private class LocalMetaRegion extends LocalRegion { protected LocalMetaRegion(RegionAttributes attrs, InternalRegionArguments ira) { super(dynamicRegionListName, attrs, null, DynamicRegionFactory.this.c, ira); Assert.assertTrue(attrs.getScope().isLocal()); } - + // This is an internal uses only region @Override - protected boolean isSecret() - { + protected boolean isSecret() { return true; } @@ -897,21 +923,20 @@ public abstract class DynamicRegionFactory { return false; } -// //@override event tracker not needed for this type of region -// void initEventTracker() { -// } + // //@override event tracker not needed for this type of region + // void initEventTracker() { + // } - // while internal, its contents should be communicated with bridge clients + // while internal, its contents should be communicated with bridge clients @Override - protected boolean shouldNotifyBridgeClients() - { + protected boolean shouldNotifyBridgeClients() { return getCache().getCacheServers().size() > 0; } // Over-ride the super behavior to perform the destruction of the dynamic region @Override - public void invokeDestroyCallbacks(EnumListenerEvent eventType, EntryEventImpl event, boolean callDispatchEventsCallback, boolean notifyGateways ) - { + public void invokeDestroyCallbacks(EnumListenerEvent eventType, EntryEventImpl event, + boolean callDispatchEventsCallback, boolean notifyGateways) { Assert.assertTrue(eventType.equals(EnumListenerEvent.AFTER_DESTROY)); // Notify bridge clients (if this is a BridgeServer) event.setEventType(eventType); @@ -926,43 +951,42 @@ public abstract class DynamicRegionFactory { // Over-ride the super behavior to perform the creation of the dynamic region @Override - protected long basicPutPart2(EntryEventImpl event, RegionEntry entry, - boolean isInitialized, long lastModified, - boolean clearConflict) { - - boolean isCreate = event.getOperation().isCreate(); - boolean set = false; - - if (isCreate && !event.callbacksInvoked()) { - // don't notify clients until all peers have created the region so that - // their register-interest operations will be sure to find data - event.callbacksInvoked(true); - set = true; - } - - long result = super.basicPutPart2(event, entry, isInitialized, lastModified, clearConflict); - - if (set) { - event.callbacksInvoked(false); - } - - if (isCreate) { - buildDynamicRegion(event); + protected long basicPutPart2(EntryEventImpl event, RegionEntry entry, boolean isInitialized, + long lastModified, boolean clearConflict) { + + boolean isCreate = event.getOperation().isCreate(); + boolean set = false; + + if (isCreate && !event.callbacksInvoked()) { + // don't notify clients until all peers have created the region so that + // their register-interest operations will be sure to find data + event.callbacksInvoked(true); + set = true; + } + + long result = super.basicPutPart2(event, entry, isInitialized, lastModified, clearConflict); + + if (set) { + event.callbacksInvoked(false); + } + + if (isCreate) { + buildDynamicRegion(event); + } + return result; } - return result; - } - + // The dynamic-region meta-region needs to tell clients about the event // after all servers have created the region so that register-interest // will work correctly @Override - public void basicPutPart3(EntryEventImpl event, RegionEntry entry, - boolean isInitialized, long lastModified, boolean invokeCallbacks, - boolean ifNew, boolean ifOld, Object expectedOldValue, - boolean requireOldValue) { - - super.basicPutPart3(event, entry, isInitialized, lastModified, invokeCallbacks, ifNew, ifOld, expectedOldValue, requireOldValue); - + public void basicPutPart3(EntryEventImpl event, RegionEntry entry, boolean isInitialized, + long lastModified, boolean invokeCallbacks, boolean ifNew, boolean ifOld, + Object expectedOldValue, boolean requireOldValue) { + + super.basicPutPart3(event, entry, isInitialized, lastModified, invokeCallbacks, ifNew, ifOld, + expectedOldValue, requireOldValue); + // this code is copied from LocalRegion.basicPutPart2 invokeCallbacks &= !entry.isTombstone(); // put() is creating a tombstone if (invokeCallbacks) { @@ -973,57 +997,56 @@ public abstract class DynamicRegionFactory { } } if (doCallback) { - notifyGatewaySender(event.getOperation().isUpdate()? EnumListenerEvent.AFTER_UPDATE - : EnumListenerEvent.AFTER_CREATE, event); + notifyGatewaySender(event.getOperation().isUpdate() ? EnumListenerEvent.AFTER_UPDATE + : EnumListenerEvent.AFTER_CREATE, event); // Notify listeners if (!event.isBulkOpInProgress()) { try { entry.dispatchListenerEvents(event); - } - catch (InterruptedException ie) { + } catch (InterruptedException ie) { Thread.currentThread().interrupt(); stopper.checkCancelInProgress(null); } } } } - } + } } - // Part of the fix for bug 35432, which required a change to the + // Part of the fix for bug 35432, which required a change to the // distribution and notification order on the BridgeServer - private class DistributedMetaRegion extends DistributedRegion { + private class DistributedMetaRegion extends DistributedRegion { protected DistributedMetaRegion(RegionAttributes attrs) { - super(dynamicRegionListName, attrs, null, DynamicRegionFactory.this.c, new InternalRegionArguments()); + super(dynamicRegionListName, attrs, null, DynamicRegionFactory.this.c, + new InternalRegionArguments()); } + // This is an internal uses only region @Override - protected boolean isSecret() - { + protected boolean isSecret() { return true; } - -// //@override event tracker not needed for this type of region -// void initEventTracker() { -// } + + // //@override event tracker not needed for this type of region + // void initEventTracker() { + // } @Override protected boolean isCopyOnRead() { return false; } - // while internal, its contents should be communicated with bridge clients + // while internal, its contents should be communicated with bridge clients @Override - final public boolean shouldNotifyBridgeClients() - { + final public boolean shouldNotifyBridgeClients() { return getCache().getCacheServers().size() > 0; - } - + } + // Over-ride the super behavior to perform the destruction of the dynamic region - // + // @Override - public void invokeDestroyCallbacks(EnumListenerEvent eventType, EntryEventImpl event, boolean callDispatchEventsCallback, boolean notifyGateways) - { + public void invokeDestroyCallbacks(EnumListenerEvent eventType, EntryEventImpl event, + boolean callDispatchEventsCallback, boolean notifyGateways) { Assert.assertTrue(eventType.equals(EnumListenerEvent.AFTER_DESTROY)); // Notify bridge clients (if this is a BridgeServer) event.setEventType(eventType); @@ -1037,10 +1060,8 @@ public abstract class DynamicRegionFactory { } @Override - protected long basicPutPart2(EntryEventImpl event, RegionEntry entry, - boolean isInitialized, long lastModified, - boolean clearConflict) - { + protected long basicPutPart2(EntryEventImpl event, RegionEntry entry, boolean isInitialized, + long lastModified, boolean clearConflict) { boolean isCreate = event.getOperation().isCreate(); boolean set = false; if (isCreate && !event.callbacksInvoked()) { @@ -1049,36 +1070,35 @@ public abstract class DynamicRegionFactory { event.callbacksInvoked(true); set = true; } - + long result = super.basicPutPart2(event, entry, isInitialized, lastModified, clearConflict); - + if (set) { event.callbacksInvoked(false); } - + if (isCreate) { try { InitialImageOperation.setInhibitStateFlush(true); // fix for bug 36175 buildDynamicRegion(event); - } - finally { + } finally { InitialImageOperation.setInhibitStateFlush(false); } } return result; } - + // The dynamic-region meta-region needs to tell clients about the event // after all servers have created the region so that register-interest // will work correctly @Override - public void basicPutPart3(EntryEventImpl event, RegionEntry entry, - boolean isInitialized, long lastModified, boolean invokeCallbacks, - boolean ifNew, boolean ifOld, Object expectedOldValue, - boolean requireOldValue) { + public void basicPutPart3(EntryEventImpl event, RegionEntry entry, boolean isInitialized, + long lastModified, boolean invokeCallbacks, boolean ifNew, boolean ifOld, + Object expectedOldValue, boolean requireOldValue) { + + super.basicPutPart3(event, entry, isInitialized, lastModified, invokeCallbacks, ifNew, ifOld, + expectedOldValue, requireOldValue); - super.basicPutPart3(event, entry, isInitialized, lastModified, invokeCallbacks, ifNew, ifOld, expectedOldValue, requireOldValue); - // this code is copied from LocalRegion.basicPutPart2 invokeCallbacks &= !entry.isTombstone(); // put() is creating a tombstone if (invokeCallbacks) { @@ -1089,14 +1109,13 @@ public abstract class DynamicRegionFactory { } } if (doCallback) { - notifyGatewaySender(event.getOperation().isUpdate()? EnumListenerEvent.AFTER_UPDATE - : EnumListenerEvent.AFTER_CREATE, event); + notifyGatewaySender(event.getOperation().isUpdate() ? EnumListenerEvent.AFTER_UPDATE + : EnumListenerEvent.AFTER_CREATE, event); // Notify listeners if (!event.isBulkOpInProgress()) { try { entry.dispatchListenerEvents(event); - } - catch (InterruptedException ie) { + } catch (InterruptedException ie) { Thread.currentThread().interrupt(); stopper.checkCancelInProgress(null); }
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/geode-core/src/main/java/org/apache/geode/cache/DynamicRegionListener.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/org/apache/geode/cache/DynamicRegionListener.java b/geode-core/src/main/java/org/apache/geode/cache/DynamicRegionListener.java index b8a47de..5448013 100644 --- a/geode-core/src/main/java/org/apache/geode/cache/DynamicRegionListener.java +++ b/geode-core/src/main/java/org/apache/geode/cache/DynamicRegionListener.java @@ -1,32 +1,30 @@ /* - * 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 + * 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 + * 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. + * 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.cache; /** - * <code>DynamicRegionListener</code> is an interface that can be - * implemented to handle dynamic region-related events. - - * The methods on a <code>DynamicRegionListener</code> are invoked synchronously. - * If the listener method takes a long time to execute then it will cause the - * operation that caused it to be invoked to take a long time. + * <code>DynamicRegionListener</code> is an interface that can be implemented to handle dynamic + * region-related events. + * + * The methods on a <code>DynamicRegionListener</code> are invoked synchronously. If the listener + * method takes a long time to execute then it will cause the operation that caused it to be invoked + * to take a long time. * <p> - * Note: It is possible to receive duplicate create events when the DynamicRegionFactory - * goes active due to Cache creation. + * Note: It is possible to receive duplicate create events when the DynamicRegionFactory goes active + * due to Cache creation. * <p> * See {@link DynamicRegionFactory} * @@ -35,8 +33,8 @@ package org.apache.geode.cache; public interface DynamicRegionListener { /** - * Handles the 'before region creation' event of a dynamic region. This method - * is invoked before the dynamic region is created in the local VM. + * Handles the 'before region creation' event of a dynamic region. This method is invoked before + * the dynamic region is created in the local VM. * * @param parentRegionName The name of the parent region * @param regionName The name of the region being created @@ -44,26 +42,26 @@ public interface DynamicRegionListener { public void beforeRegionCreate(String parentRegionName, String regionName); /** - * Handles the 'after region creation' event of a dynamic region. This method - * is invoked after the dynamic region is created in the local VM. + * Handles the 'after region creation' event of a dynamic region. This method is invoked after the + * dynamic region is created in the local VM. * * @param event A <code>RegionEvent</code> describing the event */ - public void afterRegionCreate(RegionEvent<?,?> event); + public void afterRegionCreate(RegionEvent<?, ?> event); /** - * Handles the 'before region destroyed' event of a dynamic region. This method - * is invoked before the dynamic region is destroyed in the local VM. + * Handles the 'before region destroyed' event of a dynamic region. This method is invoked before + * the dynamic region is destroyed in the local VM. * * @param event A <code>RegionEvent</code> describing the event */ - public void beforeRegionDestroy(RegionEvent<?,?> event); + public void beforeRegionDestroy(RegionEvent<?, ?> event); /** - * Handles the 'after region destroyed' event of a dynamic region. This method - * is invoked after the dynamic region is destroyed in the local VM. + * Handles the 'after region destroyed' event of a dynamic region. This method is invoked after + * the dynamic region is destroyed in the local VM. * * @param event A <code>RegionEvent</code> describing the event */ - public void afterRegionDestroy(RegionEvent<?,?> event); + public void afterRegionDestroy(RegionEvent<?, ?> event); } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/geode-core/src/main/java/org/apache/geode/cache/EntryDestroyedException.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/org/apache/geode/cache/EntryDestroyedException.java b/geode-core/src/main/java/org/apache/geode/cache/EntryDestroyedException.java index 2958ad0..fd622e0 100644 --- a/geode-core/src/main/java/org/apache/geode/cache/EntryDestroyedException.java +++ b/geode-core/src/main/java/org/apache/geode/cache/EntryDestroyedException.java @@ -1,20 +1,19 @@ /* - * 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 + * 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 + * 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. + * 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.cache; + /** * Indicates that a method was invoked on an entry that has been destroyed. * @@ -23,37 +22,39 @@ package org.apache.geode.cache; * @see Region.Entry * @since GemFire 3.0 */ -public class EntryDestroyedException extends CacheRuntimeException -{ +public class EntryDestroyedException extends CacheRuntimeException { private static final long serialVersionUID = 831865939772672542L; - /** Constructs a new <code>EntryDestroyedException</code>. */ - public EntryDestroyedException() - { - super(); + + /** Constructs a new <code>EntryDestroyedException</code>. */ + public EntryDestroyedException() { + super(); } /** * Constructs a new <code>EntryDestroyedException</code> with the message. + * * @param s the detailed message for this exception */ - public EntryDestroyedException(String s) - { + public EntryDestroyedException(String s) { super(s); } - /** Constructs a new <code>EntryDestroyedException</code> with a detailed message - * and a causal exception. + /** + * Constructs a new <code>EntryDestroyedException</code> with a detailed message and a causal + * exception. + * * @param s the message * @param ex a causal Throwable */ - public EntryDestroyedException(String s, Throwable ex) - { + public EntryDestroyedException(String s, Throwable ex) { super(s, ex); } - - /** Construct a <code>EntryDestroyedException</code> with a cause. + + /** + * Construct a <code>EntryDestroyedException</code> with a cause. + * * @param ex the causal Throwable - */ + */ public EntryDestroyedException(Throwable ex) { super(ex); } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/geode-core/src/main/java/org/apache/geode/cache/EntryEvent.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/org/apache/geode/cache/EntryEvent.java b/geode-core/src/main/java/org/apache/geode/cache/EntryEvent.java index 8dda363..10f0916 100644 --- a/geode-core/src/main/java/org/apache/geode/cache/EntryEvent.java +++ b/geode-core/src/main/java/org/apache/geode/cache/EntryEvent.java @@ -1,34 +1,32 @@ /* - * 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 + * 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 + * 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. + * 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.cache; -//import java.io.*; +// import java.io.*; -/** Contains information about an event affecting an entry, including - * its identity and the the circumstances of the event. - * It is passed in to <code>CacheListener</code>, <code>CapacityController</code>, and <code>CacheWriter</code>. +/** + * Contains information about an event affecting an entry, including its identity and the the + * circumstances of the event. It is passed in to <code>CacheListener</code>, + * <code>CapacityController</code>, and <code>CacheWriter</code>. * <p> - * If this event originated from a region stored off heap then this event can - * only be used as long as the notification method that obtained it has not returned. - * For example in your implementation of {@link CacheListener#afterUpdate(EntryEvent)} the event parameter - * is only valid until your afterUpdate method returns. It is not safe to store instances of this - * class and use them later when using off heap storage. - * Attempts to access off-heap data from this event after it has expired will result in an - * IllegalStateException. + * If this event originated from a region stored off heap then this event can only be used as long + * as the notification method that obtained it has not returned. For example in your implementation + * of {@link CacheListener#afterUpdate(EntryEvent)} the event parameter is only valid until your + * afterUpdate method returns. It is not safe to store instances of this class and use them later + * when using off heap storage. Attempts to access off-heap data from this event after it has + * expired will result in an IllegalStateException. * * * @@ -37,35 +35,36 @@ package org.apache.geode.cache; * @see RegionEvent * @since GemFire 3.0 */ -public interface EntryEvent<K,V> extends CacheEvent<K,V> { +public interface EntryEvent<K, V> extends CacheEvent<K, V> { - /** Returns the key. + /** + * Returns the key. + * * @return the key */ public K getKey(); - - + + /** - * Returns the value in the cache prior to this event. - * When passed to an event handler after an event occurs, this value - * reflects the value that was in the cache in this VM, not necessarily - * the value that was in the cache VM that initiated the operation. - * In certain scenarios the old value may no longer be available in which - * case <code>null</code> is returned. - * This can happen for disk regions when the old value is on disk only. + * Returns the value in the cache prior to this event. When passed to an event handler after an + * event occurs, this value reflects the value that was in the cache in this VM, not necessarily + * the value that was in the cache VM that initiated the operation. In certain scenarios the old + * value may no longer be available in which case <code>null</code> is returned. This can happen + * for disk regions when the old value is on disk only. * - * @return the old value in the cache prior to this event. - * If the entry did not exist, was invalid, or was not available, - * then null is returned. - * @throws IllegalStateException if off-heap and called after the method that was passed this EntryEvent returns. + * @return the old value in the cache prior to this event. If the entry did not exist, was + * invalid, or was not available, then null is returned. + * @throws IllegalStateException if off-heap and called after the method that was passed this + * EntryEvent returns. */ public V getOldValue(); - + /** * Returns the serialized form of the value in the cache before this event. * * @return the serialized form of the value in the cache before this event - * @throws IllegalStateException if off-heap and called after the method that was passed this EntryEvent returns. + * @throws IllegalStateException if off-heap and called after the method that was passed this + * EntryEvent returns. * * @since GemFire 5.5 */ @@ -75,27 +74,30 @@ public interface EntryEvent<K,V> extends CacheEvent<K,V> { * Returns the value in the cache after this event. * * @return the value in the cache after this event - * @throws IllegalStateException if off-heap and called after the method that was passed this EntryEvent returns. + * @throws IllegalStateException if off-heap and called after the method that was passed this + * EntryEvent returns. */ public V getNewValue(); - + /** * Returns the serialized form of the value in the cache after this event. * * @return the serialized form of the value in the cache after this event - * @throws IllegalStateException if off-heap and called after the method that was passed this EntryEvent returns. + * @throws IllegalStateException if off-heap and called after the method that was passed this + * EntryEvent returns. * * @since GemFire 5.5 */ public SerializedCacheValue<V> getSerializedNewValue(); // Flag query methods - - /** Returns true if this event resulted from a loader running in this cache. - * Note that this will be true even if the local loader called <code>netSearch</code>. + + /** + * Returns true if this event resulted from a loader running in this cache. Note that this will be + * true even if the local loader called <code>netSearch</code>. * - * If this event is for a Partitioned Region, then true will be returned if the - * loader ran in the same VM as where the data is hosted. If true is returned, and {@link CacheEvent#isOriginRemote} + * If this event is for a Partitioned Region, then true will be returned if the loader ran in the + * same VM as where the data is hosted. If true is returned, and {@link CacheEvent#isOriginRemote} * is true, it means the data is not hosted locally, but the loader was run local to the data. * * @return true if this event resulted from local loader execution @@ -103,41 +105,47 @@ public interface EntryEvent<K,V> extends CacheEvent<K,V> { */ @Deprecated public boolean isLocalLoad(); - - /** Returns true if this event resulted from a loader running that was remote - * from the cache that requested it, i.e., a netLoad. Note that the cache - * that requested the netLoad may not be this cache in which case - * <code>isOriginRemote</code> will also return true. + + /** + * Returns true if this event resulted from a loader running that was remote from the cache that + * requested it, i.e., a netLoad. Note that the cache that requested the netLoad may not be this + * cache in which case <code>isOriginRemote</code> will also return true. + * * @return true if this event resulted from a netLoad * @deprecated as of GemFire 5.0, use {@link Operation#isNetLoad} instead. */ @Deprecated public boolean isNetLoad(); - - /** Returns true if this event resulted from a loader. + + /** + * Returns true if this event resulted from a loader. + * * @return true if isLocalLoad or isNetLoad * @deprecated as of GemFire 5.0, use {@link Operation#isLoad} instead. */ @Deprecated public boolean isLoad(); - - /** Returns true if this event resulted from a <code>netSearch</code>. If the <code>netSearch</code> - * was invoked by a loader however, this will return false and <code>isLocalLoad()</code> - * or <code>isNetLoad()</code> will return true instead. + + /** + * Returns true if this event resulted from a <code>netSearch</code>. If the + * <code>netSearch</code> was invoked by a loader however, this will return false and + * <code>isLocalLoad()</code> or <code>isNetLoad()</code> will return true instead. * * @return true if this event resulted from a netSearch * @deprecated as of GemFire 5.0, use {@link Operation#isNetSearch} instead. */ @Deprecated public boolean isNetSearch(); + /** * Gets the TransactionId for this EntryEvent. - * @return the ID of the transaction that performed the operation that - * generated this event; null if no transaction involved. + * + * @return the ID of the transaction that performed the operation that generated this event; null + * if no transaction involved. * @since GemFire 4.0 */ public TransactionId getTransactionId(); - + /** * Returns true if this event originated on a client. * @@ -147,6 +155,7 @@ public interface EntryEvent<K,V> extends CacheEvent<K,V> { */ @Deprecated public boolean isBridgeEvent(); + /** * Returns true if this event originated on a client. * @@ -154,12 +163,12 @@ public interface EntryEvent<K,V> extends CacheEvent<K,V> { * @return true if this event originated on a client. */ public boolean hasClientOrigin(); + /** - * Returns <code>true</code> if the old value is "available". - * Not available means that an old value existed but it could not be obtained - * or it was deemed too expensive to obtain. - * Note that {@link #getOldValue} will return <code>null</code> when this - * method returns <code>false</code>. + * Returns <code>true</code> if the old value is "available". Not available means that an old + * value existed but it could not be obtained or it was deemed too expensive to obtain. Note that + * {@link #getOldValue} will return <code>null</code> when this method returns <code>false</code>. + * * @since GemFire 6.0 */ public boolean isOldValueAvailable(); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/geode-core/src/main/java/org/apache/geode/cache/EntryExistsException.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/org/apache/geode/cache/EntryExistsException.java b/geode-core/src/main/java/org/apache/geode/cache/EntryExistsException.java index 15f915f..a6abbf4 100644 --- a/geode-core/src/main/java/org/apache/geode/cache/EntryExistsException.java +++ b/geode-core/src/main/java/org/apache/geode/cache/EntryExistsException.java @@ -1,24 +1,23 @@ /* - * 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 + * 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 + * 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. + * 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.cache; -/** Thrown when attempting to create a <code>Region.Entry</code> that already - * exists in the <code>Region</code>. +/** + * Thrown when attempting to create a <code>Region.Entry</code> that already exists in the + * <code>Region</code>. * * @see org.apache.geode.cache.Region#create(Object, Object) * @see Region.Entry @@ -32,6 +31,7 @@ public class EntryExistsException extends CacheException { /** * Constructs an instance of <code>EntryExistsException</code> with the specified detail message. + * * @param msg the detail message * @since GemFire 6.5 */ http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/geode-core/src/main/java/org/apache/geode/cache/EntryNotFoundException.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/org/apache/geode/cache/EntryNotFoundException.java b/geode-core/src/main/java/org/apache/geode/cache/EntryNotFoundException.java index ddc666a..498049b 100644 --- a/geode-core/src/main/java/org/apache/geode/cache/EntryNotFoundException.java +++ b/geode-core/src/main/java/org/apache/geode/cache/EntryNotFoundException.java @@ -1,25 +1,24 @@ /* - * 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 + * 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 + * 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. + * 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.cache; -/** Thrown when an operation is invoked on <code>Region</code> for an entry that - * doesn't exist in the <code>Region</code>. This exception is <i>not</i> - * thrown by {@link org.apache.geode.cache.Region#get(Object)} or {@link Region#getEntry}. +/** + * Thrown when an operation is invoked on <code>Region</code> for an entry that doesn't exist in the + * <code>Region</code>. This exception is <i>not</i> thrown by + * {@link org.apache.geode.cache.Region#get(Object)} or {@link Region#getEntry}. * * * @@ -29,18 +28,22 @@ package org.apache.geode.cache; * @since GemFire 3.0 */ public class EntryNotFoundException extends CacheException { -private static final long serialVersionUID = -2404101631744605659L; + private static final long serialVersionUID = -2404101631744605659L; + /** - * Constructs an instance of <code>EntryNotFoundException</code> with the specified detail message. + * Constructs an instance of <code>EntryNotFoundException</code> with the specified detail + * message. + * * @param msg the detail message */ public EntryNotFoundException(String msg) { super(msg); } - + /** * Constructs an instance of <code>EntryNotFoundException</code> with the specified detail message * and cause. + * * @param msg the detail message * @param cause the causal Throwable */