Commit d85ce245 authored by Andre Freyssinet's avatar Andre Freyssinet
Browse files

Allows to fix a destination in memory, it forces the preload during

server initialization (JORAM-358).
parent b5c5769c
......@@ -410,10 +410,18 @@ public abstract class Destination extends Agent implements DestinationMBean {
logger.log(BasicLevel.ERROR, this + ": error setting destination period", e);
}
}
boolean fixedInMemory = false;
if (prop != null && prop.containsKey(DestinationConstants.FIXED_IN_MEMORY))
fixedInMemory = ConversionHelper.toBoolean(prop.get(DestinationConstants.FIXED_IN_MEMORY));
if (firstTime) {
period = newPeriod;
fixed = fixedInMemory;
} else {
setPeriod(newPeriod);
if (fixedInMemory)
logger.log(BasicLevel.ERROR, this + ": cannot fix already created destination in memory.");
}
interceptorsProp = null;
......
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2009 - 2019 ScalAgent Distributed Technologies
* Copyright (C) 2009 - 2020 ScalAgent Distributed Technologies
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -35,6 +35,12 @@ public final class DestinationConstants {
public static final String REDELIVERY_DELAY = "redeliveryDelay";
public static final String DELIVERY_DELAY = "deliveryDelay";
/**
* Name of property allowing to force the destination to be always in memory.
* By side effect the destination is pre-loaded during server initialization.
*/
public static final String FIXED_IN_MEMORY = "fixedInMemory";
/** The property name for the distribution handler class name. */
public static final String DISTRIBUTION_CLASS_NAME = "distribution.className";
/** */
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment