Changeset 1672 for branches/3.0-Beta2/components/server
- Timestamp:
- 06/25/07 23:14:32 (18 months ago)
- 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 948 948 // ========================================================================= 949 949 950 public void loadEventContext(boolean isRead yOnly) {950 public void loadEventContext(boolean isReadOnly) { 951 951 952 952 // needed services … … 958 958 959 959 // start refilling current details 960 cd.setReadOnly(isRead yOnly);960 cd.setReadOnly(isReadOnly); 961 961 962 962 // Experimenter … … 997 997 cd.newEvent(type, token); 998 998 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); 1005 1020 setCurrentEvent(iUpdate.saveAndReturnObject(event)); 1006 }1007 1008 1021 } 1009 1022 … … 1027 1040 && p.getEventType().equals(t_name)) { 1028 1041 cd.setCurrentEventContext(bec); 1042 if (!bec.isReadOnly) { 1043 saveEventIfWriteMethod(); 1044 } 1029 1045 } 1030 1046 … … 1119 1135 if (Event.class.isAssignableFrom(klass) 1120 1136 || 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); 1122 1139 } 1123 1140 -
branches/3.0-Beta2/components/server/src/ome/security/basic/EventHandler.java
r1237 r1672 88 88 /** 89 89 * invocation interceptor for prepairing this {@link Thread} for execution 90 * and subsequently reseting it. 90 * and subsequently reseting it. 91 91 * 92 92 * @see org.aopalliance.intercept.MethodInterceptor#invoke(org.aopalliance.intercept.MethodInvocation) … … 108 108 109 109 else { 110 secSys.loadEventContext( false);110 secSys.loadEventContext(readOnly); 111 111 objCtxMap.put(arg0.getThis(), secSys.getEventContext()); 112 112 prevCtx = secSys.getEventContext(); … … 114 114 } 115 115 } 116 // Need to update the read-ability 117 ((BasicEventContext)prevCtx).isReadOnly = readOnly; 116 118 secSys.setEventContext(prevCtx); 117 119 }
