public void validate() throws InvalidPropertyException
{
if (destinationType != null
&& ! destinationType.equals("javax.jms.Queue")
&& ! destinationType.equals("javax.jms.Topic"))
throw new InvalidPropertyException("Invalid destination type: "
+ destinationType);
if (destination == null)
throw new InvalidPropertyException("Missing destination property.");
if (acknowledgeMode != null
&& ! acknowledgeMode.equals(AUTO_ACKNOWLEDGE)
&& ! acknowledgeMode.equals(DUPS_OK_ACKNOWLEDGE))
throw new InvalidPropertyException("Invalid acknowledge mode: "
+ acknowledgeMode);
if (subscriptionDurability != null) {
if (subscriptionDurability.equals("Durable")
&& destinationType.equals("javax.jms.Queue"))
throw new InvalidPropertyException("Can't set a durable subscription "
+ "on a JMS queue.");
if (subscriptionDurability.equals("Durable")
&& subscriptionName == null)
throw new InvalidPropertyException("Missing durable subscription name.");
}
}