Fuse 6 is no longer supported
As of February 2025, Red Hat Fuse 6 is no longer supported. If you are using Fuse 6, please upgrade to Red Hat build of Apache Camel.Using the File Binding Component
Using the file system as a message transport
Copyright © 2013 Red Hat, Inc. and/or its affiliates.
Abstract
Chapter 1. Introduction to the File Binding Component Copy linkLink copied to clipboard!
Abstract
Overview Copy linkLink copied to clipboard!
- poller endpoint
- A poller endpoint polls a specified location on the file system for files. When it finds a file it reads the file and sends it to the NMR for delivery to the appropriate endpoint.ImportantA poller endpoint can only create in-only message exchanges.
- sender endpoint
- A sender endpoint receives messages from the NMR. It then writes the contents of the message to a specified location on the file system.
Key features Copy linkLink copied to clipboard!
- custom filters for selecting files
- custom marshalers for converting the contents of a file to and from a normalized message
- custom locking mechanism for controlling file access during reads
- archiving of read files
Contents of a file component service unit Copy linkLink copied to clipboard!
xbean.xml- The
xbean.xmlfile contains the XML configuration for the endpoint defined by the service unit. The contents of this file are the focus of this guide.NoteThe service unit can define more than one endpoint. meta-inf/jbi.xml- The
jbi.xmlfile is the JBI descriptor for the service unit. Example 1.1, “JBI descriptor for a file component service unit” shows a JBI descriptor for a file component service unit.Example 1.1. JBI descriptor for a file component service unit
<jbi xmlns="http://java.sun.com/xml/ns/jbi" version="1.0"> <services binding-component="false" /> </jbi>
<jbi xmlns="http://java.sun.com/xml/ns/jbi" version="1.0"> <services binding-component="false" /> </jbi>Copy to Clipboard Copied! Toggle word wrap Toggle overflow TipThe developer typically does not need to hand code this file. It is generated by the Red Hat JBoss Fuse Maven tooling.
OSGi Packaging Copy linkLink copied to clipboard!
- you will need to include an OSGi bundle manifest in the
META-INFfolder of the bundle. - You need to add the following to your service unit's configuration file:
<bean class="org.apache.servicemix.common.osgi.EndpointExporter" />
<bean class="org.apache.servicemix.common.osgi.EndpointExporter" />Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Namespace Copy linkLink copied to clipboard!
http://servicemix.apache.org/file/1.0 namespace. You will need to add a namespace declaration similar to the one in Example 1.2, “Namespace declaration for using file endpoints” to your xbean.xml file's beans element.
Example 1.2. Namespace declaration for using file endpoints
<beans ...
xmlns:file="http://servicemix.apache.org/file/1.0"
... >
...
</beans>
<beans ...
xmlns:file="http://servicemix.apache.org/file/1.0"
... >
...
</beans>
beans element's xsi:schemaLocation as shown in Example 1.3, “Schema location for using file endpoints”.
Example 1.3. Schema location for using file endpoints
Chapter 2. Using Poller Endpoints Copy linkLink copied to clipboard!
Abstract
2.1. Introduction to poller endpoints Copy linkLink copied to clipboard!
Overview Copy linkLink copied to clipboard!
Where does a poller endpoint fit into a solution? Copy linkLink copied to clipboard!
Figure 2.1. Poller endpoint
Configuration element Copy linkLink copied to clipboard!
poller element. All its configuration can be specified using attributes of this element.
bean elements or child elements of the poller element.
2.2. Basic configuration Copy linkLink copied to clipboard!
Overview Copy linkLink copied to clipboard!
- the endpoint's name
- the endpoint's service name
- the file or directory to be monitored
- the endpoint to which the resulting messages will be sent
poller element.
Identifying the endpoint Copy linkLink copied to clipboard!
- a service name
- an endpoint name
Specifying the message source Copy linkLink copied to clipboard!
poller element's file attribute. This attribute takes a URI that identifies a location on the file system.
file prefix, the endpoint will assume the URI specifies a directory on the file system and will consume all valid XML files placed in the specified directory.
inbox. The URI inbox instructs the endpoint to poll the directory inbox.
Specifying the target endpoint Copy linkLink copied to clipboard!
- If you explicitly specify an endpoint using both the
targetServiceattribute and thetargetEndpointattribute, the ESB will use that endpoint.ThetargetServiceattribute specifies the QName of a service deployed into the ESB. ThetargetEndpointattribute specifies the name of an endpoint deployed by the service specified by thetargetServiceattribute. - If you only specify a value for the
targetServiceattribute, the NMR will attempt to find an appropriate endpoint on the specified service. - If you do not specify a service name or an endpoint name, you must specify the name of an interface that can accept the message using the
targetInterfaceattribute. The NMR will attempt to locate an endpoint that implements the specified interface and direct the messages to it.Interface names are specified as QNames. They correspond to the value of thenameattribute of either a WSDL 1.1serviceTypeelement or a WSDL 2.0interfaceelement.
Example Copy linkLink copied to clipboard!
Example 2.1. Simple poller endpoint
2.3. Configuring poller endpoints interactions with the file system Copy linkLink copied to clipboard!
Overview Copy linkLink copied to clipboard!
- if the endpoint creates the directory it is configured to poll
- if the endpoint polls the subdirectories of the configured directory
- if the endpoint deletes the files it consumes
- where the endpoint archives copies of the consumed files
Directory handling Copy linkLink copied to clipboard!
autoCreateDirectory attribute to false. If the directory does not exist, the endpoint will do nothing. You will then have to create the directory manually.
recursive attribute to false.
Example 2.2. Poller endpoint that does not check subdirectories
File retention Copy linkLink copied to clipboard!
deleteFile attribute to false.
Example 2.3. Poller endpoint that leaves files behind
Archiving files Copy linkLink copied to clipboard!
archive attribute. The value of the archive attribute is a URI pointing to the directory into which the consumed files will archived.
archives.
Example 2.4. Poller endpoint that archives files
2.4. Configuring the Polling Interval Copy linkLink copied to clipboard!
Overview Copy linkLink copied to clipboard!
Scheduling the first poll Copy linkLink copied to clipboard!
firstTime attribute. The firstTime attribute specifies a date using the standard xsd:date format of YYYY-MM-DD. For example, you would specify April 1, 2025 as 2025-04-01. The first polling attempt will be made at 00:00:00 GMT on the specified date.
Example 2.5. Poller endpoint with a scheduled start time
Delaying the first poll Copy linkLink copied to clipboard!
delay attribute which specifies the delay interval in milliseconds.
Example 2.6. Poller endpoint with a delayed start time
Configuring the polling interval Copy linkLink copied to clipboard!
period attribute. The period attribute specifies the number of milliseconds the endpoint waits between polling attempts.
Example 2.7. Poller Endpoint with a thirty second polling interval
2.5. File locking Copy linkLink copied to clipboard!
Overview Copy linkLink copied to clipboard!
org.apache.servicemix.common.locks.LockManager interface. By default, poller endpoints use a provided implementation of this interface. If the default behavior is not appropriate for your application, you can implement the LockManager interface and configure your endpoints to use your implementation.
Implementing a lock manager Copy linkLink copied to clipboard!
org.apache.servicemix.common.locks.LockManager interface. The LockManager has single method, getLock() that needs to be implemented. Example 2.8, “The lock manager's get lock method” shows the signature for getLock().
Example 2.8. The lock manager's get lock method
Lock getLock(String id);getLock() method takes a string that represents the URI of the file being processes and it returns a java.util.concurrent.locks.Lock object. The returned Lock object holds the lock for the specified file.
Example 2.9. Simple lock manager implementation
Configuring the endpoint to use a lock manager Copy linkLink copied to clipboard!
lockManager attribute. The lockManager attribute's value is a reference to a bean element specifying the class of your custom lock manager implementation.
Example 2.10. Poller endpoint using a custom lock manager
lockManager element to the endpoint's configuration. The lockManager element simply wraps the bean element that configures the lock manager.
2.6. File filtering Copy linkLink copied to clipboard!
Overview Copy linkLink copied to clipboard!
java.io.FileFilter interface.
Implementing a file filter Copy linkLink copied to clipboard!
java.io.FileFilter interface. The FileFilter interface has a single method, accept(), that needs to be implemented. Example 2.11, “File filter's accept method” shows the signature of the accept() method.
Example 2.11. File filter's accept method
public boolean accept()(java.io.File pathname);accept() method takes a File object that represents the file being checked against the filter. If the file passes the filter, the accept() method should return true. If the file does not pass, then the method should return false.
Example 2.12. Simple file filter implementation
Configuring an endpoint to use a file filter Copy linkLink copied to clipboard!
filter attribute. The filter attribute's value is a reference to a bean element specifying the class of the file filter implementation.
constructor-arg element sets the filter's fitlername by passing a value into the constructor.
Example 2.13. Poller endpoint using a file filter
filter element to the endpoint's configuration. The filter element simply wraps the bean element that configures the file filter.
Chapter 3. Using Sender Endpoints Copy linkLink copied to clipboard!
Abstract
3.1. Introduction to sender endpoints Copy linkLink copied to clipboard!
Overview Copy linkLink copied to clipboard!
Where does a sender endpoint fit into a solution? Copy linkLink copied to clipboard!
Figure 3.1. Sender endpoint
Configuration element Copy linkLink copied to clipboard!
sender element. All its configuration can be specified using attributes of this element.
bean elements or child elements of the sender element.
3.2. Basic configuration Copy linkLink copied to clipboard!
Overview Copy linkLink copied to clipboard!
- the endpoint's name
- the endpoint's service name
- the file or directory to which files are written
sender element.
Identifying the endpoint Copy linkLink copied to clipboard!
- a service name
- an endpoint name
Specifying the file destination Copy linkLink copied to clipboard!
sender element's directory attribute. This attribute takes a URI that identifies a location on the file system.
Example Copy linkLink copied to clipboard!
Example 3.1. Simple sender endpoint
3.3. Configuring a sender endpoint's interaction with the file system Copy linkLink copied to clipboard!
Overview Copy linkLink copied to clipboard!
- if the endpoint creates the directory where it writes files
- how the endpoint names temporary files
Directory creation Copy linkLink copied to clipboard!
autoCreateDirectory attribute to false. If the directory does not exist, the endpoint will do nothing. You will then have to create the directory manually.
Example 3.2. Sender endpoint that creates its target directory
Appending data Copy linkLink copied to clipboard!
append attribute to true.
Example 3.3. Sender endpoint that appends existing files
Temporary file naming Copy linkLink copied to clipboard!
tempFilePrefixXXXXXtempFileSuffix. The five Xs in the middle of the filename will be filled with randomly generated characters. So given the configuration shown in Example 3.4, “Configuring a sender endpoint's temporary file prefix”, a possible temporary filename would be widgets-xy60s.xml.
Example 3.4. Configuring a sender endpoint's temporary file prefix
Chapter 4. File Marshalers Copy linkLink copied to clipboard!
Abstract
Overview Copy linkLink copied to clipboard!
org.apache.servicemix.components.util.FileMarshaler interface. You can easily configure your endpoints to use your custom marshaler instead of the default one.
Provided file marshalers Copy linkLink copied to clipboard!
- Binary File Marshaler
- The binary file marshaler is provided by the class
org.apache.servicemix.components.util.BinaryFileMarshaler. It reads in binary data and adds the data to the normalized message as an attachment. You can set the name of the attachment and specify a content type for the attachment using the properties shown in Table 4.1, “Properties for configuring the binary file marshaler”.Expand Table 4.1. Properties for configuring the binary file marshaler Name Description Default attachment Specifies the name of the attachment added to the normalized message. contentcontentType Specifies the content type of the binary data being used. Content types are specified using MIME types. MIME types are specified by RFC 2045. - Flat File Marshaler
- The flat file marshaler is provided by the class
org.apache.servicemix.components.util.SimpleFlatFileMarshaler. It reads in flat text files and converts them into XML messages.By default, the file is wrapped in aFileelement. Each line in the file is wrapped in aLineelement with anumberattribute that represents the position of the line in the original file.You can control some aspects of the generated XML file using the properties described in Table 4.2, “Properties used to control the flat file marshaler”.Expand
Implementing a file marshaler Copy linkLink copied to clipboard!
org.apache.servicemix.components.util.FileMarshaler interface. Example 4.1, “The file marshaler interface” shows the interface.
Example 4.1. The file marshaler interface
FileMarshaler interface has three methods that need to be implemented:
readMessage()- The
readMessage()method is responsible for reading a file from the file system and converting the data into a normalized message. Table 4.3, “Parameters for reading messages from the file system” describes the parameters used by the method.Expand Table 4.3. Parameters for reading messages from the file system Name Description exchangeContains the MessageExchangeobject that is going to be passed to the NMR.messageContains the NormalizedMessageobject that is going to be passed to the NMR.inContains the BufferedInputStreamwhich points to the file in the file system.pathContains the full path to the file on the file system as determined by the Java getCanonicalPath()method. getOutputName()- The
getOutputName()method returns the name of the file to be written to the file system. The message exchange and the message received by the sender endpoint are passed to the method.ImportantThe returned file name does not contain a directory path. The sender endpoint uses the directory it was configured to use. writeMessage()- The
writeMessage()method is responsible for writing messages received from the NMR to the file system as files. Table 4.4, “Parameters for writing messages to the file system” describes the parameters used by the method.Expand Table 4.4. Parameters for writing messages to the file system Name Description exchangeContains the MessageExchangeobject received from the ESB.messageContains the NormalizedMessageobject received from the ESB.outContains the BufferedOutputStreamwhich points to the file in the file system.pathContains the path to the file are returned from the getOutputName()method.
Example 4.2. Simple file marshaler
Configuring an endpoint to use a file marshaler Copy linkLink copied to clipboard!
marshaler attribute. The marshaler attribute's value is a reference to a bean element specifying the class of the file filter implementation.
Example 4.3. Poller endpoint using a file marshaler
marshaler element to the endpoint's configuration. The marshaler element simply wraps the bean element that configures the file marshaler.
Appendix A. Poller Endpoint Properties Copy linkLink copied to clipboard!
Attributes Copy linkLink copied to clipboard!
| Name | Type | Description | Default |
|---|---|---|---|
service | QName | Specifies the service name of the endpoint. | required |
endpoint | String | Specifies the name of the endpoint. | required |
interfaceName | QName | Specifies the interface name of the endpoint. | |
targetService | QName | Specifies the service name of the target endpoint. | |
targetEndPoint | String | Specifies the name of the target endpoint. | |
targetInterface | QName | Specifies the interface name of the target endpoint. | |
targetUri | string | Specifies the URI of the target endpoint. | |
autoCreateDirectory | boolean | Specifies if the endpoint will create the target directory if it does not exist. | true |
firstTime | date | Specifies the date and the time the first poll will take place. | null (The first poll will happen right after start up.) |
delay | long | Specifies amount of time, in milliseconds, to wait before performing the first poll. | 0 |
period | long | Specifies the amount of time, in milliseconds, between polls. | 5000 |
file | String | Speficies the file or directory to poll. | required |
deleteFile | boolean | Specifies if the file is deleted after it is processed. | true |
recursive | boolean | Specifies if the endpoint processes sub directories when polling. | true |
archive | string | Specifies the name of the directory to archive files into before deleting them. | null (no archiving) |
Beans Copy linkLink copied to clipboard!
| Name | Type | Description | Default |
|---|---|---|---|
marshaler | org.apache.servicemix.components.util.FileMarshaler | Specifies the class used to marshal data from the file. | DefaultFileMarshaler |
lockManager | org.apache.servicemix.locks.LockManager | Specifies the class implementing the file locking. | SimpleLockManager |
filter | java.io.FileFilter | Specifies the class implementing the filtering logic to use for selecting files. |
Appendix B. Sender Endpoint Properties Copy linkLink copied to clipboard!
Attributes Copy linkLink copied to clipboard!
| Name | Type | Description | Default |
|---|---|---|---|
service | QName | Specifies the service name of the endpoint. | required |
endpoint | String | Specifies the name of the endpoint. | required |
directory | String | Specifies the name of the directory into which data is written. | required |
autoCreateDirectory | boolean | Specifies if the endpoint creates the output directory if it does not exist. | true |
append | boolean | Specifies if the data is appended to the end of an existing file or if the data is written to a new file. | false |
tempFilePrefix | String | Specifies the prefix used when creating output files. | servicemix- |
tempFileSuffix | String | Specifies the file extension to use when creating output files. | .xml |
Beans Copy linkLink copied to clipboard!
| Name | Type | Description | Default |
|---|---|---|---|
marshaler | org.apache.servicemix.components.util.FileMarshaler | Specifies the marshaler to use when writing data from the NMR to the file system. | DefaultFileMarshaler |
Appendix C. Using the Maven JBI Tooling Copy linkLink copied to clipboard!
Abstract
- automatic generation of JBI descriptors
- dependency checking
- Set up a top-level project to build all of the service units and the final service assembly.
- Create a project for each of your service units..
- Create a project for the service assembly.
C.1. Setting up a Red Hat JBoss Fuse JBI project Copy linkLink copied to clipboard!
Overview Copy linkLink copied to clipboard!
- It allows you to control the dependencies for all of the parts of an application in a central location.
- It limits the number of times you need to specify the proper repositories to load.
- It provides you a central location from which to build and deploy the application.
Directory structure Copy linkLink copied to clipboard!
- A source directory containing the information required for the Maven assembly plug-in
- A directory to store the service assembly project
- At least one directory containing a service unit projectTipYou will need a project folder for each service unit that is to be included in the generated service assembly.
Setting up the Maven tools Copy linkLink copied to clipboard!
Example C.1. POM elements for using Red Hat JBoss Fuse Maven tooling
Listing the sub-projects Copy linkLink copied to clipboard!
modules element. The modules element contains one module element for each service unit in the assembly. You also need a module element for the service assembly.
Example JBI project pOM Copy linkLink copied to clipboard!
Example C.2. Top-level POM for a Red Hat JBoss Fuse JBI project
- 1
- Configures Maven to use the FuseSource repositories for loading the JBoss Fuse plug-ins.
- 2
- Lists the sub-projects used for this application. The
wsdl-first-cxfse-sumodule is the module for the service unit. Thewsdl-first-cxf-samodule is the module for the service assembly - 3
- Configures the Maven assembly plug-in.
- 4
- Loads the JBoss Fuse JBI plug-in.
C.2. A service unit project Copy linkLink copied to clipboard!
Overview Copy linkLink copied to clipboard!
Seeding a project using a Maven artifact Copy linkLink copied to clipboard!
groupId value and the artifactId values correspond to the project's group ID and artifact ID.
Example C.3. Maven archetype command for service units
smx-arch
su suArchetypeName
[
"-DgroupId=my.group.id"
] [
"-DartifactId=my.artifact.id"
]
") are required when using the -DgroupId argument and the -DartifactId argument.
| Name | Description |
|---|---|
| camel | Creates a project for using the Apache Camel service engine |
| cxf-se | Creates a project for developing a Java-first service using the Apache CXF service engine |
| cxf-se-wsdl-first | Creates a project for developing a WSDL-first service using the Apache CXF service engine |
| cxf-bc | Creates an endpoint project targeted at the Apache CXF binding component |
| http-consumer | Creates a consumer endpoint project targeted at the HTTP binding component |
| http-provider | Creates a provider endpoint project targeted at the HTTP binding component |
| jms-consumer | Creates a consumer endpoint project targeted at the JMS binding component (see "Using the JMS Binding Component") |
| jms-provider | Creates a provider endpoint project targeted at the JMS binding component (see "Using the JMS Binding Component") |
| file-poller | Creates a polling (consumer) endpoint project targeted at the file binding component (see Chapter 2, Using Poller Endpoints) |
| file-sender | Creates a sender (provider) endpoint project targeted at the file binding component (see Chapter 3, Using Sender Endpoints) |
| ftp-poller | Creates a polling (consumer) endpoint project targeted at the FTP binding component |
| ftp-sender | Creates a sender (provider) endpoint project targeted at the FTP binding component |
| jsr181-annotated | Creates a project for developing an annotated Java service to be run by the JSR181 service engine [a] |
| jsr181-wsdl-first | Creates a project for developing a WSDL generated Java service to be run by the JSR181 service engine [a] |
| saxon-xquery | Creates a project for executing xquery statements using the Saxon service engine |
| saxon-xslt | Creates a project for executing XSLT scripts using the Saxon service engine |
| eip | Creates a project for using the EIP service engine. [b] |
| lwcontainer | Creates a project for deploying functionality into the lightweight container [c] |
| bean | Creates a project for deploying a POJO to be executed by the bean service engine |
| ode | Create a project for deploying a BPEL process into the ODE service engine |
[a]
The JSR181 has been deprecated. The Apache CXF service engine has superseded it.
[b]
The EIP service engine has been deprecated. The Apache Camel service engine has superseded it.
[c]
The lightweight container has been deprecated.
| |
Contents of a project Copy linkLink copied to clipboard!
- a POM file that configures the JBI plug-in to create a service unit
- an XML configuration file stored in
src/main/resourcesFor many of the components, the XML configuration file is calledxbean.xml. The Apache Camel component uses a file calledcamel-context.xml.
Configuring the Maven plug-in Copy linkLink copied to clipboard!
packaging element to jbi-service-unit as shown in Example C.4.
Example C.4. Configuring the maven plug-in to build a service unit
Specifying the target components Copy linkLink copied to clipboard!
- List the targeted component as a dependency
- Add a
componentNameproperty specifying the targeted component
- Add a
componentNameproperty specifying the targeted component. - Add the remaining components to the list dependencies.
Example C.5. Specifying the target components for a service unit
componentName element. This element is added to the standard Maven properties block and it specifies the name of a targeted component, as specified in Example C.6.
Example C.6. Specifying a target component for a service unit
... <properties> <componentName>servicemix-bean</componentName> </properties> ...
...
<properties>
<componentName>servicemix-bean</componentName>
</properties>
...
componentName element, Maven does not check to see if the component is installed, nor does it download the required component.
Example Copy linkLink copied to clipboard!
Example C.7. POM file for a service unit project
- 1
- Specifies that it is a part of the top-level project shown in Example C.2, “Top-level POM for a Red Hat JBoss Fuse JBI project”
- 2
- Specifies that this project builds a service unit
- 3
- Specifies that the service unit targets the Apache CXF binding component
- 4
- Specifies to use the Red Hat JBoss Fuse Maven plug-in
C.3. A service assembly project Copy linkLink copied to clipboard!
Overview Copy linkLink copied to clipboard!
Seeding a project using a Maven artifact Copy linkLink copied to clipboard!
groupId value and the artifactId values, which correspond to the project's group ID and artifact ID.
Example C.8. Maven archetype command for service assemblies
smx-arch
sa
[
"-DgroupId=my.group.id"
] [
"-DartifactId=my.artifact.id"
]
-DgroupId argument and the -DartifactId argument.
Contents of a project Copy linkLink copied to clipboard!
Configuring the Maven plug-in Copy linkLink copied to clipboard!
packaging element to jbi-service-assembly, as shown in Example C.9.
Example C.9. Configuring the Maven plug-in to build a service assembly
Specifying the target components Copy linkLink copied to clipboard!
dependencies element. Add a dependency child element for each service unit. Example C.10 shows the configuration for a service assembly that bundles two service units.
Example C.10. Specifying the target components for a service unit
Example Copy linkLink copied to clipboard!
Example C.11. POM for a service assembly project
- 1
- Specifies that it is a part of the top-level project shown in Example C.2, “Top-level POM for a Red Hat JBoss Fuse JBI project”
- 2
- Specifies that this project builds a service assembly
- 3
- Specifies the service units being bundled by the service assembly
- 4
- Specifies to use the JBoss Fuse Maven plug-in
Appendix D. Using the Maven OSGi Tooling Copy linkLink copied to clipboard!
Abstract
D.1. Setting up a Red Hat JBoss Fuse OSGi project Copy linkLink copied to clipboard!
Overview Copy linkLink copied to clipboard!
Directory structure Copy linkLink copied to clipboard!
src folder. As in all Maven projects, you place all Java source code in the src/java folder, and you place any non-Java resources in the src/resources folder.
beans.xml file located in the src/resources/META-INF/spring folder.
Adding a bundle plug-in Copy linkLink copied to clipboard!
Example D.1. Adding an OSGi bundle plug-in to a POM
- 1
- Adds the dependency on Apache Felix
- 2
- Adds the bundle plug-in to your project
- 3
- Configures the plug-in to use the project's artifact ID as the bundle's symbolic name
- 4
- Configures the plug-in to include all Java packages imported by the bundled classes; also imports the org.apache.camel.osgi package
- 5
- Configures the plug-in to bundle the listed class, but not to include them in the list of exported packages
Activating a bundle plug-in Copy linkLink copied to clipboard!
packaging element to bundle.
Useful Maven archetypes Copy linkLink copied to clipboard!
Spring OSGi archetype Copy linkLink copied to clipboard!
org.springframework.osgi/spring-bundle-osgi-archetype/1.1.2
org.springframework.osgi/spring-bundle-osgi-archetype/1.1.2
mvn archetype:create -DarchetypeGroupId=org.springframework.osgi -DarchetypeArtifactId=spring-osgi-bundle-archetype -DarchetypeVersion=1.12 -DgroupId=groupId -DartifactId=artifactId -Dversion=version
mvn archetype:create -DarchetypeGroupId=org.springframework.osgi -DarchetypeArtifactId=spring-osgi-bundle-archetype -DarchetypeVersion=1.12 -DgroupId=groupId -DartifactId=artifactId -Dversion=version
Apache CXF code-first archetype Copy linkLink copied to clipboard!
org.apache.servicemix.tooling/servicemix-osgi-cxf-code-first-archetype/2008.01.0.3-fuse
org.apache.servicemix.tooling/servicemix-osgi-cxf-code-first-archetype/2008.01.0.3-fuse
mvn archetype:create -DarchetypeGroupId=org.apache.servicemix.tooling -DarchetypeArtifactId=spring-osgi-bundle-archetype -DarchetypeVersion=2008.01.0.3-fuse -DgroupId=groupId -DartifactId=artifactId -Dversion=version
mvn archetype:create -DarchetypeGroupId=org.apache.servicemix.tooling -DarchetypeArtifactId=spring-osgi-bundle-archetype -DarchetypeVersion=2008.01.0.3-fuse -DgroupId=groupId -DartifactId=artifactId -Dversion=version
Apache CXF wsdl-first archetype Copy linkLink copied to clipboard!
org.apache.servicemix.tooling/servicemix-osgi-cxf-wsdl-first-archetype/2008.01.0.3-fuse
org.apache.servicemix.tooling/servicemix-osgi-cxf-wsdl-first-archetype/2008.01.0.3-fuse
mvn archetype:create -DarchetypeGroupId=org.apache.servicemix.tooling -DarchetypeArtifactId=servicemix-osgi-cxf-wsdl-first-archetype -DarchetypeVersion=2008.01.0.3-fuse -DgroupId=groupId -DartifactId=artifactId -Dversion=version
mvn archetype:create -DarchetypeGroupId=org.apache.servicemix.tooling -DarchetypeArtifactId=servicemix-osgi-cxf-wsdl-first-archetype -DarchetypeVersion=2008.01.0.3-fuse -DgroupId=groupId -DartifactId=artifactId -Dversion=version
Apache Camel archetype Copy linkLink copied to clipboard!
org.apache.servicemix.tooling/servicemix-osgi-camel-archetype/2008.01.0.3-fuse
org.apache.servicemix.tooling/servicemix-osgi-camel-archetype/2008.01.0.3-fuse
mvn archetype:create -DarchetypeGroupId=org.apache.servicemix.tooling -DarchetypeArtifactId=servicemix-osgi-camel-archetype -DarchetypeVersion=2008.01.0.3-fuse -DgroupId=groupId -DartifactId=artifactId -Dversion=version
mvn archetype:create -DarchetypeGroupId=org.apache.servicemix.tooling -DarchetypeArtifactId=servicemix-osgi-camel-archetype -DarchetypeVersion=2008.01.0.3-fuse -DgroupId=groupId -DartifactId=artifactId -Dversion=version
D.2. Configuring the Bundle Plug-In Copy linkLink copied to clipboard!
Overview Copy linkLink copied to clipboard!
instructions element.
Configuration properties Copy linkLink copied to clipboard!
Setting a bundle's symbolic name Copy linkLink copied to clipboard!
+ "." + artifactId, with the following exceptions:
- If groupId has only one section (no dots), the first package name with classes is returned.For example, if the group Id is
commons-logging:commons-logging, the bundle's symbolic name isorg.apache.commons.logging. - If artifactId is equal to the last section of groupId, then groupId is used.For example, if the POM specifies the group ID and artifact ID as
org.apache.maven:maven, the bundle's symbolic name isorg.apache.maven. - If artifactId starts with the last section of groupId, that portion is removed.For example, if the POM specifies the group ID and artifact ID as
org.apache.maven:maven-core, the bundle's symbolic name isorg.apache.maven.core.
Bundle-SymbolicName child in the plug-in's instructions element, as shown in Example D.2.
Example D.2. Setting a bundle's symbolic name
Setting a bundle's name Copy linkLink copied to clipboard!
${project.name}.
Bundle-Name child to the plug-in's instructions element, as shown in Example D.3.
Example D.3. Setting a bundle's name
Setting a bundle's version Copy linkLink copied to clipboard!
${project.version}. Any dashes (-) are replaced with dots (.) and the number is padded up to four digits. For example, 4.2-SNAPSHOT becomes 4.2.0.SNAPSHOT.
Bundle-Version child to the plug-in's instructions element, as shown in Example D.4.
Example D.4. Setting a bundle's version
Specifying exported packages Copy linkLink copied to clipboard!
Export-Package list is populated by all of the packages in your local Java source code (under src/main/java), except for the deault package, ., and any packages containing .impl or .internal.
Private-Package element in your plug-in configuration and you do not specify a list of packages to export, the default behavior includes only the packages listed in the Private-Package element in the bundle. No packages are exported.
Export-Package child to the plug-in's instructions element.
Export-Package element specifies a list of packages that are to be included in the bundle and that are to be exported. The package names can be specified using the * wildcard symbol. For example, the entry com.fuse.demo.* includes all packages on the project's classpath that start with com.fuse.demo.
!. For example, the entry !com.fuse.demo.private excludes the package com.fuse.demo.private.
!com.fuse.demo.private,com.fuse.demo.*
!com.fuse.demo.private,com.fuse.demo.*
Specifying private packages Copy linkLink copied to clipboard!
Private-Package instruction to the bundle plug-in configuration. By default, if you do not specify a Private-Package instruction, all packages in your local Java source are included in the bundle.
Private-Package element and the Export-Package element, the Export-Package element takes precedence. The package is added to the bundle and exported.
Private-Package element works similarly to the Export-Package element in that you specify a list of packages to be included in the bundle. The bundle plug-in uses the list to find all classes on the project's classpath that are to be included in the bundle. These packages are packaged in the bundle, but not exported (unless they are also selected by the Export-Package instruction).
Example D.5. Including a private package in a bundle
Specifying imported packages Copy linkLink copied to clipboard!
Import-Package property with a list of all the packages referred to by the contents of the bundle.
Import-Package child to the plug-in's instructions element. The syntax for the package list is the same as for the Export-Package element and the Private-Package element.
Import-Package element, the plug-in does not automatically scan the bundle's contents to determine if there are any required imports. To ensure that the contents of the bundle are scanned, you must place an * as the last entry in the package list.
Example D.6. Specifying the packages imported by a bundle
More information Copy linkLink copied to clipboard!
Index Copy linkLink copied to clipboard!
B
- binary files, Provided file marshalers
- BinaryFileMarshaler, Provided file marshalers
- attachment, Provided file marshalers
- contentType, Provided file marshalers
- Bundle-Name, Setting a bundle's name
- Bundle-SymbolicName, Setting a bundle's symbolic name
- Bundle-Version, Setting a bundle's version
- bundles
- exporting packages, Specifying exported packages
- importing packages, Specifying imported packages
- name, Setting a bundle's name
- private packages, Specifying private packages
- symbolic name, Setting a bundle's symbolic name
- version, Setting a bundle's version
C
- componentName, Specifying the target components
E
- Export-Package, Specifying exported packages
F
- file name, Specifying the file destination
- FileFilter, Overview
- accept(), Implementing a file filter
- implementing, Implementing a file filter
- FileMarshaler, Implementing a file marshaler
- getOutputName(), Implementing a file marshaler
- readMessage(), Implementing a file marshaler
- writeMessage(), Implementing a file marshaler
- filter, Configuring an endpoint to use a file filter
- flat files, Provided file marshalers
G
- getOutoutName(), Implementing a file marshaler
I
- Import-Package, Specifying imported packages
L
- LockManager, Overview
- getLock(), Implementing a lock manager
- implementing, Implementing a lock manager
- lockManager, Configuring the endpoint to use a lock manager
M
- marshaler, Configuring an endpoint to use a file marshaler
- marshaling
- binary files, Provided file marshalers
- flat files, Provided file marshalers
- Maven archetypes, Useful Maven archetypes
- Maven tooling
- adding the bundle plug-in, Adding a bundle plug-in
- set up, Setting up the Maven tools
N
- namespace, Namespace
P
- poller, Configuration element
- archive, Archiving files
- autoCreateDirectory, Directory handling
- delay, Scheduling the first poll
- deleteFile, File retention
- endpoint, Identifying the endpoint
- file, Specifying the message source
- filter, Configuring an endpoint to use a file filter
- firstTime, Scheduling the first poll
- lockManager, Configuring the endpoint to use a lock manager
- marshaler, Configuring an endpoint to use a file marshaler
- period, Configuring the polling interval
- recursive, Directory handling
- service, Identifying the endpoint
- targetEndpoint, Specifying the target endpoint
- targetInterface, Specifying the target endpoint
- targetService, Specifying the target endpoint
- poller endpoint, Overview
- Private-Package, Specifying private packages
R
- readMessage(), Implementing a file marshaler
S
- sender, Configuration element
- append, Appending data
- autoCreateDirectory, Directory creation
- directory, Specifying the file destination
- endpoint, Identifying the endpoint
- marshaler, Configuring an endpoint to use a file marshaler
- service, Identifying the endpoint
- tempFilePrefix, Temporary file naming
- tempFileSuffix, Temporary file naming
- sender endpoint, Overview
- service assembly
- seeding, Seeding a project using a Maven artifact
- specifying the service units, Specifying the target components
- service unit
- seeding, Seeding a project using a Maven artifact
- specifying the target component, Specifying the target components
- SimpleFlatFileMarshaler, Provided file marshalers
- docElementname, Provided file marshalers
- insertLineNumbers, Provided file marshalers
- lineElementname , Provided file marshalers
- smx-arch, Seeding a project using a Maven artifact, Seeding a project using a Maven artifact
W
- writeMessage(), Implementing a file marshaler
X
- xbean.xml, Contents of a file component service unit
Legal Notice Copy linkLink copied to clipboard!
Trademark Disclaimer
Legal Notice Copy linkLink copied to clipboard!
Third Party Acknowledgements
- JLine (http://jline.sourceforge.net) jline:jline:jar:1.0License: BSD (LICENSE.txt) - Copyright (c) 2002-2006, Marc Prud'hommeaux
mwp1@cornell.eduAll rights reserved.Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- Neither the name of JLine nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - Stax2 API (http://woodstox.codehaus.org/StAX2) org.codehaus.woodstox:stax2-api:jar:3.1.1License: The BSD License (http://www.opensource.org/licenses/bsd-license.php)Copyright (c) <YEAR>, <OWNER> All rights reserved.Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - jibx-run - JiBX runtime (http://www.jibx.org/main-reactor/jibx-run) org.jibx:jibx-run:bundle:1.2.3License: BSD (http://jibx.sourceforge.net/jibx-license.html) Copyright (c) 2003-2010, Dennis M. Sosnoski.All rights reserved.Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- Neither the name of JiBX nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - JavaAssist (http://www.jboss.org/javassist) org.jboss.javassist:com.springsource.javassist:jar:3.9.0.GA:compileLicense: MPL (http://www.mozilla.org/MPL/MPL-1.1.html)
- HAPI-OSGI-Base Module (http://hl7api.sourceforge.net/hapi-osgi-base/) ca.uhn.hapi:hapi-osgi-base:bundle:1.2License: Mozilla Public License 1.1 (http://www.mozilla.org/MPL/MPL-1.1.txt)