private static void registerLogin4History(final String _userName,
                                              final String _sessionId)
    {
        try {
            final WebRequest req = (WebRequest) RequestCycle.get().getRequest();
            final HttpServletRequest httpReq = (HttpServletRequest) req.getContainerRequest();
            String ipAddress = httpReq.getHeader("X-FORWARDED-FOR");
            if (ipAddress == null) {
                ipAddress = httpReq.getRemoteAddr();
            }
            final Class<?> clazz = Class.forName("org.efaps.esjp.common.history.LoginHistory", true,
                            EFapsClassLoader.getInstance());
            final Object obj = clazz.newInstance();
            final Method method = clazz.getMethod("register", String.class, String.class, String.class);
            method.invoke(obj, _userName, _sessionId, ipAddress);
        } catch (final ClassNotFoundException | NoSuchMethodException | SecurityException | InstantiationException
                        | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
            RegistryManager.LOG.error("Error on registering Login", e);
        }
    }
private static void registerLogin4History ( final String _userName , final String _sessionId ) { try { final WebRequest req = ( WebRequest ) RequestCycle . get ( ) . getRequest ( ) ; final HttpServletRequest httpReq = ( HttpServletRequest ) req . getContainerRequest ( ) ; String ipAddress = httpReq . getHeader ( "X-FORWARDED-FOR" ) ; if ( ipAddress == null ) { ipAddress = httpReq . getRemoteAddr ( ) ; } final Class < ? > clazz = Class . forName ( "org.efaps.esjp.common.history.LoginHistory" , true , EFapsClassLoader . getInstance ( ) ) ; final Object obj = clazz . newInstance ( ) ; final Method method = clazz . getMethod ( "register" , String . class , String . class , String . class ) ; method . invoke ( obj , _userName , _sessionId , ipAddress ) ; } catch ( final ClassNotFoundException | NoSuchMethodException | SecurityException | InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e ) { RegistryManager . LOG . error ( "Error on registering Login" , e ) ; } }
@param _userName userName
@param _sessionId sessionid