Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 0264F200BB9 for ; Mon, 7 Nov 2016 20:52:20 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 00BAA160AF9; Mon, 7 Nov 2016 19:52:20 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 4AC58160AE0 for ; Mon, 7 Nov 2016 20:52:17 +0100 (CET) Received: (qmail 61758 invoked by uid 500); 7 Nov 2016 19:52:16 -0000 Mailing-List: contact commits-help@geode.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@geode.incubator.apache.org Delivered-To: mailing list commits@geode.incubator.apache.org Received: (qmail 61749 invoked by uid 99); 7 Nov 2016 19:52:16 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Nov 2016 19:52:16 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 57AEAC0C69 for ; Mon, 7 Nov 2016 19:52:15 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -6.219 X-Spam-Level: X-Spam-Status: No, score=-6.219 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-2.999] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id Azje4-n3eU0a for ; Mon, 7 Nov 2016 19:51:38 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with SMTP id B608160E33 for ; Mon, 7 Nov 2016 19:51:12 +0000 (UTC) Received: (qmail 55356 invoked by uid 99); 7 Nov 2016 19:51:10 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Nov 2016 19:51:10 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 7764BF12EF; Mon, 7 Nov 2016 19:51:10 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: klund@apache.org To: commits@geode.incubator.apache.org Date: Mon, 07 Nov 2016 19:51:49 -0000 Message-Id: <51e62d78160b46ae8940dcc24471dc4a@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [42/61] [partial] incubator-geode git commit: Added Spotless plugin to enforce formatting standards. Added Google Java Style guide formatter templates, removed existing formatter templates. archived-at: Mon, 07 Nov 2016 19:52:20 -0000 http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/CreateRegionFunction.java ---------------------------------------------------------------------- diff --git a/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/CreateRegionFunction.java b/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/CreateRegionFunction.java index 21d11d9..4e9e9fd 100644 --- a/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/CreateRegionFunction.java +++ b/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/CreateRegionFunction.java @@ -1,19 +1,17 @@ /* -* 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. -*/ + * 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.modules.util; import java.io.File; @@ -54,9 +52,11 @@ public class CreateRegionFunction implements Function, Declarable { public static final String ID = "create-region-function"; - private static final boolean DUMP_SESSION_CACHE_XML = Boolean.getBoolean("gemfiremodules.dumpSessionCacheXml"); + private static final boolean DUMP_SESSION_CACHE_XML = + Boolean.getBoolean("gemfiremodules.dumpSessionCacheXml"); - private static final String REGION_CONFIGURATION_METADATA_REGION = "__regionConfigurationMetadata"; + private static final String REGION_CONFIGURATION_METADATA_REGION = + "__regionConfigurationMetadata"; public CreateRegionFunction() { this(CacheFactory.getAnyInstance()); @@ -106,7 +106,8 @@ public class CreateRegionFunction implements Function, Declarable { RegionHelper.validateRegion(this.cache, configuration, region); } catch (Exception e) { if (!e.getMessage() - .equals(LocalizedStrings.RegionAttributesCreation_CACHELISTENERS_ARE_NOT_THE_SAME.toLocalizedString())) { + .equals(LocalizedStrings.RegionAttributesCreation_CACHELISTENERS_ARE_NOT_THE_SAME + .toLocalizedString())) { this.cache.getLogger().warning(e); } status = RegionStatus.INVALID; @@ -131,8 +132,7 @@ public class CreateRegionFunction implements Function, Declarable { return true; } - public void init(Properties properties) { - } + public void init(Properties properties) {} private RegionStatus createRegion(RegionConfiguration configuration) { // Get a distributed lock @@ -150,7 +150,8 @@ public class CreateRegionFunction implements Function, Declarable { dml.lockInterruptibly(); if (this.cache.getLogger().fineEnabled()) { end = System.currentTimeMillis(); - this.cache.getLogger().fine(this + ": Obtained lock on " + dml + " in " + (end - start) + " ms"); + this.cache.getLogger() + .fine(this + ": Obtained lock on " + dml + " in " + (end - start) + " ms"); } // Attempt to get the region again after the lock has been obtained @@ -183,7 +184,8 @@ public class CreateRegionFunction implements Function, Declarable { RegionHelper.validateRegion(this.cache, configuration, region); } catch (Exception e) { if (!e.getMessage() - .equals(LocalizedStrings.RegionAttributesCreation_CACHELISTENERS_ARE_NOT_THE_SAME.toLocalizedString())) { + .equals(LocalizedStrings.RegionAttributesCreation_CACHELISTENERS_ARE_NOT_THE_SAME + .toLocalizedString())) { this.cache.getLogger().warning(e); } status = RegionStatus.INVALID; @@ -191,10 +193,8 @@ public class CreateRegionFunction implements Function, Declarable { } } catch (Exception e) { StringBuilder builder = new StringBuilder(); - builder.append(this) - .append(": Caught Exception attempting to create region named ") - .append(configuration.getRegionName()) - .append(":"); + builder.append(this).append(": Caught Exception attempting to create region named ") + .append(configuration.getRegionName()).append(":"); this.cache.getLogger().warning(builder.toString(), e); status = RegionStatus.INVALID; } finally { @@ -214,7 +214,8 @@ public class CreateRegionFunction implements Function, Declarable { private Region createRegionConfigurationMetadataRegion() { // a sessionFactory in hibernate could have been re-started // so, it is possible that this region exists already - Region r = this.cache.getRegion(REGION_CONFIGURATION_METADATA_REGION); + Region r = + this.cache.getRegion(REGION_CONFIGURATION_METADATA_REGION); if (r != null) { return r; } @@ -227,7 +228,8 @@ public class CreateRegionFunction implements Function, Declarable { try { return gemFireCache.createVMRegion(REGION_CONFIGURATION_METADATA_REGION, ra, ira); } catch (IOException | ClassNotFoundException e) { - InternalGemFireError assErr = new InternalGemFireError(LocalizedStrings.GemFireCache_UNEXPECTED_EXCEPTION.toLocalizedString()); + InternalGemFireError assErr = new InternalGemFireError( + LocalizedStrings.GemFireCache_UNEXPECTED_EXCEPTION.toLocalizedString()); assErr.initCause(e); throw assErr; } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/DebugCacheListener.java ---------------------------------------------------------------------- diff --git a/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/DebugCacheListener.java b/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/DebugCacheListener.java index 2882f58..0f2d6ef 100644 --- a/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/DebugCacheListener.java +++ b/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/DebugCacheListener.java @@ -1,19 +1,17 @@ /* -* 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. -*/ + * 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.modules.util; import org.apache.geode.cache.Declarable; @@ -43,9 +41,7 @@ public class DebugCacheListener extends CacheListenerAdapter implements Declarab private void log(EntryEvent event) { StringBuilder builder = new StringBuilder(); - builder.append("DebugCacheListener: Received ") - .append(event.getOperation()) - .append(" for key=") + builder.append("DebugCacheListener: Received ").append(event.getOperation()).append(" for key=") .append(event.getKey()); if (event.getNewValue() != null) { builder.append("; value=").append(event.getNewValue()); @@ -53,8 +49,7 @@ public class DebugCacheListener extends CacheListenerAdapter implements Declarab event.getRegion().getCache().getLogger().info(builder.toString()); } - public void init(Properties p) { - } + public void init(Properties p) {} public boolean equals(Object obj) { // This method is only implemented so that RegionCreator.validateRegion works properly. http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/ModuleStatistics.java ---------------------------------------------------------------------- diff --git a/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/ModuleStatistics.java b/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/ModuleStatistics.java index 1c41ec9..6f276c4 100644 --- a/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/ModuleStatistics.java +++ b/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/ModuleStatistics.java @@ -1,19 +1,17 @@ /* -* 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. -*/ + * 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.modules.util; import org.apache.geode.StatisticDescriptor; @@ -41,10 +39,14 @@ public class ModuleStatistics { static { StatisticsTypeFactory f = StatisticsTypeFactoryImpl.singleton(); type = f.createType("pluginStats", "statistics for hibernate plugin and hibernate L2 cache", - new StatisticDescriptor[]{f.createLongCounter("cacheHits", "number of times an entity was found in L2 cache", - "count"), f.createLongCounter("cacheMisses", "number of times an entity was NOT found in l2 cache", - "count"), f.createLongCounter("hibernateEntityDestroyJobsScheduled", - "number of entities scheduled for destroy because of version conflict with a remote member", "jobs")}); + new StatisticDescriptor[] { + f.createLongCounter("cacheHits", "number of times an entity was found in L2 cache", + "count"), + f.createLongCounter("cacheMisses", + "number of times an entity was NOT found in l2 cache", "count"), + f.createLongCounter("hibernateEntityDestroyJobsScheduled", + "number of entities scheduled for destroy because of version conflict with a remote member", + "jobs")}); cacheHitsId = type.nameToId("cacheHits"); cacheMissesId = type.nameToId("cacheMisses"); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/RegionConfiguration.java ---------------------------------------------------------------------- diff --git a/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/RegionConfiguration.java b/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/RegionConfiguration.java index f8825d2..e20421a 100644 --- a/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/RegionConfiguration.java +++ b/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/RegionConfiguration.java @@ -1,19 +1,17 @@ /* -* 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. -*/ + * 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.modules.util; import org.apache.geode.DataSerializable; @@ -28,8 +26,8 @@ import java.io.IOException; import java.io.InputStream; /** - * Class RegionConfiguration encapsulates the configuration attributes for a Region to be - * created on the server. + * Class RegionConfiguration encapsulates the configuration attributes for a + * Region to be created on the server. * * @since GemFire 6.5 */ @@ -82,16 +80,15 @@ public class RegionConfiguration implements DataSerializable { private boolean enableSessionExpirationCacheListener = false; /** - * name for the CacheWriter to be associated with this region. This cache writer must have a zero arg constructor and - * must be present on the classpath on the server. + * name for the CacheWriter to be associated with this region. This cache writer must have a zero + * arg constructor and must be present on the classpath on the server. */ private String cacheWriterName; /** * Default constructor used by the DataSerialiable interface */ - public RegionConfiguration() { - } + public RegionConfiguration() {} /** * Sets the name of the Region to be created @@ -168,7 +165,8 @@ public class RegionConfiguration implements DataSerializable { /** * Enables/disables delta replication across a Gateway. * - * @param enableGatewayDeltaReplication true to enable, false to disable gateway delta replication. + * @param enableGatewayDeltaReplication true to enable, false to disable gateway delta + * replication. */ public void setEnableGatewayDeltaReplication(boolean enableGatewayDeltaReplication) { this.enableGatewayDeltaReplication = enableGatewayDeltaReplication; @@ -269,30 +267,21 @@ public class RegionConfiguration implements DataSerializable { } public String toString() { - return new StringBuilder().append("RegionConfiguration[") - .append("regionName=") - .append(this.regionName) - .append("; regionAttributesId=") - .append(this.regionAttributesId) - .append("; maxInactiveInterval=") - .append(this.maxInactiveInterval) - .append("; enableGatewayDeltaReplication=") - .append(this.enableGatewayDeltaReplication) - .append("; enableGatewayReplication=") - .append(this.enableGatewayReplication) - .append("; enableDebugListener=") - .append(this.enableDebugListener) + return new StringBuilder().append("RegionConfiguration[").append("regionName=") + .append(this.regionName).append("; regionAttributesId=").append(this.regionAttributesId) + .append("; maxInactiveInterval=").append(this.maxInactiveInterval) + .append("; enableGatewayDeltaReplication=").append(this.enableGatewayDeltaReplication) + .append("; enableGatewayReplication=").append(this.enableGatewayReplication) + .append("; enableDebugListener=").append(this.enableDebugListener) .append("; enableSessionExpirationCacheListener=") - .append(this.enableSessionExpirationCacheListener) - .append("; cacheWriter=") - .append(this.cacheWriterName) - .append("]") - .toString(); + .append(this.enableSessionExpirationCacheListener).append("; cacheWriter=") + .append(this.cacheWriterName).append("]").toString(); } /** - * set the fully qualified name of the {@link CacheWriter} to be created on the server. The cacheWriter must have a - * zero arg constructor, and must be present on the classpath on the server. + * set the fully qualified name of the {@link CacheWriter} to be created on the server. The + * cacheWriter must have a zero arg constructor, and must be present on the classpath on the + * server. * * @param cacheWriterName fully qualified class name of the cacheWriter */ http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/RegionConfigurationCacheListener.java ---------------------------------------------------------------------- diff --git a/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/RegionConfigurationCacheListener.java b/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/RegionConfigurationCacheListener.java index c05d9d6..e756533 100644 --- a/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/RegionConfigurationCacheListener.java +++ b/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/RegionConfigurationCacheListener.java @@ -1,19 +1,17 @@ /* -* 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. -*/ + * 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.modules.util; import org.apache.geode.cache.Cache; @@ -27,7 +25,8 @@ import org.apache.geode.cache.util.CacheListenerAdapter; import java.util.Properties; -public class RegionConfigurationCacheListener extends CacheListenerAdapter implements Declarable { +public class RegionConfigurationCacheListener + extends CacheListenerAdapter implements Declarable { private Cache cache; @@ -38,7 +37,8 @@ public class RegionConfigurationCacheListener extends CacheListenerAdapter event) { RegionConfiguration configuration = event.getNewValue(); if (this.cache.getLogger().fineEnabled()) { - this.cache.getLogger().fine("RegionConfigurationCacheListener received afterCreate for region " + event.getKey()); + this.cache.getLogger().fine( + "RegionConfigurationCacheListener received afterCreate for region " + event.getKey()); } // Create region // this is a replicate region, and many VMs can be doing create region @@ -69,18 +69,14 @@ public class RegionConfigurationCacheListener extends CacheListenerAdapter 0) { - builder1.append("RegionConfigurationCacheListener region ") - .append(region.getName()) - .append(" has been initialized with the following ") - .append(regionSize) + builder1.append("RegionConfigurationCacheListener region ").append(region.getName()) + .append(" has been initialized with the following ").append(regionSize) .append(" region configurations:\n"); builder2 = new StringBuilder(); builder2.append("RegionConfigurationCacheListener created the following ") - .append(regionSize) - .append(" regions:\n"); + .append(regionSize).append(" regions:\n"); } else { - builder1.append("RegionConfigurationCacheListener region ") - .append(region.getName()) + builder1.append("RegionConfigurationCacheListener region ").append(region.getName()) .append(" has been initialized with no region configurations"); } } @@ -109,6 +105,5 @@ public class RegionConfigurationCacheListener extends CacheListenerAdapter memberInfoSet, - String when) { + private static void fillInRebalanceResultsMemberDetails(StringBuilder builder, + Set memberInfoSet, String when) { builder.append("\nMember Info ").append(when).append(" Rebalance:\n"); for (PartitionMemberInfo info : memberInfoSet) { - builder.append("\tdistributedMember=") - .append(info.getDistributedMember()) - .append(", configuredMaxMemory=") - .append(info.getConfiguredMaxMemory()) - .append(", size=") - .append(info.getSize()) - .append(", bucketCount=") - .append(info.getBucketCount()) - .append(", primaryCount=") - .append(info.getPrimaryCount()); + builder.append("\tdistributedMember=").append(info.getDistributedMember()) + .append(", configuredMaxMemory=").append(info.getConfiguredMaxMemory()).append(", size=") + .append(info.getSize()).append(", bucketCount=").append(info.getBucketCount()) + .append(", primaryCount=").append(info.getPrimaryCount()); } } } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/RegionSizeFunction.java ---------------------------------------------------------------------- diff --git a/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/RegionSizeFunction.java b/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/RegionSizeFunction.java index 5cad86c..bedfcba 100644 --- a/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/RegionSizeFunction.java +++ b/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/RegionSizeFunction.java @@ -1,19 +1,17 @@ /* -* 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. -*/ + * 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.modules.util; import org.apache.geode.cache.Declarable; @@ -51,6 +49,5 @@ public class RegionSizeFunction implements Function, Declarable { } @Override - public void init(Properties arg0) { - } + public void init(Properties arg0) {} } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/RegionStatus.java ---------------------------------------------------------------------- diff --git a/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/RegionStatus.java b/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/RegionStatus.java index d539a5c..f7e33bc 100644 --- a/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/RegionStatus.java +++ b/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/RegionStatus.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.modules.util; http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/ResourceManagerValidator.java ---------------------------------------------------------------------- diff --git a/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/ResourceManagerValidator.java b/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/ResourceManagerValidator.java index bf39bb2..d3e5f18 100644 --- a/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/ResourceManagerValidator.java +++ b/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/ResourceManagerValidator.java @@ -1,19 +1,17 @@ /* -* 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. -*/ + * 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.modules.util; import org.apache.geode.cache.GemFireCache; @@ -53,7 +51,8 @@ public class ResourceManagerValidator { } } - private static void validateSunArguments(GemFireCache cache, ResourceManager rm, List inputArguments) { + private static void validateSunArguments(GemFireCache cache, ResourceManager rm, + List inputArguments) { // Retrieve the -Xms, -Xmx, UseConcMarkSweepGC and CMSInitiatingOccupancyFraction arguments String dashXms = null, dashXmx = null, useCMS = null, cmsIOF = null; for (String argument : inputArguments) { @@ -69,15 +68,9 @@ public class ResourceManagerValidator { } if (cache.getLogger().fineEnabled()) { StringBuilder builder = new StringBuilder(); - builder.append("Relevant input java arguments: ") - .append("dashXms=") - .append(dashXms) - .append("; dashXmx=") - .append(dashXmx) - .append("; useCMS=") - .append(useCMS) - .append("; cmsIOF=") - .append(cmsIOF); + builder.append("Relevant input java arguments: ").append("dashXms=").append(dashXms) + .append("; dashXmx=").append(dashXmx).append("; useCMS=").append(useCMS) + .append("; cmsIOF=").append(cmsIOF); cache.getLogger().fine(builder.toString()); } @@ -91,15 +84,14 @@ public class ResourceManagerValidator { verifyCMSInitiatingOccupancyFraction(cache, rm, cmsIOF); } - private static void validateJavaHeapParameters(GemFireCache cache, String dashXms, String dashXmx) { + private static void validateJavaHeapParameters(GemFireCache cache, String dashXms, + String dashXmx) { if (dashXms == null) { - cache.getLogger() - .warning( - "Setting the initial size of the heap (configured using -Xms) is recommended so that GemFire cache eviction is optimal"); + cache.getLogger().warning( + "Setting the initial size of the heap (configured using -Xms) is recommended so that GemFire cache eviction is optimal"); } else if (dashXmx == null) { - cache.getLogger() - .warning( - "Setting the maximum size of the heap (configured using -Xmx) is recommended so that GemFire cache eviction is optimal"); + cache.getLogger().warning( + "Setting the maximum size of the heap (configured using -Xmx) is recommended so that GemFire cache eviction is optimal"); } else { // Neither heap parameter is null. Parse them and verify they are the same. List dashXmsList = splitAtDigits(dashXms); @@ -108,13 +100,9 @@ public class ResourceManagerValidator { String dashXmxStr = dashXmxList.get(1); if (!dashXmsStr.equals(dashXmxStr)) { StringBuilder builder = new StringBuilder(); - builder.append("Setting the initial (") - .append(dashXmsStr) - .append(dashXmsList.get(2)) - .append(") and maximum (") - .append(dashXmxStr) - .append(dashXmxList.get(2)) - .append(") sizes of the heap the same is recommended so that GemFire cache eviction is optimal"); + builder.append("Setting the initial (").append(dashXmsStr).append(dashXmsList.get(2)) + .append(") and maximum (").append(dashXmxStr).append(dashXmxList.get(2)).append( + ") sizes of the heap the same is recommended so that GemFire cache eviction is optimal"); cache.getLogger().warning(builder.toString()); } } @@ -122,31 +110,33 @@ public class ResourceManagerValidator { private static void verifyCMSGC(GemFireCache cache, String useCMS) { if (useCMS == null) { - cache.getLogger() - .warning( - "Using the concurrent garbage collector (configured using -XX:+UseConcMarkSweepGC) is recommended so that GemFire cache eviction is optimal"); + cache.getLogger().warning( + "Using the concurrent garbage collector (configured using -XX:+UseConcMarkSweepGC) is recommended so that GemFire cache eviction is optimal"); } } - private static void verifyCMSInitiatingOccupancyFraction(GemFireCache cache, ResourceManager rm, String cmsIOF) { + private static void verifyCMSInitiatingOccupancyFraction(GemFireCache cache, ResourceManager rm, + String cmsIOF) { if (cmsIOF == null) { - cache.getLogger() - .warning( - "Setting the CMS initiating occupancy fraction (configured using -XX:CMSInitiatingOccupancyFraction=N) is recommended so that GemFire cache eviction is optimal"); + cache.getLogger().warning( + "Setting the CMS initiating occupancy fraction (configured using -XX:CMSInitiatingOccupancyFraction=N) is recommended so that GemFire cache eviction is optimal"); } else { - // Parse the CMSInitiatingOccupancyFraction. Verify it is less than both eviction and critical thresholds. + // Parse the CMSInitiatingOccupancyFraction. Verify it is less than both eviction and critical + // thresholds. int cmsIOFVal = Integer.parseInt(cmsIOF.split("=")[1]); float currentEvictionHeapPercentage = rm.getEvictionHeapPercentage(); if (currentEvictionHeapPercentage != 0 && currentEvictionHeapPercentage < cmsIOFVal) { cache.getLogger() - .warning( - "Setting the CMS initiating occupancy fraction (" + cmsIOFVal + ") less than the eviction heap percentage (" + currentEvictionHeapPercentage + ") is recommended so that GemFire cache eviction is optimal"); + .warning("Setting the CMS initiating occupancy fraction (" + cmsIOFVal + + ") less than the eviction heap percentage (" + currentEvictionHeapPercentage + + ") is recommended so that GemFire cache eviction is optimal"); } float currentCriticalHeapPercentage = rm.getCriticalHeapPercentage(); if (currentCriticalHeapPercentage != 0 && currentCriticalHeapPercentage < cmsIOFVal) { cache.getLogger() - .warning( - "Setting the CMS initiating occupancy fraction (" + cmsIOFVal + ") less than the critical heap percentage (" + currentCriticalHeapPercentage + ") is recommended so that GemFire cache eviction is optimal"); + .warning("Setting the CMS initiating occupancy fraction (" + cmsIOFVal + + ") less than the critical heap percentage (" + currentCriticalHeapPercentage + + ") is recommended so that GemFire cache eviction is optimal"); } } } @@ -160,7 +150,6 @@ public class ResourceManagerValidator { return result; } - private ResourceManagerValidator() { - } + private ResourceManagerValidator() {} } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/SessionCustomExpiry.java ---------------------------------------------------------------------- diff --git a/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/SessionCustomExpiry.java b/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/SessionCustomExpiry.java index 2e6b3cf..fd1e5b2 100644 --- a/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/SessionCustomExpiry.java +++ b/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/SessionCustomExpiry.java @@ -1,19 +1,17 @@ /* -* 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. -*/ + * 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.modules.util; import org.apache.geode.cache.CustomExpiry; @@ -27,26 +25,27 @@ import java.io.Serializable; import java.util.Properties; @SuppressWarnings("serial") -public class SessionCustomExpiry implements CustomExpiry, Serializable, Declarable { +public class SessionCustomExpiry + implements CustomExpiry, Serializable, Declarable { private static final long serialVersionUID = 182735509690640051L; - private static final ExpirationAttributes EXPIRE_NOW = new ExpirationAttributes(1, ExpirationAction.DESTROY); + private static final ExpirationAttributes EXPIRE_NOW = + new ExpirationAttributes(1, ExpirationAction.DESTROY); public ExpirationAttributes getExpiry(Region.Entry entry) { HttpSession session = entry.getValue(); if (session != null) { - return new ExpirationAttributes(entry.getValue().getMaxInactiveInterval(), ExpirationAction.DESTROY); + return new ExpirationAttributes(entry.getValue().getMaxInactiveInterval(), + ExpirationAction.DESTROY); } else { return EXPIRE_NOW; } } - public void close() { - } + public void close() {} - public void init(Properties props) { - } + public void init(Properties props) {} public boolean equals(Object obj) { // This method is only implemented so that RegionCreator.validateRegion works properly. http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/TouchPartitionedRegionEntriesFunction.java ---------------------------------------------------------------------- diff --git a/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/TouchPartitionedRegionEntriesFunction.java b/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/TouchPartitionedRegionEntriesFunction.java index ab630a2..9a3f5aa 100644 --- a/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/TouchPartitionedRegionEntriesFunction.java +++ b/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/TouchPartitionedRegionEntriesFunction.java @@ -1,19 +1,17 @@ /* -* 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. -*/ + * 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.modules.util; import org.apache.geode.cache.Cache; @@ -58,12 +56,8 @@ public class TouchPartitionedRegionEntriesFunction implements Function, Declarab if (this.cache.getLogger().fineEnabled()) { StringBuilder builder = new StringBuilder(); - builder.append("Function ") - .append(ID) - .append(" received request to touch ") - .append(primaryDataSet.getFullPath()) - .append("->") - .append(keys); + builder.append("Function ").append(ID).append(" received request to touch ") + .append(primaryDataSet.getFullPath()).append("->").append(keys); this.cache.getLogger().fine(builder.toString()); } @@ -93,7 +87,6 @@ public class TouchPartitionedRegionEntriesFunction implements Function, Declarab return true; } - public void init(Properties properties) { - } + public void init(Properties properties) {} } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/TouchReplicatedRegionEntriesFunction.java ---------------------------------------------------------------------- diff --git a/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/TouchReplicatedRegionEntriesFunction.java b/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/TouchReplicatedRegionEntriesFunction.java index f3bb294..3d2a037 100644 --- a/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/TouchReplicatedRegionEntriesFunction.java +++ b/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/TouchReplicatedRegionEntriesFunction.java @@ -1,19 +1,17 @@ /* -* 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. -*/ + * 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.modules.util; import org.apache.geode.cache.Cache; @@ -27,8 +25,8 @@ import java.util.Properties; import java.util.Set; /** - * Touches the keys contained in the set of keys by performing a get on the replicated region. This is a non-data-aware - * function invoked using onMembers or onServers. + * Touches the keys contained in the set of keys by performing a get on the replicated region. This + * is a non-data-aware function invoked using onMembers or onServers. * */ public class TouchReplicatedRegionEntriesFunction implements Function, Declarable { @@ -53,12 +51,8 @@ public class TouchReplicatedRegionEntriesFunction implements Function, Declarabl Set keys = (Set) arguments[1]; if (this.cache.getLogger().fineEnabled()) { StringBuilder builder = new StringBuilder(); - builder.append("Function ") - .append(ID) - .append(" received request to touch ") - .append(regionName) - .append("->") - .append(keys); + builder.append("Function ").append(ID).append(" received request to touch ") + .append(regionName).append("->").append(keys); this.cache.getLogger().fine(builder.toString()); } @@ -90,7 +84,6 @@ public class TouchReplicatedRegionEntriesFunction implements Function, Declarabl return true; } - public void init(Properties properties) { - } + public void init(Properties properties) {} } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/extensions/geode-modules/src/test/java/org/apache/geode/modules/session/Callback.java ---------------------------------------------------------------------- diff --git a/extensions/geode-modules/src/test/java/org/apache/geode/modules/session/Callback.java b/extensions/geode-modules/src/test/java/org/apache/geode/modules/session/Callback.java index 4b04b56..46b4a25 100644 --- a/extensions/geode-modules/src/test/java/org/apache/geode/modules/session/Callback.java +++ b/extensions/geode-modules/src/test/java/org/apache/geode/modules/session/Callback.java @@ -1,19 +1,17 @@ /* -* 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. -*/ + * 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.modules.session; import javax.servlet.ServletException; @@ -26,5 +24,6 @@ import java.io.IOException; */ public interface Callback { - public void call(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException; + public void call(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException; } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/extensions/geode-modules/src/test/java/org/apache/geode/modules/session/CommandServlet.java ---------------------------------------------------------------------- diff --git a/extensions/geode-modules/src/test/java/org/apache/geode/modules/session/CommandServlet.java b/extensions/geode-modules/src/test/java/org/apache/geode/modules/session/CommandServlet.java index 89e8d8d..3fede62 100644 --- a/extensions/geode-modules/src/test/java/org/apache/geode/modules/session/CommandServlet.java +++ b/extensions/geode-modules/src/test/java/org/apache/geode/modules/session/CommandServlet.java @@ -1,19 +1,17 @@ /* -* 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. -*/ + * 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.modules.session; @@ -42,7 +40,8 @@ public class CommandServlet extends HttpServlet { * @throws IOException */ @Override - protected void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { + protected void doGet(HttpServletRequest request, HttpServletResponse response) + throws IOException, ServletException { QueryCommand cmd = QueryCommand.UNKNOWN; String param = request.getParameter("param"); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/extensions/geode-modules/src/test/java/org/apache/geode/modules/session/EmbeddedTomcat.java ---------------------------------------------------------------------- diff --git a/extensions/geode-modules/src/test/java/org/apache/geode/modules/session/EmbeddedTomcat.java b/extensions/geode-modules/src/test/java/org/apache/geode/modules/session/EmbeddedTomcat.java index 9ba4d8f..7f04e8b 100644 --- a/extensions/geode-modules/src/test/java/org/apache/geode/modules/session/EmbeddedTomcat.java +++ b/extensions/geode-modules/src/test/java/org/apache/geode/modules/session/EmbeddedTomcat.java @@ -1,19 +1,17 @@ /* -* 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. -*/ + * 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.modules.session; import org.apache.geode.modules.session.catalina.JvmRouteBinderValve; @@ -71,7 +69,8 @@ public class EmbeddedTomcat { */ private String webappDir = ""; - public EmbeddedTomcat(String contextPath, int port, String jvmRoute) throws MalformedURLException { + public EmbeddedTomcat(String contextPath, int port, String jvmRoute) + throws MalformedURLException { this.contextPath = contextPath; this.port = port; @@ -148,7 +147,8 @@ public class EmbeddedTomcat { } } - public StandardWrapper addServlet(String path, String name, String clazz) throws ServletException { + public StandardWrapper addServlet(String path, String name, String clazz) + throws ServletException { StandardWrapper servlet = (StandardWrapper) rootContext.createWrapper(); servlet.setName(name); servlet.setServletClass(clazz); @@ -158,7 +158,7 @@ public class EmbeddedTomcat { rootContext.addServletMapping(path, name); servlet.setParent(rootContext); -// servlet.load(); + // servlet.load(); return servlet; } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/extensions/geode-modules/src/test/java/org/apache/geode/modules/session/QueryCommand.java ---------------------------------------------------------------------- diff --git a/extensions/geode-modules/src/test/java/org/apache/geode/modules/session/QueryCommand.java b/extensions/geode-modules/src/test/java/org/apache/geode/modules/session/QueryCommand.java index 81d5301..2b89e68 100644 --- a/extensions/geode-modules/src/test/java/org/apache/geode/modules/session/QueryCommand.java +++ b/extensions/geode-modules/src/test/java/org/apache/geode/modules/session/QueryCommand.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.modules.session; http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/extensions/geode-modules/src/test/java/org/apache/geode/modules/session/TestSessionsBase.java ---------------------------------------------------------------------- diff --git a/extensions/geode-modules/src/test/java/org/apache/geode/modules/session/TestSessionsBase.java b/extensions/geode-modules/src/test/java/org/apache/geode/modules/session/TestSessionsBase.java index d0c4b19..d7674dd 100644 --- a/extensions/geode-modules/src/test/java/org/apache/geode/modules/session/TestSessionsBase.java +++ b/extensions/geode-modules/src/test/java/org/apache/geode/modules/session/TestSessionsBase.java @@ -1,19 +1,17 @@ /* -* 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. -*/ + * 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.modules.session; import static org.apache.geode.distributed.ConfigurationProperties.*; @@ -72,8 +70,8 @@ public abstract class TestSessionsBase { server.startContainer(); /* - * Can only retrieve the region once the container has started up - * (and the cache has started too). + * Can only retrieve the region once the container has started up (and the cache has started + * too). */ region = sessionManager.getSessionCache().getSessionRegion(); } @@ -107,8 +105,9 @@ public abstract class TestSessionsBase { } /** - * Test callback functionality. This is here really just as an example. Callbacks are useful to implement per test - * actions which can be defined within the actual test method instead of in a separate servlet class. + * Test callback functionality. This is here really just as an example. Callbacks are useful to + * implement per test actions which can be defined within the actual test method instead of in a + * separate servlet class. */ @Test public void testCallback() throws Exception { @@ -116,7 +115,8 @@ public abstract class TestSessionsBase { Callback c = new Callback() { @Override - public void call(HttpServletRequest request, HttpServletResponse response) throws IOException { + public void call(HttpServletRequest request, HttpServletResponse response) + throws IOException { PrintWriter out = response.getWriter(); out.write(helloWorld); } @@ -141,7 +141,8 @@ public abstract class TestSessionsBase { Callback c = new Callback() { @Override - public void call(HttpServletRequest request, HttpServletResponse response) throws IOException { + public void call(HttpServletRequest request, HttpServletResponse response) + throws IOException { HttpSession session = request.getSession(); response.getWriter().write(Boolean.toString(session.isNew())); } @@ -162,7 +163,8 @@ public abstract class TestSessionsBase { } /** - * Check that our session persists. The values we pass in as query params are used to set attributes on the session. + * Check that our session persists. The values we pass in as query params are used to set + * attributes on the session. */ @Test public void testSessionPersists1() throws Exception { @@ -251,13 +253,14 @@ public abstract class TestSessionsBase { } /** - * Test setting the session expiration via a property change as would happen under normal deployment conditions. + * Test setting the session expiration via a property change as would happen under normal + * deployment conditions. */ @Test public void testSessionExpiration2() throws Exception { // TestSessions only live for a minute - sessionManager.propertyChange( - new PropertyChangeEvent(server.getRootContext(), "sessionTimeout", new Integer(30), new Integer(1))); + sessionManager.propertyChange(new PropertyChangeEvent(server.getRootContext(), "sessionTimeout", + new Integer(30), new Integer(1))); // Check that the value has been set to 60 seconds assertEquals(60, sessionManager.getMaxInactiveInterval()); @@ -343,7 +346,8 @@ public abstract class TestSessionsBase { } /** - * Test that multiple attribute updates, within the same request result in only the latest one being effective. + * Test that multiple attribute updates, within the same request result in only the latest one + * being effective. */ @Test public void testMultipleAttributeUpdates() throws Exception { @@ -351,7 +355,8 @@ public abstract class TestSessionsBase { Callback c = new Callback() { @Override - public void call(HttpServletRequest request, HttpServletResponse response) throws IOException { + public void call(HttpServletRequest request, HttpServletResponse response) + throws IOException { HttpSession session = request.getSession(); for (int i = 0; i < 1000; i++) { session.setAttribute(key, Integer.toString(i)); @@ -380,7 +385,8 @@ public abstract class TestSessionsBase { public void testCommitSessionValveInvalidSession() throws Exception { Callback c = new Callback() { @Override - public void call(HttpServletRequest request, HttpServletResponse response) throws IOException { + public void call(HttpServletRequest request, HttpServletResponse response) + throws IOException { HttpSession session = request.getSession(); session.invalidate(); response.getWriter().write("done"); @@ -406,7 +412,8 @@ public abstract class TestSessionsBase { public void testExtraSessionsNotCreated() throws Exception { Callback c = new Callback() { @Override - public void call(HttpServletRequest request, HttpServletResponse response) throws IOException { + public void call(HttpServletRequest request, HttpServletResponse response) + throws IOException { // Do nothing with sessions response.getWriter().write("done"); } @@ -426,13 +433,15 @@ public abstract class TestSessionsBase { } /** - * Test for issue #46 lastAccessedTime is not updated at the start of the request, but only at the end. + * Test for issue #46 lastAccessedTime is not updated at the start of the request, but only at the + * end. */ @Test public void testLastAccessedTime() throws Exception { Callback c = new Callback() { @Override - public void call(HttpServletRequest request, HttpServletResponse response) throws IOException { + public void call(HttpServletRequest request, HttpServletResponse response) + throws IOException { HttpSession session = request.getSession(); // Hack to expose the session to our test context session.getServletContext().setAttribute("session", session); @@ -460,7 +469,8 @@ public abstract class TestSessionsBase { Long lastAccess = (Long) session.getAttribute("lastAccessTime"); assertTrue( - "Last access time not set correctly: " + lastAccess.longValue() + " not <= " + session.getLastAccessedTime(), + "Last access time not set correctly: " + lastAccess.longValue() + " not <= " + + session.getLastAccessedTime(), lastAccess.longValue() <= session.getLastAccessedTime()); } } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/extensions/geode-modules/src/test/java/org/apache/geode/modules/session/Tomcat6SessionsJUnitTest.java ---------------------------------------------------------------------- diff --git a/extensions/geode-modules/src/test/java/org/apache/geode/modules/session/Tomcat6SessionsJUnitTest.java b/extensions/geode-modules/src/test/java/org/apache/geode/modules/session/Tomcat6SessionsJUnitTest.java index 1a9c715..cdcd2a3 100644 --- a/extensions/geode-modules/src/test/java/org/apache/geode/modules/session/Tomcat6SessionsJUnitTest.java +++ b/extensions/geode-modules/src/test/java/org/apache/geode/modules/session/Tomcat6SessionsJUnitTest.java @@ -1,19 +1,17 @@ /* -* 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. -*/ + * 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.modules.session; import org.apache.geode.modules.session.catalina.Tomcat6DeltaSessionManager;