String id = request.getRequestedSessionId();
if ((id != null) && (id.length() > 0)) {
Manager manager = request.getContext().getManager();
Session session = manager.findSession(id);
if (session instanceof ClusterSession) {
ClusterSession cses = (ClusterSession) session;
if (cses != null) {
Boolean isPrimary = new Boolean(cses.isPrimarySession());
if (log.isDebugEnabled())
log.debug(sm.getString(
"ReplicationValve.session.indicator", request.getContext().getName(),id,
primaryIndicatorName, isPrimary));
request.setAttribute(primaryIndicatorName, isPrimary);