boolean durable)
throws MessagingException {
// Check for a null listener
if (listener == null) {
throw new MessagingException("MessageListener may not be null");
}
// Check for null properties
if (connectionProperties == null) {
throw new MessagingException("Connection properties may not be null");
}
// Check for required property values
String initialContextFactory =
connectionProperties.getProperty(Context.INITIAL_CONTEXT_FACTORY);
String providerUrl =
connectionProperties.getProperty(Context.PROVIDER_URL);
String connectionFactoryName =
connectionProperties.getProperty(JMSManager.CONNECTION_FACTORY_NAME);
if (initialContextFactory == null
|| providerUrl == null
|| connectionFactoryName == null) {
throw new MessagingException("Propery values for "
+ "'java.naming.factory.initial', "
+ "'java.naming.provider.url', and"
+ "'connection.factory.name' must be provided "
+ "in order to initialize a messaging client");
}
// Check for valid client ID if durable subscriptions are required
if (durable) {
if (clientId == null || clientId.equals("")) {
throw new MessagingException("ClientId must be "
+ "specified for durable subscriptions");
}
}
m_clientId = clientId;