use of org.apache.catalina.Manager in project Payara by payara.
the class ApplicationHttpRequest method isRequestedSessionIdValid.
/**
* Returns true if the request specifies a JSESSIONID that is valid within
* the context of this ApplicationHttpRequest, false otherwise.
*
* @return true if the request specifies a JSESSIONID that is valid within
* the context of this ApplicationHttpRequest, false otherwise.
*/
@Override
public boolean isRequestedSessionIdValid() {
if (crossContext) {
String requestedSessionId = getRequestedSessionId();
if (requestedSessionId == null)
return (false);
if (context == null)
return (false);
if (session != null && requestedSessionId.equals(session.getIdInternal())) {
return session.isValid();
}
Manager manager = context.getManager();
if (manager == null)
return (false);
Session localSession = null;
try {
if (isSessionVersioningSupported) {
localSession = manager.findSession(requestedSessionId, requestedSessionVersion);
} else {
localSession = manager.findSession(requestedSessionId);
}
} catch (IOException e) {
localSession = null;
}
if ((localSession != null) && localSession.isValid()) {
return (true);
} else {
return (false);
}
} else {
return super.isRequestedSessionIdValid();
}
}
use of org.apache.catalina.Manager in project Payara by payara.
the class ContainerBase method setManager.
/**
* Set the Manager with which this Container is associated.
*
* @param manager The newly associated Manager
*/
@Override
public void setManager(Manager manager) {
Manager oldManager;
try {
writeLock.lock();
// Change components if necessary
oldManager = this.manager;
if (oldManager == manager)
return;
this.manager = manager;
// Stop the old component if necessary
if (started && (oldManager != null) && (oldManager instanceof Lifecycle)) {
try {
((Lifecycle) oldManager).stop();
} catch (LifecycleException e) {
log.log(Level.SEVERE, LogFacade.CONTAINER_BASE_SET_MANAGER_STOP, e);
}
}
// Start the new component if necessary
if (manager != null)
manager.setContainer(this);
if (started && (manager != null) && (manager instanceof Lifecycle)) {
try {
((Lifecycle) manager).start();
} catch (LifecycleException e) {
log.log(Level.SEVERE, LogFacade.CONTAINER_BASE_SET_MANAGER_START, e);
}
}
} finally {
writeLock.unlock();
}
// Report this property change to interested listeners
support.firePropertyChange("manager", oldManager, this.manager);
}
use of org.apache.catalina.Manager in project Payara by payara.
the class HAStoreBase method remove.
// SJSAS 6406580 START
/**
* Remove the Session with the specified session identifier from
* this Store, if present. If no such Session is present, this method
* takes no action.
*
* @param id Session identifier of the Session to be removed
*
* @exception IOException if an input/output error occurs
*/
public void remove(String id) throws IOException {
if (_debug > 0) {
debug("in remove");
}
if (id == null) {
if (_debug > 0) {
debug("In remove, got a null id");
}
return;
}
Manager mgr = this.getManager();
if (mgr instanceof ReplicationManagerBase) {
ReplicationManagerBase pMgr = (ReplicationManagerBase) mgr;
pMgr.doRemove(id);
} else {
this.removeSynchronized(id);
}
}
use of org.apache.catalina.Manager in project Payara by payara.
the class BaseHASession method sync.
public void sync() {
HttpSessionBindingEvent event = null;
event = new HttpSessionBindingEvent((HttpSession) this, null, null);
// Notify special event listeners on sync()
Manager manager = this.getManager();
StandardContext stdContext = (StandardContext) manager.getContainer();
// fire container event
stdContext.fireContainerEvent("sessionSync", event);
}
use of org.apache.catalina.Manager in project Payara by payara.
the class HASessionStoreValve method doPostInvoke.
/**
* A post-request processing implementation that does the valveSave.
* @param request
* @param response
*/
private void doPostInvoke(Request request, Response response) throws IOException, ServletException {
if (_logger.isLoggable(Level.FINEST)) {
_logger.finest("IN HASessionStoreValve>>postInvoke()");
}
String sessionId = null;
Session session;
StandardContext context;
Manager manager;
HttpServletRequest hreq = (HttpServletRequest) request.getRequest();
HttpSession hsess = hreq.getSession(false);
if (hsess != null) {
sessionId = hsess.getId();
if (_logger.isLoggable(Level.FINEST)) {
_logger.finest("IN HASessionStoreValve:postInvoke:sessionId=" + sessionId);
}
}
if (sessionId != null) {
context = (StandardContext) request.getContext();
manager = context.getManager();
session = manager.findSession(sessionId);
if (_logger.isLoggable(Level.FINEST)) {
_logger.finest("IN HASessionStoreValve:postInvoke:session=" + session);
}
if (session != null) {
WebEventPersistentManager pMgr = (WebEventPersistentManager) manager;
pMgr.doValveSave(session);
}
}
HACookieManager.reset();
}
Aggregations