Skip to content

Commit

Permalink
remove ajpPort.
Browse files Browse the repository at this point in the history
  • Loading branch information
zengkid committed Feb 21, 2020
1 parent 1488888 commit dc01eaf
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 52 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ protected JavaParameters createJavaParameters() {
return javaParams;

} catch (Exception e) {
throw new RuntimeException(e);
throw new RuntimeException(e.getMessage(), e);
}


Expand All @@ -148,13 +148,11 @@ private void updateServerConf(String tomcatVersion, Module module, Path confPath
XPath xpath = xPathfactory.newXPath();
XPathExpression exprConnectorShutdown = xpath.compile("/Server[@shutdown='SHUTDOWN']");
XPathExpression exprConnector = xpath.compile("/Server/Service[@name='Catalina']/Connector[@protocol='HTTP/1.1']");
XPathExpression exprConnectorAjp = xpath.compile("/Server/Service[@name='Catalina']/Connector[@protocol='AJP/1.3']");
XPathExpression expr = xpath.compile("/Server/Service[@name='Catalina']/Engine[@name='Catalina']/Host");
XPathExpression exprContext = xpath.compile
("/Server/Service[@name='Catalina']/Engine[@name='Catalina']/Host/Context");

Element portShutdown = (Element) exprConnectorShutdown.evaluate(doc, XPathConstants.NODE);
Element portEAjp = (Element) exprConnectorAjp.evaluate(doc, XPathConstants.NODE);
Element portE = (Element) exprConnector.evaluate(doc, XPathConstants.NODE);
Node hostNode = (Node) expr.evaluate(doc, XPathConstants.NODE);
NodeList nodeList = (NodeList) exprContext.evaluate(doc, XPathConstants.NODESET);
Expand All @@ -166,7 +164,6 @@ private void updateServerConf(String tomcatVersion, Module module, Path confPath
}
}
portShutdown.setAttribute("port", cfg.getAdminPort());
portEAjp.setAttribute("port", cfg.getAjpPort());
portE.setAttribute("port", cfg.getPort());


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ public class TomcatRunConfiguration extends RunConfigurationBase implements RunP
private String moduleName;
private String contextPath;
private String port;
private String ajpPort;
private String adminPort;
private String vmOptions;
private Map<String, String> envOptions;
Expand Down Expand Up @@ -115,13 +114,6 @@ public void setPort(String port) {
this.port = port;
}

public String getAjpPort() {
return ajpPort;
}

public void setAjpPort(String ajpPort) {
this.ajpPort = ajpPort;
}

public String getAdminPort() {
return adminPort;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,6 @@ protected void resetEditorFrom(TomcatRunConfiguration tomcatRunConfiguration) {
if (port != null && !"".equals(port.trim())) {
runnerSetting.getPortField().setText(port);
}
String ajpPort = tomcatRunConfiguration.getAjpPort();
if (ajpPort != null && !"".equals(ajpPort.trim())) {
runnerSetting.getAjpPort().setText(ajpPort);
}
String adminPort = tomcatRunConfiguration.getAdminPort();
if (adminPort != null && !"".equals(adminPort.trim())) {
runnerSetting.getAdminPort().setText(adminPort);
Expand Down Expand Up @@ -107,7 +103,6 @@ protected void applyEditorTo(TomcatRunConfiguration tomcatRunConfiguration) thro
tomcatRunConfiguration.setCustomContext(runnerSetting.getCustomContextField().getText());
tomcatRunConfiguration.setContextPath(runnerSetting.getContextPathField().getText());
tomcatRunConfiguration.setPort(runnerSetting.getPortField().getText());
tomcatRunConfiguration.setAjpPort(runnerSetting.getAjpPort().getText());
tomcatRunConfiguration.setAdminPort(runnerSetting.getAdminPort().getText());
tomcatRunConfiguration.setVmOptions(runnerSetting.getVmOptons().getText());
tomcatRunConfiguration.setEnvOptions(runnerSetting.getEnvOptions().getEnvs());
Expand All @@ -126,7 +121,6 @@ protected JComponent createEditor() {

JTextField contextPathField = runnerSetting.getContextPathField();
JFormattedTextField portField = runnerSetting.getPortField();
JFormattedTextField ajpPort = runnerSetting.getAjpPort();
JFormattedTextField adminPort = runnerSetting.getAdminPort();

JXButton configrationButton = runnerSetting.getConfigrationButton();
Expand Down Expand Up @@ -164,7 +158,6 @@ protected void textChanged(DocumentEvent documentEvent) {
customContextField.addBrowseFolderListener("Context xml", "Choose custom context xml file", project, FileChooserDescriptorFactory.createSingleFileDescriptor().withRoots(baseDir));

portField.setValue(8080);
ajpPort.setValue(8009);
adminPort.setValue(8005);
DefaultFormatterFactory tf = new DefaultFormatterFactory();
NumberFormat format = NumberFormat.getInstance();
Expand All @@ -175,7 +168,6 @@ protected void textChanged(DocumentEvent documentEvent) {
formatter.setMaximum(65535);
tf.setDefaultFormatter(formatter);
portField.setFormatterFactory(tf);
ajpPort.setFormatterFactory(tf);
adminPort.setFormatterFactory(tf);

return runnerSetting.getMainPanel();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
<rowspec value="center:max(d;4px):noGrow"/>
<rowspec value="top:3dlu:noGrow"/>
<rowspec value="center:max(d;4px):noGrow"/>
<rowspec value="top:3dlu:noGrow"/>
<rowspec value="center:max(d;4px):noGrow"/>
<rowspec value="top:4dlu:noGrow"/>
<rowspec value="center:max(d;4px):noGrow"/>
<rowspec value="top:3dlu:noGrow"/>
Expand Down Expand Up @@ -114,7 +112,7 @@
</component>
<component id="7eb04" class="javax.swing.JLabel">
<constraints>
<grid row="14" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<grid row="12" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<forms/>
</constraints>
<properties>
Expand All @@ -123,7 +121,7 @@
</component>
<component id="cbe38" class="com.intellij.ui.RawCommandLineEditor" binding="vmOptons">
<constraints>
<grid row="14" column="2" row-span="1" col-span="3" vsize-policy="3" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false"/>
<grid row="12" column="2" row-span="1" col-span="3" vsize-policy="3" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false"/>
<forms/>
</constraints>
<properties>
Expand All @@ -132,7 +130,7 @@
</component>
<component id="40838" class="javax.swing.JLabel">
<constraints>
<grid row="16" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<grid row="14" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<forms/>
</constraints>
<properties>
Expand All @@ -141,37 +139,17 @@
</component>
<component id="43f5c" class="com.intellij.execution.configuration.EnvironmentVariablesComponent" binding="envOptions">
<constraints>
<grid row="16" column="2" row-span="1" col-span="3" vsize-policy="3" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false"/>
<grid row="14" column="2" row-span="1" col-span="3" vsize-policy="3" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false"/>
<forms/>
</constraints>
<properties>
<text value=""/>
<toolTipText value="Warning: Experimental feature, use with extreme caution."/>
</properties>
</component>
<component id="49ebe" class="javax.swing.JLabel">
<constraints>
<grid row="10" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<forms/>
</constraints>
<properties>
<text value="AJP Port"/>
</properties>
</component>
<component id="9154a" class="javax.swing.JFormattedTextField" binding="ajpPort">
<constraints>
<grid row="10" column="2" row-span="1" col-span="3" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
<forms defaultalign-horz="false"/>
</constraints>
<properties>
<verifyInputWhenFocusTarget value="true"/>
</properties>
</component>
<component id="2be6c" class="javax.swing.JLabel">
<constraints>
<grid row="12" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<grid row="10" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<forms/>
</constraints>
<properties>
Expand All @@ -180,7 +158,7 @@
</component>
<component id="7dbeb" class="javax.swing.JFormattedTextField" binding="adminPort">
<constraints>
<grid row="12" column="2" row-span="1" col-span="3" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<grid row="10" column="2" row-span="1" col-span="3" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
<forms defaultalign-horz="false"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ public class RunnerSetting {
private JXButton configrationButton;
private RawCommandLineEditor vmOptons;
private EnvironmentVariablesComponent envOptions;
private JFormattedTextField ajpPort;
private JFormattedTextField adminPort;
private TextFieldWithBrowseButton customContextField;

Expand Down Expand Up @@ -62,9 +61,6 @@ public JFormattedTextField getPortField() {
return portField;
}

public JFormattedTextField getAjpPort() {
return ajpPort;
}

public JFormattedTextField getAdminPort() {
return adminPort;
Expand Down

0 comments on commit dc01eaf

Please sign in to comment.