http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/DeltaSessionManager.java ---------------------------------------------------------------------- diff --git a/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/DeltaSessionManager.java b/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/DeltaSessionManager.java index 5e70c2f..edc2b7d 100644 --- a/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/DeltaSessionManager.java +++ b/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/DeltaSessionManager.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.catalina; import org.apache.geode.cache.CacheFactory; @@ -61,7 +59,8 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; -abstract public class DeltaSessionManager extends ManagerBase implements Lifecycle, PropertyChangeListener, SessionManager { +abstract public class DeltaSessionManager extends ManagerBase + implements Lifecycle, PropertyChangeListener, SessionManager { /** * The number of rejected sessions. @@ -104,14 +103,15 @@ abstract public class DeltaSessionManager extends ManagerBase implements Lifecyc protected static final boolean DEFAULT_PREFER_DESERIALIZED_FORM = true; /* - * This *MUST* only be assigned during start/startInternal otherwise it will be associated - * with the incorrect context class loader. + * This *MUST* only be assigned during start/startInternal otherwise it will be associated with + * the incorrect context class loader. */ protected Log LOGGER; protected String regionName = DEFAULT_REGION_NAME; - protected String regionAttributesId; // the default is different for client-server and peer-to-peer + protected String regionAttributesId; // the default is different for client-server and + // peer-to-peer protected Boolean enableLocalCache; // the default is different for client-server and peer-to-peer @@ -131,9 +131,11 @@ abstract public class DeltaSessionManager extends ManagerBase implements Lifecyc private final Set<String> sessionsToTouch; - private static final long TIMER_TASK_PERIOD = Long.getLong("gemfiremodules.sessionTimerTaskPeriod", 10000); + private static final long TIMER_TASK_PERIOD = + Long.getLong("gemfiremodules.sessionTimerTaskPeriod", 10000); - private static final long TIMER_TASK_DELAY = Long.getLong("gemfiremodules.sessionTimerTaskDelay", 10000); + private static final long TIMER_TASK_DELAY = + Long.getLong("gemfiremodules.sessionTimerTaskDelay", 10000); public DeltaSessionManager() { // Create the set to store sessions to be touched after get attribute requests @@ -197,7 +199,7 @@ abstract public class DeltaSessionManager extends ManagerBase implements Lifecyc @Override public boolean getEnableGatewayDeltaReplication() { - //return this.enableGatewayDeltaReplication; + // return this.enableGatewayDeltaReplication; return false; // disabled } @@ -285,11 +287,11 @@ abstract public class DeltaSessionManager extends ManagerBase implements Lifecyc } /** - * This method was taken from StandardManager to set the default maxInactiveInterval based on the container (to 30 - * minutes). + * This method was taken from StandardManager to set the default maxInactiveInterval based on the + * container (to 30 minutes). * <p> - * Set the Container with which this Manager has been associated. If it is a Context (the usual case), listen for - * changes to the session timeout property. + * Set the Container with which this Manager has been associated. If it is a Context (the usual + * case), listen for changes to the session timeout property. * * @param container The associated Container */ @@ -317,32 +319,32 @@ abstract public class DeltaSessionManager extends ManagerBase implements Lifecyc return null; } if (getLogger().isDebugEnabled()) { - getLogger().debug(this + ": Finding session " + id + " in " + getSessionCache().getOperatingRegionName()); + getLogger().debug( + this + ": Finding session " + id + " in " + getSessionCache().getOperatingRegionName()); } DeltaSessionInterface session = (DeltaSessionInterface) getSessionCache().getSession(id); /* - * Check that the context name for this session is the same as this manager's. - * This comes into play when multiple versions of a webapp are deployed and - * active at the same time; the context name will contain an embedded - * version number; something like /test###2. + * Check that the context name for this session is the same as this manager's. This comes into + * play when multiple versions of a webapp are deployed and active at the same time; the context + * name will contain an embedded version number; something like /test###2. */ - if (session != null && - !session.getContextName().isEmpty() && - !getContextName().equals(session.getContextName())) { - getLogger().info(this + ": Session " + id + - " rejected as container name and context do not match: " + - getContextName() + " != " + session.getContextName()); + if (session != null && !session.getContextName().isEmpty() + && !getContextName().equals(session.getContextName())) { + getLogger() + .info(this + ": Session " + id + " rejected as container name and context do not match: " + + getContextName() + " != " + session.getContextName()); session = null; } if (session == null) { if (getLogger().isDebugEnabled()) { - getLogger().debug(this + ": Did not find session " + id + " in " + getSessionCache().getOperatingRegionName()); + getLogger().debug(this + ": Did not find session " + id + " in " + + getSessionCache().getOperatingRegionName()); } } else { if (getLogger().isDebugEnabled()) { - getLogger().debug( - this + ": Found session " + id + " in " + getSessionCache().getOperatingRegionName() + ": " + session); + getLogger().debug(this + ": Found session " + id + " in " + + getSessionCache().getOperatingRegionName() + ": " + session); } // The session was previously stored. Set new to false. session.setNew(false); @@ -368,8 +370,8 @@ abstract public class DeltaSessionManager extends ManagerBase implements Lifecyc } // Create the appropriate session cache - this.sessionCache = cache.isClient() ? new ClientServerSessionCache(this, cache) : new PeerToPeerSessionCache(this, - cache); + this.sessionCache = cache.isClient() ? new ClientServerSessionCache(this, cache) + : new PeerToPeerSessionCache(this, cache); // Initialize the session cache this.sessionCache.initialize(); @@ -386,39 +388,39 @@ abstract public class DeltaSessionManager extends ManagerBase implements Lifecyc } public void remove(Session session, boolean update) { - //super.remove(session); + // super.remove(session); // Remove the session from the region if necessary. // It will have already been removed if it expired implicitly. DeltaSessionInterface ds = (DeltaSessionInterface) session; if (ds.getExpired()) { if (getLogger().isDebugEnabled()) { - getLogger().debug( - this + ": Expired session " + session.getId() + " from " + getSessionCache().getOperatingRegionName()); + getLogger().debug(this + ": Expired session " + session.getId() + " from " + + getSessionCache().getOperatingRegionName()); } } else { if (getLogger().isDebugEnabled()) { - getLogger().debug( - this + ": Destroying session " + session.getId() + " from " + getSessionCache().getOperatingRegionName()); + getLogger().debug(this + ": Destroying session " + session.getId() + " from " + + getSessionCache().getOperatingRegionName()); } getSessionCache().destroySession(session.getId()); if (getLogger().isDebugEnabled()) { - getLogger().debug( - this + ": Destroyed session " + session.getId() + " from " + getSessionCache().getOperatingRegionName()); + getLogger().debug(this + ": Destroyed session " + session.getId() + " from " + + getSessionCache().getOperatingRegionName()); } } } @Override public void add(Session session) { - //super.add(session); + // super.add(session); if (getLogger().isDebugEnabled()) { - getLogger().debug( - this + ": Storing session " + session.getId() + " into " + getSessionCache().getOperatingRegionName()); + getLogger().debug(this + ": Storing session " + session.getId() + " into " + + getSessionCache().getOperatingRegionName()); } getSessionCache().putSession(session); if (getLogger().isDebugEnabled()) { - getLogger().debug( - this + ": Stored session " + session.getId() + " into " + getSessionCache().getOperatingRegionName()); + getLogger().debug(this + ": Stored session " + session.getId() + " into " + + getSessionCache().getOperatingRegionName()); } getSessionCache().getStatistics().incSessionsCreated(); } @@ -463,17 +465,16 @@ abstract public class DeltaSessionManager extends ManagerBase implements Lifecyc } /* - * If local caching is enabled, add the session to the set of sessions to be - * touched. A timer task will be periodically invoked to get the session in - * the session region to update its last accessed time. This prevents the - * session from expiring in the case where the application is only getting - * attributes from the session and never putting attributes into the - * session. If local caching is disabled. the session's last accessed time - * would already have been updated properly in the sessions region. + * If local caching is enabled, add the session to the set of sessions to be touched. A timer task + * will be periodically invoked to get the session in the session region to update its last + * accessed time. This prevents the session from expiring in the case where the application is + * only getting attributes from the session and never putting attributes into the session. If + * local caching is disabled. the session's last accessed time would already have been updated + * properly in the sessions region. * - * Note: Due to issues in GemFire expiry, sessions are always asynchronously - * touched using a function regardless whether or not local caching is - * enabled. This prevents premature expiration. + * Note: Due to issues in GemFire expiry, sessions are always asynchronously touched using a + * function regardless whether or not local caching is enabled. This prevents premature + * expiration. */ protected void addSessionToTouch(String sessionId) { this.sessionsToTouch.add(sessionId); @@ -533,7 +534,8 @@ abstract public class DeltaSessionManager extends ManagerBase implements Lifecyc if (currentActiveSessions > getMaxActive()) { setMaxActive(currentActiveSessions); if (getLogger().isDebugEnabled()) { - getLogger().debug(DeltaSessionManager.this + ": Set max active sessions: " + currentActiveSessions); + getLogger().debug( + DeltaSessionManager.this + ": Set max active sessions: " + currentActiveSessions); } } } @@ -596,15 +598,20 @@ abstract public class DeltaSessionManager extends ManagerBase implements Lifecyc /** * Process property change events from our associated Context. * <p> - * Part of this method implementation was taken from StandardManager. The sessionTimeout can be changed in the web.xml - * which is processed after the context.xml. The context (and the default session timeout) would already have been set - * in this Manager. This is the way to get the new session timeout value specified in the web.xml. + * Part of this method implementation was taken from StandardManager. The sessionTimeout can be + * changed in the web.xml which is processed after the context.xml. The context (and the default + * session timeout) would already have been set in this Manager. This is the way to get the new + * session timeout value specified in the web.xml. * <p> * The precedence order for setting the session timeout value is: * <p> - * <ol> <li>the max inactive interval is set based on the Manager defined in the context.xml <li>the max inactive - * interval is then overwritten by the value of the Context's session timeout when setContainer is called <li>the max - * inactive interval is then overwritten by the value of the session-timeout specified in the web.xml (if any) </ol> + * <ol> + * <li>the max inactive interval is set based on the Manager defined in the context.xml + * <li>the max inactive interval is then overwritten by the value of the Context's session timeout + * when setContainer is called + * <li>the max inactive interval is then overwritten by the value of the session-timeout specified + * in the web.xml (if any) + * </ol> * * @param event The property change event that has occurred */ @@ -622,27 +629,27 @@ abstract public class DeltaSessionManager extends ManagerBase implements Lifecyc try { int interval = ((Integer) event.getNewValue()).intValue(); if (interval < RegionConfiguration.DEFAULT_MAX_INACTIVE_INTERVAL) { - getLogger().warn( - "The configured session timeout of " + interval + " minutes is invalid. Using the original value of " + event - .getOldValue() + " minutes."); - interval = ((Integer) event.getOldValue()).intValue(); - ; + getLogger().warn("The configured session timeout of " + interval + + " minutes is invalid. Using the original value of " + event.getOldValue() + + " minutes."); + interval = ((Integer) event.getOldValue()).intValue();; } // StandardContext.setSessionTimeout passes -1 if the configured timeout // is 0; otherwise it passes the value set in web.xml. If the interval // parameter equals the default, set the max inactive interval to the // default (no expiration); otherwise set it in seconds. - setMaxInactiveInterval( - interval == RegionConfiguration.DEFAULT_MAX_INACTIVE_INTERVAL ? RegionConfiguration.DEFAULT_MAX_INACTIVE_INTERVAL : interval * 60); + setMaxInactiveInterval(interval == RegionConfiguration.DEFAULT_MAX_INACTIVE_INTERVAL + ? RegionConfiguration.DEFAULT_MAX_INACTIVE_INTERVAL : interval * 60); } catch (NumberFormatException e) { - getLogger().error(sm.getString("standardManager.sessionTimeout", event.getNewValue().toString())); + getLogger() + .error(sm.getString("standardManager.sessionTimeout", event.getNewValue().toString())); } } } /** - * Save any currently active sessions in the appropriate persistence mechanism, if any. If persistence is not - * supported, this method returns without doing anything. + * Save any currently active sessions in the appropriate persistence mechanism, if any. If + * persistence is not supported, this method returns without doing anything. * * @throws IOException if an input/output error occurs */ @@ -658,8 +665,8 @@ abstract public class DeltaSessionManager extends ManagerBase implements Lifecyc } else { regionName = "/" + getRegionName(); } - Query query = querySvc.newQuery("select s.id from " + regionName + - " as s where s.contextName = '" + context.getPath() + "'"); + Query query = querySvc.newQuery("select s.id from " + regionName + + " as s where s.contextName = '" + context.getPath() + "'"); getLogger().debug("Query: " + query.getQueryString()); SelectResults results; @@ -732,7 +739,8 @@ abstract public class DeltaSessionManager extends ManagerBase implements Lifecyc } // Write the number of active sessions, followed by the details - if (getLogger().isDebugEnabled()) getLogger().debug("Unloading " + list.size() + " sessions"); + if (getLogger().isDebugEnabled()) + getLogger().debug("Unloading " + list.size() + " sessions"); try { oos.writeObject(new Integer(list.size())); for (DeltaSessionInterface session : list) { @@ -740,9 +748,8 @@ abstract public class DeltaSessionManager extends ManagerBase implements Lifecyc StandardSession standardSession = (StandardSession) session; standardSession.passivate(); standardSession.writeObjectData(oos); - } - else { - //All DeltaSessionInterfaces as of Geode 1.0 should be based on StandardSession + } else { + // All DeltaSessionInterfaces as of Geode 1.0 should be based on StandardSession throw new IOException("Session should be of type StandardSession"); } } @@ -777,21 +784,21 @@ abstract public class DeltaSessionManager extends ManagerBase implements Lifecyc } } -// // Expire all the sessions we just wrote -// if (getLogger().isDebugEnabled()) { -// getLogger().debug("Expiring " + list.size() + " persisted sessions"); -// } -// Iterator<StandardSession> expires = list.iterator(); -// while (expires.hasNext()) { -// StandardSession session = expires.next(); -// try { -// session.expire(false); -// } catch (Throwable t) { -//// ExceptionUtils.handleThrowable(t); -// } finally { -// session.recycle(); -// } -// } + // // Expire all the sessions we just wrote + // if (getLogger().isDebugEnabled()) { + // getLogger().debug("Expiring " + list.size() + " persisted sessions"); + // } + // Iterator<StandardSession> expires = list.iterator(); + // while (expires.hasNext()) { + // StandardSession session = expires.next(); + // try { + // session.expire(false); + // } catch (Throwable t) { + //// ExceptionUtils.handleThrowable(t); + // } finally { + // session.recycle(); + // } + // } if (getLogger().isDebugEnabled()) { getLogger().debug("Unloading complete"); @@ -799,11 +806,11 @@ abstract public class DeltaSessionManager extends ManagerBase implements Lifecyc } /** - * Load any currently active sessions that were previously unloaded to the appropriate persistence mechanism, if any. - * If persistence is not supported, this method returns without doing anything. + * Load any currently active sessions that were previously unloaded to the appropriate persistence + * mechanism, if any. If persistence is not supported, this method returns without doing anything. * * @throws ClassNotFoundException if a serialized class cannot be found during the reload - * @throws IOException if an input/output error occurs + * @throws IOException if an input/output error occurs */ protected void doLoad() throws ClassNotFoundException, IOException { Context context = getTheContext(); @@ -884,7 +891,8 @@ abstract public class DeltaSessionManager extends ManagerBase implements Lifecyc Region region = getSessionCache().getOperatingRegion(); DeltaSessionInterface existingSession = (DeltaSessionInterface) region.get(session.getId()); // Check whether the existing session is newer - if (existingSession != null && existingSession.getLastAccessedTime() > session.getLastAccessedTime()) { + if (existingSession != null + && existingSession.getLastAccessedTime() > session.getLastAccessedTime()) { if (getLogger().isDebugEnabled()) { getLogger().debug("Loaded session " + session.getId() + " is older than cached copy"); } @@ -951,16 +959,9 @@ abstract public class DeltaSessionManager extends ManagerBase implements Lifecyc @Override public String toString() { - return new StringBuilder().append(getClass().getSimpleName()) - .append("[") - .append("container=") - .append(getTheContext()) - .append("; regionName=") - .append(this.regionName) - .append("; regionAttributesId=") - .append(this.regionAttributesId) - .append("]") - .toString(); + return new StringBuilder().append(getClass().getSimpleName()).append("[").append("container=") + .append(getTheContext()).append("; regionName=").append(this.regionName) + .append("; regionAttributesId=").append(this.regionAttributesId).append("]").toString(); } protected String getContextName() { @@ -969,10 +970,10 @@ abstract public class DeltaSessionManager extends ManagerBase implements Lifecyc public Context getTheContext() { if (getContainer() instanceof Context) { - return (Context) getContainer(); + return (Context) getContainer(); } else { - getLogger().error("Unable to unload sessions - container is of type " + - getContainer().getClass().getName() + " instead of StandardContext"); + getLogger().error("Unable to unload sessions - container is of type " + + getContainer().getClass().getName() + " instead of StandardContext"); return null; } }
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/JvmRouteBinderValve.java ---------------------------------------------------------------------- diff --git a/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/JvmRouteBinderValve.java b/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/JvmRouteBinderValve.java index 0254fb4..b2b28fc 100644 --- a/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/JvmRouteBinderValve.java +++ b/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/JvmRouteBinderValve.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.catalina; import org.apache.catalina.Manager; @@ -48,7 +46,8 @@ public class JvmRouteBinderValve extends ValveBase { getNext().invoke(request, response); } - private void handlePossibleFailover(Request request, DeltaSessionManager manager, String localJvmRoute) { + private void handlePossibleFailover(Request request, DeltaSessionManager manager, + String localJvmRoute) { String sessionId = request.getRequestedSessionId(); if (sessionId != null) { // Get request JVM route @@ -62,13 +61,8 @@ public class JvmRouteBinderValve extends ValveBase { if (requestJvmRoute != null && !requestJvmRoute.equals(localJvmRoute)) { if (manager.getLogger().isDebugEnabled()) { StringBuilder builder = new StringBuilder(); - builder.append(this) - .append(": Handling failover of session ") - .append(sessionId) - .append(" from ") - .append(requestJvmRoute) - .append(" to ") - .append(localJvmRoute); + builder.append(this).append(": Handling failover of session ").append(sessionId) + .append(" from ").append(requestJvmRoute).append(" to ").append(localJvmRoute); manager.getLogger().debug(builder.toString()); } // Get the original session @@ -77,21 +71,15 @@ public class JvmRouteBinderValve extends ValveBase { session = manager.findSession(sessionId); } catch (IOException e) { StringBuilder builder = new StringBuilder(); - builder.append(this) - .append(": Caught exception attempting to find session ") - .append(sessionId) - .append(" in ") - .append(manager); + builder.append(this).append(": Caught exception attempting to find session ") + .append(sessionId).append(" in ").append(manager); manager.getLogger().warn(builder.toString(), e); } if (session == null) { StringBuilder builder = new StringBuilder(); - builder.append(this) - .append(": Did not find session ") - .append(sessionId) - .append(" to failover in ") - .append(manager); + builder.append(this).append(": Did not find session ").append(sessionId) + .append(" to failover in ").append(manager); manager.getLogger().warn(builder.toString()); } else { // Change its session id. This removes the previous session and creates the new one. http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/PeerToPeerCacheLifecycleListener.java ---------------------------------------------------------------------- diff --git a/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/PeerToPeerCacheLifecycleListener.java b/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/PeerToPeerCacheLifecycleListener.java index 254e4d3..ac797fc 100644 --- a/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/PeerToPeerCacheLifecycleListener.java +++ b/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/PeerToPeerCacheLifecycleListener.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.catalina; import org.apache.geode.modules.session.bootstrap.PeerToPeerCache; http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/PeerToPeerSessionCache.java ---------------------------------------------------------------------- diff --git a/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/PeerToPeerSessionCache.java b/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/PeerToPeerSessionCache.java index 82bcc6f..0e1097b 100644 --- a/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/PeerToPeerSessionCache.java +++ b/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/PeerToPeerSessionCache.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.catalina; import org.apache.geode.cache.Cache; @@ -60,7 +58,8 @@ public class PeerToPeerSessionCache extends AbstractSessionCache { // If local cache is enabled, create the local region fronting the session region // and set it as the operating region; otherwise, use the session region directly // as the operating region. - this.operatingRegion = getSessionManager().getEnableLocalCache() ? createOrRetrieveLocalRegion() : this.sessionRegion; + this.operatingRegion = getSessionManager().getEnableLocalCache() ? createOrRetrieveLocalRegion() + : this.sessionRegion; // Create or retrieve the statistics createStatistics(); @@ -92,7 +91,7 @@ public class PeerToPeerSessionCache extends AbstractSessionCache { } else { // Execute the member touch function on all the server(s) Execution execution = FunctionService.onMembers(getCache().getDistributedSystem()) - .withArgs(new Object[]{this.sessionRegion.getFullPath(), sessionIds}); + .withArgs(new Object[] {this.sessionRegion.getFullPath(), sessionIds}); collector = execution.execute(TouchReplicatedRegionEntriesFunction.ID, true, false, false); } @@ -186,7 +185,8 @@ public class PeerToPeerSessionCache extends AbstractSessionCache { Region<String, HttpSession> frontingRegion = this.cache.getRegion(frontingRegionName); if (frontingRegion == null) { // Create the region factory - RegionFactory<String, HttpSession> factory = this.cache.createRegionFactory(RegionShortcut.LOCAL_HEAP_LRU); + RegionFactory<String, HttpSession> factory = + this.cache.createRegionFactory(RegionShortcut.LOCAL_HEAP_LRU); // Add the cache loader and writer factory.setCacheLoader(new LocalSessionCacheLoader(this.sessionRegion)); @@ -203,13 +203,15 @@ public class PeerToPeerSessionCache extends AbstractSessionCache { // Create the region frontingRegion = factory.create(frontingRegionName); if (getSessionManager().getLogger().isDebugEnabled()) { - getSessionManager().getLogger().debug("Created new local session region: " + frontingRegion); + getSessionManager().getLogger() + .debug("Created new local session region: " + frontingRegion); } } else { if (getSessionManager().getLogger().isDebugEnabled()) { - getSessionManager().getLogger().debug("Retrieved existing local session region: " + frontingRegion); + getSessionManager().getLogger() + .debug("Retrieved existing local session region: " + frontingRegion); } } return frontingRegion; } -} +} http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/SessionCache.java ---------------------------------------------------------------------- diff --git a/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/SessionCache.java b/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/SessionCache.java index fc6c3cd..5c0fecd 100644 --- a/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/SessionCache.java +++ b/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/SessionCache.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.catalina; import org.apache.geode.cache.GemFireCache; http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/SessionManager.java ---------------------------------------------------------------------- diff --git a/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/SessionManager.java b/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/SessionManager.java index 6afd1ca..e739fa4 100644 --- a/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/SessionManager.java +++ b/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/SessionManager.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.catalina; import org.apache.juli.logging.Log; http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/Tomcat6DeltaSessionManager.java ---------------------------------------------------------------------- diff --git a/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/Tomcat6DeltaSessionManager.java b/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/Tomcat6DeltaSessionManager.java index f35c088..45b777b 100644 --- a/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/Tomcat6DeltaSessionManager.java +++ b/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/Tomcat6DeltaSessionManager.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.catalina; import org.apache.catalina.LifecycleException; @@ -28,10 +26,12 @@ public class Tomcat6DeltaSessionManager extends DeltaSessionManager { protected LifecycleSupport lifecycle = new LifecycleSupport(this); /** - * Prepare for the beginning of active use of the public methods of this component. This method should be called - * after <code>configure()</code>, and before any of the public methods of the component are utilized. + * Prepare for the beginning of active use of the public methods of this component. This method + * should be called after <code>configure()</code>, and before any of the public methods of the + * component are utilized. * - * @throws LifecycleException if this component detects a fatal error that prevents this component from being used + * @throws LifecycleException if this component detects a fatal error that prevents this component + * from being used */ @Override public void start() throws LifecycleException { @@ -65,8 +65,8 @@ public class Tomcat6DeltaSessionManager extends DeltaSessionManager { } /** - * Gracefully terminate the active use of the public methods of this component. This method should be the last one - * called on a given instance of this component. + * Gracefully terminate the active use of the public methods of this component. This method should + * be the last one called on a given instance of this component. * * @throws LifecycleException if this component detects a fatal error that needs to be reported */ @@ -114,8 +114,8 @@ public class Tomcat6DeltaSessionManager extends DeltaSessionManager { } /** - * Get the lifecycle listeners associated with this lifecycle. If this Lifecycle has no listeners registered, a - * zero-length array is returned. + * Get the lifecycle listeners associated with this lifecycle. If this Lifecycle has no listeners + * registered, a zero-length array is returned. */ @Override public LifecycleListener[] findLifecycleListeners() { http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/callback/LocalSessionCacheLoader.java ---------------------------------------------------------------------- diff --git a/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/callback/LocalSessionCacheLoader.java b/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/callback/LocalSessionCacheLoader.java index ca86051..2686b44 100644 --- a/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/callback/LocalSessionCacheLoader.java +++ b/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/callback/LocalSessionCacheLoader.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.catalina.callback; import org.apache.geode.cache.CacheLoader; @@ -37,9 +35,7 @@ public class LocalSessionCacheLoader implements CacheLoader<String, HttpSession> return this.backingRegion.get(helper.getKey()); } - public void close() { - } + public void close() {} - public void init(Properties p) { - } + public void init(Properties p) {} } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/callback/LocalSessionCacheWriter.java ---------------------------------------------------------------------- diff --git a/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/callback/LocalSessionCacheWriter.java b/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/callback/LocalSessionCacheWriter.java index a138f86..238f55e 100644 --- a/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/callback/LocalSessionCacheWriter.java +++ b/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/callback/LocalSessionCacheWriter.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.catalina.callback; import org.apache.geode.cache.CacheWriterException; @@ -26,7 +24,8 @@ import org.apache.geode.cache.util.CacheWriterAdapter; import javax.servlet.http.HttpSession; import java.util.Properties; -public class LocalSessionCacheWriter extends CacheWriterAdapter<String, HttpSession> implements Declarable { +public class LocalSessionCacheWriter extends CacheWriterAdapter<String, HttpSession> + implements Declarable { private final Region<String, HttpSession> backingRegion; @@ -51,9 +50,7 @@ public class LocalSessionCacheWriter extends CacheWriterAdapter<String, HttpSess } } - public void close() { - } + public void close() {} - public void init(Properties p) { - } + public void init(Properties p) {} } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/callback/SessionExpirationCacheListener.java ---------------------------------------------------------------------- diff --git a/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/callback/SessionExpirationCacheListener.java b/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/callback/SessionExpirationCacheListener.java index fd2b472..caaaa37 100644 --- a/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/callback/SessionExpirationCacheListener.java +++ b/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/callback/SessionExpirationCacheListener.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.catalina.callback; import org.apache.geode.cache.Declarable; @@ -28,7 +26,8 @@ import java.util.Properties; import org.apache.catalina.session.ManagerBase; -public class SessionExpirationCacheListener extends CacheListenerAdapter<String, HttpSession> implements Declarable { +public class SessionExpirationCacheListener extends CacheListenerAdapter<String, HttpSession> + implements Declarable { public void afterDestroy(EntryEvent<String, HttpSession> event) { // A Session expired. If it was destroyed by GemFire expiration, process it. @@ -39,11 +38,10 @@ public class SessionExpirationCacheListener extends CacheListenerAdapter<String, session = (DeltaSessionInterface) event.getOldValue(); } else { /* - * This comes into play when we're dealing with an empty client proxy. We - * need the actual destroyed object to come back from the server so that - * any associated listeners can fire correctly. Having the destroyed - * object come back as the callback arg depends on setting the property - * gemfire.EXPIRE_SENDS_ENTRY_AS_CALLBACK. + * This comes into play when we're dealing with an empty client proxy. We need the actual + * destroyed object to come back from the server so that any associated listeners can fire + * correctly. Having the destroyed object come back as the callback arg depends on setting the + * property gemfire.EXPIRE_SENDS_ENTRY_AS_CALLBACK. */ Object callback = event.getCallbackArgument(); if (callback != null && callback instanceof DeltaSessionInterface) { @@ -59,8 +57,7 @@ public class SessionExpirationCacheListener extends CacheListenerAdapter<String, } } - public void init(Properties p) { - } + public void init(Properties p) {} public boolean equals(Object obj) { // This method is only implemented so that RegionAttributesCreation.sameAs http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/internal/DeltaSessionAttributeEvent.java ---------------------------------------------------------------------- diff --git a/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/internal/DeltaSessionAttributeEvent.java b/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/internal/DeltaSessionAttributeEvent.java index 9bc9f7e..896eb86 100644 --- a/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/internal/DeltaSessionAttributeEvent.java +++ b/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/internal/DeltaSessionAttributeEvent.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.catalina.internal; import org.apache.geode.DataSerializable; http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/internal/DeltaSessionAttributeEventBatch.java ---------------------------------------------------------------------- diff --git a/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/internal/DeltaSessionAttributeEventBatch.java b/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/internal/DeltaSessionAttributeEventBatch.java index 3ccd2d0..4558047 100644 --- a/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/internal/DeltaSessionAttributeEventBatch.java +++ b/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/internal/DeltaSessionAttributeEventBatch.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.catalina.internal; import org.apache.geode.DataSerializer; @@ -34,8 +32,7 @@ public class DeltaSessionAttributeEventBatch extends AbstractGatewayDeltaEvent { private List<DeltaSessionAttributeEvent> eventQueue; - public DeltaSessionAttributeEventBatch() { - } + public DeltaSessionAttributeEventBatch() {} public DeltaSessionAttributeEventBatch(String regionName, String sessionId, List<DeltaSessionAttributeEvent> eventQueue) { @@ -52,7 +49,8 @@ public class DeltaSessionAttributeEventBatch extends AbstractGatewayDeltaEvent { DeltaSessionInterface session = region.get(this.key); if (session == null) { StringBuilder builder = new StringBuilder(); - builder.append("Session ").append(this.key).append(" was not found while attempting to apply ").append(this); + builder.append("Session ").append(this.key) + .append(" was not found while attempting to apply ").append(this); cache.getLogger().warning(builder.toString()); } else { session.applyAttributeEvents(region, this.eventQueue); @@ -75,15 +73,9 @@ public class DeltaSessionAttributeEventBatch extends AbstractGatewayDeltaEvent { } public String toString() { - return new StringBuilder().append("DeltaSessionAttributeEventBatch[") - .append("regionName=") - .append(this.regionName) - .append("; sessionId=") - .append(this.key) - .append("; numberOfEvents=") - .append(this.eventQueue.size()) - .append("]") - .toString(); + return new StringBuilder().append("DeltaSessionAttributeEventBatch[").append("regionName=") + .append(this.regionName).append("; sessionId=").append(this.key).append("; numberOfEvents=") + .append(this.eventQueue.size()).append("]").toString(); } } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/internal/DeltaSessionDestroyAttributeEvent.java ---------------------------------------------------------------------- diff --git a/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/internal/DeltaSessionDestroyAttributeEvent.java b/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/internal/DeltaSessionDestroyAttributeEvent.java index 021f2ef..7ab59a5 100644 --- a/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/internal/DeltaSessionDestroyAttributeEvent.java +++ b/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/internal/DeltaSessionDestroyAttributeEvent.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.catalina.internal; import org.apache.geode.DataSerializable; @@ -32,8 +30,7 @@ public class DeltaSessionDestroyAttributeEvent implements DeltaSessionAttributeE private String attributeName; - public DeltaSessionDestroyAttributeEvent() { - } + public DeltaSessionDestroyAttributeEvent() {} public DeltaSessionDestroyAttributeEvent(String attributeName) { this.attributeName = attributeName; @@ -64,11 +61,8 @@ public class DeltaSessionDestroyAttributeEvent implements DeltaSessionAttributeE } public String toString() { - return new StringBuilder().append("DeltaSessionDestroyAttributeEvent[") - .append("attributeName=") - .append(this.attributeName) - .append("]") - .toString(); + return new StringBuilder().append("DeltaSessionDestroyAttributeEvent[").append("attributeName=") + .append(this.attributeName).append("]").toString(); } } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/internal/DeltaSessionStatistics.java ---------------------------------------------------------------------- diff --git a/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/internal/DeltaSessionStatistics.java b/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/internal/DeltaSessionStatistics.java index ed0196f..57c14b4 100644 --- a/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/internal/DeltaSessionStatistics.java +++ b/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/internal/DeltaSessionStatistics.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.catalina.internal; import org.apache.geode.StatisticDescriptor; @@ -41,10 +39,12 @@ public class DeltaSessionStatistics { // Initialize type StatisticsTypeFactory f = StatisticsTypeFactoryImpl.singleton(); type = f.createType(typeName, typeName, - new StatisticDescriptor[]{f.createIntCounter(SESSIONS_CREATED, "The number of sessions created", - "operations"), f.createIntCounter(SESSIONS_INVALIDATED, - "The number of sessions invalidated by invoking invalidate", "operations"), f.createIntCounter( - SESSIONS_EXPIRED, "The number of sessions invalidated by timeout", "operations"),}); + new StatisticDescriptor[] { + f.createIntCounter(SESSIONS_CREATED, "The number of sessions created", "operations"), + f.createIntCounter(SESSIONS_INVALIDATED, + "The number of sessions invalidated by invoking invalidate", "operations"), + f.createIntCounter(SESSIONS_EXPIRED, "The number of sessions invalidated by timeout", + "operations"),}); // Initialize id fields sessionsCreatedId = type.nameToId(SESSIONS_CREATED); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/internal/DeltaSessionUpdateAttributeEvent.java ---------------------------------------------------------------------- diff --git a/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/internal/DeltaSessionUpdateAttributeEvent.java b/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/internal/DeltaSessionUpdateAttributeEvent.java index 0ea8635..090a1a3 100644 --- a/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/internal/DeltaSessionUpdateAttributeEvent.java +++ b/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/catalina/internal/DeltaSessionUpdateAttributeEvent.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.catalina.internal; import org.apache.geode.DataSerializable; @@ -33,8 +31,7 @@ public class DeltaSessionUpdateAttributeEvent implements DeltaSessionAttributeEv private Object attributeValue; - public DeltaSessionUpdateAttributeEvent() { - } + public DeltaSessionUpdateAttributeEvent() {} public DeltaSessionUpdateAttributeEvent(String attributeName, Object attributeValue) { this.attributeName = attributeName; @@ -72,13 +69,9 @@ public class DeltaSessionUpdateAttributeEvent implements DeltaSessionAttributeEv } public String toString() { - return new StringBuilder().append("DeltaSessionUpdateAttributeEvent[") - .append("attributeName=") - .append(this.attributeName) - .append("; attributeValue=") - .append(this.attributeValue) - .append("]") - .toString(); + return new StringBuilder().append("DeltaSessionUpdateAttributeEvent[").append("attributeName=") + .append(this.attributeName).append("; attributeValue=").append(this.attributeValue) + .append("]").toString(); } } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/Banner.java ---------------------------------------------------------------------- diff --git a/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/Banner.java b/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/Banner.java index 7aeb9ff..e3dff53 100644 --- a/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/Banner.java +++ b/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/Banner.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.internal.GemFireVersion; http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/BootstrappingFunction.java ---------------------------------------------------------------------- diff --git a/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/BootstrappingFunction.java b/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/BootstrappingFunction.java index 943a803..64ecef3 100644 --- a/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/BootstrappingFunction.java +++ b/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/BootstrappingFunction.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; @@ -37,7 +35,8 @@ public class BootstrappingFunction implements Function, MembershipListener { public static final String ID = "bootstrapping-function"; - private static final int TIME_TO_WAIT_FOR_CACHE = Integer.getInteger("gemfiremodules.timeToWaitForCache", 30000); + private static final int TIME_TO_WAIT_FOR_CACHE = + Integer.getInteger("gemfiremodules.timeToWaitForCache", 30000); @Override public void execute(FunctionContext context) { @@ -64,7 +63,7 @@ public class BootstrappingFunction implements Function, MembershipListener { cache = CacheFactory.getAnyInstance(); break; } catch (Exception ignore) { - //keep trying and hope for the best + // keep trying and hope for the best } try { Thread.sleep(250); @@ -169,8 +168,7 @@ public class BootstrappingFunction implements Function, MembershipListener { } @Override - public void memberDeparted(InternalDistributedMember id, boolean crashed) { - } + public void memberDeparted(InternalDistributedMember id, boolean crashed) {} @Override public void memberJoined(InternalDistributedMember id) { @@ -178,11 +176,10 @@ public class BootstrappingFunction implements Function, MembershipListener { } @Override - public void memberSuspect(InternalDistributedMember id, InternalDistributedMember whoSuspected, String reason) { - } + public void memberSuspect(InternalDistributedMember id, InternalDistributedMember whoSuspected, + String reason) {} @Override public void quorumLost(Set<InternalDistributedMember> internalDistributedMembers, - List<InternalDistributedMember> internalDistributedMembers2) { - } + List<InternalDistributedMember> internalDistributedMembers2) {} } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/ClassLoaderObjectInputStream.java ---------------------------------------------------------------------- diff --git a/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/ClassLoaderObjectInputStream.java b/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/ClassLoaderObjectInputStream.java index e0297bb..d5ebbab 100644 --- a/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/ClassLoaderObjectInputStream.java +++ b/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/ClassLoaderObjectInputStream.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.IOException; http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8bf39571/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/ContextMapper.java ---------------------------------------------------------------------- diff --git a/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/ContextMapper.java b/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/ContextMapper.java index 505b797..703c785 100644 --- a/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/ContextMapper.java +++ b/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/ContextMapper.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.modules.session.catalina.DeltaSessionManager; @@ -26,11 +24,13 @@ import org.apache.catalina.session.ManagerBase; /** * This basic singleton class maps context paths to manager instances. * <p> - * This class exists for a particular corner case described here. Consider a client-server environment with empty client - * regions *and* the need to fire HttpSessionListener destroy events. When a session expires, in this scenario, the - * Gemfire destroy events originate on the server and, with some Gemfire hackery, the destroyed object ends up as the - * event's callback argument. At the point that the CacheListener then gets the event, the re-constituted session object - * has no manager associated and so we need to re-attach a manager to it so that events can be fired correctly. + * This class exists for a particular corner case described here. Consider a client-server + * environment with empty client regions *and* the need to fire HttpSessionListener destroy events. + * When a session expires, in this scenario, the Gemfire destroy events originate on the server and, + * with some Gemfire hackery, the destroyed object ends up as the event's callback argument. At the + * point that the CacheListener then gets the event, the re-constituted session object has no + * manager associated and so we need to re-attach a manager to it so that events can be fired + * correctly. */ public class ContextMapper {
