@Test(expected = IllegalArgumentException.class) public void testGetOrCreateGroupBadNamespace() { ConnectionManager.getOrCreateGroup(""); }
public static ConnectionGroup getOrCreateGroup(String namespace) { AssertUtil.assertNotBlank(namespace, "namespace should not be empty"); ConnectionGroup group = CONN_MAP.get(namespace); if (group == null) { synchronized (CREATE_LOCK) { if ((group = CONN_MAP.get(namespace)) == null) { group = new ConnectionGroup(namespace); CONN_MAP.put(namespace, group); } } } return group; }
ConnectionManager { public static ConnectionGroup getOrCreateGroup(String namespace) { AssertUtil.assertNotBlank(namespace, "namespace should not be empty"); ConnectionGroup group = CONN_MAP.get(namespace); if (group == null) { synchronized (CREATE_LOCK) { if ((group = CONN_MAP.get(namespace)) == null) { group = new ConnectionGroup(namespace); CONN_MAP.put(namespace, group); } } } return group; } }
ConnectionManager { public static ConnectionGroup getOrCreateGroup(String namespace) { AssertUtil.assertNotBlank(namespace, "namespace should not be empty"); ConnectionGroup group = CONN_MAP.get(namespace); if (group == null) { synchronized (CREATE_LOCK) { if ((group = CONN_MAP.get(namespace)) == null) { group = new ConnectionGroup(namespace); CONN_MAP.put(namespace, group); } } } return group; } private  ConnectionManager(); }
ConnectionManager { public static ConnectionGroup getOrCreateGroup(String namespace) { AssertUtil.assertNotBlank(namespace, "namespace should not be empty"); ConnectionGroup group = CONN_MAP.get(namespace); if (group == null) { synchronized (CREATE_LOCK) { if ((group = CONN_MAP.get(namespace)) == null) { group = new ConnectionGroup(namespace); CONN_MAP.put(namespace, group); } } } return group; } private  ConnectionManager(); static int getConnectedCount(String namespace); static ConnectionGroup getOrCreateGroup(String namespace); static void removeConnection(String address); static void removeConnection(String namespace, String address); static ConnectionGroup addConnection(String namespace, String address); static ConnectionGroup getOrCreateConnectionGroup(String namespace); static ConnectionGroup getConnectionGroup(String namespace); }
ConnectionManager { public static ConnectionGroup getOrCreateGroup(String namespace) { AssertUtil.assertNotBlank(namespace, "namespace should not be empty"); ConnectionGroup group = CONN_MAP.get(namespace); if (group == null) { synchronized (CREATE_LOCK) { if ((group = CONN_MAP.get(namespace)) == null) { group = new ConnectionGroup(namespace); CONN_MAP.put(namespace, group); } } } return group; } private  ConnectionManager(); static int getConnectedCount(String namespace); static ConnectionGroup getOrCreateGroup(String namespace); static void removeConnection(String address); static void removeConnection(String namespace, String address); static ConnectionGroup addConnection(String namespace, String address); static ConnectionGroup getOrCreateConnectionGroup(String namespace); static ConnectionGroup getConnectionGroup(String namespace);  }