Skip to content

Commit

Permalink
Remove preserveState parameter support
Browse files Browse the repository at this point in the history
  • Loading branch information
sajinieKavindya committed Dec 13, 2024
1 parent e5073be commit eb0016d
Showing 1 changed file with 1 addition and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,6 @@ public class InboundEndpoint implements AspectConfigurable, ManagedLifecycle {
private SynapseEnvironment synapseEnvironment;
private InboundRequestProcessor inboundRequestProcessor;
private Registry registry;
/**
* This property determines whether the inbound endpoint should preserve its state
* across server restarts or configuration updates.
* */
private boolean preserveState = false;
/** car file name which this endpoint deployed from */
private String artifactContainerName;
/** Whether the deployed inbound endpoint is edited via the management console */
Expand All @@ -88,7 +83,6 @@ public void init(SynapseEnvironment se) {
log.info("Initializing Inbound Endpoint: " + getName());
synapseEnvironment = se;
registry = se.getSynapseConfiguration().getRegistry();
setPreserveState();
startInPausedMode = startInPausedMode();
inboundRequestProcessor = getInboundRequestProcessor();
if (inboundRequestProcessor != null) {
Expand Down Expand Up @@ -175,24 +169,6 @@ private void resolveSystemSecureVaultProperties(Properties props) {
}
}

/**
* Configures the `preserveState` property for the inbound endpoint.
* <p>
* This method checks if the parameter {@code INBOUND_ENDPOINT_PRESERVE_STATE} is defined.
* If the parameter exists, its value is parsed as a boolean and assigned to the `preserveState` variable.
* </p>
*
* @see InboundEndpointConstants#INBOUND_ENDPOINT_PRESERVE_STATE
*/
private void setPreserveState() {
if (getParameter(InboundEndpointConstants.INBOUND_ENDPOINT_PRESERVE_STATE) != null) {
preserveState = Boolean.parseBoolean(getParameter(InboundEndpointConstants.INBOUND_ENDPOINT_PRESERVE_STATE));
}
if (!preserveState) {
deleteInboundEndpointStateInRegistry();
}
}

/**
* Remove inbound endpoints.
* <p>
Expand All @@ -209,9 +185,6 @@ public void destroy(boolean removeTask) {
} else {
inboundRequestProcessor.destroy();
}
if (!preserveState) {
deleteInboundEndpointStateInRegistry();
}
} catch (Exception e) {
log.error("Unable to destroy Inbound endpoint", e);
}
Expand Down Expand Up @@ -478,7 +451,7 @@ public void addHandler(MessagingHandler handler) {
* @param state the {@link InboundEndpointState} to be saved in the registry
*/
private void setInboundEndpointStateInRegistry(InboundEndpointState state) {
if (Objects.isNull(registry) && preserveState) {
if (Objects.isNull(registry)) {
log.warn("Registry not available! The state of the Inbound Endpoint will not be saved.");
return;
}
Expand Down Expand Up @@ -517,9 +490,6 @@ private void deleteInboundEndpointStateInRegistry() {
*/
private boolean startInPausedMode() {

if (!preserveState) {
return isSuspend();
}
if (getInboundEndpointStateFromRegistry() == InboundEndpointState.INITIAL) {
return isSuspend();
}
Expand Down

0 comments on commit eb0016d

Please sign in to comment.