Skip to content

Commit

Permalink
Deprecated getDomainRoot removed
Browse files Browse the repository at this point in the history
Signed-off-by: David Matějček <david.matejcek@omnifish.ee>
  • Loading branch information
dmatej committed Dec 7, 2022
1 parent 380aa49 commit c9c98f2
Show file tree
Hide file tree
Showing 15 changed files with 277 additions and 193 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (c) 1997, 2018 Oracle and/or its affiliates. All rights reserved.
* 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
* terms of the Eclipse Public License v. 2.0, which is available at
Expand Down Expand Up @@ -143,8 +143,8 @@ public synchronized void postConstruct() {
iiopService = config.getExtensionByType(IiopService.class);
umbrellaRoot = new File(installRootURI).getParentFile();
umbrellaRootURI = umbrellaRoot.toURI();
systemLevelSignedJARsRoot = new File(serverEnv.getDomainRoot(), JWS_SIGNED_SYSTEM_JARS_ROOT);
domainLevelSignedJARsRoot = new File(serverEnv.getDomainRoot(), JWS_SIGNED_DOMAIN_JARS_ROOT);
systemLevelSignedJARsRoot = new File(serverEnv.getInstanceRoot(), JWS_SIGNED_SYSTEM_JARS_ROOT);
domainLevelSignedJARsRoot = new File(serverEnv.getInstanceRoot(), JWS_SIGNED_DOMAIN_JARS_ROOT);
}

public static String signingAlias(final DeploymentContext dc) {
Expand Down Expand Up @@ -181,7 +181,7 @@ private synchronized AppClientHTTPAdapter startSystemContentAdapter() {
AppClientHTTPAdapter sysAdapter = new AppClientHTTPAdapter(
NamingConventions.JWSAPPCLIENT_SYSTEM_PREFIX,
new Properties(),
serverEnv.getDomainRoot(),
serverEnv.getInstanceRoot(),
new File(installRootURI),
iiopService,
orbFactory);
Expand Down Expand Up @@ -419,7 +419,7 @@ private synchronized AppClientHTTPAdapter createAndRegisterAdapter(
final AppClientHTTPAdapter adapter = new AppClientHTTPAdapter(
contextRoot, staticContent,
dynamicContent, tokens,
serverEnv.getDomainRoot(),
serverEnv.getInstanceRoot(),
new File(installRootURI),
iiopService,
orbFactory);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1035,7 +1035,7 @@ private static String getBrokerInstanceName(String asDomain, String asInstance,
suffix = p.getValue();
}
if (name.equals("append-version") &&
Boolean.valueOf(p.getValue()).booleanValue()) {
Boolean.parseBoolean(p.getValue())) {
suffix = Version.getMajorVersion() + "_" +
Version.getMinorVersion();
}
Expand Down Expand Up @@ -1074,7 +1074,7 @@ private void createMQVarDirectoryIfNecessary(){
}

private String getMQVarDir(){
String asInstanceRoot = getServerEnvironment().getDomainRoot().getPath();
String asInstanceRoot = getServerEnvironment().getInstanceRoot().getPath();
String mqInstanceDir = asInstanceRoot + java.io.File.separator + MQ_DIR_NAME;
return mqInstanceDir;
}
Expand Down Expand Up @@ -1102,8 +1102,7 @@ private String getBrokerHomeDir() {
String IMQ_INSTALL_SUBDIR = java.io.File.separator + ".." + java.io.File.separator + ".." + java.io.File.separator + "imq";
//java.io.File.separator + "bin"; hack until MQ RA changes
//XXX: This doesn't work in clustered instances.
brokerHomeDir = getServerEnvironment().getDomainRoot()//ApplicationServer.getServerContext().getInstallRoot()
+ IMQ_INSTALL_SUBDIR;
brokerHomeDir = getServerEnvironment().getInstanceRoot() + IMQ_INSTALL_SUBDIR;
} else {
//hack until MQ RA changes
brokerHomeDir = brokerHomeDir + java.io.File.separator + ".." ;
Expand Down Expand Up @@ -1391,12 +1390,12 @@ private void setMdbContainerProperties() throws ConnectorRuntimeException {
setProperty(cd, envProp4);

String integrationMode = getJmsService().getType();
boolean lazyInit = Boolean.valueOf(getJmsHost().getLazyInit());
boolean lazyInit = Boolean.parseBoolean(getJmsHost().getLazyInit());
val = "true";
if (EMBEDDED.equals(integrationMode) && lazyInit) {
val = "false";
}
doBind = Boolean.valueOf(val);
doBind = Boolean.parseBoolean(val);
ConnectorConfigProperty envProp5 = new ConnectorConfigProperty(MQ_PORTMAPPER_BIND, val, val, "java.lang.Boolean");
setProperty(cd, envProp5);

Expand Down Expand Up @@ -1477,7 +1476,7 @@ private void setJmsServiceProperties(JmsService service) throws ConnectorRuntime
setProperty(cd, envProp6);

boolean useExternal = shouldUseExternalRmiRegistry(jmsraUtil);
val = Boolean.valueOf(useExternal).toString();
val = Boolean.toString(useExternal);
ConnectorConfigProperty envProp7 = new ConnectorConfigProperty(
USEEXTERNALRMIREGISTRY, val, val, "java.lang.Boolean");
setProperty(cd, envProp7);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ boolean updateVirtualServerProperties(
dir = new File(logRoot, accessLog);
} else {
ServerEnvironment env = services.getService(ServerEnvironment.class);
dir = new File(env.getDomainRoot(), accessLog);
dir = new File(env.getInstanceRoot(), accessLog);
}
}

Expand Down Expand Up @@ -777,9 +777,9 @@ void updateAccessLogAttributes(HttpService httpService, WebContainerFeatureFacto

// rotation-enabled
if (accessLogConfig == null) {
setRotatable(Boolean.valueOf(ConfigBeansUtilities.getDefaultRotationEnabled()));
setRotatable(Boolean.parseBoolean(ConfigBeansUtilities.getDefaultRotationEnabled()));
} else {
setRotatable(Boolean.valueOf(accessLogConfig.getRotationEnabled()));
setRotatable(Boolean.parseBoolean(accessLogConfig.getRotationEnabled()));
}
// rotation-interval
interval = 0;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/*
*
* Copyright (c) 2021, 2022 Contributors to Eclipse Foundation.
* Copyright (c) 1997, 2018 Oracle and/or its affiliates. All rights reserved.
*
Expand Down Expand Up @@ -430,8 +429,8 @@ public void postConstruct() {
_embedded.setFileLoggerHandlerFactory(fileLoggerHandlerFactory);
_embedded.setWebContainerFeatureFactory(webContainerFeatureFactory);

_embedded.setCatalinaHome(instance.getDomainRoot().getAbsolutePath());
_embedded.setCatalinaBase(instance.getDomainRoot().getAbsolutePath());
_embedded.setCatalinaHome(instance.getInstanceRoot().getAbsolutePath());
_embedded.setCatalinaBase(instance.getInstanceRoot().getAbsolutePath());
_embedded.setUseNaming(false);
if (_debug > 1) {
_embedded.setDebug(_debug);
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) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
Expand All @@ -17,6 +18,12 @@
package org.glassfish.admin.rest.resources;

import com.sun.enterprise.config.serverbeans.Domain;

import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.Produces;
import jakarta.ws.rs.core.MediaType;

import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Collection;
Expand All @@ -31,22 +38,18 @@
import java.util.TreeSet;
import java.util.Vector;
import java.util.logging.Level;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.Produces;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.core.MediaType;

import org.glassfish.admin.rest.RestLogging;
import org.glassfish.admin.rest.RestService;
import org.glassfish.admin.rest.utils.Util;
import org.glassfish.admin.rest.generator.ClassWriter;
import org.glassfish.admin.rest.generator.CommandResourceMetaData;
import org.glassfish.admin.rest.generator.CommandResourceMetaData.ParameterMetaData;

import org.glassfish.admin.rest.generator.ResourcesGenerator;
import org.glassfish.admin.rest.generator.ResourcesGeneratorBase;
import org.glassfish.admin.rest.utils.Util;
import org.glassfish.admin.rest.utils.xml.RestActionReporter;
import org.glassfish.api.ActionReport;
import org.glassfish.api.admin.CommandModel;
import org.glassfish.api.admin.CommandModel.ParamModel;
import org.glassfish.api.admin.CommandRunner;
import org.glassfish.api.admin.ParameterMap;
import org.glassfish.api.admin.RestRedirect;
Expand All @@ -65,18 +68,19 @@
public class StatusGenerator extends AbstractResource {

protected StringBuilder status = new StringBuilder();
private Set<String> commandsUsed = new TreeSet<String>();
private Set<String> allCommands = new TreeSet<String>();
private Set<String> restRedirectCommands = new TreeSet<String>();
private Map<String, String> commandsToResources = new TreeMap<String, String>();
private Map<String, String> resourcesToDeleteCommands = new TreeMap<String, String>();
private Properties propsI18N = new SortedProperties();
private final Set<String> commandsUsed = new TreeSet<>();
private final Set<String> allCommands = new TreeSet<>();
private final Set<String> restRedirectCommands = new TreeSet<>();
private final Map<String, String> commandsToResources = new TreeMap<>();
private final Map<String, String> resourcesToDeleteCommands = new TreeMap<>();
private final Properties propsI18N = new SortedProperties();

static private class SortedProperties extends Properties {

@Override
public Enumeration keys() {
Enumeration keysEnum = super.keys();
Vector<String> keyList = new Vector<String>();
Vector<String> keyList = new Vector<>();
while (keysEnum.hasMoreElements()) {
keyList.add((String) keysEnum.nextElement());
}
Expand Down Expand Up @@ -277,7 +281,7 @@ public void listOfCommands() {

class NOOPClassWriter implements ClassWriter {

private String className;
private final String className;

public NOOPClassWriter(String className, String baseClassName, String resourcePath) {
this.className = className;
Expand Down Expand Up @@ -452,10 +456,9 @@ public Boolean hasTargetParam(String command) {
Collection<CommandModel.ParamModel> params;
params = getParamMetaData(command);

Iterator<CommandModel.ParamModel> iterator = params.iterator();
CommandModel.ParamModel paramModel;
while (iterator.hasNext()) {
paramModel = iterator.next();
for (ParamModel param : params) {
paramModel = param;
// Param param = paramModel.getParam();
if (paramModel.getName().equals("target")) {
return true;
Expand Down
Loading

0 comments on commit c9c98f2

Please sign in to comment.