Skip to content

Commit

Permalink
WFLY-1077 IIOP subsystem: Persistent resource parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
tadamski committed Jan 13, 2015
1 parent c18f162 commit 643b7f3
Show file tree
Hide file tree
Showing 30 changed files with 964 additions and 1,344 deletions.
54 changes: 54 additions & 0 deletions jdkorb/src/main/java/org/jboss/as/jdkorb/AttributeConstants.java
@@ -0,0 +1,54 @@
package org.jboss.as.jdkorb;

/*
* JBoss, Home of Professional Open Source.
* Copyright 2014, Red Hat, Inc., and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/

/**
* @author <a href="mailto:tadamski@redhat.com">Tomasz Adamski</a>
*/

import org.jboss.as.controller.access.constraint.SensitivityClassification;
import org.jboss.as.controller.access.management.SensitiveTargetAccessConstraintDefinition;
import org.jboss.as.controller.operations.validation.EnumValidator;
import org.jboss.as.controller.operations.validation.ParameterValidator;
import org.jboss.dmr.ModelNode;

public class AttributeConstants {

private AttributeConstants() {
}

static final ModelNode DEFAULT_DISABLED_PROPERTY = new ModelNode().set("off");

static final ModelNode DEFAULT_ENABLED_PROPERTY = new ModelNode().set("on");

static final ParameterValidator SSL_CONFIG_VALIDATOR =
new EnumValidator<SSLConfigValue>(SSLConfigValue.class, true, false);

static final ParameterValidator ON_OFF_VALIDATOR = new EnumValidator<TransactionsAllowedValues>(
TransactionsAllowedValues.class, true, false, TransactionsAllowedValues.ON, TransactionsAllowedValues.OFF);

static final SensitivityClassification JDKORB_SECURITY =
new SensitivityClassification(JdkORBExtension.SUBSYSTEM_NAME, "jdkorb-security", false, false, true);

static final SensitiveTargetAccessConstraintDefinition JDKORB_SECURITY_DEF = new SensitiveTargetAccessConstraintDefinition(JDKORB_SECURITY);
}
Expand Up @@ -31,7 +31,6 @@
import org.jboss.as.controller.AttributeDefinition;
import org.jboss.as.controller.OperationContext;
import org.jboss.as.controller.OperationFailedException;
import org.jboss.as.controller.PathElement;
import org.jboss.as.controller.PersistentResourceDefinition;
import org.jboss.as.controller.ReloadRequiredRemoveStepHandler;
import org.jboss.as.controller.SimpleAttributeDefinitionBuilder;
Expand All @@ -48,7 +47,7 @@
*
* @author <a href="mailto:tadamski@redhat.com">Tomasz Adamski</a>
*/
class ClientTransportConfigDefinition extends PersistentResourceDefinition {
class ClientTransportDefinition extends PersistentResourceDefinition {


static final AttributeDefinition REQUIRES_SSL =
Expand All @@ -60,18 +59,17 @@ class ClientTransportConfigDefinition extends PersistentResourceDefinition {

static final Collection<AttributeDefinition> ATTRIBUTES = Arrays.asList(REQUIRES_SSL);

static final ClientTransportConfigDefinition INSTANCE = new ClientTransportConfigDefinition();
static final ClientTransportDefinition INSTANCE = new ClientTransportDefinition();

private ClientTransportConfigDefinition() {
super(PathElement.pathElement(JdkORBSubsystemConstants.CLIENT_TRANSPORT_CONFIG, JdkORBSubsystemConstants.DEFAULT),
JdkORBExtension.getResourceDescriptionResolver(JdkORBSubsystemConstants.CLIENT_TRANSPORT_CONFIG),
new AbstractAddStepHandler(ATTRIBUTES),
ReloadRequiredRemoveStepHandler.INSTANCE);
private ClientTransportDefinition() {
super(JdkORBExtension.PATH_CLIENT_TRANSPORT, JdkORBExtension
.getResourceDescriptionResolver(JdkORBSubsystemConstants.CLIENT_TRANSPORT), new AbstractAddStepHandler(
ATTRIBUTES), ReloadRequiredRemoveStepHandler.INSTANCE);
}

@Override
public List<AccessConstraintDefinition> getAccessConstraints() {
return Collections.singletonList((AccessConstraintDefinition) JdkORBSubsystemDefinitions.JDKORB_SECURITY_DEF);
return Collections.singletonList((AccessConstraintDefinition) AttributeConstants.JDKORB_SECURITY_DEF);
}

@Override
Expand Down

This file was deleted.

Expand Up @@ -31,7 +31,6 @@
import org.jboss.as.controller.AttributeDefinition;
import org.jboss.as.controller.OperationContext;
import org.jboss.as.controller.OperationFailedException;
import org.jboss.as.controller.PathElement;
import org.jboss.as.controller.PersistentResourceDefinition;
import org.jboss.as.controller.ReloadRequiredRemoveStepHandler;
import org.jboss.as.controller.SimpleAttributeDefinitionBuilder;
Expand Down Expand Up @@ -80,16 +79,14 @@ public class IORASContextDefinition extends PersistentResourceDefinition {
static final IORASContextDefinition INSTANCE = new IORASContextDefinition();

private IORASContextDefinition() {
super(PathElement.pathElement(JdkORBSubsystemConstants.SETTING, JdkORBSubsystemConstants.IOR_AS_CONTEXT),
JdkORBExtension.getResourceDescriptionResolver(JdkORBSubsystemConstants.IOR_SETTINGS,
JdkORBSubsystemConstants.IOR_AS_CONTEXT),
new AbstractAddStepHandler(ATTRIBUTES),
ReloadRequiredRemoveStepHandler.INSTANCE);
super(JdkORBExtension.PATH_IOR_AS, JdkORBExtension.getResourceDescriptionResolver(
JdkORBSubsystemConstants.IOR_SETTINGS, JdkORBSubsystemConstants.IOR_AS_CONTEXT), new AbstractAddStepHandler(
ATTRIBUTES), ReloadRequiredRemoveStepHandler.INSTANCE);
}

@Override
public List<AccessConstraintDefinition> getAccessConstraints() {
return Collections.singletonList((AccessConstraintDefinition)JdkORBSubsystemDefinitions.JDKORB_SECURITY_DEF);
return Collections.singletonList((AccessConstraintDefinition)AttributeConstants.JDKORB_SECURITY_DEF);
}

@Override
Expand Down
Expand Up @@ -31,7 +31,6 @@
import org.jboss.as.controller.AttributeDefinition;
import org.jboss.as.controller.OperationContext;
import org.jboss.as.controller.OperationFailedException;
import org.jboss.as.controller.PathElement;
import org.jboss.as.controller.PersistentResourceDefinition;
import org.jboss.as.controller.ReloadRequiredRemoveStepHandler;
import org.jboss.as.controller.SimpleAttributeDefinitionBuilder;
Expand Down Expand Up @@ -65,16 +64,14 @@ public class IORSASContextDefinition extends PersistentResourceDefinition {
static final IORSASContextDefinition INSTANCE = new IORSASContextDefinition();

private IORSASContextDefinition() {
super(PathElement.pathElement(JdkORBSubsystemConstants.SETTING, JdkORBSubsystemConstants.IOR_SAS_CONTEXT),
JdkORBExtension.getResourceDescriptionResolver(JdkORBSubsystemConstants.IOR_SETTINGS,
JdkORBSubsystemConstants.IOR_SAS_CONTEXT),
new AbstractAddStepHandler(ATTRIBUTES),
ReloadRequiredRemoveStepHandler.INSTANCE);
super(JdkORBExtension.PATH_IOR_SAS, JdkORBExtension.getResourceDescriptionResolver(
JdkORBSubsystemConstants.IOR_SETTINGS, JdkORBSubsystemConstants.IOR_SAS_CONTEXT), new AbstractAddStepHandler(
ATTRIBUTES), ReloadRequiredRemoveStepHandler.INSTANCE);
}

@Override
public List<AccessConstraintDefinition> getAccessConstraints() {
return Collections.singletonList((AccessConstraintDefinition) JdkORBSubsystemDefinitions.JDKORB_SECURITY_DEF);
return Collections.singletonList((AccessConstraintDefinition) AttributeConstants.JDKORB_SECURITY_DEF);
}

@Override
Expand Down
Expand Up @@ -7,7 +7,6 @@

import org.jboss.as.controller.AbstractAddStepHandler;
import org.jboss.as.controller.AttributeDefinition;
import org.jboss.as.controller.PathElement;
import org.jboss.as.controller.PersistentResourceDefinition;
import org.jboss.as.controller.ReloadRequiredRemoveStepHandler;

Expand All @@ -27,9 +26,9 @@ class IORSettingsDefinition extends PersistentResourceDefinition {
IORSASContextDefinition.INSTANCE));

private IORSettingsDefinition() {
super(PathElement.pathElement(JdkORBSubsystemConstants.IOR_SETTINGS, JdkORBSubsystemConstants.DEFAULT),
JdkORBExtension.getResourceDescriptionResolver(JdkORBSubsystemConstants.IOR_SETTINGS),
new AbstractAddStepHandler(), ReloadRequiredRemoveStepHandler.INSTANCE);
super(JdkORBExtension.PATH_IOR_SETTINGS, JdkORBExtension
.getResourceDescriptionResolver(JdkORBSubsystemConstants.IOR_SETTINGS), new AbstractAddStepHandler(),
ReloadRequiredRemoveStepHandler.INSTANCE);
}

@Override
Expand Down
85 changes: 0 additions & 85 deletions jdkorb/src/main/java/org/jboss/as/jdkorb/IORSettingsParser.java

This file was deleted.

Expand Up @@ -31,10 +31,8 @@
import org.jboss.as.controller.AttributeDefinition;
import org.jboss.as.controller.OperationContext;
import org.jboss.as.controller.OperationFailedException;
import org.jboss.as.controller.PathElement;
import org.jboss.as.controller.PersistentResourceDefinition;
import org.jboss.as.controller.ReloadRequiredRemoveStepHandler;
import org.jboss.as.controller.SimpleAttributeDefinition;
import org.jboss.as.controller.SimpleAttributeDefinitionBuilder;
import org.jboss.as.controller.access.management.AccessConstraintDefinition;
import org.jboss.as.controller.operations.validation.EnumValidator;
Expand Down Expand Up @@ -99,7 +97,7 @@ class IORTransportConfigDefinition extends PersistentResourceDefinition {
.setAllowExpression(true)
.build();

static final SimpleAttributeDefinition DETECT_MISORDERING =
static final AttributeDefinition DETECT_MISORDERING =
new SimpleAttributeDefinitionBuilder(JdkORBSubsystemConstants.IOR_TRANSPORT_DETECT_MISORDERING, ModelType.STRING, true)
.setFlags(AttributeAccess.Flag.RESTART_ALL_SERVICES)
.setDefaultValue(DEFAULT_VALUE)
Expand All @@ -113,16 +111,14 @@ class IORTransportConfigDefinition extends PersistentResourceDefinition {
static final IORTransportConfigDefinition INSTANCE = new IORTransportConfigDefinition();

private IORTransportConfigDefinition() {
super(PathElement.pathElement(JdkORBSubsystemConstants.SETTING, JdkORBSubsystemConstants.IOR_TRANSPORT_CONFIG),
JdkORBExtension.getResourceDescriptionResolver(JdkORBSubsystemConstants.IOR_SETTINGS,
JdkORBSubsystemConstants.IOR_TRANSPORT_CONFIG),
new AbstractAddStepHandler(ATTRIBUTES),
ReloadRequiredRemoveStepHandler.INSTANCE);
super(JdkORBExtension.PATH_IOR_TRANSPORT, JdkORBExtension.getResourceDescriptionResolver(
JdkORBSubsystemConstants.IOR_SETTINGS, JdkORBSubsystemConstants.IOR_TRANSPORT_CONFIG),
new AbstractAddStepHandler(ATTRIBUTES), ReloadRequiredRemoveStepHandler.INSTANCE);
}

@Override
public List<AccessConstraintDefinition> getAccessConstraints() {
return Collections.singletonList((AccessConstraintDefinition) JdkORBSubsystemDefinitions.JDKORB_SECURITY_DEF);
return Collections.singletonList((AccessConstraintDefinition) AttributeConstants.JDKORB_SECURITY_DEF);
}

@Override
Expand Down

0 comments on commit 643b7f3

Please sign in to comment.