CHAMELEON framework
CHAMELEON allows the development and deployment of Java applications that, via the different adaptation alternatives (i.e., different implementations), are generic and can be correctly adapted with respect to a dynamically provided execution context. A complete description of the CHAMELEON Framework can be found in [PhDThesis'10 - A Framework For Context Aware Adaptable Software Applications And Services ]. The figure below shows the framework architecture.
adaptable public class e-learningMidlet extends MIDlet
implements CommandListener {
State state;
public e-learningMidlet(){...}
/* Life-cycle management methods */
protected void pauseApp(){...}
protected void startApp(){...}
protected void destroyApp(){...}
/* State management methods */
adaptable protected void saveState();
adaptable protected void restoreState();
/* e-Learning specific methods */
adaptable void connect();
adaptable void getLesson();
...
}
//----------------------------------------------------------
alternative class GPRS adapts e-learningMidlet {
void connect() {
Annotation.slsAnnotation("Cost(low),e-lQuality(low)");
Middleware.connectViaGPRS();
}
void getLesson() { /* streaming of the lesson slides */ }
protected void saveState() { ... /* save into the state the
number of the current slide */ ...}
protected void restoreState() { ... /* restore the saved state */}
}
//-----------------------------------------------------------
alternative class WiFi adapts e-learningMidlet {
void connect() {
Annotation.slsAnnotation("Cost(high),e-lQuality(high)");
Middleware.connectViaWiFi();
}
void getLesson() { /* streaming of the video lesson
with its multimedia content */
Annotation.resourceAnnotation("Battery(high)");
...
}
protected void saveState() { ... /* save into the state the
current frame of the video lesson */ ...}
protected void restoreState() { ... /* restore the saved state */}
}
defineRES Battery as {low,medium,high}
defineRES WiFi as Boolean
defineRES WiFiNet as Boolean
defineRES GPRS as Boolean
defineRES GPRSNet as Boolean
Resource Sets:
DemandGPRS = {GPRS(true), GPRSNet(true)};
DemandWiFi = {WiFi(true),
WiFiNet(true), Battery(high)};
Supply 1 = {GPRS(true), WiFi(true), GPRSNet(true),
WiFiNet(false), Battery(low)};
Supply 2 = {GPRS(true), WiFi(true), GPRSNet(true),
WiFiNet(true), Battery(high)};
Broadly speaking a resource is any item that is
required to accomplish an activity or complete a task. Some
resources are subject to consumption (e.g., energy, heap space),
while others, if present, are never exhausted (e.g., function
libraries, network radio interfaces). Thus, we model a
resource as a typed identifier that can be associated to
Natural, Boolean or Enumerated values. Natural
values are used for consumable resources whose availability varies
during execution. Boolean values define resources that can be
present or not (i.e. non-consumable ones). Enumerated values can
define non-consumable resources that provide a restricted set of
admissible values (e.g. screen resolution, network type).
Above we show an example
of some resource definitions. A resource instance is an
association res(val) where a resource res is coupled to its
value val in typeof(res) (e.g. WiFi(true)). A
resource set is a set of resource instances with no resource
occurring more than once. It is used to specify both the
resource demand of an alternative and the resource
supply of an execution environment.
defineSLS Cost as {low, high};
defineSLS e-lQuality as {low, high};
SLS Sets:
SLSGPRS = {Cost(low), e-lQuality(low)};
SLSWiFi = {Cost(high), e-lQuality(high)};
Please refer to [PhDThesis'10,08">CAMPUS'08,FASE'09,TechRep10]
(and references therein) for more details.
CHAMELEON has been fully implemented in Java (although other languages are eligible) and uses XML-based data encoding for the Resource and SLS Models. It is worth mentioning that, even though both the ARA and the Customizer could be space and time consuming, they are executed on the server-side of the framework which should not suffer resource limitations.
Paola
::©www.di.univaq.it/inverard
Marco
::©www.di.univaq.it/marco.autili
Paolo
::©www.di.univaq.it/paolo.dibenedetto
::last modified: --\--\--