JBoss.org Community Documentation
JBossWS-Eventing registeres a event dispatcher within local JNDI tree that can be used to emit notifications from applications.
java:/EventDispatcher
The event dispatcher interface:
public interface EventDispatcher { void dispatch(URI eventSourceNS, Element payload); }
Example notification
(1) URI eventSourceURI = new URI("http://http://www.jboss.org/sysmon/SystemInfo"); (2) Element payload = DOMUtils.parse("SOME XML STRING"); try { InitialContext iniCtx = getInitialContext(); (3) EventDispatcher delegate = (EventDispatcher) iniCtx.lookup(EventingConstants.DISPATCHER_JNDI_NAME); (4) delegate.dispatch(eventSourceURI, payload); } catch (Exception e) { // }
Address your event source correctly (TargetNamespace+PortTypeName)
Create your payload
Lookup dispatcher from JNDI
Dispatch notification.
The SubscriptionManager MBean is the actual core component that drives the JBossWS-Eventing implementation. It can be accessed through the jmx-console.
jboss.ws.eventing:service=SubscriptionManager
Management operations exist to monitor and maintain active subscritions and deployed event sources. The current implementation is backed by a ThreadPoolExecutor, that asynchronously delivers messages to event sink endpoints. It can be configured through the following attributes:
corePoolSize - average number of idle threads
maximumPoolSize - maximum number of threads
eventKeepAlive - keep alive before an undelivered event message is discarded.