-
1. Re: Programmatically getting SwitchYardCamelContext or ServiceDomain instances
jorgemoralespou_2 Feb 13, 2015 3:41 AM (in response to jokser)Hi,
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? ...?
Cheers,
-
2. Re: Programmatically getting SwitchYardCamelContext or ServiceDomain instances
jokser Feb 13, 2015 3:55 AM (in response to jorgemoralespou_2)Hi,
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.
-
3. Re: Programmatically getting SwitchYardCamelContext or ServiceDomain instances
jorgemoralespou_2 Feb 13, 2015 4:33 AM (in response to jokser)1 of 1 people found this helpfulHi Pavel,
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.
-
4. Re: Programmatically getting SwitchYardCamelContext or ServiceDomain instances
jokser Feb 13, 2015 6:34 AM (in response to jorgemoralespou_2)I found it. It's really easy. Thank you very much.
-
5. Re: Programmatically getting SwitchYardCamelContext or ServiceDomain instances
jokser Feb 16, 2015 2:21 AM (in response to jorgemoralespou_2)Hi again,
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.