Example usage for org.apache.wicket.protocol.http IRequestLogger objectUpdated

List of usage examples for org.apache.wicket.protocol.http IRequestLogger objectUpdated

Introduction

In this page you can find the example usage for org.apache.wicket.protocol.http IRequestLogger objectUpdated.

Prototype

void objectUpdated(Object value);

Source Link

Document

Called to monitor updates of objects in the ISessionStore

Usage

From source file:bugs.HttpSessionStoreModified.java

License:Apache License

/**
 * @see org.apache.wicket.session.ISessionStore#setAttribute(org.apache.wicket.request.Request,
 *      java.lang.String, java.io.Serializable)
 *//* w  w w.j  a va 2 s. com*/
@Override
public final void setAttribute(final Request request, final String name, final Serializable value) {
    // ignore call if the session was marked invalid
    HttpSession httpSession = getHttpSession(request, false);
    if (httpSession != null) {
        String attributeName = getSessionAttributePrefix(request) + name;
        IRequestLogger logger = Application.get().getRequestLogger();
        if (logger != null) {
            if (httpSession.getAttribute(attributeName) == null) {
                logger.objectCreated(value);
            } else {
                logger.objectUpdated(value);
            }
        }
        setValueInternal(httpSession, value, attributeName);
    }
}

From source file:com.mastfrog.acteur.wicket.ActeurSessionStore.java

License:Apache License

/**
 * @see/*ww  w  .j a v  a 2s.c om*/
 * org.apache.wicket.session.ISessionStore#setAttribute(org.apache.wicket.request.Request,
 * java.lang.String, java.io.Serializable)
 */
@Override
public final void setAttribute(final Request request, final String name, final Serializable value) {
    // ignore call if the session was marked invalid
    SessionImpl httpSession = getHttpSession(request, false);
    if (httpSession != null) {
        String attributeName = getSessionAttributePrefix(request) + name;
        IRequestLogger logger = Application.get().getRequestLogger();
        if (logger != null) {
            if (httpSession.getAttribute(attributeName) == null) {
                logger.objectCreated(value);
            } else {
                logger.objectUpdated(value);
            }
        }
        httpSession.setAttribute(attributeName, value);
    }
}