/** * @param topic Topic to subscribe to. * @param p Message predicate. */ public void addUserMessageListener(@Nullable final Object topic, @Nullable final IgniteBiPredicate<UUID, ?> p) { if (p != null) { try { if (p instanceof PlatformMessageFilter) ((PlatformMessageFilter)p).initialize(ctx); else ctx.resource().injectGeneric(p); addMessageListener(TOPIC_COMM_USER, new GridUserMessageListener(topic, (IgniteBiPredicate<UUID, Object>)p)); } catch (IgniteCheckedException e) { throw new IgniteException(e); } } }
/** * @param topic Topic to subscribe to. * @param p Message predicate. */ @SuppressWarnings("unchecked") public void addUserMessageListener(@Nullable final Object topic, @Nullable final IgniteBiPredicate<UUID, ?> p) { if (p != null) { try { if (p instanceof PlatformMessageFilter) ((PlatformMessageFilter)p).initialize(ctx); else ctx.resource().injectGeneric(p); addMessageListener(TOPIC_COMM_USER, new GridUserMessageListener(topic, (IgniteBiPredicate<UUID, Object>)p)); } catch (IgniteCheckedException e) { throw new IgniteException(e); } } }
/** * @param topic Topic to unsubscribe from. * @param p Message predicate. */ @SuppressWarnings("unchecked") public void removeUserMessageListener(@Nullable Object topic, IgniteBiPredicate<UUID, ?> p) { try { removeMessageListener(TOPIC_COMM_USER, new GridUserMessageListener(topic, (IgniteBiPredicate<UUID, Object>)p)); } catch (IgniteCheckedException e) { throw new IgniteException(e); } }
/** * @param topic Topic to unsubscribe from. * @param p Message predicate. */ public void removeUserMessageListener(@Nullable Object topic, IgniteBiPredicate<UUID, ?> p) { try { removeMessageListener(TOPIC_COMM_USER, new GridUserMessageListener(topic, (IgniteBiPredicate<UUID, Object>)p)); } catch (IgniteCheckedException e) { throw new IgniteException(e); } }