@LiveObject @SuppressWarnings("serial") public class Topic extends Destination
/** * When an Entry is inserted, updated, or arrives via a partition transfer need to ensure that the MBean * for this {@link Topic} is properly visible. * * @param entry The {@link BinaryEntry} provided by the LiveObjectInterceptor */ @OnInserted @OnUpdated @OnArrived @OnRestored public void onChanged(BinaryEntry entry) { if (logger.isLoggable(Level.FINER)) { logger.log(Level.FINER, "Topic:onChanged identifier:{0}", getIdentifier()); } MessagingMBeanManager MBeanManager = MessagingMBeanManager.getInstance(); MBeanManager.registerMBean(this, TopicProxy.class, MBeanManager.buildTopicMBeanName(getIdentifier())); }
/** * When a {@link Topic} is removed from the cache or is removed via a departing partition * need to unregister its MBean. * * @param entry The {@link BinaryEntry} provided by the LiveObjectInterceptor */ @OnRemoved @OnDeparting public void onRemoved(BinaryEntry entry) { if (logger.isLoggable(Level.FINER)) { logger.log(Level.FINER, "Topic:onRemoved identifier:{0}", getIdentifier()); } MessagingMBeanManager MBeanManager = MessagingMBeanManager.getInstance(); MBeanManager.unregisterMBean(this, MBeanManager.buildTopicMBeanName(getIdentifier())); }
@OnInserted @OnArrived @OnRestored public void onEntryInserted(BinaryEntry entry)
/** * An entry has been updated. * * @param entry the BinaryEntry */ @OnUpdated public void onEntryUpdated(BinaryEntry entry) { if (logger.isLoggable(Level.FINER)) { logger.log(Level.FINER, "Scheduling the EventChannelController for {0} to distribute available events.", new Object[] {this}); } ResourceRegistry registry = entry.getContext().getManager().getCacheFactory().getResourceRegistry(); EventChannelControllerManager manager = registry.getResource(EventChannelControllerManager.class); // when a subscription is update we assume we need to schedule distribution final EventChannelController controller = manager.getEventChannelController(distributorIdentifier, controllerIdentifier); if (hasVisibleMessages()) { controller.preempt(); } }
/** * When an Entry is inserted, updated, or arrives via a partition transfer need to ensure that the MBean * and lease for this @{TopicSubscription} is properly visible. * * @param entry The {@link BinaryEntry} provided by the LiveObjectInterceptor */ @OnInserted @OnUpdated @OnArrived @OnRestored public void onChanged(BinaryEntry entry) { if (logger.isLoggable(Level.FINER)) { logger.log(Level.FINER, "TopicSubscription:onChanged identifier:{0}", getIdentifier()); } // Handle lease processing registerLease(); MessagingMBeanManager MBeanManager = MessagingMBeanManager.getInstance(); MBeanManager.registerMBean(this, SubscriptionProxy.class, MBeanManager.buildTopicSubscriptionMBeanName(getIdentifier())); }
/** * When a {@link TopicSubscription} is removed from the cache or is remove via a partition departing * need to unregister its MBean and clean up the lease. * * @param entry The {@link BinaryEntry} provided by the LiveObjectInterceptor */ @OnRemoved @OnDeparting public void onRemoved(BinaryEntry entry) { if (logger.isLoggable(Level.FINER)) { logger.log(Level.FINER, "TopicSubscription:onRemoved identifier:{0}", getIdentifier()); } // Handle lease processing unregisterLease(); // Unregister the subscription MBEAN MessagingMBeanManager MBeanManager = MessagingMBeanManager.getInstance(); MBeanManager.unregisterMBean(this, MBeanManager.buildTopicSubscriptionMBeanName(getIdentifier())); }
@OnInserted @OnArrived @OnRestored public void onEntryInserted(BinaryEntry entry)
@LiveObject @SuppressWarnings("serial") public class QueueSubscription extends LeasedSubscription
/** * When an Entry is inserted, updated, or arrived via a partition transfer need to ensure that the * MBean and lease for this {@link QueueSubscription} is properly visible. * * @param entry The {@link BinaryEntry} provided by the LiveObjectInterceptor */ @OnInserted @OnUpdated @OnArrived @OnRestored public void onChanged(BinaryEntry entry) { if (logger.isLoggable(Level.FINER)) { logger.log(Level.FINER, "QueueSubscription:onChanged identifier:{0}", getIdentifier()); } // Handle lease processing registerLease(); // Register the subscription MBEAN MessagingMBeanManager MBeanManager = MessagingMBeanManager.getInstance(); MBeanManager.registerMBean(this, QueueSubscriptionProxy.class, MBeanManager.buildQueueSubscriptionMBeanName(getIdentifier())); }
@OnRemoved @OnDeparting public void onEntryRemoved(BinaryEntry entry) { // for deleted subscriptions, schedule the stopping of the associated EventChannelController ResourceRegistry registry = CacheFactory.getConfigurableCacheFactory().getResourceRegistry(); if (logger.isLoggable(Level.FINE)) { logger.log(Level.FINE, "Scheduling the EventChannelController for {0} to stop.", new Object[] {this}); } EventChannelControllerManager manager = registry.getResource(EventChannelControllerManager.class); EventChannelController controller = manager.unregisterEventChannelController(distributorIdentifier, controllerIdentifier); controller.stop(); }
@LiveObject public class JMSEventChannelControllerConfiguration implements ExternalizableLite, PortableObject,
@OnInserted @OnUpdated @OnArrived @OnRestored public void onChanged(BinaryEntry entry)
/** * When a {@link QueueSubscription} is removed from the cache or removed via a partition departing * need to unregister its MBean and clean up the lease. * * @param entry The {@link BinaryEntry} provided by the LiveObjectInterceptor */ @OnRemoved @OnDeparting public void onRemoved(BinaryEntry entry) { if (logger.isLoggable(Level.FINER)) { logger.log(Level.FINER, "QueueSubscription:onRemoved identifier:{0}", getIdentifier()); } // Handle lease processing unregisterLease(); // Unregister the subscription MBEAN MessagingMBeanManager MBeanManager = MessagingMBeanManager.getInstance(); MBeanManager.unregisterMBean(this, MBeanManager.buildQueueSubscriptionMBeanName(getIdentifier())); }
@LiveObject @SuppressWarnings("serial") public class TopicSubscription extends LeasedSubscription
/** * An entry has been removed or is departing. * * @param entry the BinaryEntry */ @OnRemoved @OnDeparting public void onEntryRemoved(BinaryEntry entry) { // for deleted subscriptions, schedule the stopping of the associated EventChannelController if (logger.isLoggable(Level.FINE)) { logger.log(Level.FINE, "Scheduling the EventChannelController for {0} to stop.", new Object[] {this}); } ResourceRegistry registry = CacheFactory.getConfigurableCacheFactory().getResourceRegistry(); EventChannelControllerManager manager = registry.getResource(EventChannelControllerManager.class); // remove registered service EventChannelController controller = manager.unregisterEventChannelController(distributorIdentifier, controllerIdentifier); controller.stop(); }
@LiveObject public class CoherenceEventChannelSubscription extends Subscription implements EventChannelControlled
/** * When a {@link Queue} is removed from the cache or removed via a departing partition * need to unregister its MBean * * @param entry The {@link BinaryEntry} provided by the LiveObjectInterceptor */ @OnRemoved @OnDeparting public void onRemoved(BinaryEntry entry) { if (logger.isLoggable(Level.FINER)) { logger.log(Level.FINER, "Queue:onRemoved identifier: {0}", getIdentifier()); } // Shutdown the Engine which contains the finite state machine, used to coalesce queue event processing. ResourceRegistry registry = CacheFactory.getConfigurableCacheFactory().getResourceRegistry(); QueueEngine qEngine = registry.getResource(QueueEngine.class, getIdentifier().toString()); if (qEngine != null) { registry.unregisterResource(QueueEngine.class, getIdentifier().toString()); qEngine.dispose(); } // Unregister the destination MBEAN MessagingMBeanManager MBeanManager = MessagingMBeanManager.getInstance(); MBeanManager.unregisterMBean(this, MBeanManager.buildQueueMBeanName(getIdentifier())); }
@LiveObject @SuppressWarnings("serial") public class Queue extends Destination