Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
research:software:reflexd [2007/07/29 17:14] adminresearch:software:reflexd [2011/09/20 05:29] (current) etanter
Line 1: Line 1:
 +<note warning>
 +ReflexD is not an actively-supported project anymore
 +</note>
  
 +=====  What is ReflexD? =====
 +
 +ReflexD is a versatile kernel for distributed AOP in Java. ReflexD is implemented as an extension of [[research:software:reflex|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:
 +<code java>
 +public interface RHost{
 +    public String getName();
 +
 +    public String getAddress();
 +
 +    public Properties getProperties();
 +}
 +</code>
 +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:
 +<code java>
 +public interface HostSelector{
 +    public boolean accept(RHost aRHost);
 +}
 +</code>
 +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:
 +
 +<code java>
 +RHost host = RHosts.get("remoteHost.com", "hostName");
 +Logger logger = (Logger) host.create("com.logging.Logger");
 +</code>
 +
 +The code above creates a ''Logger'' instance in a remote host located in ''remoteHost.com'' 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:
 +<code>
 +% java reflex.StartLinkRep debugLinks
 +</code>
 +Where debugLinks is the name of the repository.
 +
 +\\ And to put links this repository:
 +<code>
 +% java reflex.ExportToRep reflex://remoteHost.com/debugLinks ConfDebug
 +</code>
 +Where ConfDebug is the traditional config class.
 +
 +\\ And finally, to run an application which is subject to the previously defined link:
 +<code>
 +% java "--javaagent:reflex.jar=-lp reflex://remoteHost.com/debugLinks" Main
 +</code>
 +
 +The above command runs the application retrieving the links from the link repository named ''debugLinks'' in the ''remoteHost.com'' host. As you can see we use the ''java.lang.instrumentation'' classes to instrument the classes being loaded.
 +
 +=====  Implementation =====
 +
 +To see implementation details, please visit the [[research:software:reflexd:remote|Remote Consistency Framework]] page.
 +
 +
 +=====  Publications =====
 +
 +<html>
 +<script>load_bibtex('reflexd')</script>
 +<div id="bibtex">Loading bibtex info...</div>
 +</html>