MCPcopy Index your code
hub / github.com/BruceEckel/OnJava8-Examples / SyncFactory

Class SyncFactory

concurrent/SynchronizedFactory.java:7–17  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5import java.util.concurrent.atomic.*;
6
7final class SyncFactory implements HasID {
8 private final int id;
9 private SyncFactory(SharedArg sa) {
10 id = sa.get();
11 }
12 @Override public int getID() { return id; }
13 public static synchronized
14 SyncFactory factory(SharedArg sa) {
15 return new SyncFactory(sa);
16 }
17}
18
19public class SynchronizedFactory {
20 public static void main(String[] args) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected