OW2 Consortium joram

Compare Revisions

Ignore whitespace Rev 6425 → Rev 6426

/trunk/joram/joram/shared/src/main/java/org/objectweb/joram/shared/admin/AdminCommandConstant.java
34,10 → 34,11
public static final int CMD_STOP_HANDLER = 7;
public static final int CMD_INVOKE_STATIC = 8;
public static final int CMD_ADD_CLIENTID = 9;
public static final int CMD_SET_REDELIVERY_DELAY = 10;
 
public static final String[] commandNames = { "CMD_NO", "CMD_ADD_INTERCEPTORS", "CMD_REMOVE_INTERCEPTORS",
"CMD_GET_INTERCEPTORS", "CMD_REPLACE_INTERCEPTORS", "CMD_SET_PROPERTIES", "CMD_START_HANDLER",
"CMD_STOP_HANDLER", "CMD_INVOKE_STATIC", "CMD_ADD_CLIENTID" };
"CMD_STOP_HANDLER", "CMD_INVOKE_STATIC", "CMD_ADD_CLIENTID", "CMD_SET_REDELIVERY_DELAY" };
 
/** use by destination */
public static final String INTERCEPTORS = "jms_joram_interceptors";
81,5 → 82,6
/** Used by AdminTopic to invoke a static method */
public static final String INVOKE_METHOD_RESULT = "jms_joram_invoke_result";
/** Used by UserAgent and Destination to set the redeliveryDelay attribute */
public static final String REDELIVERY_DELAY = "joram.jms.redeliveryDelay";
}
/trunk/joram/joram/mom/core/src/main/java/org/objectweb/joram/mom/proxies/UserAgent.java
148,9 → 148,11
import org.objectweb.joram.shared.client.XACnxRollback;
import org.objectweb.joram.shared.excepts.AccessException;
import org.objectweb.joram.shared.excepts.DestinationException;
import org.objectweb.joram.shared.excepts.MessageValueException;
import org.objectweb.joram.shared.excepts.MomException;
import org.objectweb.joram.shared.excepts.RequestException;
import org.objectweb.joram.shared.excepts.StateException;
import org.objectweb.joram.shared.messages.ConversionHelper;
import org.objectweb.joram.shared.messages.MessageHelper;
import org.objectweb.util.monolog.api.BasicLevel;
import org.objectweb.util.monolog.api.Logger;
3458,6 → 3460,22
}
break;
 
case AdminCommandConstant.CMD_SET_REDELIVERY_DELAY:
prop = request.getProp();
if (prop != null && prop.containsKey(AdminCommandConstant.REDELIVERY_DELAY)) {
int reDeliveryDelay;
try {
reDeliveryDelay = ConversionHelper.toInt(prop.get(AdminCommandConstant.REDELIVERY_DELAY));
setRedeliveryDelay(reDeliveryDelay);
} catch (MessageValueException e) {
if (logger.isLoggable(BasicLevel.WARN))
logger.log(BasicLevel.WARN, "EXCEPTION:: AdminCommandConstant handling [" + getName() + "] set the redelivery delay", e);
}
} else {
throw new Exception("redeliveryDelay undefined.");
}
break;
default:
throw new Exception("Bad command : \"" + request.getCommand() + "\"");
}
/trunk/joram/joram/client/jms/src/main/java/org/objectweb/joram/client/jms/admin/User.java
889,6 → 889,19
}
/**
* Set redeliveryDelay attribute.
*
* @param redeliveryDelay The delay use to wait before re-delivering messages after a deny.
* @throws ConnectException
* @throws AdminException
*/
public void setRedeliveryDelay(int redeliveryDelay) throws ConnectException, AdminException {
Properties properties = new Properties();
properties.put(AdminCommandConstant.REDELIVERY_DELAY, "" + redeliveryDelay);
getWrapper().processAdmin(getProxyId(), AdminCommandConstant.CMD_SET_REDELIVERY_DELAY, properties);
}
 
/**
* @deprecated
*/
public Message readMessage(String subName,
/trunk/joram/joram/client/jms/src/main/java/org/objectweb/joram/client/jms/Queue.java
34,6 → 34,7
import org.objectweb.joram.client.jms.admin.AdminException;
import org.objectweb.joram.client.jms.admin.AdminModule;
import org.objectweb.joram.shared.admin.AddRemoteDestination;
import org.objectweb.joram.shared.admin.AdminCommandConstant;
import org.objectweb.joram.shared.admin.ClearQueue;
import org.objectweb.joram.shared.admin.ClusterAdd;
import org.objectweb.joram.shared.admin.ClusterLeave;
670,4 → 671,21
// public void resetDefaultDMQ() throws ConnectException, AdminException {
// getWrapper().setDefaultDMQ(null);
// }
/**
* Set redeliveryDelay attribute.
*
* @param redeliveryDelay The delay use to wait before re-delivering messages after a deny.
* @throws ConnectException
* @throws AdminException
*/
public void setRedeliveryDelay(int redeliveryDelay) throws ConnectException, AdminException {
// Note: We could use the getWrapper().processAdmin method with the corresponding
// AdminCommandConstant.CMD_SET_REDELIVERY_DELAY command (this process is used to
// configure redeliveryDelay of UserAgent). In this case we have to overload the
// processAdminCommand in the MOM Queue class.
Properties properties = new Properties();
properties.setProperty(Queue.REDELIVERY_DELAY, "5");
setProperties(properties);
}
}