• Views
  • Iteration Report
  • My Iteration Report
  •  
OMERO.server
  • Login
  • Help/Guide
  • About Trac
  • Preferences
  • Wiki
  • Timeline
  • Roadmap
  • Browse Source
  • View Tickets
  • Search

Context Navigation

  • ← Previous Changeset
  • Next Changeset →

Changeset 1672

Show
Ignore:
Timestamp:
06/25/07 23:14:32 (18 months ago)
Author:
jmoore
Message:

#740 Fixing event context loading re: stateful sessions.

Location:
branches/3.0-Beta2/components/server/src/ome/security/basic
Files:
2 modified

  • BasicSecuritySystem.java (modified) (5 diffs)
  • EventHandler.java (modified) (3 diffs)

Legend:

Unmodified
Added
Removed
  • branches/3.0-Beta2/components/server/src/ome/security/basic/BasicSecuritySystem.java

    r1581 r1672  
    948948    // ========================================================================= 
    949949 
    950     public void loadEventContext(boolean isReadyOnly) { 
     950    public void loadEventContext(boolean isReadOnly) { 
    951951 
    952952        // needed services 
    … …  
    958958 
    959959        // start refilling current details 
    960         cd.setReadOnly(isReadyOnly); 
     960        cd.setReadOnly(isReadOnly); 
    961961 
    962962        // Experimenter 
    … …  
    997997        cd.newEvent(type, token); 
    998998 
    999         Event event = getCurrentEvent(); 
    1000         event.getGraphHolder().setToken(token, token); 
    1001  
    1002         // If this event is not read only, then lets save this event to prevent 
    1003         // flushing issues later. 
    1004         if (!isReadyOnly) { 
     999        if (!isReadOnly) {    
     1000            saveEventIfWriteMethod(); 
     1001        } 
     1002         
     1003    } 
     1004 
     1005    /** During {@link #loadEventContext(boolean) loading} and  
     1006     * {@link #setEventContext(EventContext) setting} of the {@link EventContext} 
     1007     * it is necessary to save the {@link Event} to prevent "null or transient 
     1008     * value exceptions" later. This is done also done for {@link Event events} 
     1009     * of stateful services, in which the {@link EventContext#isReadOnly()} flag 
     1010     * changes from true to false. 
     1011     *  
     1012     * @see EventHandler 
     1013     * @see #loadEventContext(boolean) 
     1014     * @see #setEventContext(EventContext) 
     1015     */ 
     1016    private void saveEventIfWriteMethod() { 
     1017            IUpdate iUpdate = sf.getUpdateService(); 
     1018            Event event = getCurrentEvent(); 
     1019            event.getGraphHolder().setToken(token, token); 
    10051020            setCurrentEvent(iUpdate.saveAndReturnObject(event)); 
    1006         } 
    1007  
    10081021    } 
    10091022 
    … …  
    10271040                && p.getEventType().equals(t_name)) { 
    10281041            cd.setCurrentEventContext(bec); 
     1042            if (!bec.isReadOnly) { 
     1043                saveEventIfWriteMethod(); 
     1044            } 
    10291045        } 
    10301046 
    … …  
    11191135        if (Event.class.isAssignableFrom(klass) 
    11201136                || EventLog.class.isAssignableFrom(klass)) { 
    1121             log.debug("Not logging creation of logging type:" + klass); 
     1137            // Cannot log because these are the log classes. 
     1138            log.info("Noticing:" + action + "," + klass + "," + id); 
    11221139        } 
    11231140 
  • branches/3.0-Beta2/components/server/src/ome/security/basic/EventHandler.java

    r1237 r1672  
    8888    /** 
    8989     * invocation interceptor for prepairing this {@link Thread} for execution 
    90      * and subsequently reseting it. 
     90     * and subsequently reseting it.  
    9191     *  
    9292     * @see org.aopalliance.intercept.MethodInterceptor#invoke(org.aopalliance.intercept.MethodInvocation) 
    … …  
    108108 
    109109                else { 
    110                     secSys.loadEventContext(false); 
     110                    secSys.loadEventContext(readOnly); 
    111111                    objCtxMap.put(arg0.getThis(), secSys.getEventContext()); 
    112112                    prevCtx = secSys.getEventContext(); 
    … …  
    114114                } 
    115115            } 
     116            // Need to update the read-ability 
     117            ((BasicEventContext)prevCtx).isReadOnly = readOnly; 
    116118            secSys.setEventContext(prevCtx); 
    117119        } 

Download in other formats:

  • Unified Diff
  • Zip Archive

Trac Powered

Powered by Trac 0.11
By Edgewall Software.

Visit the Trac open source project at
http://trac.edgewall.org/