You can create your own mediator project using Developer Studio (formerly called carbon studio), and then include the mediator logic in the mediator project of this class [1]. Then create a C-App project in Developer Studio, which includes the Class pick as an artifact of the C-App [2].
After exporting this C-App project, you will receive a CAR file that contains your class proxy [3]. After you deploy this CAR file to the ESB, it automatically deploys the OSGi package of the class broker to the ESB, and you can immediately use the class broker.
When you update the class broker logic, you can re-export the C-App project and simply replace the existing CAR file in the ESB with a new CAR file. Then your previous OSGi class broker package will be removed from the ESB. But due to a limitation in the implementation of Equinox OSGi, you cannot use the new version of the class broker until the server restarts.
So all you have to do is replace the existing CAR file with the new version of the CAR file and restart the ESB server. The ESB server will take care of deploying the OSGi package on the system.
Since we have implemented support for deploying the C-App on Carbon Server through Eclipse [4], you can also use this approach. What you need to do is add the ESB server to the Eclipse instance and deploy the C application that contains the class proxy through Eclipse itself. When you follow this approach, you can update the logic in the class proxy and reinstall the new version of the CAR file on the server via Eclipse [5].
You can even debug your class proxy inside Developer Studio, following the guidance in [6].
[1]. http://wso2.org/project/developer-studio/2.0.1/docs/server_extensions_category.html#CustomMediator
[2]. http://wso2.org/project/developer-studio/2.0.1/docs/packaging.html#Distribution
[3]. http://wso2.org/project/developer-studio/2.0.1/docs/testing_deploying_category.html#CarGen
[4]. http://wso2.org/project/developer-studio/2.0.1/docs/testing_deploying_category.html#Deploy
[5]. http://wso2.org/project/developer-studio/2.0.1/docs/testing_deploying_category.html#Redeploy
[6]. http://wso2.org/project/developer-studio/2.0.1/docs/testing_deploying_category.html#debug
Hope this helps!
Harshana