use of org.jboss.as.controller.AttributeDefinition in project wildfly by wildfly.
the class ElytronIntegrationResourceDefinitions method getElytronKeyStoreResourceDefinition.
/**
* Defines a resource that represents an Elytron-compatible key store that can be exported by a JSSE-enabled domain
* in the legacy security subsystem.
*
* To export the key store the resource uses a {@code BasicAddHandler} implementation that registers the elytron key-store
* capability and implements a {@code org.jboss.as.security.elytron.BasicService.ValueSupplier} that uses the injected
* {@code SecurityDomainContext} to obtain a {@code JSSESecurityDomain}. If such domain is found, its configured key
* store is obtained and returned.
*
* The {@code ValueSupplier} implementation throws an exception if the referenced legacy domain is not a JSSE-enabled
* domain or if the domain doesn't contain a key store configuration.
*/
public static ResourceDefinition getElytronKeyStoreResourceDefinition() {
final AttributeDefinition[] attributes = new AttributeDefinition[] { LEGACY_JSSE_CONFIG };
final AbstractAddStepHandler addHandler = createAddHandler(attributes, KEY_STORE_RUNTIME_CAPABILITY);
return new BasicResourceDefinition(Constants.ELYTRON_KEY_STORE, addHandler, attributes, KEY_STORE_RUNTIME_CAPABILITY);
}
use of org.jboss.as.controller.AttributeDefinition in project wildfly by wildfly.
the class LoginModuleResourceDefinition method registerAttributes.
@Override
public void registerAttributes(ManagementResourceRegistration resourceRegistration) {
super.registerAttributes(resourceRegistration);
OperationStepHandler writeHandler = new ModelOnlyWriteAttributeHandler(ATTRIBUTES);
for (AttributeDefinition attribute : ATTRIBUTES) {
resourceRegistration.registerReadWriteAttribute(attribute, null, writeHandler);
}
}
use of org.jboss.as.controller.AttributeDefinition in project wildfly by wildfly.
the class MappingModuleDefinition method registerAttributes.
@Override
public void registerAttributes(ManagementResourceRegistration resourceRegistration) {
super.registerAttributes(resourceRegistration);
OperationStepHandler writeHandler = new ModelOnlyWriteAttributeHandler(getAttributes());
for (AttributeDefinition attr : getAttributes()) {
resourceRegistration.registerReadWriteAttribute(attr, null, writeHandler);
}
}
use of org.jboss.as.controller.AttributeDefinition in project wildfly by wildfly.
the class ResteasyAttributeTestCase method testBadSyntax.
/**
* Verify that syntactically incorrect values get kicked out.
*/
@Test
public void testBadSyntax() throws Exception {
for (AttributeDefinition attribute : JaxrsAttribute.ATTRIBUTES) {
// RESTEasy accepts any string for "resteasy-media-type-param-mapping".
if (JaxrsAttribute.RESTEASY_MEDIA_TYPE_PARAM_MAPPING.equals(attribute)) {
continue;
}
ModelNode op = Operations.createWriteAttributeOperation(ADDRESS, attribute.getName(), mangleAttribute(attribute));
ModelNode result = client.getControllerClient().execute(op);
Assert.assertEquals(FAILED, result.get(OUTCOME).asString());
}
}
use of org.jboss.as.controller.AttributeDefinition in project wildfly by wildfly.
the class ListenerResourceDefinition method registerAttributes.
@Override
public void registerAttributes(ManagementResourceRegistration resourceRegistration) {
// DO NOT call super, as we need non-standard handling for enabled
Collection<AttributeDefinition> ads = getAttributes();
// we include ENABLED in this set, but it doesn't matter we don't register rrh for it
OperationStepHandler rrh = new ReloadRequiredWriteAttributeHandler(ads);
OperationStepHandler enh = new EnabledAttributeHandler();
for (AttributeDefinition ad : ads) {
OperationStepHandler osh = ad == ENABLED ? enh : rrh;
resourceRegistration.registerReadWriteAttribute(ad, null, osh);
}
for (ConnectorStat attr : ConnectorStat.values()) {
resourceRegistration.registerMetric(attr.definition, ReadStatisticHandler.INSTANCE);
}
}
Aggregations