Showing posts with label eclipse. Show all posts
Showing posts with label eclipse. Show all posts

Sunday, June 15, 2008

Penelope is born!


Penelope is an Aspect-based framework for enhancing Eclipse RCP applications. It leverages several 3rd party products like Equinox Aspects and Guice/Peaberry and aims to provide a way for creating component-based RCP applications using test-driven-approach.

But more importantly, I've finally started to finalize all this Aspect-related stuff in something really useful! Next moves will involve:
  • verify the feasability of having a platform-wide injector instead of several for bundle.
  • infrastructure for Model-View-Presenter-based development for Eclipse RCP: together with the Presenter-first approach we want to support test-driven development with no excuses! This will require extending the Guice/Peaberry framework with RCP-related support classes.
  • support for Eclipse Extensions (possibly in collaboration with Peaberry)
  • some kind toolbox integrated within the Eclipse workbench to ease development tasks.

Thursday, June 12, 2008

[Solved] Eclipse 3.4 + Ubuntu 8.04 + SUN JDK == Crash

I've been trying to run eclipse 3.4 RC3 on my ubuntu 8.04 64 bit box: nothing. The issues can be tracked to two things:
  1. XULRunner should be updated to latest version, otherwise the internal browser will crash, for example when showing the Welcome view.
  2. The workbench will crash when attempting compilation of your workspace for the first time. This seems to be related to a bug in the HotSpot of your JRE: if you take a look at the crashlog and see something like:
Current CompileTask:
C2:1504 org.eclipse.core.internal.dtree.DataTreeNode.forwardDeltaWith([Lorg/eclipse/core/internal/dtree/AbstractDataTreeNode;[Lorg/eclipse/core/internal/dtree/AbstractDataTreeNode;Lorg/eclipse/core/internal/dtree/IComparator;)[Lorg/eclipse/core/internal/dtree/AbstractDataTreeNode; (469 bytes)
then, welcome into the club ;)

Fortunately there is a workaround even for this by adding

-XX:CompileCommand=exclude,org/eclipse/core/internal/dtree/DataTreeNode,forwardDeltaWith

in your eclipse.ini JVM options.
Kudos to the great community! :D

References

Wednesday, May 14, 2008

E4

Eclipse 4 (codenamed "E4") is being discussed by the architectural board on May 15. You will note that Dependency Injection within Eclipse is also one of focal points. Yeah! Just now that we resorted to use Peaberry + AOP in eConference ;)

Sunday, October 14, 2007

Playing with hooks is nice

As you may know, eclipse provides a set of non-OSGi standard ways to developers to intervene in the framework intricate internal lifecycle (that is, they work only with Equinox). The need I have is to modify the classes bytecode when they are loaded so that I can perform manipulations of my own (let's say AOP-transformations).

From Java 5 you can use the -javaagent:agent.jar option and provide an instrumentor you like. Sadly, I'm still hard to understand how it works (maybe I'm just plain stupid with such things): in my case I only wanted to add the AspectJ weaver but after this modification it complys it cannot find classes in the AspectJ runtime library. So I give up as I want the eclipse-way for doing such things (and to learn about eclipse internals).

The instructions on the wiki page are quite precise (geez!, this is a wiki :))), so I'm only writing about what I've done: maybe it will be helpful for you out there too.
  1. I've imported the org.eclipse.osgi (binary+source) within my workspace, since this is a requirement for adaptors framework to work.
  2. I've create a new fragment for org.eclipse.osgi.
  3. I've written a HookConfigurator-derived class within this fragment and implemented the addHooks( HookRegistry registry ) method for adding my own hooks (Do not forget to export the package in the manifest file!).
    public class SpringHooksConfigurator implements HookConfigurator
    public void addHooks( HookRegistry registry ) {
    SpringInjectorHook springInjector = new SpringInjectorHook();

    registry.addWatcher( springInjector );
    registry.addClassLoadingHook( springInjector );
    }
    }
    (My hook implements both ClassLoadingHook and BundleWatcher interfaces).

  4. I've created a hookconfigurators.properties files to specify the configurators (as explained in the wiki page, the framework will look for such files and load the specified hooks).
    ##
    ## Hooks configuration
    ##
    ## This files describes to Equinox which adaptor hooks are provided by this fragment.
    ## Note that we only provide a HookConfigurator that will add its own hooks by code.
    ##
    hook.configurators = it.uniba.di.cdg.spring.hooks.SpringHooksConfigurator


  5. I've added the -Dosgi.framework.extensions option to the VM arguments and make it point to my own fragment.
Done. Have fun with your ... hooks :)

Monday, October 08, 2007

First International Conference on Eclipse Technology

On October 4/5 I attended to the event. As a community event, I'm pretty happy about such meetings: you can know about other people, their projects and possibilities of collaboration. The bad is that the community has no way to keep in contact efficiently: no mailing-list (geez, that is really a must!), no board (many directions, no direction) and not a real web-site. But the problems emerged clearly and something for addressing the situation is coming: let's hope in Google Group being established ;)
About the event per-se, several people from different subjects like universities and corporations have shown their eclipse-based projects: applications for supporting their interests (e-Learning anybody?), job (running test-cases on distributed environment without changing the core test or designing business processes) and research areas (eConference?) . The linking point is the Eclipse -platform: no theme grouped the speeches.

But:
  • the event should have separated themes allocated for days (of part of days): experience reports, research areas and tutorials(there is a heck of need for them!)
  • Keep the event focused on Eclipse
  • the Java User Groups was quite out-of-place and their intervention subtracted time to the discussions about the future of community. This is sad since many talks (about JBoss Seam, i.e.) where really interesting (but not in an Eclipse event).
For what I understand, an Eclipse-based community has two crossing concerns:
  1. Vertical application domain solutions: we are interested in a domain (eLearning, Business modeling, ...) and we should try to develop common solutions (there are a lot of frameworks in many domains being developed by the world-wide Eclipse community). In what is our national community different?
  2. Horizontal infrastructure solutions: we want to improve systems by developing common reusable parts that can be shared across applications (I mean basic components that can be assembled to compose building blocks for new or existing applications)
So, many of this things are already addressed by the international community. What can the Italian one propose in addition? Ok, everyone of us can develop and contribute improvements to existing Eclipse frameworks as listed on eclipse.org: so why having a national one if we are going to contribute to the Grand WWW directly? I guess that the technological problem has no national boundary so, at the end, the objectives of the community become:
  • to evangelize Eclipse Technology (open, cross-platform, already proven, ...): Eclipse is not only Rich Clients but also server-side technology, reporting tools, ...
  • to share experiences in direct meetings (and since we are on nation-wide scale we should meet more than once a year!)
  • to adapt Eclipse frameworks on Italian context (e-Government over Eclipse)

Monday, May 21, 2007

Spring-OSGi hello world application

The problem

OK, I need dependency injection in my cool Eclipse/OSGi applications. I plan to wrap actual Platform{UI].get*(..) method within Spring-OSGi service beans (that is, Spring beans exported as OSGi services). I want my n-tier applications to communicate through services. Ad I want them to add new features and update existing ones on the fly.

So I downloaded the actual sources, built them and copied all the jars in a directory which I made as additional extension to the JDT. This is good for me since I can play with Spring-OSGi from within eclipse without bothering with maven stuff (maven-eclipse integration is not helpful here).

I created a sample "Hello world" bundle which publishes the spring beans (one implementing a salute in Italian, the other in plain English) and an OSGi Greeter service that could be user by other services.

Spring-OSGi hints

A few things must be remembered:
  • You can have bundle-scoped beans (they are only visible within the application context associated to that bundle and no else!)
  • You can publish some beans as OSGi services (so making them available to the other bundles through the usual OSGi mechanisms, such as the service trackers).
  • You must put your XML files declaring the application context under META-INF/spring directory in your project classpath: *.xml files will be loaded automatically by the Spring Extender service.
  • The Spring Extender bundle must be activated as early as possible in your application's start-up and you cannot use the beans in the BundleActivator.{start,stop} lifecycle methods (the extender will take sometime to load the xmls and publish beans/services)
Keeping this in mind, we have all the usual Spring and OSGi concepts merged together :)

A last question: what is the minimum set of bundle for such a minimal application (no databases, no GUI, just plain OSGi+Spring+Console output) ? Here they are:

id State Bundle
0 ACTIVE system.bundle_3.2.2.R32x_v20070118
163 ACTIVE org.aopalliance_1.0.0
164 ACTIVE org.apache.commons_logging_1.0.4.v200608011657
168 ACTIVE org.aspectj.runtime_1.5.4.200701151324
169 ACTIVE org.aspectj.weaver_1.5.4.200701151324
203 ACTIVE org.springframework.osgi.backport-util-concurrent_3.0.0.SNAPSHOT
208 ACTIVE org.springframework.osgi.spring-aop_2.0.5.osgi_m3_SNAPSHOT
209 ACTIVE org.springframework.osgi.spring-beans_2.0.5.osgi_m3_SNAPSHOT
210 ACTIVE org.springframework.osgi.spring-context_2.0.5.osgi_m3_SNAPSHOT
211 ACTIVE org.springframework.osgi.spring-core_2.0.5.osgi_m3_SNAPSHOT
212 ACTIVE org.springframework.osgi.spring-osgi-core_1.0.0.m3_SNAPSHOT
213 ACTIVE org.springframework.osgi.spring-osgi-extender_1.0.0.m3_SNAPSHOT
214 ACTIVE org.springframework.osgi.spring-osgi-io_1.0.0.m3_SNAPSHOT
219 ACTIVE org.springframework.osgi.spring-osgi-mock_1.0.0.m3_SNAPSHOT

Obviously more will be needed for transactions and persistence frameworks. But for now I'm satisfied since I've breached within this new world!

Next steps
  • testing (unit and integration practices)
  • smoothing out the code and find the right time when to use the published services (for now I just use the service in a addingService() implemented in a custom service tracker of mine.

Thursday, March 01, 2007

Some OSGi links

Just some references to interesting links related to OSGi stuff.
Lastly but not least, I've found a parley from Ramnivas Laddad about DDD and AOP: really enjoyed it!