Skip to content

Eliminate Eh107InternalCacheManager by resolving services from services#2346

Merged
henri-tremblay merged 6 commits intoehcache:masterfrom
chrisdennis:107-cleanup
Jul 14, 2018
Merged

Eliminate Eh107InternalCacheManager by resolving services from services#2346
henri-tremblay merged 6 commits intoehcache:masterfrom
chrisdennis:107-cleanup

Conversation

@chrisdennis
Copy link
Copy Markdown
Member

No description provided.

@henri-tremblay
Copy link
Copy Markdown
Contributor

I prefer #2339 which eliminates it as well. But without giving some special status to the StatisticsService. Because you never know what other services can be useful.

@chrisdennis
Copy link
Copy Markdown
Member Author

There is no special status here though. The Jsr107Service already declares a dependency on the StatisticsService, this just makes sure we retrieve it via the correct channels.

ehcacheManager.init();

return new Eh107CacheManager(this, ehcacheManager, properties, config.getClassLoader(), uri,
return new Eh107CacheManager(this, ehcacheManager, jsr107Service.getStatistics(), properties, config.getClassLoader(), uri,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It still feels weird to pass the StatisticsService since the ehcacheManager is passed and already has it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not passing jsr107service and retrieve the statistics inside the constructor? I would prefer that.

@chrisdennis chrisdennis force-pushed the 107-cleanup branch 2 times, most recently from 56833e9 to ed4e97f Compare March 29, 2018 17:07
@chrisdennis chrisdennis force-pushed the 107-cleanup branch 2 times, most recently from 887891b to 76326ab Compare May 14, 2018 20:54
@chrisdennis
Copy link
Copy Markdown
Member Author

@henri-tremblay could you re-review this? It's been tweaked and expanded since you last looked at it.

@chrisdennis chrisdennis force-pushed the 107-cleanup branch 3 times, most recently from 0c9a187 to 0c17e39 Compare June 14, 2018 16:10
@chrisdennis chrisdennis force-pushed the 107-cleanup branch 2 times, most recently from 0e24cc6 to 19381c8 Compare July 11, 2018 16:36
public class DefaultJsr107Service implements Jsr107Service {

private final Jsr107Configuration configuration;
private StatisticsService statisticsService;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't that field be volatile?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably not since there the ServiceLocator creates a happens before relationship between the start of a dependency and the start of it's dependents... but it's probably safer to add it anyway.

@chrisdennis chrisdennis force-pushed the 107-cleanup branch 2 times, most recently from c8c4359 to e332743 Compare July 13, 2018 18:18
@henri-tremblay henri-tremblay merged commit ce78fdf into ehcache:master Jul 14, 2018
@henri-tremblay henri-tremblay added this to the 3.6.0 milestone Jul 14, 2018
@chrisdennis chrisdennis deleted the 107-cleanup branch September 12, 2018 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants