PageRenderTime 29ms CodeModel.GetById 16ms app.highlight 9ms RepoModel.GetById 1ms app.codeStats 0ms

/hazelcast-hibernate/src/main/java/com/hazelcast/hibernate/region/CollectionRegionAccessStrategyAdapter.java

https://bitbucket.org/gabral6_gmailcom/hazelcast
Java | 85 lines | 50 code | 17 blank | 18 comment | 0 complexity | 0707e4aa4ee94f4690a847a180b32b48 MD5 | raw file
 1/*
 2 * Copyright (c) 2008-2013, Hazelcast, Inc. All Rights Reserved.
 3 *
 4 * Licensed under the Apache License, Version 2.0 (the "License");
 5 * you may not use this file except in compliance with the License.
 6 * You may obtain a copy of the License at
 7 *
 8 * http://www.apache.org/licenses/LICENSE-2.0
 9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package com.hazelcast.hibernate.region;
18
19import com.hazelcast.hibernate.access.AccessDelegate;
20import org.hibernate.cache.CacheException;
21import org.hibernate.cache.CollectionRegion;
22import org.hibernate.cache.access.CollectionRegionAccessStrategy;
23import org.hibernate.cache.access.SoftLock;
24
25/**
26 * @author Leo Kim (lkim@limewire.com)
27 */
28public final class CollectionRegionAccessStrategyAdapter implements CollectionRegionAccessStrategy {
29
30    private final AccessDelegate<? extends HazelcastCollectionRegion> delegate;
31
32    public CollectionRegionAccessStrategyAdapter(final AccessDelegate<? extends HazelcastCollectionRegion> delegate) {
33        this.delegate = delegate;
34    }
35
36    public void evict(final Object key) throws CacheException {
37        delegate.evict(key);
38    }
39
40    public void evictAll() throws CacheException {
41        delegate.evictAll();
42    }
43
44    public Object get(final Object key, final long txTimestamp) throws CacheException {
45        return delegate.get(key, txTimestamp);
46    }
47
48    public CollectionRegion getRegion() {
49        return delegate.getHazelcastRegion();
50    }
51
52    public SoftLock lockItem(final Object key, final Object version) throws CacheException {
53        return delegate.lockItem(key, version);
54    }
55
56    public SoftLock lockRegion() throws CacheException {
57        return delegate.lockRegion();
58    }
59
60    public boolean putFromLoad(final Object key, final Object value, final long txTimestamp, final Object version)
61            throws CacheException {
62        return delegate.putFromLoad(key, value, txTimestamp, version);
63    }
64
65    public boolean putFromLoad(final Object key, final Object value, final long txTimestamp, final Object version,
66                               final boolean minimalPutOverride) throws CacheException {
67        return delegate.putFromLoad(key, value, txTimestamp, version, minimalPutOverride);
68    }
69
70    public void remove(final Object key) throws CacheException {
71        delegate.remove(key);
72    }
73
74    public void removeAll() throws CacheException {
75        delegate.removeAll();
76    }
77
78    public void unlockItem(final Object key, final SoftLock lock) throws CacheException {
79        delegate.unlockItem(key, lock);
80    }
81
82    public void unlockRegion(final SoftLock lock) throws CacheException {
83        delegate.unlockRegion(lock);
84    }
85}