Skip to content

Commit

Permalink
Merge pull request #3915 from peedeeboy/feature/tomcat_startup_timeou…
Browse files Browse the repository at this point in the history
…t_parameter

[#3898] Parameterize Tomcat startup/shutdown timeouts.
  • Loading branch information
matthiasblaesing authored Apr 2, 2022
2 parents 59d5dad + 39c1a97 commit f47ca71
Show file tree
Hide file tree
Showing 6 changed files with 250 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -237,3 +237,7 @@ CustomizerDeployment.deplolymentTimeoutSpinner.accessible.description=Deployment
CustomizerDeployment.deplolymentTimeoutLabel.tooltip=Time to wait before assuming a deployment has failed

CustomizerDeployment.deplolymentTimeoutSpinner.tooltip=Time to wait before assuming a deployment has failed

CustomizerStartup.timeoutsLabel.txt=Timeouts [s]\:
CustomizerStartup.startupTimeout.label=Startup:
CustomizerStartup.shutdownTimeout.label=Shutdown:
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ public class CustomizerDataSupport {
private SpinnerNumberModel shutdownPortModel;
private SpinnerNumberModel debugPortModel;
private SpinnerNumberModel deploymentTimeoutModel;
private SpinnerNumberModel startupTimeoutModel;
private SpinnerNumberModel shutdownTimeoutModel;
private ButtonModel driverDeploymentModel;

// model dirty flags
Expand All @@ -97,6 +99,8 @@ public class CustomizerDataSupport {
private boolean debugPortModelFlag;
private boolean deploymentTimeoutModelFlag;
private boolean driverDeploymentModelFlag;
private boolean startupTimeoutModelFlag;
private boolean shutdownTimeoutModelFlag;

private TomcatProperties tp;
private TomcatManager tm;
Expand Down Expand Up @@ -315,6 +319,24 @@ public void modelChanged() {
store(); // This is just temporary until the server manager has OK and Cancel buttons
}
});

// startupTimeoutModel
startupTimeoutModel = new SpinnerNumberModel(tp.getStartupTimeout(), 1, Integer.MAX_VALUE, 1);
startupTimeoutModel.addChangeListener(new ModelChangeAdapter() {
public void modelChanged() {
startupTimeoutModelFlag = true;
store(); // This is just temporary until the server manager has OK and Cancel buttons
}
});

// shutdownTimeoutModel
shutdownTimeoutModel = new SpinnerNumberModel(tp.getShutdownTimeout(), 1, Integer.MAX_VALUE, 1);
shutdownTimeoutModel.addChangeListener(new ModelChangeAdapter() {
public void modelChanged() {
shutdownTimeoutModelFlag = true;
store(); // This is just temporary until the server manager has OK and Cancel buttons
}
});
}


Expand Down Expand Up @@ -444,6 +466,14 @@ public SpinnerNumberModel getDeploymentTimeoutModel() {
return deploymentTimeoutModel;
}

public SpinnerNumberModel getStartupTimeoutModel() {
return startupTimeoutModel;
}

public SpinnerNumberModel getShutdownTimeoutModel() {
return shutdownTimeoutModel;
}

public ButtonModel getDriverDeploymentModel() {
return driverDeploymentModel;
}
Expand Down Expand Up @@ -554,6 +584,16 @@ private void store() {
tp.setDriverDeployment(driverDeploymentModel.isSelected());
driverDeploymentModelFlag = false;
}

if (startupTimeoutModelFlag) {
tp.setStartupTimeout((Integer)startupTimeoutModel.getValue());
startupTimeoutModelFlag = false;
}

if (shutdownTimeoutModelFlag) {
tp.setShutdownTimeout((Integer)shutdownTimeoutModel.getValue());
shutdownTimeoutModelFlag = false;
}
}

/** Create a Document initialized by the specified text parameter, which may be null */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,15 @@
-->

<Form version="1.2" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
<Form version="1.2" maxVersion="1.2" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
<NonVisualComponents>
<Component class="javax.swing.ButtonGroup" name="buttonGroup1">
</Component>
</NonVisualComponents>
<AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="true"/>
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
Expand Down Expand Up @@ -84,12 +86,12 @@
</Component>
<Component class="javax.swing.JCheckBox" name="jCheckBox1">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/netbeans/modules/tomcat5/customizer/Bundle.properties" key="TXT_CustomScript" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
<Property name="model" type="javax.swing.ButtonModel" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
<Connection code="custData.getCustomScriptModel()" type="code"/>
</Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/netbeans/modules/tomcat5/customizer/Bundle.properties" key="TXT_CustomScript" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
</Properties>
<AccessibilityProperties>
<Property name="AccessibleContext.accessibleName" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
Expand Down Expand Up @@ -133,12 +135,12 @@
</Component>
<Component class="javax.swing.JCheckBox" name="jCheckBox4">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/netbeans/modules/tomcat5/customizer/Bundle.properties" key="TXT_ForceShutdown" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
<Property name="model" type="javax.swing.ButtonModel" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
<Connection code="custData.getForceStopModel()" type="code"/>
</Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/netbeans/modules/tomcat5/customizer/Bundle.properties" key="TXT_ForceShutdown" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
</Properties>
<AccessibilityProperties>
<Property name="AccessibleContext.accessibleName" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
Expand All @@ -159,15 +161,15 @@
</Component>
<Component class="javax.swing.JRadioButton" name="jRadioButton1">
<Properties>
<Property name="model" type="javax.swing.ButtonModel" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
<Connection code="custData.getSharedMemModel()" type="code"/>
</Property>
<Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
<ComponentRef name="buttonGroup1"/>
</Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/netbeans/modules/tomcat5/customizer/Bundle.properties" key="TXT_SharedMemName" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
<Property name="model" type="javax.swing.ButtonModel" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
<Connection code="custData.getSharedMemModel()" type="code"/>
</Property>
</Properties>
<AccessibilityProperties>
<Property name="AccessibleContext.accessibleName" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
Expand All @@ -188,15 +190,15 @@
</Component>
<Component class="javax.swing.JRadioButton" name="jRadioButton2">
<Properties>
<Property name="model" type="javax.swing.ButtonModel" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
<Connection code="custData.getSocketModel()" type="code"/>
</Property>
<Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
<ComponentRef name="buttonGroup1"/>
</Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/netbeans/modules/tomcat5/customizer/Bundle.properties" key="TXT_SocketPort" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
<Property name="model" type="javax.swing.ButtonModel" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
<Connection code="custData.getSocketModel()" type="code"/>
</Property>
</Properties>
<AccessibilityProperties>
<Property name="AccessibleContext.accessibleName" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
Expand Down Expand Up @@ -273,7 +275,7 @@
</AccessibilityProperties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="0" gridY="6" gridWidth="0" gridHeight="0" fill="0" ipadX="0" ipadY="0" insetsTop="5" insetsLeft="12" insetsBottom="12" insetsRight="0" anchor="16" weightX="0.0" weightY="1.0"/>
<GridBagConstraints gridX="0" gridY="9" gridWidth="0" gridHeight="0" fill="0" ipadX="0" ipadY="0" insetsTop="5" insetsLeft="12" insetsBottom="12" insetsRight="0" anchor="16" weightX="0.0" weightY="1.0"/>
</Constraint>
</Constraints>
</Component>
Expand All @@ -295,5 +297,77 @@
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JLabel" name="timeoutsLabel">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/netbeans/modules/tomcat5/customizer/Bundle.properties" key="CustomizerStartup.timeoutsLabel.txt" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="0" gridY="6" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="11" insetsLeft="12" insetsBottom="0" insetsRight="0" anchor="17" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JLabel" name="startupTimeoutLabel">
<Properties>
<Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
<ComponentRef name="startupTimeoutSpinner"/>
</Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/netbeans/modules/tomcat5/customizer/Bundle.properties" key="CustomizerStartup.startupTimeout.label" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="0" gridY="7" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="5" insetsLeft="34" insetsBottom="0" insetsRight="0" anchor="17" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JSpinner" name="startupTimeoutSpinner">
<Properties>
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
<Connection code="custData.getStartupTimeoutModel()" type="code"/>
</Property>
<Property name="editor" type="javax.swing.JComponent" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
<Connection code="new NumberEditor(startupTimeoutSpinner, &quot;#&quot;)" type="code"/>
</Property>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="2" gridY="7" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="5" insetsLeft="5" insetsBottom="0" insetsRight="0" anchor="17" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JLabel" name="shutdownTimeoutLabel">
<Properties>
<Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
<ComponentRef name="shutdownTimeoutSpinner"/>
</Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/netbeans/modules/tomcat5/customizer/Bundle.properties" key="CustomizerStartup.shutdownTimeout.label" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="0" gridY="8" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="5" insetsLeft="34" insetsBottom="0" insetsRight="0" anchor="17" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JSpinner" name="shutdownTimeoutSpinner">
<Properties>
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
<Connection code="custData.getShutdownTimeoutModel()" type="code"/>
</Property>
<Property name="editor" type="javax.swing.JComponent" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
<Connection code="new NumberEditor(shutdownTimeoutSpinner, &quot;#&quot;)" type="code"/>
</Property>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="2" gridY="8" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="5" insetsLeft="5" insetsBottom="0" insetsRight="0" anchor="17" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
</SubComponents>
</Form>
Loading

0 comments on commit f47ca71

Please sign in to comment.