org.objectweb.fractal.api.control.NameControllerInterceptorIntent Maven / Gradle / Ivy
/*
* Generated by: org.ow2.frascati.tinfi.opt.oo.InterceptorClassGenerator
* on: Fri Jan 15 16:55:14 CET 2010
*/
package org.objectweb.fractal.api.control;
public class NameControllerInterceptorIntent
extends org.ow2.frascati.tinfi.TinfiComponentInterceptor
implements org.objectweb.fractal.julia.Interceptor,org.objectweb.fractal.api.control.NameController {
private static java.lang.reflect.Method[] METHODS;
private static class IntentJoinPointImplForMethod0
extends org.ow2.frascati.tinfi.control.intent.IntentJoinPointImpl {
public Object proceed() throws Throwable {
if( index == handlers.size() ) {
return intentTarget.getFcName();
}
else {
return super.proceed();
}
}
}
private static class IntentJoinPointImplForMethod1
extends org.ow2.frascati.tinfi.control.intent.IntentJoinPointImpl {
public Object proceed() throws Throwable {
if( index == handlers.size() ) {
intentTarget.setFcName((java.lang.String)intentMethodArguments[0]);
return null;
}
else {
return super.proceed();
}
}
}
public NameControllerInterceptorIntent() {
}
public NameControllerInterceptorIntent(Object obj) {
setFcItfDelegate(obj);
}
public void initFcController(org.objectweb.fractal.julia.InitializationContext ic) throws org.objectweb.fractal.api.factory.InstantiationException {
initIntentHandlersMap(METHODS);
super.initFcController(ic);
}
public Object clone() {
NameControllerInterceptorIntent clone = new NameControllerInterceptorIntent(getFcItfDelegate());
initFcClone(clone);
return clone;
}
public java.lang.String getFcName() {
java.util.List handlers = intentHandlersMap.get(METHODS[0]);
try {
if( handlers.size() == 0 ) {
java.lang.String ret = impl.getFcName();
return ret;
}
else {
org.ow2.frascati.tinfi.control.component.ReconfigurableComponentContext compctx = getFcCompCtxCtrlItf();
org.objectweb.fractal.api.Interface itf = getFcItf();
org.ow2.frascati.tinfi.control.intent.IntentJoinPointImpl ijp = new IntentJoinPointImplForMethod0();
ijp.init(handlers,compctx,itf,impl,METHODS[0]);
java.lang.String ret = (java.lang.String) ijp.proceed();
return ret;
}
}
catch( Throwable t ) {
if( t instanceof RuntimeException ) {
throw (RuntimeException) t;
}
throw new org.ow2.frascati.tinfi.TinfiRuntimeException(t);
}
}
public void setFcName(final java.lang.String arg0) {
java.util.List handlers = intentHandlersMap.get(METHODS[1]);
try {
if( handlers.size() == 0 ) {
impl.setFcName(arg0);
}
else {
org.ow2.frascati.tinfi.control.component.ReconfigurableComponentContext compctx = getFcCompCtxCtrlItf();
org.objectweb.fractal.api.Interface itf = getFcItf();
org.ow2.frascati.tinfi.control.intent.IntentJoinPointImpl ijp = new IntentJoinPointImplForMethod1();
ijp.init(handlers,compctx,itf,impl,METHODS[1],arg0);
ijp.proceed();
Object ret = null;
}
}
catch( Throwable t ) {
if( t instanceof RuntimeException ) {
throw (RuntimeException) t;
}
throw new org.ow2.frascati.tinfi.TinfiRuntimeException(t);
}
}
static {
try {
METHODS = new java.lang.reflect.Method[]{
org.objectweb.fractal.api.control.NameController.class.getMethod("getFcName"),
org.objectweb.fractal.api.control.NameController.class.getMethod("setFcName",java.lang.String.class),
};
}
catch( NoSuchMethodException e ) {
throw new org.ow2.frascati.tinfi.TinfiRuntimeException(e);
}
}
}