ReflexD is not an actively-supported project anymore

What is ReflexD?

ReflexD is a versatile kernel for distributed AOP in Java. ReflexD is implemented as an extension of Reflex, making use of Reflex itself and Java RMI as a base for remote invocation.

ReflexD allows distributed AOP providing means to specify:

  • Distributed cut
  • Distributed action
  • Distributed binding

Distributed cut

Distributed cut means that execution points can be selected based on the host they occurr. We have extended both the reflective model and the hookset definition to provide distributed cut.

First, to extend the reflective model, we have added the RHost interface:

public interface RHost{
    public String getName();
    public String getAddress();
    public Properties getProperties();

This interface gives access to certain characteristics of a Reflex-enabled VM (a Host): its name, its RMI address and its system properties. With these characteristics, it is possible to discriminate between hosts and select only those that meet some requirements (this selection is done implementing the HostSelector interface).

And finally, we have extended the notion of PrimitiveHookset to DistributedPrimitiveHookset. Where the difference resides in the latter taking an extra parameter: a HostSelector, that is in charge of the host-based selection. The definition of the HostSelector interface is:

public interface HostSelector{
    public boolean accept(RHost aRHost);

Which unique method accept returns true if the host is interesting in terms of the cut, false otherwise.

Distributed action

The action of an aspect may be possibly executed on a remote host, which is not necessatily the one where the cut is done. We have extended the parametrization, scope and instantiation dimensions for metaobjects.

First, the parametrization has been extended introducing two new parameters related to distribution: HOSTNAME and HOST. These parameters give access to the name of the current host and to a RHost instance representing it. This allows programmers to pass host-sensitive information to metaobjects.

Second, in order to reflect that metaobjects with GLOBAL scope are accesible just in one host, we have renamed Scope.GLOBAL to Scope.HOST.

And finally, we have added means to remotely create objects allowing explicitly-created metaobjects to be placed anywhere. The API to create an object in a remote host is:

RHost host = RHosts.get("", "hostName");
Logger logger = (Logger) host.create("com.logging.Logger");

The code above creates a Logger instance in a remote host located in and named hostName.

Distributed binding

The specification of the binding between the cut and the action of an aspect may be done in any host, which may not be the host where the cut is realized or the action is executed.

In order to do this, we have decoupled the link definition, link storage and link application. Hence, the ReflexD architecture consists in three kinds of hosts:

  • Reflex hosts, where an application (possibly subject to links) runs
  • Aspect hosts, where the links resides, exposed via link repositories
  • Any Java program running on any host that can remotely populate link repositories

For example, to start a link reposotiry:

% java reflex.StartLinkRep debugLinks

Where debugLinks is the name of the repository.

And to put links this repository:

% java reflex.ExportToRep reflex:// ConfDebug

Where ConfDebug is the traditional config class.

And finally, to run an application which is subject to the previously defined link:

% java "--javaagent:reflex.jar=-lp reflex://" Main

The above command runs the application retrieving the links from the link repository named debugLinks in the host. As you can see we use the java.lang.instrumentation classes to instrument the classes being loaded.


To see implementation details, please visit the Remote Consistency Framework page.


Loading bibtex info...