Commit 64eb35ae authored by Lionel Seinturier's avatar Lionel Seinturier

ReconfigurableComponentContext interface for accessing the reconfiguration API...

ReconfigurableComponentContext interface for accessing the reconfiguration API (o.o.f.api.Component) for @Context annotated elements.
See discussion on the frascati-team ML: http://mail.ow2.org/wws/arc/frascati-team/2009-04/msg00021.html
parent 6a5ec76f
......@@ -9,6 +9,8 @@ Tinfi 0.6
* SCA intent handler controller (features requested by Philippe)
* method level granularity for adding, listing and removing an intent handler
* intent handler on control interfaces
* ReconfigurableComponentContext interface for accessing the reconfiguration API
(o.o.f.api.Component) for @Context annotated elements
Tinfi 0.4.4
......
......@@ -35,9 +35,9 @@ import org.objectweb.fractal.juliac.ucf.UnifiedMethod;
import org.objectweb.fractal.juliac.visit.BlockSourceCodeVisitor;
import org.objectweb.fractal.juliac.visit.ClassSourceCodeVisitor;
import org.objectweb.fractal.juliac.visit.MethodSourceCodeVisitor;
import org.osoa.sca.ComponentContext;
import org.ow2.frascati.tinfi.TinfiComponentInterceptor;
import org.ow2.frascati.tinfi.TinfiRuntimeException;
import org.ow2.frascati.tinfi.control.component.ReconfigurableComponentContext;
import org.ow2.frascati.tinfi.control.intent.IntentHandler;
import org.ow2.frascati.tinfi.control.intent.IntentJoinPoint;
import org.ow2.frascati.tinfi.control.intent.IntentJoinPointImpl;
......@@ -181,7 +181,7 @@ extends AbstractInterceptorSourceCodeGenerator {
// Constructor
String[] args = new String[ paramtypes.length + 5];
args[0] = "java.util.List<"+IntentHandler.class.getName()+"> handlers";
args[1] = ComponentContext.class.getName()+" compctx";
args[1] = ReconfigurableComponentContext.class.getName()+" compctx";
args[2] = Interface.class.getName()+" itf";
args[3] = proxyclname+" intentTarget";
args[4] = "java.lang.reflect.Method intentMethod";
......@@ -295,7 +295,7 @@ extends AbstractInterceptorSourceCodeGenerator {
// Retrieve the component context
mv.visit (" ");
mv.visit (ComponentContext.class.getName());
mv.visit (ReconfigurableComponentContext.class.getName());
mv.visitln(" compctx = getFcCompCtxCtrlItf();");
// Retrieve the interface associated with the interceptor
......
......@@ -31,7 +31,6 @@ import org.objectweb.fractal.api.Interface;
import org.objectweb.fractal.api.NoSuchInterfaceException;
import org.objectweb.fractal.api.type.InterfaceType;
import org.osoa.sca.CallableReference;
import org.osoa.sca.ComponentContext;
import org.osoa.sca.RequestContext;
import org.osoa.sca.ServiceReference;
import org.ow2.frascati.tinfi.TinfiRuntimeException;
......@@ -40,11 +39,12 @@ import org.ow2.frascati.tinfi.control.property.SCAPropertyController;
import org.ow2.frascati.tinfi.osoa.ServiceReferenceImpl;
/**
* Mixin layer for implementing the {@link ComponentContext} controller.
* Mixin layer for implementing the {@link ReconfigurableComponentContext} controller.
*
* @author Lionel Seinturier <Lionel.Seinturier@univ-lille1.fr>
*/
public abstract class ComponentContextMixin implements ComponentContext {
public abstract class ComponentContextMixin
implements ReconfigurableComponentContext {
// -------------------------------------------------------------------------
// Private constructor
......@@ -211,6 +211,18 @@ public abstract class ComponentContextMixin implements ComponentContext {
return top;
}
// -------------------------------------------------------------------------
// Implementation of the ReconfigurableComponentContext interface
// -------------------------------------------------------------------------
/**
* Return the reference of the component controller associated with this
* controller.
*/
public Component getFcComponent() {
return _this_weaveableC;
}
// -------------------------------------------------------------------------
// Implementation specific
......
......@@ -27,7 +27,7 @@ import org.objectweb.fractal.api.factory.InstantiationException;
import org.objectweb.fractal.julia.Controller;
import org.objectweb.fractal.julia.InitializationContext;
import org.osoa.sca.ComponentContext;
import org.ow2.frascati.tinfi.control.component.ComponentContextDef;
import org.ow2.frascati.tinfi.control.component.ReconfigurableComponentContext;
/**
* Mixin layer for controllers which use the services provided by the {@link
......@@ -57,7 +57,8 @@ public abstract class UseComponentContextMixin implements Controller {
public void initFcController(final InitializationContext ic)
throws InstantiationException {
weavableCompCtx = (ComponentContext) ic.interfaces.get(ComponentContextDef.NAME);
weavableCompCtx = (ReconfigurableComponentContext)
ic.interfaces.get(ReconfigurableComponentContext.NAME);
/*
* Propagate the invocation to other mixin layers.
......@@ -67,7 +68,7 @@ public abstract class UseComponentContextMixin implements Controller {
/** Reference to the component context content controller. */
@SuppressWarnings("unused")
private ComponentContext weavableCompCtx;
private ReconfigurableComponentContext weavableCompCtx;
// -------------------------------------------------------------------------
......
......@@ -31,12 +31,9 @@ import org.objectweb.fractal.api.factory.InstantiationException;
import org.objectweb.fractal.julia.Controller;
import org.objectweb.fractal.julia.InitializationContext;
import org.objectweb.fractal.julia.factory.ChainedInstantiationException;
import org.osoa.sca.ComponentContext;
import org.osoa.sca.RequestContext;
import org.osoa.sca.annotations.Destroy;
import org.ow2.frascati.tinfi.control.content.ContentClassMetaData;
import org.ow2.frascati.tinfi.control.content.IllegalContentClassMetaData;
import org.ow2.frascati.tinfi.control.content.SCAContentController;
import org.ow2.frascati.tinfi.control.component.ReconfigurableComponentContext;
import org.ow2.frascati.tinfi.control.content.scope.CompositeScopeManager;
import org.ow2.frascati.tinfi.control.content.scope.ConversationScopeManager;
import org.ow2.frascati.tinfi.control.content.scope.RequestScopeManager;
......@@ -205,10 +202,10 @@ public abstract class SCAContentControllerMixin
public NameController _this_weaveableOptNC;
/**
* The {@link ComponentContext} interface of the component to which this
* controller object belongs.
* The {@link ReconfigurableComponentContext} interface of the component to
* which this controller object belongs.
*/
public ComponentContext _this_weavableCompCtx;
public ReconfigurableComponentContext _this_weavableCompCtx;
/**
* The {@link SCAPropertyController} interface of the component to which
......
......@@ -6,7 +6,7 @@
# ComponentContext interface
(sca-component-controller-itf
(sca-component-controller org.osoa.sca.ComponentContext)
(sca-component-controller org.ow2.frascati.tinfi.control.component.ReconfigurableComponentContext)
)
# SCAContentController interface
......
......@@ -36,9 +36,8 @@ import org.objectweb.fractal.api.NoSuchInterfaceException;
import org.objectweb.fractal.api.factory.InstantiationException;
import org.objectweb.fractal.julia.InitializationContext;
import org.objectweb.fractal.julia.Interceptor;
import org.osoa.sca.ComponentContext;
import org.osoa.sca.RequestContext;
import org.ow2.frascati.tinfi.control.component.ComponentContextDef;
import org.ow2.frascati.tinfi.control.component.ReconfigurableComponentContext;
import org.ow2.frascati.tinfi.control.content.SCAContentController;
import org.ow2.frascati.tinfi.control.intent.IntentHandler;
......@@ -80,7 +79,7 @@ public abstract class TinfiComponentInterceptor implements Interceptor {
}
private Component owner;
private ComponentContext compctx;
private ReconfigurableComponentContext compctx;
private SCAContentController cc;
private Interface itf;
......@@ -297,9 +296,12 @@ public abstract class TinfiComponentInterceptor implements Interceptor {
* associated with the current component. This method is used by generated
* subclasses.
*/
protected ComponentContext getFcCompCtxCtrlItf() {
protected ReconfigurableComponentContext getFcCompCtxCtrlItf() {
if( compctx == null ) {
compctx = getFcInterface(ComponentContextDef.NAME,ComponentContext.class);
compctx =
getFcInterface(
ReconfigurableComponentContext.NAME,
ReconfigurableComponentContext.class );
}
return compctx;
}
......
/***
* OW2 FraSCAti Tinfi
* Copyright (C) 2007-2009 INRIA, USTL
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser 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
*
* Contact: frascati@ow2.org
*
* Author: Lionel Seinturier
*/
package org.ow2.frascati.tinfi.control.component;
import org.objectweb.fractal.api.Component;
import org.objectweb.fractal.api.type.InterfaceType;
import org.objectweb.fractal.julia.type.BasicInterfaceType;
import org.osoa.sca.ComponentContext;
/**
* This interface contains data related to the {@link
* org.osoa.sca.ComponentContext} control interface.
*
* @author Lionel Seinturier <Lionel.Seinturier@univ-lille1.fr>
* @since 0.6
*/
public interface ReconfigurableComponentContext extends ComponentContext {
/** <code>NAME</code> of the component context control interface. */
final public static String NAME = "sca-component-controller";
/** <code>TYPE</code> of the component context control interface. */
final public static InterfaceType TYPE =
new BasicInterfaceType(
NAME,
ReconfigurableComponentContext.class.getName(),
false, false, false );
/**
* Return the reference of the component controller associated with this
* controller.
*/
public Component getFcComponent();
}
......@@ -46,7 +46,6 @@ import org.objectweb.fractal.julia.ComponentInterface;
import org.objectweb.fractal.julia.Interceptor;
import org.objectweb.fractal.julia.factory.ChainedInstantiationException;
import org.osoa.sca.CallableReference;
import org.osoa.sca.ComponentContext;
import org.osoa.sca.RequestContext;
import org.osoa.sca.ServiceReference;
import org.osoa.sca.annotations.Constructor;
......@@ -55,6 +54,7 @@ import org.osoa.sca.annotations.Reference;
import org.ow2.frascati.tinfi.CallbackManager;
import org.ow2.frascati.tinfi.TinfiComponentOutInterface;
import org.ow2.frascati.tinfi.TinfiRuntimeException;
import org.ow2.frascati.tinfi.control.component.ReconfigurableComponentContext;
import org.ow2.frascati.tinfi.control.content.AnnotatedElementNotFoundException;
import org.ow2.frascati.tinfi.control.content.ContentClassMetaData;
import org.ow2.frascati.tinfi.control.content.IllegalAnnotatedElementOperationException;
......@@ -64,13 +64,13 @@ import org.ow2.frascati.tinfi.control.property.SCAPropertyController;
* Root class for scope managers.
*
* @author Lionel Seinturier <Lionel.Seinturier@univ-lille1.fr>
* @author Philippe Merle <Philippe.Merle@lifl.fr>
* @author Philippe Merle <Philippe.Merle@inria.fr>
*/
public class AbstractScopeManager {
protected Component comp;
protected SCAPropertyController scapc;
protected ComponentContext compCtx;
protected ReconfigurableComponentContext compCtx;
protected NameController nc;
/**
......@@ -80,8 +80,9 @@ public class AbstractScopeManager {
protected ContentClassMetaData ccmd;
public AbstractScopeManager(
Component comp, SCAPropertyController scapc, ComponentContext compCtx,
NameController nc, ContentClassMetaData ccmd ) {
Component comp, SCAPropertyController scapc,
ReconfigurableComponentContext compCtx, NameController nc,
ContentClassMetaData ccmd ) {
this.comp = comp;
this.scapc = scapc;
......
......@@ -26,7 +26,7 @@ package org.ow2.frascati.tinfi.control.content.scope;
import org.objectweb.fractal.api.Component;
import org.objectweb.fractal.api.control.NameController;
import org.objectweb.fractal.api.factory.InstantiationException;
import org.osoa.sca.ComponentContext;
import org.ow2.frascati.tinfi.control.component.ReconfigurableComponentContext;
import org.ow2.frascati.tinfi.control.content.ContentClassMetaData;
import org.ow2.frascati.tinfi.control.property.SCAPropertyController;
......@@ -34,13 +34,15 @@ import org.ow2.frascati.tinfi.control.property.SCAPropertyController;
* Manager for composite-scoped components.
*
* @author Lionel Seinturier <Lionel.Seinturier@univ-lille1.fr>
* @author Philippe Merle <Philippe.Merle@lifl.fr>
* @author Philippe Merle <Philippe.Merle@inria.fr>
*/
public class CompositeScopeManager extends AbstractScopeManager implements ScopeManager {
public class CompositeScopeManager extends AbstractScopeManager
implements ScopeManager {
public CompositeScopeManager(
Component comp, SCAPropertyController scapc, ComponentContext compCtx,
NameController nc, ContentClassMetaData ccmd ) {
Component comp, SCAPropertyController scapc,
ReconfigurableComponentContext compCtx, NameController nc,
ContentClassMetaData ccmd ) {
super(comp,scapc,compCtx,nc,ccmd);
}
......
......@@ -33,10 +33,10 @@ import org.objectweb.fractal.api.Component;
import org.objectweb.fractal.api.control.NameController;
import org.objectweb.fractal.api.factory.InstantiationException;
import org.objectweb.fractal.julia.factory.ChainedInstantiationException;
import org.osoa.sca.ComponentContext;
import org.osoa.sca.Conversation;
import org.osoa.sca.ConversationEndedException;
import org.ow2.frascati.tinfi.ConversationManager;
import org.ow2.frascati.tinfi.control.component.ReconfigurableComponentContext;
import org.ow2.frascati.tinfi.control.content.ContentClassMetaData;
import org.ow2.frascati.tinfi.control.property.SCAPropertyController;
import org.ow2.frascati.tinfi.osoa.ConversationImpl;
......@@ -45,13 +45,15 @@ import org.ow2.frascati.tinfi.osoa.ConversationImpl;
* Manager for conversation-scoped components.
*
* @author Lionel Seinturier <Lionel.Seinturier@univ-lille1.fr>
* @author Philippe Merle <Philippe.Merle@lifl.fr>
* @author Philippe Merle <Philippe.Merle@inria.fr>
*/
public class ConversationScopeManager extends AbstractScopeManager implements ScopeManager {
public class ConversationScopeManager extends AbstractScopeManager
implements ScopeManager {
public ConversationScopeManager(
Component comp, SCAPropertyController scapc, ComponentContext compCtx,
NameController nc, ContentClassMetaData ccmd ) {
Component comp, SCAPropertyController scapc,
ReconfigurableComponentContext compCtx, NameController nc,
ContentClassMetaData ccmd ) {
super(comp,scapc,compCtx,nc,ccmd);
}
......
......@@ -30,8 +30,8 @@ import java.util.Stack;
import org.objectweb.fractal.api.Component;
import org.objectweb.fractal.api.control.NameController;
import org.objectweb.fractal.api.factory.InstantiationException;
import org.osoa.sca.ComponentContext;
import org.osoa.sca.RequestContext;
import org.ow2.frascati.tinfi.control.component.ReconfigurableComponentContext;
import org.ow2.frascati.tinfi.control.content.ContentClassMetaData;
import org.ow2.frascati.tinfi.control.property.SCAPropertyController;
......@@ -39,13 +39,15 @@ import org.ow2.frascati.tinfi.control.property.SCAPropertyController;
* Manager for request-scoped components.
*
* @author Lionel Seinturier <Lionel.Seinturier@univ-lille1.fr>
* @author Philippe Merle <Philippe.Merle@lifl.fr>
* @author Philippe Merle <Philippe.Merle@inria.fr>
*/
public class RequestScopeManager extends AbstractScopeManager implements ScopeManager {
public class RequestScopeManager extends AbstractScopeManager
implements ScopeManager {
public RequestScopeManager(
Component comp, SCAPropertyController scapc, ComponentContext compCtx,
NameController nc, ContentClassMetaData ccmd ) {
Component comp, SCAPropertyController scapc,
ReconfigurableComponentContext compCtx, NameController nc,
ContentClassMetaData ccmd ) {
super(comp,scapc,compCtx,nc,ccmd);
}
......
......@@ -32,7 +32,7 @@ import org.osoa.sca.RequestContext;
* Interface for scope managers.
*
* @author Lionel Seinturier <Lionel.Seinturier@univ-lille1.fr>
* @author Philippe Merle <Philippe.Merle@lifl.fr>
* @author Philippe Merle <Philippe.Merle@inria.fr>
*/
public interface ScopeManager {
......@@ -48,8 +48,8 @@ public interface ScopeManager {
*
* @param content the content instance which is released
* @param isEndMethod
* true if the method which releases the content instance is annotated
* with {@link org.osoa.sca.annotations.EndsConversation}.
* <code>true</code> if the method which releases the content instance
* is annotated with {@link org.osoa.sca.annotations.EndsConversation}.
*/
public void releaseFcContent( Object content, boolean isEndMethod );
......
......@@ -26,7 +26,7 @@ package org.ow2.frascati.tinfi.control.content.scope;
import org.objectweb.fractal.api.Component;
import org.objectweb.fractal.api.control.NameController;
import org.objectweb.fractal.api.factory.InstantiationException;
import org.osoa.sca.ComponentContext;
import org.ow2.frascati.tinfi.control.component.ReconfigurableComponentContext;
import org.ow2.frascati.tinfi.control.content.ContentClassMetaData;
import org.ow2.frascati.tinfi.control.property.SCAPropertyController;
......@@ -34,13 +34,15 @@ import org.ow2.frascati.tinfi.control.property.SCAPropertyController;
* Manager for stateless-scoped components.
*
* @author Lionel Seinturier <Lionel.Seinturier@univ-lille1.fr>
* @author Philippe Merle <Philippe.Merle@lifl.fr>
* @author Philippe Merle <Philippe.Merle@inria.fr>
*/
public class StatelessScopeManager extends AbstractScopeManager implements ScopeManager {
public class StatelessScopeManager extends AbstractScopeManager
implements ScopeManager {
public StatelessScopeManager(
Component comp, SCAPropertyController scapc, ComponentContext compCtx,
NameController nc, ContentClassMetaData ccmd ) {
Component comp, SCAPropertyController scapc,
ReconfigurableComponentContext compCtx, NameController nc,
ContentClassMetaData ccmd ) {
super(comp,scapc,compCtx,nc,ccmd);
}
......
......@@ -25,7 +25,7 @@ package org.ow2.frascati.tinfi.control.intent;
import org.aopalliance.intercept.MethodInvocation;
import org.objectweb.fractal.api.Interface;
import org.osoa.sca.ComponentContext;
import org.ow2.frascati.tinfi.control.component.ReconfigurableComponentContext;
/**
* Interface for introspecting intent join points. An intent join point
......@@ -39,7 +39,7 @@ public interface IntentJoinPoint extends MethodInvocation {
/**
* Return the component context for which the intent has been defined.
*/
public ComponentContext getComponentContext();
public ReconfigurableComponentContext getComponentContext();
/**
* Return the component interface (service or reference) for which the
......
......@@ -28,8 +28,8 @@ import java.lang.reflect.Method;
import java.util.List;
import org.objectweb.fractal.api.Interface;
import org.osoa.sca.ComponentContext;
import org.ow2.frascati.tinfi.TinfiRuntimeException;
import org.ow2.frascati.tinfi.control.component.ReconfigurableComponentContext;
/**
* Implementation of the {@link IntentJoinPoint} interface for introspecting
......@@ -44,7 +44,7 @@ public class IntentJoinPointImpl implements IntentJoinPoint {
protected List<IntentHandler> handlers;
protected int index = 0;
protected ComponentContext intentComponentContext;
protected ReconfigurableComponentContext intentComponentContext;
protected Interface intentItf;
protected Object intentTarget;
private Method intentMethod;
......@@ -52,7 +52,7 @@ public class IntentJoinPointImpl implements IntentJoinPoint {
public IntentJoinPointImpl(
List<IntentHandler> handlers,
ComponentContext intentComponentContext,
ReconfigurableComponentContext intentComponentContext,
Interface intentItf,
Object intentTarget,
Method intentMethod,
......@@ -69,7 +69,7 @@ public class IntentJoinPointImpl implements IntentJoinPoint {
/**
* Return the component context for which the intent has been defined.
*/
public ComponentContext getComponentContext() {
public ReconfigurableComponentContext getComponentContext() {
return intentComponentContext;
}
......
......@@ -72,21 +72,22 @@
<mixin>org.objectweb.fractal.julia:julia-mixins:${julia.version}:sources</mixin>
</mixins>
<adls>
<adl>org.ow2.frascati.tinfi.PolicySetsHandler</adl>
<adl>org.ow2.frascati.tinfi.PolicySets</adl>
<adl>org.ow2.frascati.tinfi.SCAContentController</adl>
<adl>org.ow2.frascati.tinfi.Constructor</adl>
<adl>org.ow2.frascati.tinfi.DuplicateReference</adl>
<adl>org.ow2.frascati.tinfi.BadDestroy</adl>
<adl>org.ow2.frascati.tinfi.BadInit</adl>
<adl>org.ow2.frascati.tinfi.ComponentContext</adl>
<adl>org.ow2.frascati.tinfi.ComponentName</adl>
<adl>org.ow2.frascati.tinfi.Constructor</adl>
<adl>org.ow2.frascati.tinfi.DuplicateDestroy</adl>
<adl>org.ow2.frascati.tinfi.DuplicateInit</adl>
<adl>org.ow2.frascati.tinfi.DuplicateReference</adl>
<adl>org.ow2.frascati.tinfi.OneWay</adl>
<adl>org.ow2.frascati.tinfi.PolicySetsHandler</adl>
<adl>org.ow2.frascati.tinfi.PolicySets</adl>
<adl>org.ow2.frascati.tinfi.Property</adl>
<adl>org.ow2.frascati.tinfi.ReconfigurableComponentContext</adl>
<adl>org.ow2.frascati.tinfi.ReferenceMultiple</adl>
<adl>org.ow2.frascati.tinfi.ReferenceNotSet</adl>
<adl>org.ow2.frascati.tinfi.SCAContentController</adl>
<adl>org.ow2.frascati.tinfi.ScopeComposite</adl>
<adl>org.ow2.frascati.tinfi.ScopeConversation</adl>
<adl>org.ow2.frascati.tinfi.ScopeRequest</adl>
......
/***
* OW2 FraSCAti Tinfi
* Copyright (C) 2009 INRIA, USTL
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser 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
*
* Contact: frascati@ow2.org
*
* Author: Lionel Seinturier
*/
package org.ow2.frascati.tinfi;
import org.objectweb.fractal.api.Component;
import org.osoa.sca.annotations.Context;
import org.ow2.frascati.tinfi.control.component.ReconfigurableComponentContext;
/**
* Component implementation for testing the features provided by the {@link
* ReconfigurableComponentContext} interface.
*
* @author Lionel Seinturier <Lionel.Seinturier@univ-lille1.fr>
* @since 0.6
*/
public class ReconfigurableComponentContextImpl
implements ReconfigurableComponentContextItf {
@Context
public ReconfigurableComponentContext ctx;
public Component getFcComponent() {
Component comp = ctx.getFcComponent();
return comp;
}
}
/***
* OW2 FraSCAti Tinfi
* Copyright (C) 2009 INRIA, USTL
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser 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
*
* Contact: frascati@ow2.org
*
* Author: Lionel Seinturier
*/
package org.ow2.frascati.tinfi;
import org.objectweb.fractal.api.Component;
import org.ow2.frascati.tinfi.control.component.ReconfigurableComponentContext;
/**
* Interface provided by the component implementation used for testing the
* features provided by the {@link ReconfigurableComponentContext} interface.
*
* @author Lionel Seinturier <Lionel.Seinturier@univ-lille1.fr>
* @since °.6
*/
public interface ReconfigurableComponentContextItf {
public Component getFcComponent();
}
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE definition PUBLIC "-//objectweb.org//DTD Fractal ADL 2.0//EN" "classpath://org/objectweb/fractal/adl/xml/standard.dtd">
<definition name="org.ow2.frascati.tinfi.ReconfigurableComponentContext" >
<interface
name="r" role="server"
signature="org.ow2.frascati.tinfi.ReconfigurableComponentContextItf" />
<content class="org.ow2.frascati.tinfi.ReconfigurableComponentContextImpl" />
<controller desc="scaPrimitive" />
</definition>
/***
* OW2 FraSCAti Tinfi
* Copyright (C) 2009 INRIA, USTL
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser 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
*
* Contact: frascati@ow2.org
*
* Author: Lionel Seinturier
*/
package org.ow2.frascati.tinfi;
import junit.framework.TestCase;
import org.objectweb.fractal.api.Component;
import org.objectweb.fractal.api.NoSuchInterfaceException;
import org.objectweb.fractal.api.control.IllegalLifeCycleException;
import org.objectweb.fractal.api.factory.InstantiationException;
import org.objectweb.fractal.util.Fractal;
import org.ow2.frascati.tinfi.control.component.ReconfigurableComponentContext;
/**
* Class for testing the features provided by the {@link
* ReconfigurableComponentContext} interface.
*
* @author Lionel Seinturier <Lionel.Seinturier@univ-lille1.fr>
* @since 0.6
*/
public class ReconfigurableComponentContextTestCase extends TestCase {
protected String adl;
protected ReconfigurableComponentContextItf itf;
@Override
protected void setUp()
throws
ClassNotFoundException, InstantiationException, IllegalAccessException,
IllegalLifeCycleException, NoSuchInterfaceException,
java.lang.InstantiationException {
adl = getClass().getPackage().getName()+".ReconfigurableComponentContext";
String service = "r";
itf = TinfiDomain.getService(
adl, ReconfigurableComponentContextItf.class, service );
}
public void testGetFcComponent() throws NoSuchInterfaceException {
Component c = itf.getFcComponent();
String name = Fractal.getNameController(c).getFcName();
assertEquals(adl,name);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment