Java Reference
In-Depth Information
dataList.addAll(cache.values());
return dataList;
}
public Seat getSeat(int seatId) {
return cache.get(seatId);
}
public void buyTicket(int seatId ) {
Seat seat = cache.get(seatId);
seat.setBooked(true);
cache.put(seatId,seat);
}
}
public Seat getSeat(int seatId) {
return cache.get(seatId);
}
public void buyTicket(int seatId ) {
Seat seat = cache.get(seatId);
seat.setBooked(true);
cache.put(seatId,seat);
}
}
The first thing we want to stress is the @Resource annotation, which injects a
org.infinispan.manager.CacheContainer instance; when the JBoss AS de-
ployer encounters this annotation, your application will include a dependency on
the requested cache container. Consequently, the cache container will automatically
start deploying and stop (including all caches) undeploying of your application.
Search WWH ::




Custom Search