public void setClientID(String clientID) { try { if (lockClientID) throw new IllegalStateException("ClientID is already set by the provider."); if (connection == null) throw new JMSException("Underlying connection is closed"); connection.setClientID(clientID); lockClientID = true; } catch (InvalidClientIDException e) { throw new InvalidClientIDRuntimeException(e.getMessage(), e.getErrorCode(), e); } catch (IllegalStateException e) { throw new IllegalStateRuntimeException(e.getMessage(), e.getErrorCode(), e); } catch (JMSException e) { throw new JMSRuntimeException(e.getMessage(), e.getErrorCode(), e); } }
public javax.jms.JMSConsumer createSharedConsumer(Topic topic, String sharedSubscriptionName, String messageSelector) { connection.lockClientID(); try { return new JMSConsumer(session.createSharedConsumer(topic, sharedSubscriptionName, messageSelector)); } catch (InvalidDestinationException e) { throw new InvalidDestinationRuntimeException(e.getMessage(), e.getErrorCode(), e); } catch (InvalidSelectorException e) { throw new InvalidSelectorRuntimeException(e.getMessage(), e.getErrorCode(), e); } catch (IllegalStateException e) { throw new IllegalStateRuntimeException(e.getMessage(), e.getErrorCode(), e); } catch (JMSException e) { if (logger.isLoggable(BasicLevel.DEBUG)) logger.log(BasicLevel.DEBUG, "Unable to crate shared consumer " + e.getMessage()); throw new JMSRuntimeException("Unable to create shared consumer " + e.getMessage(), e.getErrorCode(), e); } finally { if (connection.getAutoStart()) connection.start(); } }
public javax.jms.JMSConsumer createSharedDurableConsumer(Topic topic, String name, String messageSelector) { connection.lockClientID(); try { return new JMSConsumer(session.createSharedDurableConsumer(topic, name, messageSelector)); } catch (InvalidDestinationException e) { throw new InvalidDestinationRuntimeException(e.getMessage(), e.getErrorCode(), e); } catch (InvalidSelectorException e) { throw new InvalidSelectorRuntimeException(e.getMessage(), e.getErrorCode(), e); } catch (IllegalStateException e) { throw new IllegalStateRuntimeException(e.getMessage(), e.getErrorCode(), e); } catch (JMSException e) { if (logger.isLoggable(BasicLevel.DEBUG)) logger.log(BasicLevel.DEBUG, "Unable to crate shared durable consumer " + e.getMessage()); throw new JMSRuntimeException("Unable to create shared durable consumer " + e.getMessage(), e.getErrorCode(), e); } finally { if (connection.getAutoStart()) connection.start(); } }