|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.cruxframework.crux.core.server.rest.state.ClusteredResourceStateHandler
public class ClusteredResourceStateHandler
It is a very basic implementation of ResourceStateHandler interface for clustered environments. This implementation is based on JGroups ReplCache component and can be used as basis for most complete implementations on top of more powerful cache systems, like Infinispan, EhCache, OsCache, JCS or any other Cache system you prefer. If you choose to use this implementation, you must include jgroups.jar on your classpath. To configure the cache, you can create a file named ClusteredCacheConfig.properties and configure the following properties: channelConfigPropertyFile - JGroups channel config file name rpcTimeout - Timeout for replCache rpc calls useL1Cache - To enable or disable L1 Cache l1ReapingInterval - If L1 cache is enabled, the interval to run the Expired Values Cleaner Thread for L1 Cache l1MaxNumberOfEntries - If L1 cache is enabled, the max number of entries for L1 Cache l2ReapingInterval - The interval to run the Expired Values Cleaner Thread for L2 Cache l1MaxNumberOfEntries - The max number of entries for L2 Cache clusterName - The name of the cluster to be used by this cache replCount - The number of nodes in cluster where the information will be replicated
| Nested Class Summary | |
|---|---|
static class |
ClusteredResourceStateHandler.CacheEntry
|
| Nested classes/interfaces inherited from interface org.cruxframework.crux.core.server.rest.state.ResourceStateHandler |
|---|
ResourceStateHandler.ResourceState |
| Constructor Summary | |
|---|---|
ClusteredResourceStateHandler()
|
|
| Method Summary | |
|---|---|
ResourceStateHandler.ResourceState |
add(String uri,
long dateModified,
long expires,
String etag)
Add state information about one rest URI |
void |
clear()
Clear all state information from rest URIs |
ResourceStateHandler.ResourceState |
get(String uri)
Retrieve state information about one rest URI |
void |
remove(String uri)
Clear the state information about one rest URI |
void |
removeSegments(String... baseURIs)
Clear the state information about any rest URI that starts with one of the baseURIs provided |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ClusteredResourceStateHandler()
| Method Detail |
|---|
public ResourceStateHandler.ResourceState add(String uri,
long dateModified,
long expires,
String etag)
ResourceStateHandler
add in interface ResourceStateHandlerpublic ResourceStateHandler.ResourceState get(String uri)
ResourceStateHandler
get in interface ResourceStateHandlerpublic void remove(String uri)
ResourceStateHandler
remove in interface ResourceStateHandlerpublic void removeSegments(String... baseURIs)
ResourceStateHandler
removeSegments in interface ResourceStateHandlerpublic void clear()
ResourceStateHandler
clear in interface ResourceStateHandler
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||