org.jtoolkit.essence.concurrency
Annotation Type ThreadSafe


@Target(value=TYPE)
@Retention(value=RUNTIME)
@Inherited
public @interface ThreadSafe

Marks a class as mutable and thread safe.

A ThreadSafe component may be either @ThreadSafe(Concurrency.SYNCHRONIZED), @ThreadSafe(Concurrency.THREAD_LOCAL), @ThreadSafe(Concurrency.CONCURRENT_READ), @ThreadSafe(Concurrency.CONCURRENT_READ_WRITE).

The default is Concurrency.SYNCHRONIZED.

A "synchronized" is accessed by one thread at a time. A "concurrent-read" is able to be read by multiple threads concurrently, however writes require an exclusive lock. A "concurrent-read-write" is able to be read and written to by multiple threads concurrently..

Note: ThreadSafe object and components can be accessed by mutliple logical processes or externally to the Container.

Author:
Peter Lawrey

Optional Element Summary
 Concurrency value
           
 

value

public abstract Concurrency value
Default:
SYNCHRONIZED


Copyright © Peter Lawrey. All Rights Reserved.