| ... |
... |
@@ -73,30 +73,26 @@ public abstract class ObserveTopiaApplicationContextSupport<P extends ObserveTop |
|
73
|
73
|
/**
|
|
74
|
74
|
* Unique id associated with this application context.
|
|
75
|
75
|
*/
|
|
76
|
|
- protected final String authenticationToken;
|
|
|
76
|
+ protected final String authenticationToken = UUID.randomUUID().toString();
|
|
|
77
|
+ /**
|
|
|
78
|
+ * Mise à {@code true} quand au moins une connection a été effectuée.
|
|
|
79
|
+ */
|
|
|
80
|
+ protected boolean open;
|
|
77
|
81
|
/**
|
|
78
|
82
|
* Meta model support.
|
|
79
|
83
|
*/
|
|
80
|
|
- private transient final SingletonSupplier<TopiaMetadataModelSupport> topiaMetadataModelSupport;
|
|
|
84
|
+ private transient SingletonSupplier<TopiaMetadataModelSupport> topiaMetadataModelSupport;
|
|
81
|
85
|
/**
|
|
82
|
86
|
* Entity sql support.
|
|
83
|
87
|
*/
|
|
84
|
|
- private transient final SingletonSupplier<TopiaEntitySqlModelSupport> topiaEntitySqlModelSupport;
|
|
|
88
|
+ private transient SingletonSupplier<TopiaEntitySqlModelSupport> topiaEntitySqlModelSupport;
|
|
85
|
89
|
/**
|
|
86
|
90
|
* Usage model.
|
|
87
|
91
|
*/
|
|
88
|
|
- private transient final SingletonSupplier<TopiaUsageModel> topiaUsageModel;
|
|
89
|
|
- /**
|
|
90
|
|
- * Mise à {@code true} quand au moins une connection a été effectuée.
|
|
91
|
|
- */
|
|
92
|
|
- protected boolean open;
|
|
|
92
|
+ private transient SingletonSupplier<TopiaUsageModel> topiaUsageModel;
|
|
93
|
93
|
|
|
94
|
94
|
public ObserveTopiaApplicationContextSupport(TopiaConfiguration topiaConfiguration) {
|
|
95
|
95
|
super(topiaConfiguration);
|
|
96
|
|
- this.authenticationToken = UUID.randomUUID().toString();
|
|
97
|
|
- this.topiaMetadataModelSupport = SingletonSupplier.of(this::newMetaModelSupport);
|
|
98
|
|
- this.topiaEntitySqlModelSupport = SingletonSupplier.of(this::newEntitySqlModelSupport);
|
|
99
|
|
- this.topiaUsageModel = SingletonSupplier.of(this::newUsageModel);
|
|
100
|
96
|
}
|
|
101
|
97
|
|
|
102
|
98
|
@SuppressWarnings("deprecation")
|
| ... |
... |
@@ -120,10 +116,16 @@ public abstract class ObserveTopiaApplicationContextSupport<P extends ObserveTop |
|
120
|
116
|
public abstract ImmutableSet<Class<? extends ReferentialDto>> referentialForReplicationDto();
|
|
121
|
117
|
|
|
122
|
118
|
public TopiaUsageModel getTopiaUsageModel() {
|
|
|
119
|
+ if (topiaUsageModel == null) {
|
|
|
120
|
+ topiaUsageModel = SingletonSupplier.of(this::newUsageModel);
|
|
|
121
|
+ }
|
|
123
|
122
|
return topiaUsageModel.get();
|
|
124
|
123
|
}
|
|
125
|
124
|
|
|
126
|
125
|
public TopiaEntitySqlModelSupport getTopiaEntitySqlModelSupport() {
|
|
|
126
|
+ if (topiaEntitySqlModelSupport == null) {
|
|
|
127
|
+ topiaEntitySqlModelSupport = SingletonSupplier.of(this::newEntitySqlModelSupport);
|
|
|
128
|
+ }
|
|
127
|
129
|
return topiaEntitySqlModelSupport.get();
|
|
128
|
130
|
}
|
|
129
|
131
|
|
| ... |
... |
@@ -132,6 +134,9 @@ public abstract class ObserveTopiaApplicationContextSupport<P extends ObserveTop |
|
132
|
134
|
}
|
|
133
|
135
|
|
|
134
|
136
|
protected final TopiaMetadataModelSupport getTopiaMetadataModelSupport() {
|
|
|
137
|
+ if (topiaMetadataModelSupport == null) {
|
|
|
138
|
+ topiaMetadataModelSupport = SingletonSupplier.of(this::newMetaModelSupport);
|
|
|
139
|
+ }
|
|
135
|
140
|
return topiaMetadataModelSupport.get();
|
|
136
|
141
|
}
|
|
137
|
142
|
|