patterntesting.annotation.concurrent
Annotation Type Synchronized


@Documented
@Target(value={METHOD,TYPE})
@Retention(value=RUNTIME)
public @interface Synchronized

Instead of synchronized methods you can mark these methods as "@Synchronized". The SynchronizedAspect in patterntesting.concurrent will use ReentrantLock to realize it and to avoid deadlocks. If you set the log level to TRACE you can get additional information about the locks and waiting threads.
The default value for the timeout is 1800 seconds (30 minutes). If you want a shorter value you can use the timeout and unit attributes. Example: @Synchronized(timeout=10, unit=TimeUnit.SECONDS) will set the timeout to 10 seconds.

Since:
13.11.2008
Author:
oliver
See Also:
TimeUnit

Optional Element Summary
 long timeout
          The default timeout is 30 minutes (1800 seconds).
 TimeUnit unit
          The unit of time (with TimeUnit.SECONDS as default).
 

timeout

public abstract long timeout
The default timeout is 30 minutes (1800 seconds).

Default:
1800L

unit

public abstract TimeUnit unit
The unit of time (with TimeUnit.SECONDS as default).

Default:
java.util.concurrent.TimeUnit.SECONDS


Copyright © 2002–2014 PatternTesting Team. All rights reserved.