IBM Cloud IBM PureApplication System IBM PureSystems IBM SmartCloud Application Services

Pattern-type (Part 11): Add a post processor to a deployment

Imagine, you would like to take any actions once the deployment of a pattern is completed. This is possible because the solution offer a PostProvisioner interface that you can register and make it run after the deployment.

To achieve that you will have:

1) Create a java class which implements the PostProvisioner interface.

2) Create an OSGI service component for this class.

3) Add this OSGI file to the manifest along the package needed to run this class.

4) Add the “post-provisioners” array element to list all post provisioning service you would like to run at the end of the deployment.

For demonstrate this, we will create a simple service that just log information in the Kernel Service trace.

Create the Java class:

We will place this file in the source directory and in the com.itdove.iwd.lab package. We will call this class PostDeployment. As mentioned this class have to implement the PostProvisioner interface.

Create the OSGI file:

We have to create an OSGI file to describe the service we would like to register, the name of the service-component will be use later in the *.vm to reference the service-component we would like to launch after the deployment. We will call this file “masterPostDeployment.xml”. Don’t get confuse by the name here, the post deployment service will be launch at the end of the full pattern deployment and not after the master component deployment.

Update the manifest

We have to add this new OSGI file in the service-component list of the manifest.

As our service needs the and the org.apache.wink.client packages, we will add them in the import-package attribute.

Update the *.vm

The “post-provisioners” element must be added in the topology, let’s add it in the master.vm.

You can see a list of PostProvisioners can be specified.


Now you can built your plugin and upload it.

Create a new pattern with a component and deploy it. Once it is deployed, you will see in the Kernel Service trace the message:

4 replies on “Pattern-type (Part 11): Add a post processor to a deployment”

Hi Dominique,

I tried applying a post provisioner along with a plugin but, it gave an error for Topolgy provider not found. I made proper entries in both OSGI-INF and the vm template . Any pointers on this will help,

Thanx ,

Please check if you didn’t have a typo error between the name in the OSGF-INF and the type defined in the vm-template.
Aslo verify if you correctly updated the manifest as described in the article by adding the correct package.

Leave a Reply

Your email address will not be published. Required fields are marked *