Developing Cloud Foundry applications with Eclipse

Cloud Foundry is an open source platform as a service (PaaS) that is used in cloud computing. One of the keys to success of a given platform is having some IDEs that help users to develop applications to run on the platform. The Cloud Foundry Eclipse Tools (CF Tools) is a framework that does exactly that. It is a set of tools that allows developers to easily develop, test, and deploy applications to Cloud Foundry, directly within Eclipse. It has been jointly developed by IBM and Pivotal Software, Inc. Other vendors are more than welcome to contribute to the project.

The CF Tools are an open source project built on top of the Eclipse Web Tools Platform (WTP). It allows adopters to quickly implement a server type to interact with a Cloud Foundry server. There are a couple of vendor specific implementations already available in the Eclipse marketplace, e.g. IBM Eclipse Tools for Bluemix, Cloud Foundry Integration for Eclipse and HP Helion Development Platform Eclipse Plugin. The framework runs on a wide range of Eclipse versions from Indigo to the latest Luna version.


Functions Provided by the CF Tools

Here are some highlighted functions provided by CF Tools using IBM Eclipse Tools for Bluemix as a case study:

Installation

Most of the vendor specific implementations are available on the Eclipse marketplace. You can do a search on the Eclipse marketplace and install the server support of your choice by using the menu item Help > Eclipse Marketplace.


Server creation

In order to interact with a Cloud Foundry server, the first thing that you need to do is to create a new server. Similar to other WTP server types, you can create a server by selecting the menu File > New > Other > Server and selecting the server of your choice, e.g. IBM > IBM Bluemix. In the server creation wizard, the user can specify the connection information for the tools to connect to a Cloud Foundry server. The user can then choose the organization and space for publishing the user applications.


Servers view integration

After the server has been created, you can find the server on the Servers view and the list of applications that are installed on the server, including the ones that are installed outside of the Tools.


Application deployment and management

The CF Tools framework allows you to easily deploy applications to CF servers (e.g. WAR). To deploy an application, you can right click on the server from the Servers view and select the menu Add and Remove to add the application to the server. During the application deployment, you can specify the related deployment information, e.g. service bindings, environment variables and application URL. The Tools also provide a Save to manifest file option that saves the deployment information in the manifest.yml file for the application. The information saved in the manifest file will be prefilled in the deployment dialog when deploying the application again.


You can also update the application during your development without restaging the application.

Server editor

The server editor is one of the key features of the CF Tools framework. It allows you to view and configure server connection information, application and instance information, application environment variables, and control applications. It also allows you to manage and bind services to the application, etc.


It also allows you to query and create new services on the fly.


Remote System View

The Tools integrate with the Eclipse Remote System view to show the files on the deployed instance in the cloud. You can click on the Remote System View link in the server configuration editor to view the application artifacts deployed on the instance running in the cloud.

Application Debug

Application development will be difficult without the ability to debug an application. The framework also provide functions to allow you to debug java applications running in the Cloud.

Extensions and APIs

In terms of extensibility, the CF Tools framework also provides extensions and APIs for adopters to provide vendor specific implementations.

Branding extension

The branding extension point org.cloudfoundry.ide.eclipse.server.core.branding allows adopters to customize products to provide any needed fit and finish, e.g. default cloud foundry URL, account sign up URL, wizard icons and labels, etc.


Application Extension

Application extension point org.cloudfoundry.ide.eclipse.server.core.application allows adopters to define different supported application types that are unique to the adopter’s cloud foundry server implementation. Combined with the publishing implementation in the WTP server extension org.eclipse.wst.server.core.model.ServerBehaviourDelegate, the adopter can publish different types of applications seamlessly using the same user interfaces. For example, in the IBM Eclipse Tools for Bluemix, the Tools has implemented the application publish support for the Liberty packaged server and the JavaScript applications.

Application Wizard Extension

Adopters can also customize the deployment dialog by implementing the extension point org.cloudfoundry.ide.eclipse.server.ui.applicationWizard if they need extra information specified when deploying their new application type.

Summary

In this article, we have covered the highlights of the functions and extensions provided by the Cloud Foundry Eclipse Tools. As an application developer, you can enjoy the ease of use of the Tools to help you to develop your applications in Eclipse and run them on a Cloud Foundry server. As a vendor specific provider, when combined with the rich set of extensions from WTP, adopters can provide even more functions as needed, such as incremental publish on Java applications in Bluemix. The sky is the limit! Download one of the extensions and try it yourself.

About the Authors

yuen

Elson Yuen
IBM Canada Ltd.