|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.domian.repository.AbstractRepository<T> net.sourceforge.domian.repository.AbstractDomianCoreRepository<T> net.sourceforge.domian.repository.AbstractHibernateRepository<T>
@Deprecated abstract class AbstractHibernateRepository<T extends Entity>
Field Summary | |
---|---|
private static int |
ALL_STACKTRACE_LINES
Deprecated. |
private java.lang.Integer |
maxNumberOfRetries
Deprecated. When using the *WithRetry methods,
this value defines the maximum number of times an operation will be retried. |
private java.lang.Integer |
retryTimeoutInMilliseconds
Deprecated. When using the *WithRetry methods,
this value defines the timeout for all retried operations. |
Fields inherited from class net.sourceforge.domian.repository.AbstractDomianCoreRepository |
---|
DEFAULT_DOMIAN_ROOT_DIR_NAME, DEFAULT_DOMIAN_ROOT_PATH, log, synchronizer |
Fields inherited from class net.sourceforge.domian.repository.AbstractRepository |
---|
supportsRecursiveIndexing, usesNativePartitioningSupport |
Constructor Summary | |
---|---|
AbstractHibernateRepository()
Deprecated. |
Method Summary | ||
---|---|---|
protected void |
call(java.util.concurrent.Callable<T> callable)
Deprecated. Added for completeness. |
|
protected
|
callConcurrently(java.util.concurrent.Callable<T> callable)
Deprecated. Convenience method for running a Callable in a concurrent manner. |
|
protected
|
callConcurrentlyInNewThread(java.util.concurrent.Callable<T> callable)
Deprecated. |
|
protected
|
callConcurrentlyWithRetry(java.util.concurrent.Callable<T> callable)
Deprecated. Convenience method for running a Callable in a concurrent manner. |
|
protected
|
callExclusively(java.util.concurrent.Callable<T> callable)
Deprecated. Convenience method for running a Callable in an exclusively manner. |
|
protected
|
callExclusivelyInNewThread(java.util.concurrent.Callable<T> callable)
Deprecated. |
|
protected
|
callExclusivelyWithRetry(java.util.concurrent.Callable<T> callable)
Deprecated. Convenience method for running a Callable in an exclusively manner. |
|
protected
|
callInNewThread(java.util.concurrent.Callable<T> callable)
Deprecated. |
|
java.lang.Integer |
getMaxNumberOfRetries()
Deprecated. |
|
java.lang.Integer |
getRetryTimeoutInMilliseconds()
Deprecated. |
|
private
|
retry(java.util.concurrent.Callable<T> callable,
java.lang.Exception retryReason,
Synchronizer.MODE synchronizedMode)
Deprecated. Executes the given Callable in a fresh thread, with time-out set to retryTimeoutInMilliseconds . |
|
private
|
retry(java.lang.String methodName,
java.util.concurrent.Callable<T> callable,
java.lang.Exception reasonForRetry,
Synchronizer.MODE synchronizedMode)
Deprecated. Executes the given Callable in a fresh thread, with time-out set to retryTimeoutInMilliseconds . |
|
protected void |
run(java.lang.Runnable runnable)
Deprecated. Added for completeness. |
|
protected void |
runAsynchronously(java.lang.Runnable runnable)
Deprecated. Executes the given Runnable in a fresh and independent thread. |
|
protected void |
runConcurrently(java.lang.Runnable runnable)
Deprecated. Convenience method for running a Runnable in a concurrent manner. |
|
void |
setMaxNumberOfRetries(java.lang.Integer maxNumberOfRetries)
Deprecated. |
|
void |
setRetryTimeoutInMilliseconds(java.lang.Integer retryTimeoutInMilliseconds)
Deprecated. |
Methods inherited from class net.sourceforge.domian.repository.AbstractDomianCoreRepository |
---|
|
Methods inherited from class net.sourceforge.domian.repository.AbstractRepository |
---|
contains, count, countAll, countAllEntitiesSpecifiedBy, find, findAll, findSingle, findSingleEntitySpecifiedBy, isIndexingEntitiesRecursively, isPartitioningNatively, iterate, iterateAll, putAll, remove, removeAll, update |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface net.sourceforge.domian.repository.Repository |
---|
findAllEntitiesSpecifiedBy, iterateAllEntitiesSpecifiedBy, put, remove, removeAllEntitiesSpecifiedBy, update |
Field Detail |
---|
private static final int ALL_STACKTRACE_LINES
private java.lang.Integer maxNumberOfRetries
*WithRetry
methods,
this value defines the maximum number of times an operation will be retried.
The default value is 2.
private java.lang.Integer retryTimeoutInMilliseconds
*WithRetry
methods,
this value defines the timeout for all retried operations.
The default value is 500.
Constructor Detail |
---|
AbstractHibernateRepository()
Method Detail |
---|
public java.lang.Integer getMaxNumberOfRetries()
public void setMaxNumberOfRetries(java.lang.Integer maxNumberOfRetries)
public java.lang.Integer getRetryTimeoutInMilliseconds()
public void setRetryTimeoutInMilliseconds(java.lang.Integer retryTimeoutInMilliseconds)
protected void run(java.lang.Runnable runnable)
protected void call(java.util.concurrent.Callable<T> callable) throws java.lang.Exception
java.lang.Exception
protected void runConcurrently(java.lang.Runnable runnable)
Runnable
in a concurrent manner.
Synchronizer
protected <T> T callConcurrently(java.util.concurrent.Callable<T> callable)
Callable
in a concurrent manner.
Synchronizer
protected <T> T callExclusively(java.util.concurrent.Callable<T> callable)
Callable
in an exclusively manner.
Synchronizer
protected <T> T callConcurrentlyWithRetry(java.util.concurrent.Callable<T> callable)
Callable
in a concurrent manner.
If an exception is thrown, the Callable
will be immediately retried.
The nature of the retries are further defined by the maxNumberOfRetries
and
retryTimeoutInMilliseconds
member values.
protected <T> T callExclusivelyWithRetry(java.util.concurrent.Callable<T> callable)
Callable
in an exclusively manner.
If an exception is thrown, the Callable
will be immediately queued for retrial.
The nature of the retries are further defined by the maxNumberOfRetries
and
retryTimeoutInMilliseconds
member values.
protected <T> T callInNewThread(java.util.concurrent.Callable<T> callable) throws java.util.concurrent.ExecutionException, java.util.concurrent.TimeoutException, java.lang.InterruptedException
java.util.concurrent.ExecutionException
java.util.concurrent.TimeoutException
java.lang.InterruptedException
protected <T> T callConcurrentlyInNewThread(java.util.concurrent.Callable<T> callable) throws java.util.concurrent.ExecutionException, java.util.concurrent.TimeoutException, java.lang.InterruptedException
java.util.concurrent.ExecutionException
java.util.concurrent.TimeoutException
java.lang.InterruptedException
protected <T> T callExclusivelyInNewThread(java.util.concurrent.Callable<T> callable) throws java.util.concurrent.ExecutionException, java.util.concurrent.TimeoutException, java.lang.InterruptedException
java.util.concurrent.ExecutionException
java.util.concurrent.TimeoutException
java.lang.InterruptedException
protected void runAsynchronously(java.lang.Runnable runnable)
Runnable
in a fresh and independent thread.
This method does not block the original thread.
The Synchronizer
mode is concurrent.
(An asynchronous version of Synchronizer
in exclusive mode has no meaning,
as it is a "stop-the-world" kind of mode.)
private <T> T retry(java.util.concurrent.Callable<T> callable, java.lang.Exception retryReason, Synchronizer.MODE synchronizedMode)
Callable
in a fresh thread, with time-out set to retryTimeoutInMilliseconds
.
The Callable
will be retried maxNumberOfRetries
times.
This method will use an uncapitalized version of the given callable's simple class name as method name.
private <T> T retry(java.lang.String methodName, java.util.concurrent.Callable<T> callable, java.lang.Exception reasonForRetry, Synchronizer.MODE synchronizedMode)
Callable
in a fresh thread, with time-out set to retryTimeoutInMilliseconds
.
The Callable
will be retried maxNumberOfRetries
times.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |