[ https://issues.apache.org/jira/browse/AXIS2-5788?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17926961#comment-17926961 ]
Robert Lazarski commented on AXIS2-5788: ---------------------------------------- I looked at this and it changes some fundamental code, and it is very near the 2.0.0 release date. So, I will work on this early in the 2.0.1 cycle. I'd like it to go thru more testing than would happen now. > ConfigurationContext.getServiceGroupContext(id) always touches the id - > ("Observer Effect") > ------------------------------------------------------------------------------------------- > > Key: AXIS2-5788 > URL: https://issues.apache.org/jira/browse/AXIS2-5788 > Project: Axis2 > Issue Type: Bug > Components: kernel > Affects Versions: 1.7.3 > Environment: ANY > Reporter: Jeff Thomas > Priority: Major > Fix For: 2.0.1 > > > Currently it is not possibel to get a ServiceGroupContext from the > ConfigurationContext without forcing a touch to the 'lastTouchedTime'. > This prevents us from performing our own checks against the lastTouchedTime > because it is always set to the System time ("Observer Effect" - by observing > the system, we change the system). > I would propose a second API method which would allow retrieval of the > ServiceGroupContext by id without touching the lastTouchedTime. > Here my proposed code change: > {code:java} > /** > * Returns a ServiceGroupContext object associated with the specified ID > from the internal table. > * <p> > * If found, the returned {@code ServiceGroupContext} will be touched > with the current system time. > * > * @param serviceGroupCtxId The ID string associated with the > ServiceGroupContext object > * @return The ServiceGroupContext object, or {@code null} if not found > */ > public ServiceGroupContext getServiceGroupContext(String > serviceGroupCtxId) { > return getServiceGroupContext(serviceGroupCtxId, true); > } > /** > * Returns a ServiceGroupContext object associated with the specified ID > from the internal table. > * > * @param serviceGroupCtxId The ID string associated with the > ServiceGroupContext object > * @param touchServiceGroupContext if {@code true} the retrieved {@code > ServiceGroupContext} will be touched on > * retrieval; otherwise, {@code false}. > * @return the ServiceGroupContext object, or {@code null} if not found > */ > public ServiceGroupContext getServiceGroupContext(String > serviceGroupCtxId, boolean touchServiceGroupContext) { > if (serviceGroupCtxId == null) { > // Hashtables require non-null key-value pairs > return null; > } > ServiceGroupContext serviceGroupContext = null; > if (serviceGroupContextMap != null) { > serviceGroupContext > =serviceGroupContextMap.get(serviceGroupCtxId); > if (serviceGroupContext != null && touchServiceGroupContext) { > serviceGroupContext.touch(); > } else { > serviceGroupContext =applicationSessionServiceGroupContexts > .get(serviceGroupCtxId); > if (serviceGroupContext != null && touchServiceGroupContext) { > serviceGroupContext.touch(); > } > } > } > > return serviceGroupContext; > > } > {code} > Side note: the javadoc of getServiceGroupContextIDs is incorrect. The method > returns a String[] array of ids and not a hashmap of ServiceGroupContexts. > {code:java} > /** > * Gets all service groups in the system. > * > * @return Returns hashmap of ServiceGroupContexts. > */ > public String[] getServiceGroupContextIDs() { > {code} -- This message was sent by Atlassian Jira (v8.20.10#820010) --------------------------------------------------------------------- To unsubscribe, e-mail: java-dev-unsubscr...@axis.apache.org For additional commands, e-mail: java-dev-h...@axis.apache.org