use of org.jboss.as.controller.ReloadRequiredWriteAttributeHandler in project wildfly by wildfly.
the class EJB3SubsystemRootResourceDefinition method registerAttributes.
@Override
public void registerAttributes(ManagementResourceRegistration resourceRegistration) {
resourceRegistration.registerReadOnlyAttribute(DEFAULT_CLUSTERED_SFSB_CACHE, new SimpleAliasReadAttributeHandler(DEFAULT_SFSB_CACHE));
resourceRegistration.registerReadWriteAttribute(DEFAULT_SFSB_CACHE, null, EJB3SubsystemDefaultCacheWriteHandler.SFSB_CACHE);
resourceRegistration.registerReadWriteAttribute(DEFAULT_SFSB_PASSIVATION_DISABLED_CACHE, null, EJB3SubsystemDefaultCacheWriteHandler.SFSB_PASSIVATION_DISABLED_CACHE);
resourceRegistration.registerReadWriteAttribute(DEFAULT_SLSB_INSTANCE_POOL, null, EJB3SubsystemDefaultPoolWriteHandler.SLSB_POOL);
resourceRegistration.registerReadWriteAttribute(DEFAULT_MDB_INSTANCE_POOL, null, EJB3SubsystemDefaultPoolWriteHandler.MDB_POOL);
resourceRegistration.registerReadWriteAttribute(DEFAULT_ENTITY_BEAN_INSTANCE_POOL, null, EJB3SubsystemDefaultPoolWriteHandler.ENTITY_BEAN_POOL);
resourceRegistration.registerReadWriteAttribute(DEFAULT_ENTITY_BEAN_OPTIMISTIC_LOCKING, null, EJB3SubsystemDefaultEntityBeanOptimisticLockingWriteHandler.INSTANCE);
resourceRegistration.registerReadWriteAttribute(DEFAULT_RESOURCE_ADAPTER_NAME, null, DefaultResourceAdapterWriteHandler.INSTANCE);
resourceRegistration.registerReadWriteAttribute(DEFAULT_SINGLETON_BEAN_ACCESS_TIMEOUT, null, DefaultSingletonBeanAccessTimeoutWriteHandler.INSTANCE);
resourceRegistration.registerReadWriteAttribute(DEFAULT_STATEFUL_BEAN_ACCESS_TIMEOUT, null, DefaultStatefulBeanAccessTimeoutWriteHandler.INSTANCE);
resourceRegistration.registerReadWriteAttribute(DEFAULT_STATEFUL_BEAN_SESSION_TIMEOUT, null, DefaultStatefulBeanSessionTimeoutWriteHandler.INSTANCE);
resourceRegistration.registerReadWriteAttribute(ENABLE_STATISTICS, (context, operation) -> {
ModelNode aliasOp = operation.clone();
aliasOp.get("name").set(EJB3SubsystemModel.STATISTICS_ENABLED);
context.addStep(aliasOp, ReadAttributeHandler.INSTANCE, OperationContext.Stage.MODEL, true);
}, (context, operation) -> {
ModelNode aliasOp = operation.clone();
aliasOp.get("name").set(EJB3SubsystemModel.STATISTICS_ENABLED);
context.addStep(aliasOp, WriteAttributeHandler.INSTANCE, OperationContext.Stage.MODEL, true);
});
resourceRegistration.registerReadWriteAttribute(STATISTICS_ENABLED, null, StatisticsEnabledWriteHandler.INSTANCE);
resourceRegistration.registerReadWriteAttribute(PASS_BY_VALUE, null, EJBRemoteInvocationPassByValueWriteHandler.INSTANCE);
resourceRegistration.registerReadWriteAttribute(DEFAULT_DISTINCT_NAME, null, EJBDefaultDistinctNameWriteHandler.INSTANCE);
resourceRegistration.registerReadWriteAttribute(LOG_EJB_EXCEPTIONS, null, ExceptionLoggingWriteHandler.INSTANCE);
resourceRegistration.registerReadWriteAttribute(ALLOW_EJB_NAME_REGEX, null, EJBNameRegexWriteHandler.INSTANCE);
final EJBDefaultSecurityDomainWriteHandler defaultSecurityDomainWriteHandler = new EJBDefaultSecurityDomainWriteHandler(DEFAULT_SECURITY_DOMAIN, defaultSecurityDomainDeploymentProcessor);
resourceRegistration.registerReadWriteAttribute(DEFAULT_SECURITY_DOMAIN, null, defaultSecurityDomainWriteHandler);
final EJBDefaultMissingMethodPermissionsWriteHandler defaultMissingMethodPermissionsWriteHandler = new EJBDefaultMissingMethodPermissionsWriteHandler(DEFAULT_MISSING_METHOD_PERMISSIONS_DENY_ACCESS, missingMethodPermissionsDenyAccessMergingProcessor);
resourceRegistration.registerReadWriteAttribute(DEFAULT_MISSING_METHOD_PERMISSIONS_DENY_ACCESS, null, defaultMissingMethodPermissionsWriteHandler);
resourceRegistration.registerReadWriteAttribute(DISABLE_DEFAULT_EJB_PERMISSIONS, null, new AbstractWriteAttributeHandler<Void>(DISABLE_DEFAULT_EJB_PERMISSIONS) {
protected boolean applyUpdateToRuntime(final OperationContext context, final ModelNode operation, final String attributeName, final ModelNode resolvedValue, final ModelNode currentValue, final HandbackHolder<Void> handbackHolder) throws OperationFailedException {
if (resolvedValue.asBoolean()) {
throw EjbLogger.ROOT_LOGGER.disableDefaultEjbPermissionsCannotBeTrue();
}
return false;
}
protected void revertUpdateToRuntime(final OperationContext context, final ModelNode operation, final String attributeName, final ModelNode valueToRestore, final ModelNode valueToRevert, final Void handback) throws OperationFailedException {
}
});
resourceRegistration.registerReadWriteAttribute(ENABLE_GRACEFUL_TXN_SHUTDOWN, null, EnableGracefulTxnShutdownWriteHandler.INSTANCE);
resourceRegistration.registerReadWriteAttribute(SERVER_INTERCEPTORS, null, new ReloadRequiredWriteAttributeHandler(SERVER_INTERCEPTORS));
resourceRegistration.registerReadWriteAttribute(CLIENT_INTERCEPTORS, null, new ReloadRequiredWriteAttributeHandler(CLIENT_INTERCEPTORS));
}
use of org.jboss.as.controller.ReloadRequiredWriteAttributeHandler in project wildfly by wildfly.
the class IdentityResourceDefinition method registerAttributes.
@Override
public void registerAttributes(ManagementResourceRegistration resourceRegistration) {
outflowSecurityDomains.clear();
ReloadRequiredWriteAttributeHandler handler = new ReloadRequiredWriteAttributeHandler(ATTRIBUTES);
for (AttributeDefinition attribute : ATTRIBUTES) {
resourceRegistration.registerReadWriteAttribute(attribute, null, handler);
}
}
use of org.jboss.as.controller.ReloadRequiredWriteAttributeHandler in project wildfly by wildfly.
the class ExternalJMSTopicDefinition method registerAttributes.
@Override
public void registerAttributes(ManagementResourceRegistration registry) {
if (registerRuntimeOnly) {
registry.registerReadOnlyAttribute(CommonAttributes.DESTINATION_ENTRIES, null);
// Should this be read only as entries ?
registry.registerReadOnlyAttribute(External.ENABLE_AMQ1_PREFIX, null);
} else {
registry.registerReadWriteAttribute(CommonAttributes.DESTINATION_ENTRIES, null, new ReloadRequiredWriteAttributeHandler(CommonAttributes.DESTINATION_ENTRIES));
registry.registerReadWriteAttribute(External.ENABLE_AMQ1_PREFIX, null, new ReloadRequiredWriteAttributeHandler(External.ENABLE_AMQ1_PREFIX));
}
}
use of org.jboss.as.controller.ReloadRequiredWriteAttributeHandler in project wildfly by wildfly.
the class JMSBridgeDefinition method registerAttributes.
@Override
public void registerAttributes(ManagementResourceRegistration registry) {
ReloadRequiredWriteAttributeHandler reloadRequiredWriteAttributeHandler = new ReloadRequiredWriteAttributeHandler(ATTRIBUTES);
CredentialReferenceWriteAttributeHandler credentialReferenceWriteAttributeHandler = new CredentialReferenceWriteAttributeHandler(SOURCE_CREDENTIAL_REFERENCE, TARGET_CREDENTIAL_REFERENCE);
for (AttributeDefinition attr : ATTRIBUTES) {
if (attr.equals(SOURCE_CREDENTIAL_REFERENCE) || attr.equals(TARGET_CREDENTIAL_REFERENCE)) {
registry.registerReadWriteAttribute(attr, null, credentialReferenceWriteAttributeHandler);
} else {
registry.registerReadWriteAttribute(attr, null, reloadRequiredWriteAttributeHandler);
}
}
for (AttributeDefinition attr : READONLY_ATTRIBUTES) {
registry.registerReadOnlyAttribute(attr, JMSBridgeHandler.INSTANCE);
}
for (AttributeDefinition attr : METRICS) {
registry.registerMetric(attr, JMSBridgeHandler.READ_ONLY_INSTANCE);
}
}
use of org.jboss.as.controller.ReloadRequiredWriteAttributeHandler in project wildfly by wildfly.
the class PooledConnectionFactoryDefinition method registerAttributes.
@Override
public void registerAttributes(ManagementResourceRegistration registry) {
Collection<AttributeDefinition> definitions = getAttributes();
ReloadRequiredWriteAttributeHandler reloadRequiredWriteAttributeHandler = new ReloadRequiredWriteAttributeHandler(definitions);
CredentialReferenceWriteAttributeHandler credentialReferenceWriteAttributeHandler = new CredentialReferenceWriteAttributeHandler(CREDENTIAL_REFERENCE);
for (AttributeDefinition attr : definitions) {
if (!attr.getFlags().contains(AttributeAccess.Flag.STORAGE_RUNTIME)) {
if (deployed) {
registry.registerReadOnlyAttribute(attr, PooledConnectionFactoryConfigurationRuntimeHandler.INSTANCE);
} else {
if (attr.equals(CREDENTIAL_REFERENCE)) {
registry.registerReadWriteAttribute(attr, null, credentialReferenceWriteAttributeHandler);
} else {
registry.registerReadWriteAttribute(attr, null, reloadRequiredWriteAttributeHandler);
}
}
}
}
}
Aggregations