throw new IllegalArgumentException("unsupported session type: "
+ type);
try {
Session session = (Session) c.newInstance();
if (MBEAN_SERVER != null)
MBEAN_SERVER.registerMBean(new JmxSession(session),
getObjectName("Session-"
+ SESSION_COUNTER.incrementAndGet()));
return session;
} catch (Exception e) {
throw new RuntimeException(e);