JBoss Community

Re: META-INF/services for module extensions - question/issue

created by Brian Stansberry in JBoss AS7 Development - View the full discussion

Another hook, besides mbeans, that the AS provides for installing services from a deployment is the MSC https://github.com/jbossas/jboss-msc/blob/master/src/main/java/org/jboss/msc/service/ServiceActivator.java. Basically, the AS scans any deployment for a META-INF/services/org.jboss.msc.service.ServiceActivator file. If found, the ServiceLoader mechanism is used to load the specified ServiceActivator implementation, and then its activate() method is invoked. Via that mechanism you could install an MSC service, and that service could do your ServiceLoad start from its start() method, and also do any cleanup from its stop() method.

Reply to this message by going to Community

Start a new discussion in JBoss AS7 Development at Community