Skip to content

Commit

Permalink
WFLY-1077 IIOP subsystem: Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
tadamski committed Jan 13, 2015
1 parent cbc151c commit 1dc792b
Show file tree
Hide file tree
Showing 87 changed files with 722 additions and 1,018 deletions.
6 changes: 0 additions & 6 deletions ejb3/pom.xml
Expand Up @@ -69,16 +69,10 @@ vi:ts=4:sw=4:expandtab
<groupId>org.wildfly</groupId> <groupId>org.wildfly</groupId>
<artifactId>wildfly-ee</artifactId> <artifactId>wildfly-ee</artifactId>
</dependency> </dependency>

<!-- <dependency> -->
<!-- <groupId>${project.groupId}</groupId> -->
<!-- <artifactId>wildfly-jacorb</artifactId> -->
<!-- </dependency> -->


<dependency> <dependency>
<groupId>org.wildfly</groupId> <groupId>org.wildfly</groupId>
<artifactId>wildfly-jdkorb</artifactId> <artifactId>wildfly-jdkorb</artifactId>
<version>8.0.1.Final-SNAPSHOT</version>
</dependency> </dependency>


<dependency> <dependency>
Expand Down
Expand Up @@ -82,7 +82,7 @@ public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitPro
//we always have to add this, as even non-ejb deployments may still lookup IIOP ejb's //we always have to add this, as even non-ejb deployments may still lookup IIOP ejb's
moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, EJB_SUBSYSTEM, false, false, true, false)); moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, EJB_SUBSYSTEM, false, false, true, false));


if (JdkORBDeploymentMarker.isJacORBDeployment(deploymentUnit)) { if (JdkORBDeploymentMarker.isJdkORBDeployment(deploymentUnit)) {
//needed for dynamic IIOP stubs //needed for dynamic IIOP stubs
moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, JDKORB, false, false, false, false)); moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, JDKORB, false, false, false, false));
} }
Expand Down
Expand Up @@ -95,7 +95,7 @@ public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentU




final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
if (!JdkORBDeploymentMarker.isJacORBDeployment(deploymentUnit)) { if (!JdkORBDeploymentMarker.isJdkORBDeployment(deploymentUnit)) {
return; return;
} }


Expand Down
Expand Up @@ -65,7 +65,7 @@ public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitPro
} }


//do not bind if jacORB not present //do not bind if jacORB not present
if (!JdkORBDeploymentMarker.isJacORBDeployment(deploymentUnit)) { if (!JdkORBDeploymentMarker.isJdkORBDeployment(deploymentUnit)) {
return; return;
} }


Expand Down
5 changes: 2 additions & 3 deletions jdkorb/pom.xml
Expand Up @@ -62,8 +62,8 @@
<configuration> <configuration>
<artifactItems> <artifactItems>
<artifactItem> <artifactItem>
<groupId>org.jacorb</groupId> <groupId>org.jboss.openjdk-orb</groupId>
<artifactId>jacorb</artifactId> <artifactId>openjdk-orb</artifactId>
<type>jar</type> <type>jar</type>
<overWrite>true</overWrite> <overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/endorsed</outputDirectory> <outputDirectory>${project.build.directory}/endorsed</outputDirectory>
Expand All @@ -80,7 +80,6 @@
<dependency> <dependency>
<groupId>org.jboss.openjdk-orb</groupId> <groupId>org.jboss.openjdk-orb</groupId>
<artifactId>openjdk-orb</artifactId> <artifactId>openjdk-orb</artifactId>
<version>7.5.0</version>
</dependency> </dependency>


<dependency> <dependency>
Expand Down
Expand Up @@ -23,8 +23,8 @@
package org.jboss.as.jdkorb; package org.jboss.as.jdkorb;


import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.PROPERTIES; import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.PROPERTIES;
import static org.jboss.as.jdkorb.ORBSubsystemConstants.IDENTITY; import static org.jboss.as.jdkorb.JdkORBSubsystemConstants.IDENTITY;
import static org.jboss.as.jdkorb.ORBSubsystemConstants.SECURITY; import static org.jboss.as.jdkorb.JdkORBSubsystemConstants.SECURITY;


import java.util.HashSet; import java.util.HashSet;
import java.util.Map; import java.util.Map;
Expand Down Expand Up @@ -52,32 +52,33 @@


/** /**
* <p> * <p>
* The JacORB extension implementation. * The JdkORB extension implementation.
* </p> * </p>
* *
* @author <a href="mailto:sguilhen@redhat.com">Stefan Guilhen</a> * @author <a href="mailto:sguilhen@redhat.com">Stefan Guilhen</a>
* @author <a href="mailto:tadamski@redhat.com">Tomasz Adamski</a>
*/ */
public class ORBExtension implements Extension { public class JdkORBExtension implements Extension {


private static final ORBSubsystemParser PARSER = ORBSubsystemParser.INSTANCE; private static final JdkORBSubsystemParser PARSER = JdkORBSubsystemParser.INSTANCE;


public static final String SUBSYSTEM_NAME = "jdkorb"; public static final String SUBSYSTEM_NAME = "jdkorb";


private static final String RESOURCE_NAME = ORBExtension.class.getPackage().getName() + ".LocalDescriptions"; private static final String RESOURCE_NAME = JdkORBExtension.class.getPackage().getName() + ".LocalDescriptions";


private static final int MANAGEMENT_API_MAJOR_VERSION = 1; private static final int MANAGEMENT_API_MAJOR_VERSION = 1;
private static final int MANAGEMENT_API_MINOR_VERSION = 0; private static final int MANAGEMENT_API_MINOR_VERSION = 0;
private static final int MANAGEMENT_API_MICRO_VERSION = 0; private static final int MANAGEMENT_API_MICRO_VERSION = 0;


static ResourceDescriptionResolver getResourceDescriptionResolver(final String keyPrefix) { static ResourceDescriptionResolver getResourceDescriptionResolver(final String keyPrefix) {
return new StandardResourceDescriptionResolver(keyPrefix, RESOURCE_NAME, ORBExtension.class.getClassLoader(), true, false); return new StandardResourceDescriptionResolver(keyPrefix, RESOURCE_NAME, JdkORBExtension.class.getClassLoader(), true, false);
} }


@Override @Override
public void initialize(ExtensionContext context) { public void initialize(ExtensionContext context) {
final SubsystemRegistration subsystem = context.registerSubsystem(SUBSYSTEM_NAME, MANAGEMENT_API_MAJOR_VERSION, final SubsystemRegistration subsystem = context.registerSubsystem(SUBSYSTEM_NAME, MANAGEMENT_API_MAJOR_VERSION,
MANAGEMENT_API_MINOR_VERSION, MANAGEMENT_API_MICRO_VERSION); MANAGEMENT_API_MINOR_VERSION, MANAGEMENT_API_MICRO_VERSION);
final ManagementResourceRegistration subsystemRegistration = subsystem.registerSubsystemModel(ORBSubsystemResource.INSTANCE); final ManagementResourceRegistration subsystemRegistration = subsystem.registerSubsystemModel(JdkORBSubsystemResource.INSTANCE);
subsystemRegistration.registerOperationHandler(GenericSubsystemDescribeHandler.DEFINITION, GenericSubsystemDescribeHandler.INSTANCE); subsystemRegistration.registerOperationHandler(GenericSubsystemDescribeHandler.DEFINITION, GenericSubsystemDescribeHandler.INSTANCE);
subsystem.registerXMLElementWriter(PARSER); subsystem.registerXMLElementWriter(PARSER);


Expand All @@ -89,7 +90,7 @@ public void initialize(ExtensionContext context) {


@Override @Override
public void initializeParsers(ExtensionParsingContext context) { public void initializeParsers(ExtensionParsingContext context) {
context.setSubsystemXmlMapping(SUBSYSTEM_NAME, ORBSubsystemParser.Namespace.JdkORB_1_0.getUriString(), PARSER); context.setSubsystemXmlMapping(SUBSYSTEM_NAME, JdkORBSubsystemParser.Namespace.JdkORB_1_0.getUriString(), PARSER);
} }


/** /**
Expand All @@ -100,7 +101,7 @@ public void initializeParsers(ExtensionParsingContext context) {
protected static void registerTransformers(final SubsystemRegistration subsystem) { protected static void registerTransformers(final SubsystemRegistration subsystem) {
final ModelVersion version110 = ModelVersion.create(1, 1, 0); final ModelVersion version110 = ModelVersion.create(1, 1, 0);
final Set<String> expressionKeys = new HashSet<String>(); final Set<String> expressionKeys = new HashSet<String>();
for(final AttributeDefinition def : ORBSubsystemDefinitions.ATTRIBUTES_BY_NAME.values()) { for(final AttributeDefinition def : JdkORBSubsystemDefinitions.ATTRIBUTES_BY_NAME.values()) {
if(def.isAllowExpression()) { if(def.isAllowExpression()) {
expressionKeys.add(def.getName()); expressionKeys.add(def.getName());
} }
Expand All @@ -112,13 +113,13 @@ protected static void registerTransformers(final SubsystemRegistration subsystem


@Override @Override
public String getRejectionLogMessage(Map<String, ModelNode> attributes) { public String getRejectionLogMessage(Map<String, ModelNode> attributes) {
return ORBMessages.MESSAGES.cannotUseSecurityClient(); return JdkORBMessages.MESSAGES.cannotUseSecurityClient();
} }


@Override @Override
protected boolean rejectAttribute(PathAddress address, String attributeName, ModelNode attributeValue, protected boolean rejectAttribute(PathAddress address, String attributeName, ModelNode attributeValue,
TransformationContext context) { TransformationContext context) {
return attributeValue.getType() == ModelType.STRING && attributeValue.asString().equals(ORBSubsystemConstants.CLIENT); return attributeValue.getType() == ModelType.STRING && attributeValue.asString().equals(JdkORBSubsystemConstants.CLIENT);
} }
}, SECURITY) }, SECURITY)
.setValueConverter(new AttributeConverter.DefaultAttributeConverter() { .setValueConverter(new AttributeConverter.DefaultAttributeConverter() {
Expand All @@ -138,7 +139,7 @@ protected void convertAttribute(PathAddress address, String attributeName, Model
} }


private static ModelNode replaceSecurityClient(ModelNode model) { private static ModelNode replaceSecurityClient(ModelNode model) {
if (model.hasDefined(SECURITY) && model.get(SECURITY).asString().equals(ORBSubsystemConstants.CLIENT)) { if (model.hasDefined(SECURITY) && model.get(SECURITY).asString().equals(JdkORBSubsystemConstants.CLIENT)) {
//security=CLIENT in the new model == security=OFF plus these extra initializers in the old model //security=CLIENT in the new model == security=OFF plus these extra initializers in the old model
//Since the write-attribute is restart-required I am not doing anything for the write-attribute operation //Since the write-attribute is restart-required I am not doing anything for the write-attribute operation
model.get(SECURITY).set("off"); model.get(SECURITY).set("off");
Expand Down
Expand Up @@ -32,8 +32,9 @@
* </p> * </p>
* *
* @author <a href="mailto:sguilhen@redhat.com">Stefan Guilhen</a> * @author <a href="mailto:sguilhen@redhat.com">Stefan Guilhen</a>
* @author <a href="mailto:tadamski@redhat.com">Tomasz Adamski</a>
*/ */
public enum ORBInitializer { public enum JdkORBInitializer {


UNKNOWN("", ""), UNKNOWN("", ""),


Expand Down Expand Up @@ -66,7 +67,7 @@ public enum ORBInitializer {
* @param initializerName the name that identifies the initializer group. * @param initializerName the name that identifies the initializer group.
* @param initializerClasses an array containing the fully-qualified name of the initializers that compose the group. * @param initializerClasses an array containing the fully-qualified name of the initializers that compose the group.
*/ */
ORBInitializer(final String initializerName, final String... initializerClasses) { JdkORBInitializer(final String initializerName, final String... initializerClasses) {
this.initializerName = initializerName; this.initializerName = initializerName;
this.initializerClasses = initializerClasses; this.initializerClasses = initializerClasses;
} }
Expand Down Expand Up @@ -94,11 +95,11 @@ public String[] getInitializerClasses() {
} }


// a map that caches all available initializer groups by name. // a map that caches all available initializer groups by name.
private static final Map<String, ORBInitializer> MAP; private static final Map<String, JdkORBInitializer> MAP;


static { static {
final Map<String, ORBInitializer> map = new HashMap<String, ORBInitializer>(); final Map<String, JdkORBInitializer> map = new HashMap<String, JdkORBInitializer>();
for (ORBInitializer element : values()) { for (JdkORBInitializer element : values()) {
final String name = element.getInitializerName(); final String name = element.getInitializerName();
if (name != null) if (name != null)
map.put(name, element); map.put(name, element);
Expand All @@ -115,8 +116,8 @@ public String[] getInitializerClasses() {
* @return the {@code ORBInitializer} identified by the name. If no implementation can be found, the * @return the {@code ORBInitializer} identified by the name. If no implementation can be found, the
* {@code ORBInitializer.UNKNOWN} type is returned. * {@code ORBInitializer.UNKNOWN} type is returned.
*/ */
static ORBInitializer fromName(final String initializerName) { static JdkORBInitializer fromName(final String initializerName) {
final ORBInitializer element = MAP.get(initializerName); final JdkORBInitializer element = MAP.get(initializerName);
return element == null ? UNKNOWN : element; return element == null ? UNKNOWN : element;
} }


Expand Down
Expand Up @@ -38,20 +38,20 @@
import org.omg.CORBA.ORB; import org.omg.CORBA.ORB;


/** /**
* The jacorb subsystem is using message IDs in the range 16300-16499. This file is using the subset 16300-16399 for * The jdkorb subsystem is using message IDs in the range 16300-16499. This file is using the subset 16300-16399 for
* logger messages. * logger messages.
* See http://http://community.jboss.org/wiki/LoggingIds for the full list of currently reserved JBAS message id blocks. * See http://http://community.jboss.org/wiki/LoggingIds for the full list of currently reserved JBAS message id blocks.
* *
* @author <a href="mailto:jperkins@redhat.com">James R. Perkins</a> * @author <a href="mailto:jperkins@redhat.com">James R. Perkins</a>
* @author <a href="mailto:sguilhen@redhat.com">Stefan Guilhen</a> * @author <a href="mailto:sguilhen@redhat.com">Stefan Guilhen</a>
*/ */
@MessageLogger(projectCode = "JBAS") @MessageLogger(projectCode = "JBAS")
public interface ORBLogger extends BasicLogger { public interface JdkORBLogger extends BasicLogger {


ORBLogger ROOT_LOGGER = Logger.getMessageLogger(ORBLogger.class, ORBLogger.class.getPackage().getName()); JdkORBLogger ROOT_LOGGER = Logger.getMessageLogger(JdkORBLogger.class, JdkORBLogger.class.getPackage().getName());


@LogMessage(level = INFO) @LogMessage(level = INFO)
@Message(id = 16300, value = "Activating JacORB Subsystem") @Message(id = 16300, value = "Activating JdkORB Subsystem")
void activatingSubsystem(); void activatingSubsystem();


@LogMessage(level = DEBUG) @LogMessage(level = DEBUG)
Expand Down
Expand Up @@ -46,17 +46,17 @@
import org.omg.CORBA.NO_PERMISSION; import org.omg.CORBA.NO_PERMISSION;


/** /**
* The jacorb subsystem is using message IDs in the range 16300-16499. This file is using the subset 16400-16499 for * The jdkorb subsystem is using message IDs in the range 16300-16499. This file is using the subset 16400-16499 for
* exception messages. * exception messages.
* See http://http://community.jboss.org/wiki/LoggingIds for the full list of currently reserved JBAS message id blocks. * See http://http://community.jboss.org/wiki/LoggingIds for the full list of currently reserved JBAS message id blocks.
* *
* @author <a href="mailto:jperkins@redhat.com">James R. Perkins</a> * @author <a href="mailto:jperkins@redhat.com">James R. Perkins</a>
* @author <a href="mailto:sguilhen@redhat.com">Stefan Guilhen</a> * @author <a href="mailto:sguilhen@redhat.com">Stefan Guilhen</a>
*/ */
@MessageBundle(projectCode = "JBAS") @MessageBundle(projectCode = "JBAS")
public interface ORBMessages { public interface JdkORBMessages {


ORBMessages MESSAGES = Messages.getBundle(ORBMessages.class); JdkORBMessages MESSAGES = Messages.getBundle(JdkORBMessages.class);


@Message(id = 16400, value = "SSL support has been enabled but no security domain has been specified") @Message(id = 16400, value = "SSL support has been enabled but no security domain has been specified")
OperationFailedException noSecurityDomainSpecified(); OperationFailedException noSecurityDomainSpecified();
Expand Down Expand Up @@ -335,8 +335,8 @@ public interface ORBMessages {
StartException errorActivatingPOA(@Param Throwable cause); StartException errorActivatingPOA(@Param Throwable cause);


@Message(id = 16494, value = "Cannot use the value 'client' for 'security'. Instead set 'security' to be 'off' and set both the " + @Message(id = 16494, value = "Cannot use the value 'client' for 'security'. Instead set 'security' to be 'off' and set both the " +
"'org.omg.PortableInterceptor.ORBInitializerClass.org.jboss.as.jacorb.csiv2.CSIv2Initializer' " + "'org.omg.PortableInterceptor.ORBInitializerClass.org.jboss.as.jdkorb.csiv2.CSIv2Initializer' " +
"and 'org.omg.PortableInterceptor.ORBInitializerClass.org.jboss.as.jacorb.csiv2.SASClientInitializer' properties to be \"\"") "and 'org.omg.PortableInterceptor.ORBInitializerClass.org.jboss.as.jdkorb.csiv2.SASClientInitializer' properties to be \"\"")
String cannotUseSecurityClient(); String cannotUseSecurityClient();


} }

0 comments on commit 1dc792b

Please sign in to comment.