SlideShare a Scribd company logo
1 of 39
Download to read offline
@payara_fish 
JSR107 
Come, Code, Cache, Compute! 
Steve Millidge
@payara_fish 
Agenda 
• Basic Caching 
– Cache API 
– Cache Configuration 
• Cache Events 
• Cache Computations
@payara_fish 
What is JSR107? 
JCACHE JavaTM Temporary Caching API
Time delay in requesting an operation 
and it being initiated 
@payara_fish
1Gb Ethernet : 25 – 30MB/s 
10Gb Ethernet : 250 – 350MB/s 
Infiniband : 6GB/s (maybe) 
@payara_fish
PING TIMES 
Local : 57μs 
LAN segment : 300μs 
LAN: switches : 4ms 
UK : 30ms 
USA : 100ms 
3G : 100s ms 
@payara_fish
@payara_fish 
Spinning Rust 
Source: tomshardware.com 
Typical SSD Speed 
540MB/s 
Disk BUS Speeds 
SATA 1.0 : 150MB/s 
SATA 2.0 : 300MB/s 
SATA 3.0 : 600MB/s 
SAS : 600MB/s 
Fibre Channel : 1GB/s 
Infiniband : 1GB/s
@payara_fish 
DDR3 1600 : 12.8GB/s
@payara_fish
@payara_fish 
Caching Concepts 
Caching 
Provider 
Cache 
Manager 
Cache 
Entry 
Key 
Value
@payara_fish 
Core Concepts 
• CachingProvider 
– Retrieves and closes Cache Managers 
• CacheManager 
– Creates and destroys caches 
• Cache 
– Contains Objects in Key Value Pairs
@payara_fish 
Simple Cache Code Architecture 
Coherence 
Cache Node 
(Simple Code) 
Coherence 
Cache Node 
(Get Example) 
Coherence 
Cache Node 
(Put Example) 
Stock
@payara_fish 
Code Interlude
CachingProvider cp = Caching.getCachingProvider(); 
@payara_fish 
CacheManager cm = cp.getCacheManager(); 
MutableConfiguration<String, Stock> config 
= new MutableConfiguration<>(); 
config.setStoreByValue(true) 
.setTypes(String.class,Stock.class) 
.setManagementEnabled(true) 
.setStatisticsEnabled(true); 
Cache<String, Stock> cache = cm.createCache("J12014", 
config); 
System.out.println(cache.get("PAYA"));
@payara_fish 
Further Cache Methods 
cache.replace("PAYA",new Stock(28.0,"PAYA"); 
cache.remove(“PAYA”); 
stock = cache.getAndPut("PAYA", new 
Stock(27.0,"PAYA")); 
stock = cache.getAndReplace("PAYA",new 
Stock(28.0,"PAYA")); 
stock = cache.getAndRemove("PAYA"); 
cache.putIfAbsent("PAYA", stock);
@payara_fish 
Events
@payara_fish 
Core Concepts Events 
• CacheEntryListener 
– Receives Events relating to specific Keys 
– Subinterfaces for Created, Expired, 
Updated, Removed 
• CacheEntryEventFilter 
– Filters Events Before Delivery 
– Useful in distributed caches
@payara_fish 
Events API 
Coherence 
Cache Node 
(Simple Code) 
Coherence 
Cache Node 
(Stock Ticker) 
Coherence 
Cache Node 
(PriceTicker) 
Listener Stock
@payara_fish 
Code Interlude
CachingProvider cp = Caching.getCachingProvider(); 
CacheManager cm = cp.getCacheManager(); 
MutableConfiguration<String, Stock> config 
@payara_fish 
= new MutableConfiguration<>(); 
config.setStoreByValue(true) 
.setTypes(String.class, Stock.class) 
.setManagementEnabled(true). 
setStatisticsEnabled(true); 
Cache<String, Stock> cache = cm.createCache("J12014", 
config); 
while (true) { 
cache.put("PAYA", new Stock(Math.random() * 
20.0d, "PAYA")); 
Thread.sleep(1000); 
}
@payara_fish 
public class StockListener implements 
CacheEntryUpdatedListener<>, Serializable{ 
@Override 
public void onUpdated(Iterable<> itrbl) throws 
CacheEntryListenerException 
{ 
Iterator<CacheEntryEvent<> i = itrbl.iterator(); 
while (i.hasNext()) { 
System.out.println(i.next().getValue()); 
} 
} 
}
MutableCacheEntryListenerConfiguration<> lConf 
@payara_fish 
= new 
MutableCacheEntryListenerConfiguration<>( 
FactoryBuilder.factoryOf(new StockListener()), 
null, false, false); 
cache.registerCacheEntryListener(lConf); 
while (true) { 
Thread.sleep(1000); 
}
@payara_fish 
Listerner Interfaces 
• CacheEntryCreatedListener<K,V> 
– onCreated() 
• CacheEntryExpiredListener<K,V> 
– onExpired() 
• CacheEntryRemovedListener<K,V> 
– onRemoved() 
• CacheEntryUpdatedListener<K,V> 
– onUpdated()
@payara_fish 
Listener semantics 
• Are fired after the entry is mutated in the cache 
• if synchronous are fired, for a given key, in the order 
that events occur 
• block the calling thread until the listener returns, 
where the listener was registered as synchronous 
• that are asynchronous iterate through multiple 
events with an undefined ordering, except that 
events on the same key are in the order that the 
events occur.
@payara_fish 
Events Demo 
http://demo.c2b2.co.uk:7080/
@payara_fish 
Compute!
@payara_fish 
Compute Architecture 
Coherence 
Cache Node 
(Simple Code) 
Coherence 
Cache Node 
(Simple Code) 
StoScktockStocSktock StoScktockStocSktock 
Coherence 
Cache Node 
(Revalue) 
Entry 
Processor 
Entry 
Processor 
Coherence 
Cache Node 
(FindStock)
@payara_fish 
Key Cache Methods 
• invoke(Key,EntryProcessor,args) 
• invokeAll(Set<Key>,EntryProcessor,args) 
• Entry Processor Interface 
T process(MutableEntry<K,V>,Object … args)
@payara_fish 
Code Interlude
public class PrintStock implements 
EntryProcessor<String, Stock, String>, Serializable 
{ 
@Override 
public String process(MutableEntry<String, Stock> 
me, Object... os) throws EntryProcessorException 
@payara_fish 
{ 
System.out.println(me.getValue() + " IS HERE 
........... "); 
return null; 
} 
}
CachingProvider cp = Caching.getCachingProvider(); 
@payara_fish 
CacheManager cm = cp.getCacheManager(); 
MutableConfiguration<String,Stock> config = 
new MutableConfiguration<>(); 
config.setStoreByValue(true) 
.setTypes(String.class,Stock.class) 
.setManagementEnabled(true) 
.setStatisticsEnabled(true); 
Cache<String,Stock> cache = 
cm.createCache("J12014",config); 
cache.invoke("PAYA", new PrintStock());
@payara_fish 
Other JSR107 Features 
• Cache Loader and Cache Writers 
– Implements Read through and write 
through caching for persistence stores 
• Statistics 
– JMX Statistics (demo) 
• CDI Integration 
– Annotations for automatic cache 
interactions
@payara_fish 
CacheLoader and CacheWriter 
• Integrate with external resource 
– JPA Caching 
– Memcached integration 
– NoSQL integration 
• Provide read through and write 
through capability
@payara_fish 
CacheLoader and CacheWriter 
• CacheLoader for read through 
– load(Key) 
– loadAll(Iterable<Key>) 
– Added to Cache Configuration 
• CacheWriter for write through 
– write, writeAll 
– delete, deleteAll 
– Added to Cache Configuration
@payara_fish 
JSR 107 Annotations 
• @CacheDefaults 
• @CacheResult 
• @CachePut 
• @CacheRemove 
• @CacheRemoveAll
@payara_fish 
Example Annotations 
package my.app; 
@CacheDefaults(cacheName="domainCache") 
public class DomainDao { 
@CacheResult 
public Domain getDomain(String domainId, int index) { 
... 
} 
@CacheRemove 
public void deleteDomain(String domainId, int index) { 
... 
} 
@CacheResult(cacheName="allDomains") 
public List<Domain> getAllDomains() { 
... 
} 
}
@payara_fish 
Example Annotations 
package my.app; 
public class DomainDao { 
@CachePut(cacheName="domainCache") 
public void updateDomain(String domainId, int index, 
@CacheValue Domain 
domain) { 
... 
} 
}
@payara_fish 
Learn More 
• https://jcp.org/en/jsr/detail?id=107 
• https://github.com/jsr107 
• https://groups.google.com/forum/#!foru 
m/jsr107
@payara_fish

More Related Content

What's hot

Caching and tuning fun for high scalability
Caching and tuning fun for high scalabilityCaching and tuning fun for high scalability
Caching and tuning fun for high scalabilityWim Godden
 
MongoUK 2011 - Rplacing RabbitMQ with MongoDB
MongoUK 2011 - Rplacing RabbitMQ with MongoDBMongoUK 2011 - Rplacing RabbitMQ with MongoDB
MongoUK 2011 - Rplacing RabbitMQ with MongoDBBoxed Ice
 
Beyond PHP - It's not (just) about the code
Beyond PHP - It's not (just) about the codeBeyond PHP - It's not (just) about the code
Beyond PHP - It's not (just) about the codeWim Godden
 
MongoDB Tokyo - Monitoring and Queueing
MongoDB Tokyo - Monitoring and QueueingMongoDB Tokyo - Monitoring and Queueing
MongoDB Tokyo - Monitoring and QueueingBoxed Ice
 
DevOpsDays Warsaw 2015: Running High Performance And Fault Tolerant Elasticse...
DevOpsDays Warsaw 2015: Running High Performance And Fault Tolerant Elasticse...DevOpsDays Warsaw 2015: Running High Performance And Fault Tolerant Elasticse...
DevOpsDays Warsaw 2015: Running High Performance And Fault Tolerant Elasticse...PROIDEA
 
C* Summit EU 2013: Cassandra Internals
C* Summit EU 2013: Cassandra Internals C* Summit EU 2013: Cassandra Internals
C* Summit EU 2013: Cassandra Internals DataStax Academy
 
Beyond PHP - it's not (just) about the code
Beyond PHP - it's not (just) about the codeBeyond PHP - it's not (just) about the code
Beyond PHP - it's not (just) about the codeWim Godden
 
MongoDB - Monitoring & queueing
MongoDB - Monitoring & queueingMongoDB - Monitoring & queueing
MongoDB - Monitoring & queueingBoxed Ice
 
Replication MongoDB Days 2013
Replication MongoDB Days 2013Replication MongoDB Days 2013
Replication MongoDB Days 2013Randall Hunt
 
Java и Linux — особенности эксплуатации / Алексей Рагозин (Дойче Банк)
Java и Linux — особенности эксплуатации / Алексей Рагозин (Дойче Банк)Java и Linux — особенности эксплуатации / Алексей Рагозин (Дойче Банк)
Java и Linux — особенности эксплуатации / Алексей Рагозин (Дойче Банк)Ontico
 
Memcached Presentation @757rb
Memcached Presentation @757rbMemcached Presentation @757rb
Memcached Presentation @757rbKen Collins
 
BATTLESTAR GALACTICA : Saison 5 - Les Cylons passent dans le cloud avec Vert....
BATTLESTAR GALACTICA : Saison 5 - Les Cylons passent dans le cloud avec Vert....BATTLESTAR GALACTICA : Saison 5 - Les Cylons passent dans le cloud avec Vert....
BATTLESTAR GALACTICA : Saison 5 - Les Cylons passent dans le cloud avec Vert....La Cuisine du Web
 
How Secure Are Docker Containers?
How Secure Are Docker Containers?How Secure Are Docker Containers?
How Secure Are Docker Containers?Ben Hall
 
BDD - Behavior Driven Development Webapps mit Groovy Spock und Geb
BDD - Behavior Driven Development Webapps mit Groovy Spock und GebBDD - Behavior Driven Development Webapps mit Groovy Spock und Geb
BDD - Behavior Driven Development Webapps mit Groovy Spock und GebChristian Baranowski
 
Advanced Apache Cassandra Operations with JMX
Advanced Apache Cassandra Operations with JMXAdvanced Apache Cassandra Operations with JMX
Advanced Apache Cassandra Operations with JMXzznate
 
Tips on how to improve the performance of your custom modules for high volume...
Tips on how to improve the performance of your custom modules for high volume...Tips on how to improve the performance of your custom modules for high volume...
Tips on how to improve the performance of your custom modules for high volume...Odoo
 
Go Programming Patterns
Go Programming PatternsGo Programming Patterns
Go Programming PatternsHao Chen
 

What's hot (20)

Common scenarios in vcl
Common scenarios in vclCommon scenarios in vcl
Common scenarios in vcl
 
Caching and tuning fun for high scalability
Caching and tuning fun for high scalabilityCaching and tuning fun for high scalability
Caching and tuning fun for high scalability
 
MongoUK 2011 - Rplacing RabbitMQ with MongoDB
MongoUK 2011 - Rplacing RabbitMQ with MongoDBMongoUK 2011 - Rplacing RabbitMQ with MongoDB
MongoUK 2011 - Rplacing RabbitMQ with MongoDB
 
Beyond PHP - It's not (just) about the code
Beyond PHP - It's not (just) about the codeBeyond PHP - It's not (just) about the code
Beyond PHP - It's not (just) about the code
 
MongoDB Tokyo - Monitoring and Queueing
MongoDB Tokyo - Monitoring and QueueingMongoDB Tokyo - Monitoring and Queueing
MongoDB Tokyo - Monitoring and Queueing
 
DevOpsDays Warsaw 2015: Running High Performance And Fault Tolerant Elasticse...
DevOpsDays Warsaw 2015: Running High Performance And Fault Tolerant Elasticse...DevOpsDays Warsaw 2015: Running High Performance And Fault Tolerant Elasticse...
DevOpsDays Warsaw 2015: Running High Performance And Fault Tolerant Elasticse...
 
C* Summit EU 2013: Cassandra Internals
C* Summit EU 2013: Cassandra Internals C* Summit EU 2013: Cassandra Internals
C* Summit EU 2013: Cassandra Internals
 
Beyond PHP - it's not (just) about the code
Beyond PHP - it's not (just) about the codeBeyond PHP - it's not (just) about the code
Beyond PHP - it's not (just) about the code
 
MongoDB - Monitoring & queueing
MongoDB - Monitoring & queueingMongoDB - Monitoring & queueing
MongoDB - Monitoring & queueing
 
Replication MongoDB Days 2013
Replication MongoDB Days 2013Replication MongoDB Days 2013
Replication MongoDB Days 2013
 
Cassandra
CassandraCassandra
Cassandra
 
Java и Linux — особенности эксплуатации / Алексей Рагозин (Дойче Банк)
Java и Linux — особенности эксплуатации / Алексей Рагозин (Дойче Банк)Java и Linux — особенности эксплуатации / Алексей Рагозин (Дойче Банк)
Java и Linux — особенности эксплуатации / Алексей Рагозин (Дойче Банк)
 
Memcached Presentation @757rb
Memcached Presentation @757rbMemcached Presentation @757rb
Memcached Presentation @757rb
 
Prometheus Storage
Prometheus StoragePrometheus Storage
Prometheus Storage
 
BATTLESTAR GALACTICA : Saison 5 - Les Cylons passent dans le cloud avec Vert....
BATTLESTAR GALACTICA : Saison 5 - Les Cylons passent dans le cloud avec Vert....BATTLESTAR GALACTICA : Saison 5 - Les Cylons passent dans le cloud avec Vert....
BATTLESTAR GALACTICA : Saison 5 - Les Cylons passent dans le cloud avec Vert....
 
How Secure Are Docker Containers?
How Secure Are Docker Containers?How Secure Are Docker Containers?
How Secure Are Docker Containers?
 
BDD - Behavior Driven Development Webapps mit Groovy Spock und Geb
BDD - Behavior Driven Development Webapps mit Groovy Spock und GebBDD - Behavior Driven Development Webapps mit Groovy Spock und Geb
BDD - Behavior Driven Development Webapps mit Groovy Spock und Geb
 
Advanced Apache Cassandra Operations with JMX
Advanced Apache Cassandra Operations with JMXAdvanced Apache Cassandra Operations with JMX
Advanced Apache Cassandra Operations with JMX
 
Tips on how to improve the performance of your custom modules for high volume...
Tips on how to improve the performance of your custom modules for high volume...Tips on how to improve the performance of your custom modules for high volume...
Tips on how to improve the performance of your custom modules for high volume...
 
Go Programming Patterns
Go Programming PatternsGo Programming Patterns
Go Programming Patterns
 

Similar to Jsr107 come, code, cache, compute!

Scalable Integration with JBoss Fuse
Scalable Integration with JBoss FuseScalable Integration with JBoss Fuse
Scalable Integration with JBoss FuseChristina Lin
 
Cache is King: Get the Most Bang for Your Buck From Ruby
Cache is King: Get the Most Bang for Your Buck From RubyCache is King: Get the Most Bang for Your Buck From Ruby
Cache is King: Get the Most Bang for Your Buck From RubyMolly Struve
 
Simplifying Apache Cascading
Simplifying Apache CascadingSimplifying Apache Cascading
Simplifying Apache CascadingMing Yuan
 
Kick your database_to_the_curb_reston_08_27_19
Kick your database_to_the_curb_reston_08_27_19Kick your database_to_the_curb_reston_08_27_19
Kick your database_to_the_curb_reston_08_27_19confluent
 
Think Distributed: The Hazelcast Way
Think Distributed: The Hazelcast WayThink Distributed: The Hazelcast Way
Think Distributed: The Hazelcast WayRahul Gupta
 
Distributed caching and computing v3.7
Distributed caching and computing v3.7Distributed caching and computing v3.7
Distributed caching and computing v3.7Rahul Gupta
 
Scaling Your Cache
Scaling Your CacheScaling Your Cache
Scaling Your CacheAlex Miller
 
Apache Spark Structured Streaming + Apache Kafka = ♡
Apache Spark Structured Streaming + Apache Kafka = ♡Apache Spark Structured Streaming + Apache Kafka = ♡
Apache Spark Structured Streaming + Apache Kafka = ♡Bartosz Konieczny
 
mysqlnd query cache plugin: user-defined storage handler
mysqlnd query cache plugin: user-defined storage handlermysqlnd query cache plugin: user-defined storage handler
mysqlnd query cache plugin: user-defined storage handlerUlf Wendel
 
Speed Things Up with Transients
Speed Things Up with TransientsSpeed Things Up with Transients
Speed Things Up with TransientsCliff Seal
 
Kafka Streams: the easiest way to start with stream processing
Kafka Streams: the easiest way to start with stream processingKafka Streams: the easiest way to start with stream processing
Kafka Streams: the easiest way to start with stream processingYaroslav Tkachenko
 
Ingesting streaming data for analysis in apache ignite (stream sets theme)
Ingesting streaming data for analysis in apache ignite (stream sets theme)Ingesting streaming data for analysis in apache ignite (stream sets theme)
Ingesting streaming data for analysis in apache ignite (stream sets theme)Tom Diederich
 
Python在豆瓣的应用
Python在豆瓣的应用Python在豆瓣的应用
Python在豆瓣的应用Qiangning Hong
 
Non-blocking I/O, Event loops and node.js
Non-blocking I/O, Event loops and node.jsNon-blocking I/O, Event loops and node.js
Non-blocking I/O, Event loops and node.jsMarcus Frödin
 
Hadoop Integration in Cassandra
Hadoop Integration in CassandraHadoop Integration in Cassandra
Hadoop Integration in CassandraJairam Chandar
 
Scaling with Python: SF Python Meetup, September 2017
Scaling with Python: SF Python Meetup, September 2017Scaling with Python: SF Python Meetup, September 2017
Scaling with Python: SF Python Meetup, September 2017Varun Varma
 
High performance java ee with j cache and cdi
High performance java ee with j cache and cdiHigh performance java ee with j cache and cdi
High performance java ee with j cache and cdiPayara
 
Java In-Process Caching - Performance, Progress and Pittfalls
Java In-Process Caching - Performance, Progress and PittfallsJava In-Process Caching - Performance, Progress and Pittfalls
Java In-Process Caching - Performance, Progress and Pittfallscruftex
 
Java In-Process Caching - Performance, Progress and Pitfalls
Java In-Process Caching - Performance, Progress and PitfallsJava In-Process Caching - Performance, Progress and Pitfalls
Java In-Process Caching - Performance, Progress and PitfallsJens Wilke
 

Similar to Jsr107 come, code, cache, compute! (20)

Gimme Caching - The JCache Way
Gimme Caching - The JCache WayGimme Caching - The JCache Way
Gimme Caching - The JCache Way
 
Scalable Integration with JBoss Fuse
Scalable Integration with JBoss FuseScalable Integration with JBoss Fuse
Scalable Integration with JBoss Fuse
 
Cache is King: Get the Most Bang for Your Buck From Ruby
Cache is King: Get the Most Bang for Your Buck From RubyCache is King: Get the Most Bang for Your Buck From Ruby
Cache is King: Get the Most Bang for Your Buck From Ruby
 
Simplifying Apache Cascading
Simplifying Apache CascadingSimplifying Apache Cascading
Simplifying Apache Cascading
 
Kick your database_to_the_curb_reston_08_27_19
Kick your database_to_the_curb_reston_08_27_19Kick your database_to_the_curb_reston_08_27_19
Kick your database_to_the_curb_reston_08_27_19
 
Think Distributed: The Hazelcast Way
Think Distributed: The Hazelcast WayThink Distributed: The Hazelcast Way
Think Distributed: The Hazelcast Way
 
Distributed caching and computing v3.7
Distributed caching and computing v3.7Distributed caching and computing v3.7
Distributed caching and computing v3.7
 
Scaling Your Cache
Scaling Your CacheScaling Your Cache
Scaling Your Cache
 
Apache Spark Structured Streaming + Apache Kafka = ♡
Apache Spark Structured Streaming + Apache Kafka = ♡Apache Spark Structured Streaming + Apache Kafka = ♡
Apache Spark Structured Streaming + Apache Kafka = ♡
 
mysqlnd query cache plugin: user-defined storage handler
mysqlnd query cache plugin: user-defined storage handlermysqlnd query cache plugin: user-defined storage handler
mysqlnd query cache plugin: user-defined storage handler
 
Speed Things Up with Transients
Speed Things Up with TransientsSpeed Things Up with Transients
Speed Things Up with Transients
 
Kafka Streams: the easiest way to start with stream processing
Kafka Streams: the easiest way to start with stream processingKafka Streams: the easiest way to start with stream processing
Kafka Streams: the easiest way to start with stream processing
 
Ingesting streaming data for analysis in apache ignite (stream sets theme)
Ingesting streaming data for analysis in apache ignite (stream sets theme)Ingesting streaming data for analysis in apache ignite (stream sets theme)
Ingesting streaming data for analysis in apache ignite (stream sets theme)
 
Python在豆瓣的应用
Python在豆瓣的应用Python在豆瓣的应用
Python在豆瓣的应用
 
Non-blocking I/O, Event loops and node.js
Non-blocking I/O, Event loops and node.jsNon-blocking I/O, Event loops and node.js
Non-blocking I/O, Event loops and node.js
 
Hadoop Integration in Cassandra
Hadoop Integration in CassandraHadoop Integration in Cassandra
Hadoop Integration in Cassandra
 
Scaling with Python: SF Python Meetup, September 2017
Scaling with Python: SF Python Meetup, September 2017Scaling with Python: SF Python Meetup, September 2017
Scaling with Python: SF Python Meetup, September 2017
 
High performance java ee with j cache and cdi
High performance java ee with j cache and cdiHigh performance java ee with j cache and cdi
High performance java ee with j cache and cdi
 
Java In-Process Caching - Performance, Progress and Pittfalls
Java In-Process Caching - Performance, Progress and PittfallsJava In-Process Caching - Performance, Progress and Pittfalls
Java In-Process Caching - Performance, Progress and Pittfalls
 
Java In-Process Caching - Performance, Progress and Pitfalls
Java In-Process Caching - Performance, Progress and PitfallsJava In-Process Caching - Performance, Progress and Pitfalls
Java In-Process Caching - Performance, Progress and Pitfalls
 

More from C2B2 Consulting

Monitoring Oracle SOA Suite - UKOUG Tech15 2015
Monitoring Oracle SOA Suite - UKOUG Tech15 2015Monitoring Oracle SOA Suite - UKOUG Tech15 2015
Monitoring Oracle SOA Suite - UKOUG Tech15 2015C2B2 Consulting
 
Hands-on Performance Tuning Lab - Devoxx Poland
Hands-on Performance Tuning Lab - Devoxx PolandHands-on Performance Tuning Lab - Devoxx Poland
Hands-on Performance Tuning Lab - Devoxx PolandC2B2 Consulting
 
Monitoring Oracle SOA Suite
Monitoring Oracle SOA SuiteMonitoring Oracle SOA Suite
Monitoring Oracle SOA SuiteC2B2 Consulting
 
Advanced queries on the Infinispan Data Grid
Advanced queries on the Infinispan Data Grid Advanced queries on the Infinispan Data Grid
Advanced queries on the Infinispan Data Grid C2B2 Consulting
 
Building WebLogic Domains With WLST
Building WebLogic Domains With WLSTBuilding WebLogic Domains With WLST
Building WebLogic Domains With WLSTC2B2 Consulting
 
Hands-on Performance Workshop - The science of performance
Hands-on Performance Workshop - The science of performanceHands-on Performance Workshop - The science of performance
Hands-on Performance Workshop - The science of performanceC2B2 Consulting
 
JBoss Clustering on OpenShift
JBoss Clustering on OpenShiftJBoss Clustering on OpenShift
JBoss Clustering on OpenShiftC2B2 Consulting
 
Dr. Low Latency or: How I Learned to Stop Worrying about Pauses and Love the ...
Dr. Low Latency or: How I Learned to Stop Worrying about Pauses and Love the ...Dr. Low Latency or: How I Learned to Stop Worrying about Pauses and Love the ...
Dr. Low Latency or: How I Learned to Stop Worrying about Pauses and Love the ...C2B2 Consulting
 
Oracle Coherence & WebLogic 12c Web Sockets: Delivering Real Time Push at Scale
Oracle Coherence & WebLogic 12c Web Sockets: Delivering Real Time Push at ScaleOracle Coherence & WebLogic 12c Web Sockets: Delivering Real Time Push at Scale
Oracle Coherence & WebLogic 12c Web Sockets: Delivering Real Time Push at ScaleC2B2 Consulting
 
Java Middleware Surgery
Java Middleware Surgery Java Middleware Surgery
Java Middleware Surgery C2B2 Consulting
 
Oracle SOA Suite Performance Tuning- UKOUG Application Server & Middleware SI...
Oracle SOA Suite Performance Tuning- UKOUG Application Server & Middleware SI...Oracle SOA Suite Performance Tuning- UKOUG Application Server & Middleware SI...
Oracle SOA Suite Performance Tuning- UKOUG Application Server & Middleware SI...C2B2 Consulting
 
'Deploying with GlassFish & Docker'
'Deploying with GlassFish & Docker' 'Deploying with GlassFish & Docker'
'Deploying with GlassFish & Docker' C2B2 Consulting
 
'JMS @ Data Grid? Hacking the Glassfish messaging for fun & profit'
'JMS @ Data Grid? Hacking the Glassfish messaging for fun & profit' 'JMS @ Data Grid? Hacking the Glassfish messaging for fun & profit'
'JMS @ Data Grid? Hacking the Glassfish messaging for fun & profit' C2B2 Consulting
 
'New JMS features in GlassFish 4.0' by Nigel Deakin
'New JMS features in GlassFish 4.0' by Nigel Deakin'New JMS features in GlassFish 4.0' by Nigel Deakin
'New JMS features in GlassFish 4.0' by Nigel DeakinC2B2 Consulting
 
Coherence sig-nfr-web-tier-scaling-using-coherence-web
Coherence sig-nfr-web-tier-scaling-using-coherence-webCoherence sig-nfr-web-tier-scaling-using-coherence-web
Coherence sig-nfr-web-tier-scaling-using-coherence-webC2B2 Consulting
 
JUDCon 2013- JBoss Data Grid and WebSockets: Delivering Real Time Push at Scale
JUDCon 2013- JBoss Data Grid and WebSockets: Delivering Real Time Push at ScaleJUDCon 2013- JBoss Data Grid and WebSockets: Delivering Real Time Push at Scale
JUDCon 2013- JBoss Data Grid and WebSockets: Delivering Real Time Push at ScaleC2B2 Consulting
 
GeeCon- 'www.NoSQL.com' by Mark Addy
GeeCon- 'www.NoSQL.com' by Mark Addy GeeCon- 'www.NoSQL.com' by Mark Addy
GeeCon- 'www.NoSQL.com' by Mark Addy C2B2 Consulting
 

More from C2B2 Consulting (20)

Monitoring Oracle SOA Suite - UKOUG Tech15 2015
Monitoring Oracle SOA Suite - UKOUG Tech15 2015Monitoring Oracle SOA Suite - UKOUG Tech15 2015
Monitoring Oracle SOA Suite - UKOUG Tech15 2015
 
Hands-on Performance Tuning Lab - Devoxx Poland
Hands-on Performance Tuning Lab - Devoxx PolandHands-on Performance Tuning Lab - Devoxx Poland
Hands-on Performance Tuning Lab - Devoxx Poland
 
Monitoring Oracle SOA Suite
Monitoring Oracle SOA SuiteMonitoring Oracle SOA Suite
Monitoring Oracle SOA Suite
 
Advanced queries on the Infinispan Data Grid
Advanced queries on the Infinispan Data Grid Advanced queries on the Infinispan Data Grid
Advanced queries on the Infinispan Data Grid
 
Through the JMX Window
Through the JMX WindowThrough the JMX Window
Through the JMX Window
 
Building WebLogic Domains With WLST
Building WebLogic Domains With WLSTBuilding WebLogic Domains With WLST
Building WebLogic Domains With WLST
 
Hands-on Performance Workshop - The science of performance
Hands-on Performance Workshop - The science of performanceHands-on Performance Workshop - The science of performance
Hands-on Performance Workshop - The science of performance
 
JBoss Clustering on OpenShift
JBoss Clustering on OpenShiftJBoss Clustering on OpenShift
JBoss Clustering on OpenShift
 
Dr. Low Latency or: How I Learned to Stop Worrying about Pauses and Love the ...
Dr. Low Latency or: How I Learned to Stop Worrying about Pauses and Love the ...Dr. Low Latency or: How I Learned to Stop Worrying about Pauses and Love the ...
Dr. Low Latency or: How I Learned to Stop Worrying about Pauses and Love the ...
 
Through the JMX Window
Through the JMX WindowThrough the JMX Window
Through the JMX Window
 
Oracle Coherence & WebLogic 12c Web Sockets: Delivering Real Time Push at Scale
Oracle Coherence & WebLogic 12c Web Sockets: Delivering Real Time Push at ScaleOracle Coherence & WebLogic 12c Web Sockets: Delivering Real Time Push at Scale
Oracle Coherence & WebLogic 12c Web Sockets: Delivering Real Time Push at Scale
 
Java Middleware Surgery
Java Middleware Surgery Java Middleware Surgery
Java Middleware Surgery
 
Jax London 2013
Jax London 2013Jax London 2013
Jax London 2013
 
Oracle SOA Suite Performance Tuning- UKOUG Application Server & Middleware SI...
Oracle SOA Suite Performance Tuning- UKOUG Application Server & Middleware SI...Oracle SOA Suite Performance Tuning- UKOUG Application Server & Middleware SI...
Oracle SOA Suite Performance Tuning- UKOUG Application Server & Middleware SI...
 
'Deploying with GlassFish & Docker'
'Deploying with GlassFish & Docker' 'Deploying with GlassFish & Docker'
'Deploying with GlassFish & Docker'
 
'JMS @ Data Grid? Hacking the Glassfish messaging for fun & profit'
'JMS @ Data Grid? Hacking the Glassfish messaging for fun & profit' 'JMS @ Data Grid? Hacking the Glassfish messaging for fun & profit'
'JMS @ Data Grid? Hacking the Glassfish messaging for fun & profit'
 
'New JMS features in GlassFish 4.0' by Nigel Deakin
'New JMS features in GlassFish 4.0' by Nigel Deakin'New JMS features in GlassFish 4.0' by Nigel Deakin
'New JMS features in GlassFish 4.0' by Nigel Deakin
 
Coherence sig-nfr-web-tier-scaling-using-coherence-web
Coherence sig-nfr-web-tier-scaling-using-coherence-webCoherence sig-nfr-web-tier-scaling-using-coherence-web
Coherence sig-nfr-web-tier-scaling-using-coherence-web
 
JUDCon 2013- JBoss Data Grid and WebSockets: Delivering Real Time Push at Scale
JUDCon 2013- JBoss Data Grid and WebSockets: Delivering Real Time Push at ScaleJUDCon 2013- JBoss Data Grid and WebSockets: Delivering Real Time Push at Scale
JUDCon 2013- JBoss Data Grid and WebSockets: Delivering Real Time Push at Scale
 
GeeCon- 'www.NoSQL.com' by Mark Addy
GeeCon- 'www.NoSQL.com' by Mark Addy GeeCon- 'www.NoSQL.com' by Mark Addy
GeeCon- 'www.NoSQL.com' by Mark Addy
 

Recently uploaded

Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdfEnhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdfRTS corp
 
Effectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorEffectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorTier1 app
 
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full RecordingOpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full RecordingShane Coughlan
 
eSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolseSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolsosttopstonverter
 
What’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesWhat’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesVictoriaMetrics
 
Introduction to Firebase Workshop Slides
Introduction to Firebase Workshop SlidesIntroduction to Firebase Workshop Slides
Introduction to Firebase Workshop Slidesvaideheekore1
 
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonLeveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonApplitools
 
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4jGraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4jNeo4j
 
Data modeling 101 - Basics - Software Domain
Data modeling 101 - Basics - Software DomainData modeling 101 - Basics - Software Domain
Data modeling 101 - Basics - Software DomainAbdul Ahad
 
Keeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldKeeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldRoberto Pérez Alcolea
 
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptxThe Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptxRTS corp
 
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdfAndrey Devyatkin
 
Zer0con 2024 final share short version.pdf
Zer0con 2024 final share short version.pdfZer0con 2024 final share short version.pdf
Zer0con 2024 final share short version.pdfmaor17
 
Copilot para Microsoft 365 y Power Platform Copilot
Copilot para Microsoft 365 y Power Platform CopilotCopilot para Microsoft 365 y Power Platform Copilot
Copilot para Microsoft 365 y Power Platform CopilotEdgard Alejos
 
Ronisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited CatalogueRonisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited Catalogueitservices996
 
2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shardsChristopher Curtin
 
Strategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero resultsStrategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero resultsJean Silva
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxAndreas Kunz
 
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full RecordingOpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full RecordingShane Coughlan
 
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...Bert Jan Schrijver
 

Recently uploaded (20)

Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdfEnhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
 
Effectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorEffectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryError
 
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full RecordingOpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
 
eSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolseSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration tools
 
What’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesWhat’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 Updates
 
Introduction to Firebase Workshop Slides
Introduction to Firebase Workshop SlidesIntroduction to Firebase Workshop Slides
Introduction to Firebase Workshop Slides
 
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonLeveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
 
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4jGraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
 
Data modeling 101 - Basics - Software Domain
Data modeling 101 - Basics - Software DomainData modeling 101 - Basics - Software Domain
Data modeling 101 - Basics - Software Domain
 
Keeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldKeeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository world
 
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptxThe Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
 
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf
 
Zer0con 2024 final share short version.pdf
Zer0con 2024 final share short version.pdfZer0con 2024 final share short version.pdf
Zer0con 2024 final share short version.pdf
 
Copilot para Microsoft 365 y Power Platform Copilot
Copilot para Microsoft 365 y Power Platform CopilotCopilot para Microsoft 365 y Power Platform Copilot
Copilot para Microsoft 365 y Power Platform Copilot
 
Ronisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited CatalogueRonisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited Catalogue
 
2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards
 
Strategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero resultsStrategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero results
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
 
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full RecordingOpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
 
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
 

Jsr107 come, code, cache, compute!

  • 1. @payara_fish JSR107 Come, Code, Cache, Compute! Steve Millidge
  • 2. @payara_fish Agenda • Basic Caching – Cache API – Cache Configuration • Cache Events • Cache Computations
  • 3. @payara_fish What is JSR107? JCACHE JavaTM Temporary Caching API
  • 4. Time delay in requesting an operation and it being initiated @payara_fish
  • 5. 1Gb Ethernet : 25 – 30MB/s 10Gb Ethernet : 250 – 350MB/s Infiniband : 6GB/s (maybe) @payara_fish
  • 6. PING TIMES Local : 57μs LAN segment : 300μs LAN: switches : 4ms UK : 30ms USA : 100ms 3G : 100s ms @payara_fish
  • 7. @payara_fish Spinning Rust Source: tomshardware.com Typical SSD Speed 540MB/s Disk BUS Speeds SATA 1.0 : 150MB/s SATA 2.0 : 300MB/s SATA 3.0 : 600MB/s SAS : 600MB/s Fibre Channel : 1GB/s Infiniband : 1GB/s
  • 10. @payara_fish Caching Concepts Caching Provider Cache Manager Cache Entry Key Value
  • 11. @payara_fish Core Concepts • CachingProvider – Retrieves and closes Cache Managers • CacheManager – Creates and destroys caches • Cache – Contains Objects in Key Value Pairs
  • 12. @payara_fish Simple Cache Code Architecture Coherence Cache Node (Simple Code) Coherence Cache Node (Get Example) Coherence Cache Node (Put Example) Stock
  • 14. CachingProvider cp = Caching.getCachingProvider(); @payara_fish CacheManager cm = cp.getCacheManager(); MutableConfiguration<String, Stock> config = new MutableConfiguration<>(); config.setStoreByValue(true) .setTypes(String.class,Stock.class) .setManagementEnabled(true) .setStatisticsEnabled(true); Cache<String, Stock> cache = cm.createCache("J12014", config); System.out.println(cache.get("PAYA"));
  • 15. @payara_fish Further Cache Methods cache.replace("PAYA",new Stock(28.0,"PAYA"); cache.remove(“PAYA”); stock = cache.getAndPut("PAYA", new Stock(27.0,"PAYA")); stock = cache.getAndReplace("PAYA",new Stock(28.0,"PAYA")); stock = cache.getAndRemove("PAYA"); cache.putIfAbsent("PAYA", stock);
  • 17. @payara_fish Core Concepts Events • CacheEntryListener – Receives Events relating to specific Keys – Subinterfaces for Created, Expired, Updated, Removed • CacheEntryEventFilter – Filters Events Before Delivery – Useful in distributed caches
  • 18. @payara_fish Events API Coherence Cache Node (Simple Code) Coherence Cache Node (Stock Ticker) Coherence Cache Node (PriceTicker) Listener Stock
  • 20. CachingProvider cp = Caching.getCachingProvider(); CacheManager cm = cp.getCacheManager(); MutableConfiguration<String, Stock> config @payara_fish = new MutableConfiguration<>(); config.setStoreByValue(true) .setTypes(String.class, Stock.class) .setManagementEnabled(true). setStatisticsEnabled(true); Cache<String, Stock> cache = cm.createCache("J12014", config); while (true) { cache.put("PAYA", new Stock(Math.random() * 20.0d, "PAYA")); Thread.sleep(1000); }
  • 21. @payara_fish public class StockListener implements CacheEntryUpdatedListener<>, Serializable{ @Override public void onUpdated(Iterable<> itrbl) throws CacheEntryListenerException { Iterator<CacheEntryEvent<> i = itrbl.iterator(); while (i.hasNext()) { System.out.println(i.next().getValue()); } } }
  • 22. MutableCacheEntryListenerConfiguration<> lConf @payara_fish = new MutableCacheEntryListenerConfiguration<>( FactoryBuilder.factoryOf(new StockListener()), null, false, false); cache.registerCacheEntryListener(lConf); while (true) { Thread.sleep(1000); }
  • 23. @payara_fish Listerner Interfaces • CacheEntryCreatedListener<K,V> – onCreated() • CacheEntryExpiredListener<K,V> – onExpired() • CacheEntryRemovedListener<K,V> – onRemoved() • CacheEntryUpdatedListener<K,V> – onUpdated()
  • 24. @payara_fish Listener semantics • Are fired after the entry is mutated in the cache • if synchronous are fired, for a given key, in the order that events occur • block the calling thread until the listener returns, where the listener was registered as synchronous • that are asynchronous iterate through multiple events with an undefined ordering, except that events on the same key are in the order that the events occur.
  • 25. @payara_fish Events Demo http://demo.c2b2.co.uk:7080/
  • 27. @payara_fish Compute Architecture Coherence Cache Node (Simple Code) Coherence Cache Node (Simple Code) StoScktockStocSktock StoScktockStocSktock Coherence Cache Node (Revalue) Entry Processor Entry Processor Coherence Cache Node (FindStock)
  • 28. @payara_fish Key Cache Methods • invoke(Key,EntryProcessor,args) • invokeAll(Set<Key>,EntryProcessor,args) • Entry Processor Interface T process(MutableEntry<K,V>,Object … args)
  • 30. public class PrintStock implements EntryProcessor<String, Stock, String>, Serializable { @Override public String process(MutableEntry<String, Stock> me, Object... os) throws EntryProcessorException @payara_fish { System.out.println(me.getValue() + " IS HERE ........... "); return null; } }
  • 31. CachingProvider cp = Caching.getCachingProvider(); @payara_fish CacheManager cm = cp.getCacheManager(); MutableConfiguration<String,Stock> config = new MutableConfiguration<>(); config.setStoreByValue(true) .setTypes(String.class,Stock.class) .setManagementEnabled(true) .setStatisticsEnabled(true); Cache<String,Stock> cache = cm.createCache("J12014",config); cache.invoke("PAYA", new PrintStock());
  • 32. @payara_fish Other JSR107 Features • Cache Loader and Cache Writers – Implements Read through and write through caching for persistence stores • Statistics – JMX Statistics (demo) • CDI Integration – Annotations for automatic cache interactions
  • 33. @payara_fish CacheLoader and CacheWriter • Integrate with external resource – JPA Caching – Memcached integration – NoSQL integration • Provide read through and write through capability
  • 34. @payara_fish CacheLoader and CacheWriter • CacheLoader for read through – load(Key) – loadAll(Iterable<Key>) – Added to Cache Configuration • CacheWriter for write through – write, writeAll – delete, deleteAll – Added to Cache Configuration
  • 35. @payara_fish JSR 107 Annotations • @CacheDefaults • @CacheResult • @CachePut • @CacheRemove • @CacheRemoveAll
  • 36. @payara_fish Example Annotations package my.app; @CacheDefaults(cacheName="domainCache") public class DomainDao { @CacheResult public Domain getDomain(String domainId, int index) { ... } @CacheRemove public void deleteDomain(String domainId, int index) { ... } @CacheResult(cacheName="allDomains") public List<Domain> getAllDomains() { ... } }
  • 37. @payara_fish Example Annotations package my.app; public class DomainDao { @CachePut(cacheName="domainCache") public void updateDomain(String domainId, int index, @CacheValue Domain domain) { ... } }
  • 38. @payara_fish Learn More • https://jcp.org/en/jsr/detail?id=107 • https://github.com/jsr107 • https://groups.google.com/forum/#!foru m/jsr107