...
Code Block |
---|
|
<classpath>
<location>lib/foo.jar</location>
</classpath>
|
Endpoint
A few examples:
Wiki Markup |
---|
{snippet:id=embedded|lang=xml|url=http://svn.apache.org/repos/asf/incubator/servicemix/trunk/servicemix-jsr181/src/test/resources/good2/xbean.xml} |
Wiki Markup |
---|
{snippet:id=reference|lang=xml|url=http://svn.apache.org/repos/asf/incubator/servicemix/trunk/servicemix-jsr181/src/test/resources/good2/xbean.xml} |
Wiki Markup |
---|
{snippet:id=byclass|lang=xml|url=http://svn.apache.org/repos/asf/incubator/servicemix/trunk/servicemix-jsr181/src/test/resources/good2/xbean.xml} |
Info |
---|
title | Endpoint attributes |
---|
borderStyle | solidbgColor='lighblue' |
---|
|
Name | Type | Description | Required |
---|
annotations | String | The annotations used to configure the service. Can be "none", "java5", "jsr181", "commons". If not specified, the annotations type will be discovered by looking at the class. | no | endpoint | String | JBI Endpoint name | no (will be auto-generated if not specified) | interfaceName | QName | Interface QName implemented by the JBI endpoint | no (will be auto-generated if not specified) | pojo | Object | the instanciated POJO to service requests | one of pojo or pojoClass | pojoClass | String | the class name of the POJO to service requests | one of pojo or pojoClass | service | QName | JBI Service name | no (will be auto-generated if not specified) | serviceInterface | String | the class name of the interface to expose as a service | no | typeMapping | String | Can be "default", "xmlbeans", "jaxb2". Defaults to "default" (Aegis) if no annotations used, else defaults to "jaxb2" | no |
|
...
Code Block |
---|
|
public void myMethod() {
ServiceMixClient client = new DefaultServiceMixClient(this.context);
QName service = new QName("http://servicemix.org/cheese/", "receiver");
EndpointResolver resolver = client.createResolverForService(service);
client.send(resolver, null, null, "<hello>world</hello>");
}
|
Lightweight mode
The servicemix-jsr181 component can also be configured in a spring/xbean configuration file, for use in an embedded ServiceMix.
Here is an example of such a configuration:
Wiki Markup |
---|
{snippet:id=lightweight|lang=xml|url=http://svn.apache.org/repos/asf/incubator/servicemix/trunk/servicemix-jsr181/src/test/resources/org/apache/servicemix/jsr181/spring.xml} |
Warning |
---|
title | Classpath issues when embedding servicemix-jsr181 component |
---|
|
When using the servicemix.xml configuration file to create jsr181 endpoints, you must include the servicemix-jsr181-xxx.jar in your classpath. You will find this file inside the component installer (./components/servicemix-jsr181-xxx.zip). Failing this, an IllegalArgumentException will be thrown with the following message: Component name: xxxxxx is bound to an object which is not a JBI component, it is of type: javax.xml.namespace.QName or aanother exception with |