Skip to content

Commit

Permalink
Descriptor must be Descriptor, not any instance
Browse files Browse the repository at this point in the history
- then EjbReference cannot be used anywhere.
- in this commit I left out several files, because they are in conflict with
  the design, which wasn't visible until I did this.

Signed-off-by: David Matějček <david.matejcek@omnifish.ee>
  • Loading branch information
dmatej committed Sep 18, 2022
1 parent f22ee37 commit ac1d5be
Show file tree
Hide file tree
Showing 116 changed files with 2,230 additions and 2,436 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,15 @@

import com.sun.enterprise.deployment.util.DOLUtils;

import java.io.Serializable;
import java.util.logging.Level;
import java.util.logging.Logger;

import org.glassfish.deployment.common.Descriptor;

/**
* This descriptor holds the security configuration of an EJB IOR.
*/
public class EjbIORConfigurationDescriptor implements Serializable {
public class EjbIORConfigurationDescriptor extends Descriptor {
private static final long serialVersionUID = 1L;
private static final Logger LOG = DOLUtils.getDefaultLogger();

Expand Down Expand Up @@ -89,7 +90,7 @@ public String getIntegrity() {

/**
* Set the value of the integrity element to the specified value.
* @param the value (one of supported, required, none).
* @param val the value (one of supported, required, none).
*/
public void setIntegrity(String val) {
if (!val.equalsIgnoreCase(NONE) && !val.equalsIgnoreCase(SUPPORTED) && !val.equalsIgnoreCase(REQUIRED)) {
Expand Down Expand Up @@ -134,7 +135,7 @@ public String getEstablishTrustInTarget() {
*/
public void setEstablishTrustInTarget(String val) {
if (!val.equalsIgnoreCase(NONE) && !val.equalsIgnoreCase(SUPPORTED)) {
throw new RuntimeException("Incorrect value for " + "establishTrustInTarget:" + val);
throw new RuntimeException("Incorrect value for establishTrustInTarget:" + val);
}

establishTrustInTarget = val;
Expand All @@ -156,7 +157,7 @@ public String getEstablishTrustInClient() {
*/
public void setEstablishTrustInClient(String val) {
if (!val.equalsIgnoreCase(NONE) && !val.equalsIgnoreCase(SUPPORTED) && !val.equalsIgnoreCase(REQUIRED)) {
throw new RuntimeException("Incorrect value for " + "establishTrustInClient:" + val);
throw new RuntimeException("Incorrect value for establishTrustInClient: " + val);
}
establishTrustInClient = val;
}
Expand All @@ -177,7 +178,7 @@ public String getAuthenticationMethod() {
*/
public void setAuthenticationMethod(String val) {
if (!val.equalsIgnoreCase(USERNAME_PASSWORD) && !val.equalsIgnoreCase(NONE)) {
throw new RuntimeException("Incorrect value for " + "authentication method:" + val);
throw new RuntimeException("Incorrect value for authentication method: " + val);
}
authenticationMethod = val;
}
Expand Down Expand Up @@ -213,7 +214,7 @@ public String getCallerPropagation() {
*/
public void setCallerPropagation(String val) {
if (!val.equalsIgnoreCase(NONE) && !val.equalsIgnoreCase(SUPPORTED) && !val.equalsIgnoreCase(REQUIRED)) {
throw new RuntimeException("Incorrect value for callerPropagation:" + val);
throw new RuntimeException("Incorrect value for callerPropagation: " + val);
}
callerPropagation = val;
}
Expand Down Expand Up @@ -249,6 +250,7 @@ public void setAuthMethodRequired(String val) {
/**
* Returns a formatted String of the attributes of this object.
*/
@Override
public void print(StringBuffer toStringBuffer) {
toStringBuffer.append("\n integrity ").append(integrity);
toStringBuffer.append( "\n confidentiality " ).append( confidentiality);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,19 @@
import com.sun.enterprise.deployment.core.MetadataSource;
import com.sun.enterprise.deployment.util.TypeUtil;

import java.io.Serializable;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.Objects;

import org.glassfish.deployment.common.Descriptor;

/**
* This class holds information about an injection target like the class name
* of the injected target, and field/method information used for injection.
*
* @author Jerome Dochez
*/
public class InjectionTarget implements Serializable {
public class InjectionTarget extends Descriptor {

private static final long serialVersionUID = 1L;
private String className;
Expand Down Expand Up @@ -59,6 +60,7 @@ public String getClassName() {
}


// Used by reflection!
public void setClassName(String className) {
this.className = className;
}
Expand All @@ -76,6 +78,7 @@ public String getTargetName() {
return targetName;
}

// Used by reflection!
public void setTargetName(String targetName) {
this.targetName = targetName;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,43 +24,78 @@
import java.util.Map;
import java.util.Map.Entry;

import org.glassfish.deployment.common.Descriptor;
import org.glassfish.api.deployment.archive.ArchiveType;
import org.glassfish.deployment.common.RootDeploymentDescriptor;

/**
* Holds namespace-to-package mapping information from a
* "non-exhaustive" jaxrpc mapping file.
*
* @author Kenneth Saks
*/
public class JaxrpcMappingDescriptor extends Descriptor {
public class JaxrpcMappingDescriptor extends RootDeploymentDescriptor {

private static final long serialVersionUID = 1L;
private final Map<String, String> packageToNamespaceUriMap = new HashMap<>();
private final Map<String, String> namespaceUriToPackageMap = new HashMap<>();

private boolean simpleMapping = true;

public JaxrpcMappingDescriptor() {
@Override
public String getModuleID() {
return "";
}


@Override
public String getDefaultSpecVersion() {
return "1.0";
}


@Override
public boolean isEmpty() {
return namespaceUriToPackageMap.isEmpty();
}


@Override
public ArchiveType getModuleType() {
return null;
}


@Override
public ClassLoader getClassLoader() {
return null;
}


@Override
public boolean isApplication() {
return false;
}


public void setIsSimpleMapping(boolean flag) {
simpleMapping = flag;
}


/**
* @return true if only mapping info only contains package->namespace
* mapping.
* @return true if only mapping info only contains package->namespace mapping.
*/
public boolean isSimpleMapping() {
return simpleMapping;
}


public void addMapping(String javaPackage, String namespaceUri) {
packageToNamespaceUriMap.put(javaPackage, namespaceUri);
namespaceUriToPackageMap.put(namespaceUri, javaPackage);
}


/**
* @return Collection of Mapping elements
*/
Expand Down Expand Up @@ -94,5 +129,4 @@ public String getPackage() {
return javaPackage;
}
}

}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* Copyright (c) 2022 Contributors to the Eclipse Foundation
* Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
Expand All @@ -16,23 +17,21 @@

package com.sun.enterprise.deployment.io;

import org.glassfish.deployment.common.Descriptor;

import com.sun.enterprise.deployment.PermissionsDescriptor;
import com.sun.enterprise.deployment.node.PermissionsNode;
import com.sun.enterprise.deployment.node.RootXMLNode;

public class PermissionsDeploymentDescriptorFile extends
DeploymentDescriptorFile {
import org.glassfish.deployment.common.Descriptor;

public class PermissionsDeploymentDescriptorFile extends DeploymentDescriptorFile<PermissionsDescriptor> {

@Override
public String getDeploymentDescriptorPath() {

return "META-INF/permissions.xml";
}

@Override
public RootXMLNode getRootXMLNode(Descriptor descriptor) {

@Override
public PermissionsNode getRootXMLNode(Descriptor descriptor) {
return new PermissionsNode();

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
*
* @author Jerome Dochez
*/
public class AppClientRuntimeDDFile extends ConfigurationDeploymentDescriptorFile {
public class AppClientRuntimeDDFile extends ConfigurationDeploymentDescriptorFile<ApplicationClientDescriptor> {

/**
* @return the location of the DeploymentDescriptor file for a
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import com.sun.enterprise.deployment.io.DescriptorConstants;
import com.sun.enterprise.deployment.node.runtime.application.gf.ApplicationRuntimeNode;

import java.util.List;
import java.util.Map;

import org.glassfish.deployment.common.Descriptor;
Expand All @@ -39,7 +40,7 @@
@ConfigurationDeploymentDescriptorFileFor(EarType.ARCHIVE_TYPE)
@PerLookup
@Service
public class ApplicationRuntimeDDFile extends ConfigurationDeploymentDescriptorFile {
public class ApplicationRuntimeDDFile extends ConfigurationDeploymentDescriptorFile<Application> {

/**
* @return the location of the DeploymentDescriptor file for a
Expand Down Expand Up @@ -75,9 +76,10 @@ public ApplicationRuntimeNode getRootXMLNode(Descriptor descriptor) {
*/
@Override
public void registerBundle(
Map rootNodesMap,
Map publicIDToDTDMap,
Map versionUpgrades) {
Map<String, Class<?>> rootNodesMap,
Map<String, String> publicIDToDTDMap,
Map<String, List<Class<?>>> versionUpgrades
) {
String bundle = ApplicationRuntimeNode.registerBundle(publicIDToDTDMap, versionUpgrades);
rootNodesMap.put(bundle, ApplicationRuntimeNode.class);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* Copyright (c) 2022 Contributors to the Eclipse Foundation
* Copyright (c) 1997, 2018 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
Expand All @@ -17,36 +18,28 @@
package com.sun.enterprise.deployment.io.runtime;

import com.sun.enterprise.deployment.ConnectorDescriptor;
import org.glassfish.deployment.common.Descriptor;
import com.sun.enterprise.deployment.io.ConfigurationDeploymentDescriptorFile;
import com.sun.enterprise.deployment.io.DescriptorConstants;
import com.sun.enterprise.deployment.node.RootXMLNode;
import com.sun.enterprise.deployment.node.runtime.connector.ConnectorNode;

import org.glassfish.deployment.common.Descriptor;

/**
* This class is responsible for handling the XML configuration information
* for the SunOne AppServer Web Container
*
* @author Jerome Dochez
*/
public class ConnectorRuntimeDDFile extends ConfigurationDeploymentDescriptorFile {
public class ConnectorRuntimeDDFile extends ConfigurationDeploymentDescriptorFile<ConnectorDescriptor> {

/**
* @return the location of the DeploymentDescriptor file for a
* particular type of J2EE Archive
*/
@Override
public String getDeploymentDescriptorPath() {
return DescriptorConstants.S1AS_RAR_JAR_ENTRY;
}

/**
* @return a RootXMLNode responsible for handling the deployment
* descriptors associated with this J2EE module
*
* @param the descriptor for which we need the node
*/
public RootXMLNode getRootXMLNode(Descriptor descriptor) {

@Override
public ConnectorNode getRootXMLNode(Descriptor descriptor) {
if (descriptor instanceof ConnectorDescriptor) {
return new ConnectorNode((ConnectorDescriptor) descriptor);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import com.sun.enterprise.deployment.ApplicationClientDescriptor;
import com.sun.enterprise.deployment.io.ConfigurationDeploymentDescriptorFile;
import com.sun.enterprise.deployment.io.DescriptorConstants;
import com.sun.enterprise.deployment.node.RootXMLNode;
import com.sun.enterprise.deployment.node.runtime.GFAppClientRuntimeNode;

import org.glassfish.deployment.common.Descriptor;
Expand All @@ -29,25 +28,16 @@
* This class is responsible for handling the XML configuration information
* for the Glassfish Application Client Container
*/
public class GFAppClientRuntimeDDFile extends ConfigurationDeploymentDescriptorFile {
public class GFAppClientRuntimeDDFile extends ConfigurationDeploymentDescriptorFile<ApplicationClientDescriptor> {

/**
* @return the location of the DeploymentDescriptor file for a
* particular type of J2EE Archive
*/
@Override
public String getDeploymentDescriptorPath() {
return DescriptorConstants.GF_APP_CLIENT_JAR_ENTRY;
}

/**
* @return a RootXMLNode responsible for handling the deployment
* descriptors associated with this J2EE module
*
* @param the descriptor for which we need the node
*/

@Override
public RootXMLNode getRootXMLNode(Descriptor descriptor) {
public GFAppClientRuntimeNode getRootXMLNode(Descriptor descriptor) {
if (descriptor instanceof ApplicationClientDescriptor) {
return new GFAppClientRuntimeNode((ApplicationClientDescriptor) descriptor);
}
Expand Down

0 comments on commit ac1d5be

Please sign in to comment.