Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FISH-1074 Hot Deploy Payara Server application from the Eclipse IDE #41

Merged
merged 5 commits into from
Oct 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,18 @@
<property-editor>
<hint>
<name>aux.text</name>
<value>In debug mode changes can be hot deployed to a local Payara without requiring reloading the application. This pattern indicates resources that when changed do trigger a reload.</value>
<value>In debug mode changes can be hot swapped to a local Payara Server without requiring reloading the application. This pattern indicates resources that when changed do trigger a reload.</value>
</hint>
<property>RestartPattern</property>
</property-editor>
<property-editor>
<visible-when>${Enabled}</visible-when>
<hint>
<name>aux.text</name>
<value>When checked deploys application in the Hot Deploy mode.</value>
</hint>
<property>EnableHotDeploy</property>
</property-editor>
<property-editor>
<hint>
<name>aux.text</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,172 +45,168 @@
* This interface represents the user properties for a Payara server.
*
* <p>
* Layout of this model to create a UI is done in
* Layout of this model to create a UI is done in
* <code>org.eclipse.payara.tools.ui/src/org/eclipse/payara/tools/ui/PayaraUI.sdef</code>
*
* <p>
* This class has direct references to XML elements in that file via
* the XmlBinding annotations.
* This class has direct references to XML elements in that file via the
* XmlBinding annotations.
*
* <p>
* Data storage of this model is in the Server's general attributes, which it is
* coupled to via the {@link PayaraServerModelWorkingCopyAdapter} class.
*/
public interface IPayaraServerModel extends Element {

ElementType TYPE = new ElementType(IPayaraServerModel.class);

// *** Name ***

@Label(standard = "na&me")
@Required
@Service(impl = PayaraServerConfigServices.UniqueServerNameValidationService.class)
ValueProperty PROP_NAME = new ValueProperty(TYPE, "Name");
Value<String> getName();
void setName(String value);


// *** HostName ***

@Label(standard = "&host name")
@Required
ValueProperty PROP_HOST_NAME = new ValueProperty(TYPE, "HostName");
Value<String> getHostName();
void setHostName(String value);


// *** Remote ***

@Type(base = Boolean.class)
@Derived(text = "${ HostName != 'localhost' }")
ValueProperty PROP_REMOTE = new ValueProperty(TYPE, "Remote");
Value<Boolean> getRemote();


// *** Domain path ***

@XmlBinding(path = "domain-path")
@Label(standard = "domain &path")
@Required
@Type(base = Path.class)
@MustExist
@AbsolutePath
@ValidFileSystemResourceType(FOLDER)
@Service(impl = PayaraServerConfigServices.DomainLocationValidationService.class)
@Listeners(PayaraServerConfigServices.DomainLocationListener.class)
@Enablement(expr = "${ ! Remote }")
ValueProperty PROP_DOMAIN_PATH = new ValueProperty(TYPE, "DomainPath");
Value<Path> getDomainPath();
void setDomainPath(Path value);


// *** Admin ***

@XmlBinding(path = "admin-name")
@Label(standard = "admin nam&e")
@Required
@DefaultValue(text = "admin")
ValueProperty PROP_ADMIN_NAME = new ValueProperty(TYPE, "AdminName");
Value<String> getAdminName();
void setAdminName(String value);


// *** Admin pass ***

@XmlBinding(path = "admin-password")
@Label(standard = "admin pass&word")
@SensitiveData
ValueProperty PROP_ADMIN_PASSWORD = new ValueProperty(TYPE, "AdminPassword");
Value<String> getAdminPassword();
void setAdminPassword(String value);


// *** Admin port ***

@Type(base = Integer.class)
@XmlBinding(path = "admin-port")
@Label(standard = "admin p&ort")
@Required
@NumericRange(min = "1025", max = "65535")
@Enablement(expr = "${ Remote }")
ValueProperty PROP_ADMIN_PORT = new ValueProperty(TYPE, "AdminPort");
Value<Integer> getAdminPort();
void setAdminPort(Integer value);


// *** Debug port ***

@Type(base = Integer.class)
@XmlBinding(path = "debug-port")
@Label(standard = "deb&ug port")
@NumericRange(min = "1034", max = "65535")
@DefaultValue(text = "8009")
@Documentation(content =
"For local server you can specify the port on which the server will be debugged. If empty, the current value" +
" from domain.xml will be used.\n For remote servers you may want to specify the debug port to be able to debug your" +
" applications running on the server.")
ValueProperty PROP_DEBUG_PORT = new ValueProperty(TYPE, "DebugPort");
Value<Integer> getDebugPort();
void setDebugPort(Integer value);


// *** Server port ***

@Type(base = Integer.class)
@XmlBinding(path = "server-port")
@Label(standard = "server port")
@Enablement(expr = "false")
ValueProperty PROP_SERVER_PORT = new ValueProperty(TYPE, "ServerPort");
Value<Integer> getServerPort();
void setServerPort(Integer value);


// *** Preserve sessions ***

@Type(base = Boolean.class)
@XmlBinding(path = "preserve-sessions")
@DefaultValue(text = "false")
@Label(standard = "preser&ve sessions across redeployment")
ValueProperty PROP_PRESERVE_SESSIONS = new ValueProperty(TYPE, "PreserveSessions");
Value<Boolean> getPreserveSessions();
void setPreserveSessions(Boolean value);


// *** Use anonymous connections for admin commands ***

@Type(base = Boolean.class)
@XmlBinding(path = "use-anonymous-connections")
@DefaultValue(text = "true")
@Label(standard = "use anon&ymous connections for admin commands")
ValueProperty PROP_USE_ANONYMOUS_CONNECTIONS = new ValueProperty(TYPE, "UseAnonymousConnections");
Value<Boolean> getUseAnonymousConnections();
void setUseAnonymousConnections(Boolean value);


// *** Use JAR archives for deployment ***

@Type(base = Boolean.class)
@XmlBinding(path = "use-jar-deployment")
@DefaultValue(text = "false")
@Label(standard = "use &JAR archives for deployment")
@Enablement(expr = "${ ! Remote }")
ValueProperty PROP_USE_JAR_DEPLOYMENT = new ValueProperty(TYPE, "UseJarDeployment");
Value<Boolean> getUseJarDeployment();
void setUseJarDeployment(Boolean value);

String PROP_RESTART_PATTERN_DEFAULT = "\\.(jar|class|xml)$";
@DefaultValue(text = PROP_RESTART_PATTERN_DEFAULT)
ValueProperty PROP_RESTART_PATTERN = new ValueProperty(TYPE, "RestartPattern");
Value<String> getRestartPattern();
void setRestartPattern(String value);

// <property-editor>AttachDebuggerEarly</property-editor>


boolean PROP_ATTACH_DEBUGGER_DEFAULT = false;
@Type(base = Boolean.class)
@DefaultValue(text = PROP_ATTACH_DEBUGGER_DEFAULT + "")
ValueProperty PROP_ATTACH_DEBUGGER_EARLY = new ValueProperty(TYPE, "AttachDebuggerEarly");
Value<Boolean> getAttachDebuggerEarly();
void setAttachDebuggerEarly(Boolean value);
ElementType TYPE = new ElementType(IPayaraServerModel.class);

// *** Name ***

@Label(standard = "na&me")
@Required
@Service(impl = PayaraServerConfigServices.UniqueServerNameValidationService.class)
ValueProperty PROP_NAME = new ValueProperty(TYPE, "Name");
Value<String> getName();
void setName(String value);

// *** HostName ***

@Label(standard = "&host name")
@Required
ValueProperty PROP_HOST_NAME = new ValueProperty(TYPE, "HostName");
Value<String> getHostName();
void setHostName(String value);

// *** Remote ***

@Type(base = Boolean.class)
@Derived(text = "${ HostName != 'localhost' }")
ValueProperty PROP_REMOTE = new ValueProperty(TYPE, "Remote");
Value<Boolean> getRemote();

// *** Domain path ***

@XmlBinding(path = "domain-path")
@Label(standard = "domain &path")
@Required
@Type(base = Path.class)
@MustExist
@AbsolutePath
@ValidFileSystemResourceType(FOLDER)
@Service(impl = PayaraServerConfigServices.DomainLocationValidationService.class)
@Listeners(PayaraServerConfigServices.DomainLocationListener.class)
@Enablement(expr = "${ ! Remote }")
ValueProperty PROP_DOMAIN_PATH = new ValueProperty(TYPE, "DomainPath");
Value<Path> getDomainPath();
void setDomainPath(Path value);

// *** Admin ***

@XmlBinding(path = "admin-name")
@Label(standard = "admin nam&e")
@Required
@DefaultValue(text = "admin")
ValueProperty PROP_ADMIN_NAME = new ValueProperty(TYPE, "AdminName");
Value<String> getAdminName();
void setAdminName(String value);

// *** Admin pass ***

@XmlBinding(path = "admin-password")
@Label(standard = "admin pass&word")
@SensitiveData
ValueProperty PROP_ADMIN_PASSWORD = new ValueProperty(TYPE, "AdminPassword");
Value<String> getAdminPassword();
void setAdminPassword(String value);

// *** Admin port ***

@Type(base = Integer.class)
@XmlBinding(path = "admin-port")
@Label(standard = "admin p&ort")
@Required
@NumericRange(min = "1025", max = "65535")
@Enablement(expr = "${ Remote }")
ValueProperty PROP_ADMIN_PORT = new ValueProperty(TYPE, "AdminPort");
Value<Integer> getAdminPort();
void setAdminPort(Integer value);

// *** Debug port ***

@Type(base = Integer.class)
@XmlBinding(path = "debug-port")
@Label(standard = "deb&ug port")
@NumericRange(min = "1034", max = "65535")
@DefaultValue(text = "8009")
@Documentation(content =
"For local server you can specify the port on which the server will be debugged. If empty, the current value" +
" from domain.xml will be used.\n For remote servers you may want to specify the debug port to be able to debug your" +
" applications running on the server.")
ValueProperty PROP_DEBUG_PORT = new ValueProperty(TYPE, "DebugPort");
Value<Integer> getDebugPort();
void setDebugPort(Integer value);

// *** Server port ***

@Type(base = Integer.class)
@XmlBinding(path = "server-port")
@Label(standard = "server port")
@Enablement(expr = "false")
ValueProperty PROP_SERVER_PORT = new ValueProperty(TYPE, "ServerPort");
Value<Integer> getServerPort();
void setServerPort(Integer value);

// *** Preserve sessions ***

@Type(base = Boolean.class)
@XmlBinding(path = "preserve-sessions")
@DefaultValue(text = "false")
@Label(standard = "preser&ve sessions across redeployment")
ValueProperty PROP_PRESERVE_SESSIONS = new ValueProperty(TYPE, "PreserveSessions");
Value<Boolean> getPreserveSessions();
void setPreserveSessions(Boolean value);

// *** Use anonymous connections for admin commands ***

@Type(base = Boolean.class)
@XmlBinding(path = "use-anonymous-connections")
@DefaultValue(text = "true")
@Label(standard = "use anon&ymous connections for admin commands")
ValueProperty PROP_USE_ANONYMOUS_CONNECTIONS = new ValueProperty(TYPE, "UseAnonymousConnections");
Value<Boolean> getUseAnonymousConnections();
void setUseAnonymousConnections(Boolean value);

// *** Use JAR archives for deployment ***

@Type(base = Boolean.class)
@XmlBinding(path = "use-jar-deployment")
@DefaultValue(text = "false")
@Label(standard = "use &JAR archives for deployment")
@Enablement(expr = "${ ! Remote }")
ValueProperty PROP_USE_JAR_DEPLOYMENT = new ValueProperty(TYPE, "UseJarDeployment");
Value<Boolean> getUseJarDeployment();
void setUseJarDeployment(Boolean value);

String PROP_RESTART_PATTERN_DEFAULT = "\\.(jar|class|xml)$";
@DefaultValue(text = PROP_RESTART_PATTERN_DEFAULT)
ValueProperty PROP_RESTART_PATTERN = new ValueProperty(TYPE, "RestartPattern");
Value<String> getRestartPattern();
void setRestartPattern(String value);

String PROP_ENABLE_HOT_DEPLOY_DEFAULT = "false";
@Type(base = Boolean.class)
@XmlBinding(path = "enable-hot-deploy")
@DefaultValue(text = PROP_ENABLE_HOT_DEPLOY_DEFAULT)
@Label(standard = "Enable the Hot Deploy mode")
@Enablement(expr = "${ ! Remote }")
ValueProperty PROP_ENABLE_HOT_DEPLOY = new ValueProperty(TYPE, "EnableHotDeploy");
Value<Boolean> getEnableHotDeploy();
void setEnableHotDeploy(Boolean value);

boolean PROP_ATTACH_DEBUGGER_DEFAULT = false;
@Type(base = Boolean.class)
@DefaultValue(text = PROP_ATTACH_DEBUGGER_DEFAULT + "")
ValueProperty PROP_ATTACH_DEBUGGER_EARLY = new ValueProperty(TYPE, "AttachDebuggerEarly");
Value<Boolean> getAttachDebuggerEarly();
void setAttachDebuggerEarly(Boolean value);
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
******************************************************************************/

/******************************************************************************
* Copyright (c) 2019 Payara Foundation
* Copyright (c) 2019-2021 Payara Foundation
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
Expand All @@ -31,6 +31,7 @@
import static org.eclipse.payara.tools.sapphire.IPayaraServerModel.PROP_SERVER_PORT;
import static org.eclipse.payara.tools.sapphire.IPayaraServerModel.PROP_USE_ANONYMOUS_CONNECTIONS;
import static org.eclipse.payara.tools.sapphire.IPayaraServerModel.PROP_USE_JAR_DEPLOYMENT;
import static org.eclipse.payara.tools.sapphire.IPayaraServerModel.PROP_ENABLE_HOT_DEPLOY;
import static org.eclipse.payara.tools.server.PayaraServer.ATTR_ADMIN;
import static org.eclipse.payara.tools.server.PayaraServer.ATTR_ADMINPASS;
import static org.eclipse.payara.tools.server.PayaraServer.ATTR_ADMINPORT;
Expand Down Expand Up @@ -169,6 +170,10 @@ public void dispose() {
if (propertyDef == PROP_USE_JAR_DEPLOYMENT) {
return new AttributeValueBinding(workingCopy, ATTR_JARDEPLOY);
}

if (propertyDef == PROP_ENABLE_HOT_DEPLOY) {
return new AttributeValueBinding(workingCopy, PROP_ENABLE_HOT_DEPLOY.name());
}

if (propertyDef == PROP_RESTART_PATTERN) {
return new AttributeValueBinding(workingCopy, PROP_RESTART_PATTERN.name());
Expand Down
Loading