
![]() | ![]() | ![]() | ||
![]() | ![]() | |||
| Generated on 2012-01-17 | Copyright © 1997-2011 INRIA/University of Nice-Sophia Antipolis/ActiveEon |
Legal Notice
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation; version 3 of the License.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
If needed, contact us to obtain a release under GPL Version 2 or 3, or a different license than the GPL.
Contact: <proactive@ow2.org> or <contact@activeeon.com>
Copyright 1997-2011 INRIA/University of Nice-Sophia Antipolis/ActiveEon.
Mailing List
Mailing List Archive
http://www.objectweb.org/wws/arc/proactive
Bug-Traking System
| Team Leader |
|---|
|
Denis Caromel
|
| Contributors from OASIS Team | Contributors from ActiveEon Company |
|---|---|
|
|
| Former Important Contributors | |
|---|---|
|
Table of Contents
List of Figures
List of Tables
List of Examples
IC2D is a set of tools based on the SWT (Eclipse) technology which allows to monitor and benchmark Java ProActive applications.
It includes the following views:
Graphical Monitoring View - A graphical environment for remote monitoring and steering of distributed and grid applications. It provides a graphical visualisation for hosts, Java Virtual Machines, and active objects, including the topology and the volume of communications.
Timers Chart View - TimIt plug-in provides a complete solution to benchmark applications' performance. It is able to produce a large variety of statistics, advanced timers with hierarchical capabilities. This powerful feature also provides a graphical representation of multiple events along a timeline.
Reports View - CharIt plug-in provides a visual comparative timer view based on pie charts.
You can download the archive file (a standard zip file) containing IC2D from the Activeeon download page. You will be asked to accept the license agreement and provide a few details including your email address. Within a few minutes you will receive an email containing a password and an URL where you will be able to download the latest release of IC2D.
Uncompress the archive using your favorite ZIP program such as Winzip under Windows or using the tar command under most Linux/Unix systems. Uncompressing the archive creates an IC2D directory and all the files contained in the archive go into this directory and its subdirectories.
Run IC2D from the installation folder to start monitoring. For information on using IC2D read Chapter 2, IC2D: Interactive Control and Debugging of Distribution.
IC2D requieres a JVM 1.6 or higher to be compiled.
If you want to develop IC2D or plugins for IC2D the installation steps are the following:
Download and unpack the RCP/Plug-in Developers version of Eclipse.
Install Subversion or your favorite SVN client.
Download ProActive for development through the anonymous or authenticated SVN. The SVN and Eclipse configuration information can be found on the INRIA gForge website.
Go to the compile directory of your ProActive installation directory and compile ProActive by running:
./build deploy
Go to the compile directory of your IC2D installation directory and copy the necessary ProActive libraries by running:
./build ic2d.libCopy
![]() | Note |
|---|---|
|
This command might fail if your ProActive directory does not correspond to the one defined in <property name="programming.dir" value="${basedir}/../ProActive/" /> If you are facing this issue, edit this file writing the right location of your ProActive directory (${basedir} corresponds to the root of the IC2D directory). |
From the IC2D project, import the IC2D plugin by going to File --> Import.

Browse for the IC2D src directory.

The directory
is src in the IC2D installation
directory.

Once the plugins loaded, click on the
Finish button and Eclipse should look like this:

Install the Business Intelligence and Reporting Tools used by TimIt for profiling.
To install go to Help -> Install New Software....
In the Work with text box, select your eclipse version. Then, you should see the list of available software.
Select Birt Intelligence, Reporting and Charting and click on Finish0.

Once the Birt installation finished, go to ic2d.product and click on Synchronize
and then click on Launch Application. Don't worry if the launch fails, we will fix that in the next step.

Open the Run Dialog, click on ic2d.product, click on Plugins tab, select all the workspace plugins and click on the Add Required Plug-ins button. then, click on Apply, and then click on Run.

You should have a running IC2D application. Feel free to test it and improve the code.
IC2D is a graphical environment for remote monitoring and steering of distributed and grid applications . IC2D is built on top of ProActive that provides asynchronous calls and migration.
IC2D is available in the form of a Java standalone application based on Eclipse Rich Client Platform (RCP) , available for several platforms (Windows, Linux, Mac OSX)
IC2D is based on a plugin architecture and provides 2 plugins in relation to the monitoring and the control of ProActive applications:
The Monitoring plugin which provides a graphical visualisation for hosts, Java Virtual Machines (JVMs), and active objects, including the topology and the volume of communications.
The Job Monitoring plugin which provides a tree representation of all these objects.
The Monitoring plugin provides the Monitoring perspective displayed in the Figure 2.1, “The Monitoring Perspective”.
This perspective defines the following set of views :
The Monitoring view: contains the graphical visualisation for ProActive objects
The Legend view: contains the legend corresponding to the Monitoring view's content
The Console view: contains log corresponding to the Monitoring view's events
In order to monitor a new host:
open the Monitoring Perspective: Window->Open Perspective->Other...->Monitoring (in the standalone IC2D, it should be already opened because it is the default perspective)
Click-right on the Monitoring view and select Monitor a new host... . It opens the "Monitor a new Host" dialog displayed in the Figure 2.2, “Monitor New Host Dialog”
enter informations required about the host to monitor, and click OK
The Monitoring view provides some functionalities which are accessible through a set of buttons. This section describes all these buttons:
Display the "Monitor a new host" dialog in order to monitor a new host.
Display the "Set Depth Control" dialog in order to change the depth variable. Let us assume we have 3 hosts (A, B and C). On A, there is an active object oaA which communicates with another active object oaB which is on B. This one communicates with an active object oaC on C, and aoA does not communicate with aoC. Then if we monitor A, and if the depth is 1, we will not see aoC.
Display the "Set Time to Refresh" dialog in order to change the time to refresh the model. And find the new added objects.
Refreh the model.
When the eye is opened the monitoring is activated.
Open a new Monitoring view. This button can be used in any perspective. The new created view will be named 'Monitoring#number_of_this_view'
All the other buttons concern the IC2D debugging features and will be describe latter on in Chapter 3, Using IC2D debugging features.
On the top of the Monitoring View, one can find the Virtual Nodes list. When some nodes are monirored, their virtual nodes are added to this list. And when a virtual node is checked, all its nodes are highlighted.
At the bottom of the Monitoring view, one can find a set of buttons used to manage the communications display:
Auto Reset: automatic reset of communications, you can specify the auto reset time.
Drawing style : defines how arrows are displayed. The 3 following options are available:
Proportional : arrows thickness is proportional to the number of requests
Ratio: arrows thickness uses a ratio of the number of requests
Fixed: arrows always have the same thickness whatever the number of communications
Topology: shows/hides communications, and erases all communications
Monitored Objects : Sum up of monitorized objects. It shows how many active objects, JVMs and hosts are monitored.
The TimIt plugin for IC2D provides the ability to profile a distributed application in real time.
The activation of profiling is done through a TimItTechnicalService attached to the virtual node that contains active objects the user want to profile.
In your deployement descriptor you have to declare the technical service :
<technicalServices>
<class name="org.objectweb.proactive.benchmarks.timit.util.service.TimItTechnicalService">
<property name="timitActivation" value="all"/>
<property name="reduceResults" value="false"/>
<property name="printOutput" value="false"/>
</class>
</technicalServices>
This technical service can be either defined into the proactive application definition or into the virtual node one.
As shown in Figure 2.12, “ Gathering stats ”, clicking-right in the monitoring panel, the user can collect some usefull information from active objects during the execution time to analyse the application performance.
For that, 3 views are available.
The main view, shown in Figure 2.13, “ Time snapshots for 2 active objects ”, is composed of bar charts (one chart per active object). Each chart represents cumulated times of different states that the active object has been in.
The tree view, shown in Figure 2.14, “ Hierarchical decomposition of the total time of an active object ”, allows a more detailed hierarchical decomposition view of the total time for a particular active object.
Suppose that your active object class is:
package org.objectweb.user.example;
public class ActiveObjectClass{
public ActiveObjectClass(){}
public void methodA(Integer i, Double d){}
private void methodB(){}
protected void methodC(){}
}
The hierarchical time decomposition includes times of user active object class methods (that must be public and non-final) served as requests (i.e. called by other active objects).
Total - The total time since the creation of the active object.
WaitForRequest - The time spent on waiting for requests.
Serve - The time spent on serving incoming requests.
org.objectweb.user.example.ActiveObjectClass.methodA(Integer, Double) - The time spent on serving the methodA as a request (local calls to this method are not included).
UserComputation - The time spent on computation (i.e. everything except communications).
SendRequest - The time spent on sending requests to other active objects.
BeforeSerialization - The time spent before the serialization of requests to other active objects.
Serialization - The time spent on serializing requests to other active objects.
AfterSerialization - The time spent after the serialization of requests to other active objects.
LocalCopy - The time spent on copying arguments in case of communications with local active objects.
SendReply - The time spent on sending replies to other active objects.
GroupOneWayCall - The time spent on performing asynchronous one way calls to groups of active objects (void methods).
GroupAsyncCall - The time spent on performing asynchronous calls to groups of active objects (non-void methods).
WaitByNecessity - The time spent on waiting by necessity.
The timeline view shown in Figure 2.15, “ The timeline for 7 active objects ” represents all events that were recorded during a certain time-lapse. The color of each event corresponds to the same color defined in the Legend view. This view shows the intensity of particular states (serving, waiting for request, etc.).
The ChartIt plugin allows users to chart in real time any numerical values provided by ProActive resources such as runtimes (JVMs), nodes and active objects involved in a distributed application.
To understand the following explanation the reader should be familiar with JMX technology. More precisely, the default behavior uses numerical values that are based on attributes of JMX MBeans associated with each ProActive resource. Meanwhile it is possible to provide custom resources to the ChartIt plugin with user-defined providers of numerical values.
Many chart types are available including bars, lines, pies and time based series. ChartIt uses 2 external APIs for chart rendering :
For a quick start, as shown in Figure 2.16, “ Show PA_JVM<ID> in ChartIt (right-click in Monitoring View). ”, simply right-click on a ProActive runtime (a JVM) representation in the Monitoring View and click on Show PA_JVM<ID> in ChartIt.
An editor-based view will appear with a predefined set of different charts representing various numerical values such as heap-size of the selected ProActive runtime (JVM), threads and others.
The current set of charts is predefined for a ProActive runtime (a JVM). ChartIt offers a way to change the current configuration with other chart types in the Overview tab of the ChartIt editor.
To do so, click on the Clear button (cross button) at the top-right corner of the ChartIt editor and click on Overview tab as shown in Figure 2.18, “ChartIt Overview tab view.”.
The Overview tab is composed of following sections :
Resource Description - contains various information about the monitored resource.
Available Data Providers - contains a table of all available data providers (based by default on MBean's attributes). Only numerical type based data providers can be used as input for a chart, such data providers are represented with a blue circle icon in the table.
Data Provider Details - contains the description and the value of the selected data provider.
Chart Description - contains the description of the current chart. More precisely, the chart name, the chart type, the refresh period (in seconds) and a list of used data providers. These data providers MUST be numerical.
Charts - contains a list of available charts, buttons to create/remove a chart and save/load the current configuration. The selected chart in the list will be described in the Chart Description section.
Let us add another chart to the current configuration as shown in Figure 2.19, “ChartIt Overview tab: create a new chart.”. To do so, simply click on Create button in the Charts section. A new chart will appear in the charts list, with a default name (automatically selected in the description section where you can change its name). Then add some data providers from the Available Data Providers section by selecting one or more in the table (you can select multiple providers by pressing CTRL key on your keyboard).
Once your chart has been created simply click back on the Charts tab in the ChartIt view to see your chart as shown in the Figure 2.20, “ChartIt Charts tab with custom chart.”. For instance, the custom pie chart represents the percentage of user/internal bodies on the monitored ProActive runtime (ie the monitored JVM).
IC2D comes with several plug-ins to help developers with the process of debugging their applications built above ProActive.
The communication between a debugger (like JDB or Eclipse) and a Java Virtual Machine (JVM) uses a socket connection. The debugger has therefore to know the URL of the JVM and the port number available for this socket connection. However, no port number is available by default on the JVM. Thus, in order to be able to launch the JVM with the correct arguments, the IC2D debugger connection tool is intended to give the information needed to the debugger connection.
First of all, JVMs (ProActive Runtimes) have to be started with the debug command line argument, otherwise it is not possible to establish a remote connection to these JVMs. The additional argument is of the following form:
-DdebugID=padebug_someDeploymentId -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=0,launch='java -cp <path/to/ProActive.jar> org.objectweb.proactive.core.debug.dconnection.DebuggeePortSetter padebug_someDeploymentId'
In the previous line, the path to the ProActive archive is the only thing to be changed. The debug id and the port number (address) will be set randomly so as to avoid conflicts between JVMs.
In order to ease the use of the debugging features, the GCMA descriptor has been extended to easily start runtimes in debug mode. One has to add the tag <debug/> as a child of the application/proactive tag. An example is shown hereafter:
<?xml version="1.0" encoding="UTF-8"?> <GCMApplication xmlns="urn:gcm:application:1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:gcm:application:1.0 http://proactive.inria.fr/schemas/gcm/1.0/ApplicationDescriptorSchema.xsd"> <environment> <javaPropertyVariable name="proactive.home" /> <javaPropertyVariable name="user.dir" /> <descriptorVariable name="hostCapacity" value="2"/> <descriptorVariable name="vmCapacity" value="2"/> </environment> <application> <proactive base="root" relpath="${proactive.home}"> <configuration> <applicationClasspath> <pathElement base="proactive" relpath="dist/lib/ProActive_examples.jar"/> <pathElement base="proactive" relpath="dist/lib/ibis-1.4.jar"/> <pathElement base="proactive" relpath="dist/lib/ibis-connect-1.0.jar"/> <pathElement base="proactive" relpath="dist/lib/ibis-util-1.0.jar"/> </applicationClasspath> <debug/> </configuration> <virtualNode id="Workers" capacity="4"/> </proactive> </application> <resources> <nodeProvider id="workers"> <file path="../GCMD_Local.xml" /> </nodeProvider> </resources> </GCMApplication>
One does not have to complete his descriptor with jvmarg tags to give arguments evoked above: it is precisely the role of the debug tag. It gives these arguments to all the created JVMs.
The IC2D debugger connection differs slightly from a simple debugger connection. When a user wants to connect a debugger to a remote JVM, he actually has to connect it to the local IC2D JVM. Then, it is an active object (created when the user sends the connection request) that is in charge of transmitting, through a proactive connection, the debugger information and requests to the JVM.
When a user right clicks on a monitored JVM, he can select an option (connect a debugger) that shows him the port number of his local debugger.
The following dialog box should appear:
Then, you can select either to use the Eclipse Extended Debugger or an external one. In case of an external one, the following window should appear asking you to give the connection information:
Next, the user has just to connect his debugger. For example: The Eclipse debugger
The step by step mode allows to control the execution of an active object at the service level. There are several types of breakpoints located at different steps of the service execution. These breakpoints are used to stop (when it is enabled) and restart (when it is disabled) an active object execution.
The standard breakpoints are located inside the service thread of an active object. These breakpoints do not block the other threads (like immediate services, JMX, ...). There are 3 points:
New service: This breakpoint is located before the beginning of the service. If the breakpoint is enabled, then the service will not start.
Enabled by default.
End service: This breakpoint is located after the end of the service. Once the service finished, no other service will start if the breakpoint is enabled.
Enabled by default.
Send request: This breakpoint is located before sending a request to an active object. The request is not added to the request queue of the active object.
Disabled by default.
The immediate service breakpoints are located inside each immediate service thread. The functionalities of these breakpoints are the same than those of standard breakpoints. For one object, there may be several immediate services blocked at the same time. There are 2 points for this specific service:
New immediate service: This breakpoint is located before the beginning of the immediate service.
Enabled by default.
End immediate service: This breakpoint is located after the end of the immediate service.
Enabled by default.
The main functionality of the step by step mode is to stop and restart an active object (enable/disable button). This functionality is available for one object or for each object in a node, a JVM, a host or a world (all object visible on IC2D monitoring). If an active object has been stopped, it is possible to restart it up to the next enabled breakpoint (next step button).
The filter tool allows to enable or disable some specific breakpoints. For example, it is possible to enable a new service and send request breakpoints, and disable the others.
This tool enables to introduce a delay after the breakpoints. Using this tool, the active object will stop at each breakpoint and will automatically restart after the delay.
The Distributed Services Flow Analysis provides analysis tools to validate and/or debug your application execution.
This plugin for IC2D provides distributed services flows analysis for ProActive applications with graphical display such as a communication graph of the services or a sequence diagram of a flow. That allows users or developers to understand and validate how a ProActive application has been executed.

Screenshot of the main view of this plugin on the right, and the monitoring view on the left.
Figure 4.1. Screenshot
In order to analyse your application with this DSF Plugin in IC2D, you have to execute your application with the PAProperty proactive.tag.dsf set to true. Next the only thing left is to monitor your application like you do usually in IC2D Monitoring.
Once you have started to monitor your application in IC2D, you can display the Distributed Service Flow view from the windows menu.
You have now acces to the following actions:
Refresh the graph: Refreshes the graph part of the view to display the informations got from the monitoring. This action provides three ways of displaying the graph:
Merged: All the DSF are displayed as one merged graph.
Separately: All DSG are displayed separately. This can take a while and not be efficient.
Filtered: You can set filter to choose which DSF you want to display. You can set filters for actives objects, methods called and DSF value.
Take a snapshot: Exports the current graph part toward a PNG file.
Import / Export: Imports or Exports the data gotten from the monitoring.
Replay a DSF: You can choose to replay step by step a DSF.
Automatic Replay: Automatically displays all next steps in the replay with a little delay between each step.
Next communication in the replay: Displays the next step of the replay.
Generate a Sequence Diagram: Genereates a Sequence Diagram in SVG Format for the DSF you will choose.
Clear all: Clears all data and resets the view.

Example of the Communication graph, and the information displayed when you click on a connection between two nodes.
Figure 4.2. Graph View Exemple
If you choose to display a sequence diagram for a DSF, you will generate a SVG File representing it. There is a possibilty that there are some missing message from the monitoring, so the communication impacted by these losses are rendered in a different color. Black if no loss, orange if there are less than 25% of loss, and in Red if there are more of 50% of loss.
IC2D is composed of several plugins:
org.objectweb.proactive.ic2d : This plugin is the "frame" which contains the other plugins. It is only needed in the standalone version.
org.objectweb.proactive.ic2d.monitoring : provides graphical representation of hosts, runtimes, virtual nodes and active objects topology, also displaying communications between active objects.
org.objectweb.proactive.ic2d.jobmonitoring : provides tree-based representation of hosts, runtimes , virtual nodes and active objects.
org.objectweb.proactive.ic2d.launcher : initiates application deployment using deployment descriptors
org.objectweb.proactive.ic2d.lib : provides Java archives (jar) required by the other plugins which are not provided by the Eclipse like ProActive.jar, log4j.jar, etc.
org.objectweb.proactive.ic2d.console : provides logging capability through the Eclipse console.
The aim of this plugin is to provide the essential features for monitoring of ProActive applications. Monitorable entities are
Figure 5.1, “Graphical representation of the data” shows the graphical representation of hosts, virtual nodes, runtimes (ProActive JVM), nodes, and active objects.
The diagram Figure 5.2, “Class diagram” describes relationships between Java classes:
The AOObject class represents an Active Object.
The NodeObject class represents a node. Nodes contain Active Objects.
The VMObject represents a runtime. Runtimes contain nodes
The VNObject class represents a virtual node. The virtual node is a logical entity which has no real existence at runtime. When using Deployment Descriptors, it is the mapping of a virtual node on a runtime that leads to the creation of one or more nodes on this runtime. Virtual nodes can be mapped on more than one runtime, thus as shown in the figure, a node is bound to both a runtime and a virtual node.
The HostObject class represents the hardware that hosts the runtime, it is possible to coallocate several runtimes on the same host
The WorldObject class is a "special" object that allows to gather hosts and virtual nodes under a common root.
When IC2D is used to monitor a host, it looks for any available runtimes on the host, then enumerates any nodes, virtual nodes and active objects contained within each runtime.
In order to do this, it grabs the URL entered by the user, then creates a new HostObject and add it to the WorldObject. Next, a thread starts and regularly queries the WorldObject to explore itself. The following sequence diagram explains how a WorldObject explores itself for the first time (Figure 5.3, “The world exploring itself for the first time”).
The WorldObject queries its HostObjects to explore themselves
Each HostObject looks for ProActive Runtimes on the current host then creates VMObject s corresponding to the newly discovered runtimes
Each VMObject explores itself, looking for Nodes contained within its ProActiveRuntime. Each Node is mapped into a NodeObject
Each NodeObject looks for contained active objects asking it to the ProActiveRuntime of its parent (VMObject) and creates the corresponding AOObject s.
Now all objects are found. And these operation will be regularly repeated until the user stops monitoring.
The Graphical Editing Framework (GEF) allows developers to take an existing application model and quickly create a rich graphical interface.
GEF employs an MVC (Model View Controller) architecture which enables simple changes to be applied to the model from the view.
This section introduces the needed to the comprehension of GEF. For more details about GEF go to the Section 5.1.1.4, “Links” .
We describe here the implementation of the MVC pattern used within IC2D:
The Models ( Figure 5.4, “The Models” )
The Controllers = In GEF the controllers are subclasses of EditPart ( Figure 5.5, “The Controllers and the factory” )
The Views = The Figure s ( Figure 5.6, “The Views” )
Three things to not forget
The data must be organized in a tree structure. . See Figure 5.7, “ The data strucure of the monitoring plugin ”
In GEF the controllers are subclasses of EditPart
A factory (implementing EditPartFactory ) allows GEF to create the controller corresponding to the model.
In blue, the data which we use with GEF. As you can see it, they are organized in a tree structure.
Description of the creation of the controllers and the figures step by step :
We indicate to GEF the root element of the tree, and the factory.
GEF queries the factory to create the controller corresponding to the root.
GEF queries the obtained controller to create the figure corresponding to the model.
GEF queries the root to provide it its sons.
On each one of these children, GEF do the same process.
GEF queries the factory to create the controller corresponding to the first child.
GEF queries the obtained controller to create the figure corresponding to the model.
GEF queries the model to provide it its sons.
etc...
The official site of GEF: http://www.eclipse.org/gef/
A web page referring a lot of very interesting links about GEF: http://eclipsewiki.editme.com/GEF
A detailed description of GEF : http://eclipse-wiki.info/GEFDescription
Somes GEF examples : http://eclipse-wiki.info/GEFExamples
The pattern Observer/Observable is used to update the figures when the model changes.
In the Figure 5.8, “Observable objects” you can see all the observable objects with methods which can call notifyObservers .
In the Figure 5.9, “Observer objects” , you can see all the observer objects and where the method update is overriden.
In the Table 5.1, “Observable and Observer objects” , you can see each observable with their observers.
|
Observable |
Observer |
|---|---|
|
WorldObject |
WorldEditPart |
|
MonitorThread | |
|
VirtualNodesGroup | |
|
HostObject |
HostEditPart |
|
VMObject |
VMEditPart |
|
NodeObject |
NodeEditPart |
|
AOObject |
AOEditPart |
Table 5.1. Observable and Observer objects
In the following diagram, you can see all classes necessary to the espionage of the active objects.
When a node is found for the first time, IC2D put a spy in the node.
Once the spy is in the node, it regularly asks to the SpyEventManager to provide all the events. The next step is explained in the Figure 5.11, “Active Objects' events management”.
Then the Spy transmits all these events to the SpyListener .
For the each event, the SpyListener calls the corresponding method on SpyEventListener
The SpyEventListener searches the AOObject concerned with this event (thanks to the Node attribut of his class). And it modifies the state of this object.
The AOObject notify its observers.
The AOEditPart , which is an AOObject observer, update the view of this Active Object.
The NodeObject calls its "addSpy()" method :
This method creates a SpyEventListener with the NodeObject in parameter.
It creates also a SpyListener with the SpyEventListener in parameter.
Next,it turns active the previous SpyListener.
And creates a new Active Object (with the PAActiveObject.newActive method) which is the spy with 2 parameters : the turned active object (SpyListener) , and the node . (This node is given in parameter at the constructor of the NodeObject)
When an active object is found for the first time, we ask to the NodeObject to provide us the spy.
We call the ' addMessageEventListener ' method on the Spy .
The Spy calls on its SpyEventManager the ' addMessageEventListener ' method.
The SpyEventManager adds a MessageEvent listener to the body of the active object.
In some cases, you may want to hide some objects to the users, i.e. don't monitor some internal objects. For example, spy objects used by IC2D for monitoring JVMs. That's why we introduce the concept of filtering in the monitoring plugin.
The package org.objectweb.proactive.monitoring.filters contains:
Filter : an abstract class, which has to be extended by all filter classes. This class provides the method filter (AbstractDataObject) that returns true if it matches the filter, otherwise false.
FilterProcess : provides the method filter (AbstractDataObject object).This is the first method called when a new object is discovered. It applies all filters on the object and if at least one filter returns true the object is not monitored.
This plugin provides several methods to log in the console :
log (String message)
warn (String message)
err (String message)
logException (Throwable e)
debug (String message)
debug (Throwable e)
You can have several different consoles. For example, the plugin monitoring logs in a console named "Monitoring", all the log4j messages are logged in the console "Log4j", ...
If you want to add your own console, you must choose a unique name. and call the method Console. getInstance (String yourUniqueName) to obtain the console (if it didn't exist it is created). Then you can call the methods above on your console.
This plugin contains all jar (which are not provided by Eclipse) necessary to the other plugins (like ProActive.jar, log4j.jar, ...). So if you modify the code and need a new jar, you have to add it to the plugin lib. And if you create a new plugin which needs a jar which is in the plugin lib, it must be dependent of this plugin.
Here is the IC2D SVN repository : svn://scm.gforge.inria.fr/svn/proactive/branches/proactive_newIC2D
You have to checkout :
org.objectweb.proactive.ic2d
org.objectweb.proactive.ic2d.monitoring
org.objectweb.proactive.ic2d.lib
org.objectweb.proactive.ic2d.console
org.objectweb.proactive.ic2d.launcher
If you are using Eclipse and its plugin Subclipse , open the SVN Repository perspective and checkout all those folders as new Java projects .
You'll maybe have to replace the proactive.jar file in the plugin org.objectweb.proactive.ic2d.lib, it depends on your ProActive version.
Now, you can run IC2D clicking on the link Launch the product in ic2d.product in the org.objectweb.proactive.ic2d project.
IC2D is a Rich Client Platform (RCP) based on the familiar Eclipse plug-in architecture .
If you want to create a plug-in for IC2D, you have to use the Eclipse's Plug-in Development Environment (PDE) . This is a complete environment that Eclipse provides for plug-in development. The PDE adds a new perspective and several views and wizards that help you create, maintain, and publish plug-ins. The PDE creates boilerplate starter code that you can use to build your plug-in. This section explains how to use the plug-in project wizard to create your plug-in.
Select File > New > Project from the menu bar to open the new project wizard
Select Plug-in Project in Plug-in Development
Click Next
In the
Project name
field, enter a name for the plug-in. For
example, we chose
org.objectweb.proactive.ic2d.example. You
must use the fully-qualified name to ensure
its uniqueness.
In the Project contents pane, accept the default directory value
Make sure the Create a Java project option is selected since we want our project to contain Java files. Accept the default values of the other options
Beginning in Eclipse 3.1 you will get best results by using the OSGi bundle manifest. In contrast to previous versions, this is now the default.
Click Next
Enter the fully qualified ID of the plug-in which by default it is the same as the project name
Accept the default values of the other options
Click Finish
The plug-in project has the file structure illustrated in the followed figure.
The plug-in manifest ties all the code and resources together. When you first create a plug-in, Eclipse will create and open the manifest for you automatically. The manifest is split into two files: MANIFEST.MF and plugin.xml . PDE provides a fancy editor to modify the options stored in these files (see Figure 5.18, “ Interface for editing the manifest and related files. ” ) but also allows you to edit the source directly.
MANIFEST.MF
The OSGi bundle manifest is stored in MANIFEST.MF. OSGi is the name of a standard that Eclipse uses for dynamically loading plug-ins. Example 5.1, “MANIFEST.MF” shows the OSGi bundle manifest generated by the plug-in wizard. Everything in this file can be edited by the Manifest editor, so there should be no need to edit it by hand . However if you need to, just double-click it in the Package Explorer to bring up the Manifest editor, then click on the MANIFEST.MF tab in the editor to see and modify the source.
Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Example Plug-in Bundle-SymbolicName: org.objectweb.proactive.ic2d.example Bundle-Version: 1.0.0 Bundle-Activator: org.objectweb.proactive.ic2d.example.ExamplePlugin Bundle-Localization: plugin Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime Eclipse-AutoStart: true
Example 5.1. MANIFEST.MF
plugin.xml
The Eclipse extension manifest is called plugin.xml. It's used for defining and using Eclipse extension points , so if you're not using extension points then this file may be omitted. Extension points are the fundamental way that Eclipse plug-ins are tied together. This new plug-in is not yet using extension points so the plug-in wizard didn't generate the plugin.xml file.
The plug-in class is an optional singleton class that can be used to store global information for the plug-in. It's also a convenient place to put a few static utility functions used by other classes in the plug-in. See the listing Example 5.2, “ExamplePlugin.java” for the plug-in class that was created for us by the plug-in wizard.
package org.objectweb.proactive.ic2d.example;
import org.eclipse.ui.plugin.*;
import org.eclipse.jface.resource.ImageDescriptor;
import org.osgi.framework.BundleContext;
/**
* The main plugin class to be used in the desktop.
*/
public class ExamplePlugin extends AbstractUIPlugin {
//The shared instance.
private static ExamplePlugin plugin;
/**
* The constructor.
*/
public ExamplePlugin() {
plugin = this;
}
/**
* This method is called upon plug-in activation
*/
public void start(BundleContext context) throws Exception {
super.start(context);
}
/**
* This method is called when the plug-in is stopped
*/
public void stop(BundleContext context) throws Exception {
super.stop(context);
plugin = null;
}
/**
* Returns the shared instance.
*/
public static ExamplePlugin getDefault() {
return plugin;
}
/**
* Returns an image descriptor for the image file at the given
* plug-in relative path.
*
* @param path the path
* @return the image descriptor
*/
public static ImageDescriptor getImageDescriptor(String path) {
return AbstractUIPlugin.imageDescriptorFromPlugin("org.objectweb.proactive.ic2d.example", path);
}
}
Example 5.2. ExamplePlugin.java
The build.properties file (see Example 5.3, “build.properties” ) will be needed when exporting the application for others to use . In particular if your application needs any resources like icons they should be listed here in the bin.includes section. The Plug-in Manifest editor provides a convenient interface to modify this file that is less error-prone than modifying it by hand.
In the project org.objectweb.proactive.ic2d , open ic2d.product . In the Configuration tab, click Add .
Then select your plug-in.
Now, click Add Required Plug-ins .
Return to the Overview tab and click Synchronize . Now launch ic2d by clicking Launch the product .
You can verify that your plug-in is integrated : in the IC2D frame, go to Help > About product > Plug-in Details .
Perspectives provide an additional layer of organization inside the workbench page. A perspective defines an appropriate collection of views , their layout, and applicable actions for a given user task. Users can switch between perspectives as they move across tasks. From an implementation point of view, the user's active perspective controls which views are shown on the workbench page and their positions and sizes. Editors are not affected by a change in perspective.
A new perspective is added to the workbench using a simple two step process :
Add a perspective extension to the plugin.xml file.
Define a perspective class for the extension within the plug-in.
Step 1 : Add a Perspective Extension to the plugin.xml file
Open MANIFEST.MF with the Plug-in Manifest Editor
Open the Extensions tab
Click Add
In the Extensions Points tab, select org.eclipse.ui.perspectives
Ajouter un screenshot
Click Finish
Right click the new extension : New > perspective
Now, enter the ID , the name and the class corresponding to the perspective.
If the plugin.xml file didn't exist, it is now created. Example 5.4, “plugin.xml” shows the plugin.xml file that was created.
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.0"?>
<plugin>
<extension
point="org.eclipse.ui.perspectives">
<perspective
class="org.objectweb.proactive.ic2d.example.ExamplePerspective"
id="org.objectweb.proactive.ic2d.example.ExamplePerspective"
name="Example"/>
</extension>
</plugin>
Example 5.4. plugin.xml
Step 2 : Define a Perspective Class for the Extension within the Plug-in
Now we need to define the perspective class which must implements the IPerspectiveFactory interface :
package org.objectweb.proactive.ic2d.example;
import org.eclipse.ui.IPageLayout;
import org.eclipse.ui.IPerspectiveFactory;
public class ExamplePerspective implements IPerspectiveFactory {
public static final String ID="org.objectweb.proactive.ic2d.example.ExamplePerspective";
public void createInitialLayout(IPageLayout layout) {
// TODO Auto-generated method stub
}
}
Example 5.5. ExamplePlugin.java
You have created your first perspective !
A view is typically used to navigate a hierarchy of information, open an editor, or display properties for the active editor.
Create a view looks like create a perspective. You have to add a perspective extension to the plugin.xml file and to define a view class for the extension within the plug-in .
Step 1 : Add a View Extension to the plugin.xml file
Add an extension : org.eclipse.ui.views, then add a view and configure it.
An editor is a visual component within a workbench page. It is used to interact with the primary focus of attention, which may be a document, data object, or person. The primary focus of attention is a reflection of the primary task.
![]() | Required |
|---|---|
|
You need to have :
|
cd ProActive/compile ./build ic2dLib (linux) ./build.bat ic2dLib (windows)
A new 'ProActive.jar' is created and pasted in the 'org.objectweb.proactive.ic2d.lib'.
![]() | Note |
|---|---|
|
The 'org.objectweb.proactive.ic2d.lib' plug-in has a lot of libraries including ProActive. If a plug-in want to use ProActive, it need to depends on this plug-in. |
In Eclipse
Select: 'File'>'Import'>'General'>'Existing Projects into Workspace'
Next, select as root directory 'ProActive/ic2d-plugins-src'
And select all
Now, you have several new projects in your workspace.
Copy the file 'ic2d.java.policy ' from 'ProActive/ic2d-plugins-src/org.objectweb.proactive.ic2d/ic2d.java.policy' and paste this one in your home directory.
![]() | On Windows |
|---|---|
|
In the Testing part, press 'Synchronize', and 'Launch the product'
Select the 'org.objectweb.proactive.ic2d' plug-in, and open the file 'ic2d.product'
In the Exporting part, press 'Eclipse Product export wizard'
Select the name of the root directory of the IC2D stand-alone application (ex: MyIC2D).
Select, also the destination, where to create the IC2D stand-alone application.
Press 'Finish'
Now, you have a new directory containing your product. Modify the file IC2D.ini and replace: ${env_var:HOME} by: ${user.home}
In Eclipse, go to: 'Help'>'About Eclipse SDK'>'Feature Details' And search 'Graphical Editing Framework' as Feature Name.
In Eclipse, go to:
'Help'>'Software Updates'>'Find and Install'
Select 'Search fo new features to install'
And check 'Callist Discovery Site'
Select the 'Callisto Discovery Site' in the Update Site Mirrors frame.
Then, Check 'Graphical Editing Framework'
And install this new feature.
Maybe, the plug-in try to export some classes which it doesn't contains. So, on the 'org.objectweb.proactive.ic2d.lib' project, do a right click, and select 'Properties' Go to Java Build Path, and select the 'Libraries' frame. Now remove jar files which displays an error message.
Install the RCP delta pack. See Export Product
© 1997-2010 INRIA/University of Nice-Sophia Antipolis/ActiveEon All Rights Reserved