41
41
import org .jboss .as .controller .descriptions .ModelDescriptionConstants ;
42
42
import org .jboss .as .controller .descriptions .OverrideDescriptionProvider ;
43
43
import org .jboss .as .controller .parsing .ExtensionParsingContext ;
44
+ import org .jboss .as .controller .parsing .ProfileParsingCompletionHandler ;
44
45
import org .jboss .as .controller .persistence .SubsystemMarshallingContext ;
45
46
import org .jboss .as .controller .persistence .SubsystemXmlWriterRegistry ;
46
47
import org .jboss .as .controller .registry .AttributeAccess ;
@@ -212,8 +213,6 @@ public ExtensionParsingContext getExtensionParsingContext(final String moduleNam
212
213
*
213
214
* @return the {@link ExtensionContext}. Will not return {@code null}
214
215
*
215
- * @param moduleName the name of the extension's module. Cannot be {@code null}
216
- * @return the {@link ExtensionContext}. Will not return {@code null}
217
216
* @throws IllegalStateException if no {@link #setSubsystemParentResourceRegistrations(ManagementResourceRegistration, ManagementResourceRegistration)} profile resource registration has been set}
218
217
*/
219
218
public ExtensionContext getExtensionContext (final String moduleName ) {
@@ -245,6 +244,19 @@ public Set<String> getUnnamedNamespaces(final String moduleName) {
245
244
return result ;
246
245
}
247
246
247
+ public Set <ProfileParsingCompletionHandler > getProfileParsingCompletionHandlers () {
248
+ Set <ProfileParsingCompletionHandler > result = new HashSet <ProfileParsingCompletionHandler >();
249
+
250
+ for (ExtensionInfo extensionInfo : extensions .values ()) {
251
+ synchronized (extensionInfo ) {
252
+ if (extensionInfo .parsingCompletionHandler != null ) {
253
+ result .add (extensionInfo .parsingCompletionHandler );
254
+ }
255
+ }
256
+ }
257
+ return Collections .unmodifiableSet (result );
258
+ }
259
+
248
260
/**
249
261
* Cleans up a module's subsystems from the resource registration model.
250
262
*
@@ -419,13 +431,20 @@ public void setDeploymentXmlMapping(String namespaceUri, XMLElementReader<ModelN
419
431
public void setDeploymentXmlMapping (String subsystemName , String namespaceUri , XMLElementReader <ModelNode > reader ) {
420
432
// ignored
421
433
}
434
+
435
+ @ Override
436
+ public void setProfileParsingCompletionHandler (ProfileParsingCompletionHandler handler ) {
437
+ assert handler != null : "handler is null" ;
438
+ synchronized (extension ) {
439
+ extension .parsingCompletionHandler = handler ;
440
+ }
441
+ }
422
442
}
423
443
424
444
public class ExtensionContextImpl implements ExtensionContext {
425
445
426
446
private final ExtensionInfo extension ;
427
447
private final PathManager pathManager ;
428
- private String subsystemName ;
429
448
430
449
private ExtensionContextImpl (String extensionName , PathManager pathManager ) {
431
450
assert pathManager != null || !processType .isServer () : "pathManager is null" ;
@@ -442,7 +461,6 @@ public SubsystemRegistration registerSubsystem(String name, int majorVersion, in
442
461
@ Override
443
462
public SubsystemRegistration registerSubsystem (String name , int majorVersion , int minorVersion , int microVersion ) {
444
463
assert name != null : "name is null" ;
445
- this .subsystemName = name ;
446
464
checkNewSubystem (extension .extensionModuleName , name );
447
465
SubsystemInformationImpl info = extension .getSubsystemInfo (name );
448
466
info .setMajorVersion (majorVersion );
@@ -592,6 +610,7 @@ public class ExtensionInfo {
592
610
private final Set <String > unnamedParsers = new HashSet <String >();
593
611
private final String extensionModuleName ;
594
612
private XMLMapper xmlMapper ;
613
+ private ProfileParsingCompletionHandler parsingCompletionHandler ;
595
614
596
615
public ExtensionInfo (String extensionModuleName ) {
597
616
this .extensionModuleName = extensionModuleName ;
@@ -710,6 +729,7 @@ public ManagementResourceRegistration getSubModel(PathAddress address) {
710
729
return deployments .getSubModel (address );
711
730
}
712
731
732
+ @ SuppressWarnings ("deprecation" )
713
733
@ Override
714
734
public ManagementResourceRegistration registerSubModel (PathElement address , DescriptionProvider descriptionProvider ) {
715
735
ManagementResourceRegistration depl = deployments .registerSubModel (address , descriptionProvider );
@@ -801,12 +821,14 @@ public void unregisterOperationHandler(String operationName) {
801
821
subdeployments .unregisterOperationHandler (operationName );
802
822
}
803
823
824
+ @ SuppressWarnings ("deprecation" )
804
825
@ Override
805
826
public void registerReadWriteAttribute (String attributeName , OperationStepHandler readHandler , OperationStepHandler writeHandler , AttributeAccess .Storage storage ) {
806
827
deployments .registerReadWriteAttribute (attributeName , readHandler , writeHandler , storage );
807
828
subdeployments .registerReadWriteAttribute (attributeName , readHandler , writeHandler , storage );
808
829
}
809
830
831
+ @ SuppressWarnings ("deprecation" )
810
832
@ Override
811
833
public void registerReadWriteAttribute (String attributeName , OperationStepHandler readHandler , OperationStepHandler writeHandler , EnumSet <AttributeAccess .Flag > flags ) {
812
834
deployments .registerReadWriteAttribute (attributeName , readHandler , writeHandler , flags );
@@ -819,12 +841,14 @@ public void registerReadWriteAttribute(AttributeDefinition definition, Operation
819
841
subdeployments .registerReadWriteAttribute (definition , readHandler , writeHandler );
820
842
}
821
843
844
+ @ SuppressWarnings ("deprecation" )
822
845
@ Override
823
846
public void registerReadOnlyAttribute (String attributeName , OperationStepHandler readHandler , AttributeAccess .Storage storage ) {
824
847
deployments .registerReadOnlyAttribute (attributeName , readHandler , storage );
825
848
subdeployments .registerReadOnlyAttribute (attributeName , readHandler , storage );
826
849
}
827
850
851
+ @ SuppressWarnings ("deprecation" )
828
852
@ Override
829
853
public void registerReadOnlyAttribute (String attributeName , OperationStepHandler readHandler , EnumSet <AttributeAccess .Flag > flags ) {
830
854
deployments .registerReadOnlyAttribute (attributeName , readHandler , flags );
@@ -837,6 +861,7 @@ public void registerReadOnlyAttribute(AttributeDefinition definition, OperationS
837
861
subdeployments .registerReadOnlyAttribute (definition , readHandler );
838
862
}
839
863
864
+ @ SuppressWarnings ("deprecation" )
840
865
@ Override
841
866
public void registerMetric (String attributeName , OperationStepHandler metricHandler ) {
842
867
deployments .registerMetric (attributeName , metricHandler );
@@ -849,6 +874,7 @@ public void registerMetric(AttributeDefinition definition, OperationStepHandler
849
874
subdeployments .registerMetric (definition , metricHandler );
850
875
}
851
876
877
+ @ SuppressWarnings ("deprecation" )
852
878
@ Override
853
879
public void registerMetric (String attributeName , OperationStepHandler metricHandler , EnumSet <AttributeAccess .Flag > flags ) {
854
880
deployments .registerMetric (attributeName , metricHandler , flags );
0 commit comments