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); manager.getLogger().debug(builder.toString()); builder.append(this).append(": Caught exception attempting to find session ") .append(sessionId).append(" in ").append(manager); manager.getLogger().warn(builder.toString(), e); builder.append(this).append(": Did not find session ").append(sessionId) .append(" to failover in ").append(manager); manager.getLogger().warn(builder.toString()); } else {
protected void unregisterJvmRouteBinderValve() { if (getLogger().isDebugEnabled()) { getLogger().debug(this + ": Unregistering JVM route binder valve"); } if (jvmRouteBinderValve != null) { getPipeline().removeValve(jvmRouteBinderValve); } }
if (getLogger().isDebugEnabled()) { getLogger().debug(this + ": Starting"); init(); } catch (Throwable t) { getLogger().error(t.getMessage(), t);
@Override public URL getURL() { String url = baseUrl + "!/"; try { return new URL(url); } catch (MalformedURLException e) { if (log.isDebugEnabled()) { log.debug(sm.getString("fileResource.getUrlFail", url), e); } return null; } }
private static void logFull(Log loghelper, int currentThreadCount, int maxThreads) { if( logfull ) { log.error(sm.getString("threadpool.busy", new Integer(currentThreadCount), new Integer(maxThreads))); logfull=false; } else if( log.isDebugEnabled() ) { log.debug("All threads are busy " + currentThreadCount + " " + maxThreads ); } }
protected void deregisterJmx() { try { if (mbeans.remove(poolName)!=null) { ObjectName oname = getObjectName(getClass(),poolName); ManagementFactory.getPlatformMBeanServer().unregisterMBean(oname); } } catch (MBeanRegistrationException e) { log.debug("Jmx deregistration failed.",e); } catch (InstanceNotFoundException e) { log.debug("Jmx deregistration failed.",e); } catch (MalformedObjectNameException e) { log.warn("Jmx deregistration failed.",e); } catch (RuntimeOperationsException e) { log.warn("Jmx deregistration failed.",e); } }
} else { if (getPoolProperties().getLogValidationErrors()) { log.error("Custom validation through "+poolProperties.getValidator()+" failed."); } catch (Exception ex) { if (getPoolProperties().getLogValidationErrors()) { log.warn("SQL Validation error", ex); } else if (log.isDebugEnabled()) { log.debug("Unable to validate object:",ex);
@Override public void remove(Session session, boolean update) { log.debug("Removing session ID : " + session.getId()); try { getClient().delete(generateRedisSessionKey(session.getId())); } catch (Throwable t) { log.error("Failed to remove session [" + session.getId() + "]", t); } currentSessionState.remove(); }
@Override public URL getURL() { try { return new URL(baseUrl + "!/"); } catch (MalformedURLException e) { if (log.isDebugEnabled()) { log.debug(sm.getString("fileResource.getUrlFail", "", baseUrl), e); } return null; } }
@Override public Principal getPrincipal() { if (this.principal == null && this.serializedPrincipal != null) { SerializablePrincipal sp = null; try { sp = (SerializablePrincipal) BlobHelper.deserializeBlob(this.serializedPrincipal); } catch (Exception e) { StringBuilder builder = new StringBuilder(); builder.append(this).append( ": Serialized principal contains a byte[] that cannot be deserialized due to the following exception"); ((DeltaSessionManager) getManager()).getLogger().warn(builder.toString(), e); return null; } this.principal = sp.getPrincipal(((DeltaSessionManager) this.manager).getTheContext().getRealm()); if (getManager() != null) { DeltaSessionManager mgr = (DeltaSessionManager) getManager(); if (mgr.getLogger().isDebugEnabled()) { mgr.getLogger().debug(this + ": Deserialized principal: " + this.principal); // mgr.logCurrentStack(); } } } return this.principal; }
protected void unregisterCommitSessionValve() { if (getLogger().isDebugEnabled()) { getLogger().debug(this + ": Unregistering CommitSessionValve"); } if (commitSessionValve != null) { getPipeline().removeValve(commitSessionValve); } }
getLogger().debug("No session store file found"); return; if (getLogger().isDebugEnabled()) { getLogger().debug("Loading sessions from " + store.getAbsolutePath()); if (getLogger().isDebugEnabled()) { getLogger().debug("Creating custom object input stream for class loader"); if (getLogger().isDebugEnabled()) { getLogger().debug("Creating standard object input stream"); if (getLogger().isDebugEnabled()) { getLogger().debug("No persisted data file found"); int n = count.intValue(); if (getLogger().isDebugEnabled()) { getLogger().debug("Loading " + n + " persisted sessions"); && existingSession.getLastAccessedTime() > session.getLastAccessedTime()) { if (getLogger().isDebugEnabled()) { getLogger().debug("Loaded session " + session.getId() + " is older than cached copy"); if (getLogger().isDebugEnabled()) { getLogger().debug("Loaded session " + session.getId() + " is invalid"); getLogger().debug("Loading session " + session.getId()); session.activate(); add(session);
/** * Process a "stop" event for this Host. */ public void stop() { if (log.isDebugEnabled()) log.debug(sm.getString("hostConfig.stop")); if (oname != null) { try { Registry.getRegistry(null, null).unregisterComponent(oname); } catch (Exception e) { log.error(sm.getString("hostConfig.jmx.unregister", oname), e); } } oname = null; }
private boolean pingSessionBackup( @Nonnull final String sessionId ) throws InterruptedException { final String key = _sessionIdFormat.createBackupKey( sessionId ); final Future<Boolean> touchResultFuture = _storage.add( key, 1, BYTE_1 ); try { final boolean touchResult = touchResultFuture.get(200, TimeUnit.MILLISECONDS); if ( touchResult ) { _log.warn( "The secondary backup for session " + sessionId + " should be touched in memcached, but it seemed to be" + " not existing." ); return false; } _log.debug( "The secondary session backup was ping'ed successfully." ); return true; } catch ( final TimeoutException e ) { _log.warn( "The secondary backup for session " + sessionId + " could not be completed within 200 millis, was cancelled now." ); return false; } catch ( final ExecutionException e ) { _log.warn( "An exception occurred when trying to ping session " + sessionId, e ); return false; } } }
log.warn("maxActive is smaller than 1, setting maxActive to: "+PoolProperties.DEFAULT_MAX_ACTIVE); properties.setMaxActive(PoolProperties.DEFAULT_MAX_ACTIVE); log.warn("initialSize is larger than maxActive, setting initialSize to: "+properties.getMaxActive()); properties.setInitialSize(properties.getMaxActive()); log.warn("minIdle is larger than maxActive, setting minIdle to: "+properties.getMaxActive()); properties.setMinIdle(properties.getMaxActive()); for (int i=0; i<proxies.length; i++) { try { if (log.isDebugEnabled()) { log.debug("Creating interceptor instance of class:"+proxies[i].getInterceptorClass()); interceptor.poolStarted(this); }catch (Exception x) { log.error("Unable to inform interceptor of pool start.",x); if (jmxPool!=null) jmxPool.notify(org.apache.tomcat.jdbc.pool.jmx.ConnectionPool.NOTIFY_INIT, getStackTrace(x)); close(true);
@Override public String getCanonicalPath() { try { return resource.getCanonicalPath(); } catch (IOException ioe) { if (log.isDebugEnabled()) { log.debug(sm.getString("fileResource.getCanonicalPathFail", resource.getPath()), ioe); } return null; } }
protected void releaseLock( @Nonnull final String sessionId ) { try { if ( _log.isDebugEnabled() ) { _log.debug( "Releasing lock for session " + sessionId ); } final long start = System.currentTimeMillis(); _storage.delete( _sessionIdFormat.createLockName( sessionId ) ).get(); _stats.registerSince( RELEASE_LOCK, start ); } catch ( final Exception e ) { _log.warn( "Caught exception when trying to release lock for session " + sessionId, e ); } }
@Override public void run() { // Get the sessionIds to touch and clear the set inside synchronization Set<String> sessionIds = null; sessionIds = new HashSet<String>(getSessionsToTouch()); getSessionsToTouch().clear(); // Touch the sessions we currently have if (!sessionIds.isEmpty()) { getSessionCache().touchSessions(sessionIds); if (getLogger().isDebugEnabled()) { getLogger().debug(DeltaSessionManager.this + ": Touched sessions: " + sessionIds); } } } };
getLogger().debug("Query: " + query.getQueryString()); getLogger().debug("No sessions to unload for context " + context.getPath()); return; // nothing to do return; if (getLogger().isDebugEnabled()) { getLogger().debug("Unloading sessions to " + store.getAbsolutePath()); if (getLogger().isDebugEnabled()) getLogger().debug("Unloading " + list.size() + " sessions"); try { oos.writeObject(new Integer(list.size())); getLogger().error("Exception unloading sessions", e); try { oos.close(); if (getLogger().isDebugEnabled()) { getLogger().debug("Locally destroying session " + session.getId()); if (getLogger().isDebugEnabled()) { getLogger().debug("Unloading complete");
/** * Process a "stop" event for this Host. */ public void stop() { if (log.isDebugEnabled()) log.debug(sm.getString("hostConfig.stop")); if (oname != null) { try { Registry.getRegistry(null, null).unregisterComponent(oname); } catch (Exception e) { log.error(sm.getString("hostConfig.jmx.unregister", oname), e); } } oname = null; }