From the docs:
While it's a best practice to write your service logic to the data that's defined in the contract (the input and output message types), there can be situations where you need to access contextual information like message headers (e.g. received file name) in your implementation. To facilitate this, the Bean component allows you to access the SwitchYard Exchange Context instance associated with a given Bean Service Operation invocation. To get a reference to the Context, simply add a Context property to your bean and annotate it with the CDI @Inject annotation.
But maybe it would be good if you could explain more what you need to do. What is managing manually services and routes? Start them and stop them? Modify some value? ...?
I need to start and stop services. I found that it can be done using ServiceHandler class. Why I need this? It's associated with my recent theme about HA singleton and your advice in this theme.
1 of 1 people found this helpful
Still being cryptic
You can start and stop the binding, which it is much easier. You can do it accessing the appropriate MBean. There is one thread in the forum explaining how to achieve this, if you search for it.
I found it. It's really easy. Thank you very much.
I found a bug
When I tried to get instance of Service bean from MBean server it throwed me exception that bean is not registered. After debugging I explored that method MBeans.registerApplication which registers beans is not invoked, because before this method invocation creation of org.switchyard.admin.base.BaseApplication fails with TransformerConfigurationException (Translet class loaded, but unable to create translet instance). All of these operations are in SwitchYardBuilder.applicationDeployed(). The source of exception is XMLHelper.write(Node, Writer, outputProperties) method.
I found that it's Wildfly bug [WFCORE-519] Xalan Linkage error : TransformerConfigurationException - JBoss Issue Tracker
It's sad, because I'm using Wildfly 8.1.
P.S. Now it works after removing -jaxpmodule "javax.xml.jaxp-provider" from standalone.bat file.