Skip to content

Commit

Permalink
deprecated methods removed
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikita committed Dec 23, 2016
1 parent 49e0303 commit 18f6c46
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 51 deletions.
29 changes: 0 additions & 29 deletions redisson/src/main/java/org/redisson/RedissonLiveObjectService.java
Original file line number Diff line number Diff line change
Expand Up @@ -110,23 +110,6 @@ public RMap<String, Object> getMap(Object proxied) {
return ClassUtils.getField(proxied, "liveObjectLiveMap");
}

@Override
public <T> T create(Class<T> entityClass) {
validateClass(entityClass);
try {
Class<? extends T> proxyClass = getProxyClass(entityClass);
Object id = generateId(entityClass);
T proxied = instantiateLiveObject(proxyClass, id);
if (!getMap(proxied).fastPut("redisson_live_object", "1")) {
throw new IllegalArgumentException("Object already exists");
}
return proxied;
} catch (Exception ex) {
unregisterClass(entityClass);
throw ex instanceof RuntimeException ? (RuntimeException) ex : new RuntimeException(ex);
}
}

private <T> Object generateId(Class<T> entityClass) throws NoSuchFieldException {
String idFieldName = getRIdFieldName(entityClass);
RId annotation = entityClass
Expand All @@ -149,18 +132,6 @@ public <T, K> T get(Class<T> entityClass, K id) {
}
}

@Override
public <T, K> T getOrCreate(Class<T> entityClass, K id) {
try {
T proxied = instantiateLiveObject(getProxyClass(entityClass), id);
getMap(proxied).fastPut("redisson_live_object", "1");
return proxied;
} catch (Exception ex) {
unregisterClass(entityClass);
throw ex instanceof RuntimeException ? (RuntimeException) ex : new RuntimeException(ex);
}
}

@Override
public <T> T attach(T detachedObject) {
validateDetached(detachedObject);
Expand Down
22 changes: 0 additions & 22 deletions redisson/src/main/java/org/redisson/api/RLiveObjectService.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,6 @@
*/
public interface RLiveObjectService {

/**
* Use {@link #persist(Object)} method instead
*
* @param entityClass Entity class
* @param <T> Entity type
* @return Always returns a proxied object. Even it does not exist in redis.
*/
@Deprecated
<T> T create(Class<T> entityClass);

/**
* Finds the entity from Redis with the id.
*
Expand All @@ -57,18 +47,6 @@ public interface RLiveObjectService {
*/
<T, K> T get(Class<T> entityClass, K id);

/**
* Use {@link #persist(Object)} method instead
*
* @param entityClass Entity class
* @param id identifier
* @param <T> Entity type
* @param <K> Key type
* @return Always returns a proxied object. Even it does not exist in redis.
*/
@Deprecated
<T, K> T getOrCreate(Class<T> entityClass, K id);

/**
* Returns proxied object for the detached object. Discard all the
* field values already in the detached instance.
Expand Down

0 comments on commit 18f6c46

Please sign in to comment.