use of jakarta.jms.InvalidClientIDRuntimeException in project openmq by eclipse-ee4j.
the class JMSContextImpl method checkClientID.
/**
* Check that the specified clientID is not null or an empty string. If it is, log and throw a
* InvalidClientIDRuntimeException.
*/
protected void checkClientID(String clientID) {
if (clientID == null || (clientID.trim().length() == 0)) {
String errorString = AdministeredObject.cr.getKString(ClientResources.X_INVALID_CLIENT_ID, "\"\"");
InvalidClientIDRuntimeException jmse = new jakarta.jms.InvalidClientIDRuntimeException(errorString, ClientResources.X_INVALID_CLIENT_ID);
ExceptionHandler.throwJMSRuntimeException(jmse);
}
}
use of jakarta.jms.InvalidClientIDRuntimeException in project openmq by eclipse-ee4j.
the class JMSContextImpl method setClientID.
@Override
public void setClientID(String clientID) {
// this method is not permitted in the Java EE web or EJB containers
if (containerType == ContainerType.JavaEE_Web_or_EJB) {
// "This method may not be called in a Java EE web or EJB container"
String errorString = AdministeredObject.cr.getKString(ClientResources.X_FORBIDDEN_IN_JAVAEE_WEB_EJB);
JMSRuntimeException jmsre = new com.sun.messaging.jms.MQRuntimeException(errorString, ClientResources.X_FORBIDDEN_IN_JAVAEE_WEB_EJB);
ExceptionHandler.throwJMSRuntimeException(jmsre);
}
// may throw JMSRuntimeException
checkNotClosed();
// may throw IllegalStateRuntimeException
checkSetClientIDAllowed();
// may throw InvalidClientIDRuntimeException
checkClientID(clientID);
if (connection instanceof ContextableConnection) {
((ContextableConnection) connection)._setClientIDForContext(clientID);
} else {
// for debugging
throw new RuntimeException("Not yet implemented for " + connection.getClass());
}
disallowSetClientID();
}
Aggregations