Thursday, November 20, 2008

Tutorial: How to create a remote OSGi service

In this article you will learn how to create a remote OSGi service from a "local" OSGi service using R-OSGi. The OSGi service for an user manager is published by the Activator of the service bundle:
public class Activator implements BundleActivator {
public void start(final BundleContext context) throws Exception {
context.registerService(IUserManager.class.getName(), new UserManager(), null);
System.out.println("Service registered.");
}

public void stop(final BundleContext context) throws Exception {}
}
The Activator of the application bundle uses the service:
public class Activator implements BundleActivator {
public void start(final BundleContext context) throws Exception {
final ServiceReference serviceRef = context.getServiceReference(IUserManager.class.getName());
if (serviceRef == null) {
System.out.println("Service not found!");
} else {
final IUserManager userManager = (IUserManager) context.getService(serviceRef);

try {
System.out.println("All user names:");
final List<String> names = userManager.getUserNames();
for (final String name : names) {
System.out.println("Name = " + name);
}
} finally {
context.ungetService(serviceRef);
}
}
}

public void stop(final BundleContext context) throws Exception {}
}
Now you have to verify that R-OSGi is installed on your local Eclipse. Activate the view "Plug-ins" and search for a bundle named ch.ethz.iks.r_osgi.remote. If it is already there, you may skip the following installation procedure.

The easiest way to install R-OSGi into your Eclipse is to install the Eclipse Communication Framework (ECF). Use one of the following update sites:
After the download of the plug-ins, their installation and the restart of the Eclipse IDE the R-OSGi bundle will be available in the "Plug-ins" view.

First, you have to add the bundle ch.ethz.iks.r_osgi.remote to the list of required plug-ins. Do this for both the application and the service bundle. Then you have to mark the published OSGi service as remote service (inside the Activator of the service bundle):
  public void start(final BundleContext context) throws Exception {
final Hashtable properties = new Hashtable();
properties.put(RemoteOSGiService.R_OSGi_REGISTRATION, Boolean.TRUE);
context.registerService(IUserManager.class.getName(), new UserManager(), properties);
System.out.println("Service registered.");
}
That was easy! Using the remote service requires a little bit more code. Instead of getting the user manager service directly from the service registry, you have to get the R-OSGi service from the service registry. Then you have to query the R-OSGi service for the remote user manager services. The code inside the Activator of the application bundle looks like this:
  public void start(final BundleContext context) throws Exception {
final ServiceReference serviceRef = context.getServiceReference(RemoteOSGiService.class.getName());
if (serviceRef == null) {
System.out.println("R-OSGi service not found!");
} else {
final RemoteOSGiService remote = (RemoteOSGiService) context.getService(serviceRef);
try {
remote.connect(new URI("r-osgi://205.207.25.9:9278"));

final RemoteServiceReference[] references = remote.getRemoteServiceReferences(
new URI("r-osgi://205.207.25.9:9278"), IUserManager.class.getName(), null);
if (references == null) {
System.out.println("Service not found!");
} else {
final IUserManager userManager = (IUserManager) remote.getRemoteService(references[0]);

System.out.println("All user names:");
final List<String> names = userManager.getUserNames();
for (final String name : names) {
System.out.println("Name = " + name);
}
}
} finally {
context.ungetService(serviceRef);
}
}
}
Now you should test the remote OSGi service. Create a run configuration for the service and run it. Then create a run configuration for the application and run it. Depending on your user manager implementation you should see something like this (Console of the application):
osgi> All user names:
Name = Charly
Name = Dennis
Name = Ed
You may download the source code from here.

Wednesday, September 3, 2008

Tutorial: Sample RCP application using Spring, Spring Dynamic Modules for OSGi Service Platforms and AgileRCP (3/3)

In the first two parts of the tutorial you have learned how to use Spring beans as OSGi services (see part 1 and part 2). You have used the ApplicationContextTracker of AgileRCP to access Spring's ApplicationContext. The third part of the tutorial will show you how to use Eclipse RCP Extensions in interaction with Spring beans. AgileRCP offers a convenient way to do this without the hassle of the direct use of the ApplicationContextTracker.
  1. Create a new interface for a user view:
    • New -> Interface
    • Name: IUserView
    • Extended Interfaces: org.agilercp.ui.IView, org.agilercp.ui.view.IWorkbenchPartView

  2. Add a method for setting a list of user names:
        void setUserNames(final List<String> names);
  3. The interface is not compile clean, because some packages are missing. Add the following packages to the list of imported packages (MANIFEST.MF, Dependencies tab):
    • org.agilercp.ui
    • org.agilercp.ui.dialog
    • org.agilercp.ui.view
    • org.agilercp.ui.workbench
    • org.agilercp.util.log

  4. Edit the view of the application (View.java):
    • The view extends DefaultViewParta (from AgileRCP) instead of ViewPart.
    • The view implements the interface IUserView.
    • The table viewer displays a list of user names.
    • This list will be set from outside.
    public class View extends DefaultViewPart implements IUserView {
    public static final String ID = "org.digitalcure.hellospring.app.view";

    private TableViewer tableViewer;

    @Override
    protected void doCreatePartControl(final Composite parent) {
    final Composite composite = new Composite(parent, SWT.NONE);
    composite.setLayout((new GridLayout(1, false)));
    composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

    tableViewer = new TableViewer(composite, SWT.FULL_SELECTION | SWT.BORDER);
    tableViewer.getTable().setHeaderVisible(true);
    tableViewer.getTable().setLinesVisible(true);
    tableViewer.getTable().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

    final TableColumn firstNameColumn = new TableColumn(tableViewer.getTable(), SWT.NONE);
    firstNameColumn.setText("Name");
    firstNameColumn.setWidth(100);

    tableViewer.setContentProvider(new ArrayContentProvider());
    tableViewer.setLabelProvider(new UserTableLabelProvider());
    }

    @Override
    public void setFocus() {
    tableViewer.getTable().setFocus();
    }

    public void setUserNames(final List<String> names) {
    tableViewer.setInput(names);
    }

    private class UserTableLabelProvider extends LabelProvider implements ITableLabelProvider {
    public Image getColumnImage(final Object element, final int columnIndex) {
    return null;
    }

    public String getColumnText(final Object element, final int columnIndex) {
    if (!(element instanceof String)) {
    throw new IllegalArgumentException("The given object must be a string!");
    }

    return (String) element;
    }
    }
    }
  5. Edit the plugin.xml file:
    • Go to the Extensions tab, expand the node "org.eclipse.ui.views" and select "View (view)".
    • Change the class to: org.agilercp.ui.workbench.WorkbenchPartFactory

  6. The WorkbenchPartFactory implementation will create an instance of a Spring bean with the ID of the view (org.digitalcure.hellospring.app.view). The Spring bean has to implement the interface org.agilercp.ui.IPresenter. So now you have to create a new class for the presenter:
    • New -> Class
    • Name: UserPresenter
    • Superclass: org.agilercp.ui.DefaultPresenter

  7. You have to specify the type of the presented view:
    public class UserPresenter extends DefaultPresenter<IUserView> { ... }
  8. Add a member for the user manager to the user presenter class and a constructor that provides both the user manager and the user view:
        private final IUserManager userManager;

    public UserPresenter(final IUserView view, final IUserManager userManager) {
    super(view);
    this.userManager = userManager;
    }
  9. Override the handleViewCreated(...) method and initialize the view with the list of user names:
        @Override
    protected void handleViewCreated(final IUserView view) {
    super.handleViewCreated(view);
    getView().setUserNames(userManager.getUserNames());
    }
  10. Edit the Spring configuration file bundle-context.xml and add a Spring bean for the user presenter:
        <bean name="org.digitalcure.hellospring.app.view" class="org.digitalcure.hellospring.app.UserPresenter">
    <constructor-arg>
    <bean class="org.digitalcure.hellospring.app.View" />
    </constructor-arg>
    <constructor-arg ref="userManagerService" />
    </bean>
  11. The source code modifications are finished, so you have to modify the product configuration file "HelloSpringApp.product". Go to the Configuration tab and press "Add Required Plug-ins".

  12. Open the Run Configuration and press "Add Required Bundles".

  13. Press "Run" to run the application. The list inside the application window should display the user names now.
You may download the source code of the tutorial from here.

Monday, September 1, 2008

Tutorial: Sample RCP application using Spring, Spring Dynamic Modules for OSGi Service Platforms and AgileRCP (2/3)

In this tutorial you will extend the sample application of the first tutorial part. You will add another plug-in that provides a new user manager. You will learn how to declare Spring beans as OSGi services and use them in other plug-ins. This is possible without any modification of the original source code.
  1. Create a new plug-in project for the user manager service:
    • New -> Other... -> Plug-in Development / Plug-in Project
    • Choose a proper project name, e.g. "org.digitalcure.hellospring.service"
    • Generate an activator: yes, This plug-in will make contributions to the UI: no, Would you like to create a rich client application? no
    • Create a plug-in using one of the templates: no

  2. Edit the MANIFEST.MF file and import the package "org.digitalcure.hellospring.common" (Dependencies tab).

  3. Create an implementation of a user manager. Create a new class inside the "org.digitalcure.hellospring.service" package:
    • New -> Class
    • Choose a class name: ExtendedUserManager
    • Interfaces: org.digitalcure.hellospring.common.IUserManager

  4. Implement the getUserNames() method, so that it returns three names, e.g.:
    public List<String> getUserNames() {
    final List<String> list = new ArrayList<String>(3);
    list.add("Charly");
    list.add("Dennis");
    list.add("Ed");
    return list;
    }
  5. Now you are ready to create the Spring configuration files. Create a folder named "spring" inside the META-INF folder.

  6. Create two XML files inside the "spring" folder:
    • bundle-context.xml
    • bundle-context-osgi.xml

  7. bundle-context.xml: Create a Spring bean for the user manager:
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">

    <bean id="extendedUserManager" class="org.digitalcure.hellospring.service.ExtendedUserManager" />
    </beans>
  8. bundle-context-osgi.xml: Export the user manager bean as OSGi service:
    <?xml version="1.0" encoding="UTF-8"?>
    <beans:beans
    xmlns="http://www.springframework.org/schema/osgi"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:beans="http://www.springframework.org/schema/beans"
    xsi:schemaLocation="http://www.springframework.org/schema/osgi
    http://www.springframework.org/schema/osgi/spring-osgi.xsd
    http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans.xsd">

    <service id="extendedUserManagerService" ref="extendedUserManager"
    interface="org.digitalcure.hellospring.common.IUserManager" />
    </beans:beans>
  9. Add Spring support to the "service" project: Open the context menu for the project and select "Spring Tools" -> "Add Spring Project Nature". The project itself will be marked with a "S" in the upper right corner of the project icon.

  10. Open the Properties dialog of the project. Go to "Spring" -> "Beans Support" and add the two XML files of the "spring" folder. After closing the dialog, both XML files will be marked with an "S", plus the Java file "ExtendedUserManager.java".

  11. Switch back to the first project (the "app" project). Now you have to configure the first user manager (default user manager) as service. You have to edit the Spring configuration files of the project.

  12. bundle-context-osgi.xml: Export the user manager bean as OSGi service:
    <?xml version="1.0" encoding="UTF-8"?>
    <beans:beans
    xmlns="http://www.springframework.org/schema/osgi"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:beans="http://www.springframework.org/schema/beans"
    xsi:schemaLocation="http://www.springframework.org/schema/osgi
    http://www.springframework.org/schema/osgi/spring-osgi.xsd
    http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans.xsd">

    <service id="defaultUserManagerService" ref="defaultUserManager"
    interface="org.digitalcure.hellospring.common.IUserManager" />
    </beans:beans>
  13. bundle-context.xml: Import an user manager service:
    <osgi:reference id="userManagerService" interface="org.digitalcure.hellospring.common.IUserManager" />
  14. bundle-context.xml: Use the user manager service for the action:
    <bean id="listUserAction" class="org.digitalcure.hellospring.app.ListUserAction" >
    <property name="userManager" ref="userManagerService" />
    </bean>
  15. Edit the product configuration file "HelloSpringApp.product" and add the "service" plug-in to the list of plug-ins (Configuration tab).

  16. Edit the Run Configuration. Add the "service" plug-in to the list of plug-ins.

  17. Run the application. Take care of the logger messages in the Console view. When the application frame appears, select the menu item "File" -> "List Users". You should see a list of user names in the Console view.

  18. Please note that the user managers of both plug-ins ("app" and "service") are available as OSGi services. You may control the ranking of the services by adding the "ranking" attribute to the service definition.

  19. "app" plug-in, bundle-context-osgi.xml:
    <service id="defaultUserManagerService" ref="defaultUserManager"
    interface="org.digitalcure.hellospring.common.IUserManager" ranking="5" />
  20. "service" plug-in, bundle-context-osgi.xml:
    <service id="extendedUserManagerService" ref="extendedUserManager"
    interface="org.digitalcure.hellospring.common.IUserManager" ranking="7" />
  21. Run the application once again and see what names are printed. You may now modify the ranking of the user manager service of the "service" plug-in to 3 and run the application again. You should see other names printed in the Console view.
You may download the source code of the tutorial from here.

Sunday, August 31, 2008

Tutorial: Sample RCP application using Spring, Spring Dynamic Modules for OSGi Service Platforms and AgileRCP (1/3)

In this article you will learn how to create an RCP application that makes use of Spring, Spring-DM and AgileRCP. You will create a simple user manager that returns a list of names and an action that uses this user manager. The tutorial will show you how to use the ApplicationContextTracker of AgileRCP.
  1. Install Eclipse IDE, Spring IDE and AgileRCP as described in this post.

  2. Create a new plug-in project for the RCP application:
    • Switch to the Plug-in Development perspective.
    • New -> Other... -> Plug-in Development / Plug-in Project
    • Choose a proper project name, e.g. "org.digitalcure.hellospring.app"
    • Generate an activator: yes, This plug-in will make contributions to the UI: yes, Would you like to create a rich client application? yes
    • Create a plug-in using one of the templates: yes, select: RCP application with a view

  3. Create a second plug-in project for the service interface definition:
    • New -> Other... -> Plug-in Development / Plug-in Project
    • Choose a proper project name, e.g. "org.digitalcure.hellospring.common"
    • Generate an activator: yes, This plug-in will make contributions to the UI: no, Would you like to create a rich client application? no
    • Create a plug-in using one of the templates: no

  4. Create a new interface inside the package "org.digitalcure.hellospring.common":
    • New -> Interface
    • Choose an interface name: IUserManager
    • Add a single method:
    /**
    * Returns the names of all users.
    * @return list of user names, never null
    */
    List<String> getUserNames();

  5. Edit the MANIFEST.MF file and add the package "org.digitalcure.hellospring.common" to the list of exported packages (Runtime tab).

  6. Switch back to the first project (the "app" project). Edit the MANIFEST.MF file and import the package "org.digitalcure.hellospring.common" (Dependencies tab).

  7. Create a default implementation of a user manager. Create a new class inside the "org.digitalcure.hellospring.app" package:
    • New -> Class
    • Choose a class name: DefaultUserManager
    • Interfaces: org.digitalcure.hellospring.common.IUserManager

  8. Implement the getUserNames() method, so that it returns two names, e.g.:
    public List<String> getUserNames() {
    final List<String> list = new ArrayList<String>(2);
    list.add("Adam");
    list.add("Berti");
    return list;
    }

  9. Create an action that lists all user names of a user manager. Create a new class inside the "org.digitalcure.hellospring.app" package:
    • Choose a class name: ListUserAction
    • Superclass: org.eclipse.jface.action.Action

  10. Add a default constructor to the class that calls the super-constructor with a single string argument:
    public ListUserAction() {
    super("List Users");
    }

  11. Add a member that holds a user manager plus a setter method:
    private IUserManager userManager;

    public void setUserManager(final IUserManager usrManager) {
    userManager = usrManager;
    }

  12. Implement the run() method, so that all users are printed in the console:
    @Override
    public void run() {
    if (userManager == null) {
    System.out.println("User manager unset!");
    } else {
    System.out.println("All user names:");
    final List<String> names = userManager.getUserNames();
    for (final String name : names) {
    System.out.println("name = " + name);
    }
    }
    }

  13. The action has to provide a valid ID:
    private static final String ID = "org.digitalcure.hellospring.app.listalluser";

    @Override
    public String getId() {
    return ID;
    }

  14. Now you are ready to create the Spring configuration files. Create a folder named "spring" inside the META-INF folder.

  15. Create two XML files inside the "spring" folder:
    • bundle-context.xml
    • bundle-context-osgi.xml

  16. bundle-context.xml: Create a Spring bean for the user manager:
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:osgi="http://www.springframework.org/schema/osgi"
    xsi:schemaLocation="http://www.springframework.org/schema/osgi
    http://www.springframework.org/schema/osgi/spring-osgi.xsd
    http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans.xsd">

    <bean id="defaultUserManager" class="org.digitalcure.hellospring.app.DefaultUserManager" />
    </beans>

  17. bundle-context-osgi.xml: No service definitions:
    <?xml version="1.0" encoding="UTF-8"?>
    <beans:beans
    xmlns="http://www.springframework.org/schema/osgi"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:beans="http://www.springframework.org/schema/beans"
    xsi:schemaLocation="http://www.springframework.org/schema/osgi
    http://www.springframework.org/schema/osgi/spring-osgi.xsd
    http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans.xsd">
    </beans:beans>

  18. Now you are ready to define the action for listing all users as a Spring bean. This bean uses the default user manager:
    <bean id="listUserAction" class="org.digitalcure.hellospring.app.ListUserAction" >
    <property name="userManager" ref="defaultUserManager" />
    </bean>

  19. Add Spring support to the "app" project: Open the context menu for the project and select "Spring Tools" -> "Add Spring Project Nature". The project itself will be marked with a "S" in the upper right corner of the project icon.

  20. Open the Properties dialog of the project. Go to "Spring" -> "Beans Support" and add the two XML files of the "spring" folder. After closing the dialog, both XML files will be marked with an "S", plus the Java files "DefaultUserManager.java" and "ListUserAction.java".

  21. Now you have to create an instance of the action and add it to the File menu:
    • Edit the class ApplicationActionBarAdvisor
    • Add a member for the action that lists all users and add it to the menu inside the method fillMenuBar(...).
      private IAction listUserAction;

      @Override
      protected void fillMenuBar(final IMenuManager menuBar) {
      final MenuManager fileMenu = new MenuManager(
      "&File", IWorkbenchActionConstants.M_FILE);
      menuBar.add(fileMenu);

      if (listUserAction != null) {
      fileMenu.add(listUserAction);
      }
      fileMenu.add(exitAction);
      }

    • Inside the makeActions(...), get the ApplicationContext from an ApplicationContextTracker. Then an instance of the Spring bean for the action that lists the user is created.
      @Override
      protected void makeActions(final IWorkbenchWindow window) {
      try {
      final Bundle bundle = Activator.getDefault().getBundle();
      final ApplicationContextTracker applicationContextTracker =
      new ApplicationContextTracker(bundle, bundle.getBundleContext());

      ApplicationContext applicationContext = null;
      try {
      applicationContext =
      applicationContextTracker.getApplicationContext();
      } catch (final Throwable t2) {
      t2.printStackTrace();
      } finally {
      applicationContextTracker.close();
      }

      if (applicationContext == null) {
      System.out.println("NO APPLICATION CONTEXT!");
      } else {
      listUserAction = (IAction) applicationContext.getBean("listUserAction");
      register(listUserAction);
      }
      } catch (final Throwable t) {
      t.printStackTrace();
      }

      exitAction = ActionFactory.QUIT.create(window);
      register(exitAction);
      }

  22. The source code is not compile clean, because some packages are missing. Add the following packages to the list of imported packages (MANIFEST.MF, Dependencies tab):
    • "org.eclipse.springframework.util"
    • "org.springframework.beans.factory
    • "org.springframework.context"

  23. Now a product configuration has to be created:
    • New -> Product Configuration
    • Enter or select the parent folder: org.digitalcure.hellospring.app
    • File name: HelloSpringApp.product
    • Create a configuration file with basic settings: yes
    • Press "Finish". The wizard will be closed and the product editor will be opened.
    • Name: Hello Spring Application
    • ID: New...
    • A dialog for the product definition will be displayed. Just press "Finish".
    • Version: 1.0.0
    • Application: org.digitalcure.hellospring.app.application
    • The product configuration is based on: plug-ins
    • Switch to the Configuration tab.
    • Include optional dependencies when computing required plug-ins: no
    • Add the two plug-ins of the workspace: "org.digitalcure.hellospring.app" and "org.digitalcure.hellospring.common".
    • Press "Add Required Plug-ins".
    • Save the editor.

  24. Edit the plugins.xml file:
    • Go to the Extensions tab and select "org.eclipse.core.runtime.products".
    • ID: HelloSpringApp.product

  25. Now you are ready to run the application:
    • Open the Run Configurations dialog using the menu item "Run" -> "Run Configurations...".
    • Create a new launch configuration under OSGi Framework.
    • Name: HelloSpringApp
    • Framework: Equinox, Default Start Level: 4, Default Auto-Start: true
    • Select the two plug-ins inside the workspace.
    • Remove the selection from all plug-ins of the target platform.
    • Include optional dependencies when computing required bundles: no
    • Add new workspace bundles to this launch configuration automatically: no
    • Validate bundles automatically prior to launch: yes
    • Press the button "Add Required Bundles".
    • Press "Apply" and change to the Arguments tab.
    • Add the following program arguments right after the existing arguments: -consoleLog -product HelloSpringApp.product
    • Remove any existing VM arguments.
    • Change to the Settings tab and select "Clear the configuration area before launching".
    • Press "Run".

  26. The application will run. Take care of the logger messages in the Console view. When the application frame appears, select the menu item "File" -> "List Users". You should see the two user names in the Console view.

You may download the source code of the tutorial from here.

Monday, August 25, 2008

Tutorial: Installation of an Eclipse IDE for using Spring, Spring Dynamic Modules for OSGi Service Platforms and AgileRCP

In this tutorial you will install an Eclipse IDE that supports the development using Spring, Spring-DM and AgileRCP. I've written this article because the installation procedure is a kind of cumbersome and hard to discover for beginners.
  1. Download the Eclipse IDE for Java EE Developers from the Eclipse homepage. Note: When writing this article the current Eclipse IDE version was 3.4 (Ganymede).

  2. Extract the downloaded ZIP file on your hard disk. When using Windows you would probably create a new folder under "C:\Program Files\" called "Eclipse_SpringDM" and extract the archive there. Optional: Create a shortcut to the Eclipse executable on your desktop.

  3. Run the Eclipse IDE. Don't worry because the very first startup will take a while. Then choose a folder for your workspace.

  4. Install the Spring IDE: Open the Software Update dialog and add a new update site: http://springide.org/updatesite_nightly
    Select the following features from that site and start the installation:
    • Spring IDE Core
    • Spring IDE AOP Extension
    • Spring IDE Autowire Extension
    • Spring IDE JavaConfig Extension
    • Spring IDE OSGi Extension
    • Spring IDE AOP Developer Resources
    • Spring IDE Autowire Extension Developer Resource
    • Spring IDE Core Developer Resources
    • Spring IDE JavaConfig Extension Developer Resources
    • Spring IDE OSGi Extension Developer Resources
    Note: When writing this article the installed version of Spring IDE was 2.1.0.

  5. Restart Eclipse when the installation has finished.

  6. Update the installed Spring IDE features and restart Eclipse when the update has finished. If there are no updates available, skip this step. Note: When writing this article the current Spring IDE version was 2.1.1.

  7. Install AgileRCP: Download the latest release of AgileRCP from SourceForge: http://sourceforge.net/projects/agilercp/
    Extract the downloaded ZIP file in a temporary folder, e.g. "C:\Temp\". Open the Software Update dialog and add a new local update site pointing to your temporary folder. Select the following features from that site and start the installation:
    • Agile RCP Tooling / Ide Feature
    • Framework / Agilercp Feature
    Note #1: When writing this article the current AgileRCP version was 1.0.0 RC2.
    Note #2: If the installation using the Software Update dialog does not work because of unresolved dependencies, install the features and plug-ins using the "wild west" approach: just copy the extracted files directly into your Eclipse installation. Warning: The Eclipse documentation states that this is not recommended, see here.

  8. Quit Eclipse when the installation has finished.

  9. Update to the lastest version of Spring-DM: Download Spring-DM from the homepage. Extract the downloaded ZIP file into a temporary folder, e.g. "C:\Temp\". Copy the following files into the "plugins" folder of your Eclipse installation:
    • spring-osgi-core-[version].jar
    • spring-osgi-extender-[version].jar
    • spring-osgi-io-[version].jar
    Note: When writing this article the current Spring DM version was 1.1.1.

  10. Run Eclipse once again. Now the installation is finished.

Resources: