All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.objectweb.fractal.api.ComponentInterceptorIntent Maven / Gradle / Ivy

There is a newer version: 2.7
Show newest version
/*
 * Generated by: org.ow2.frascati.tinfi.opt.oo.InterceptorClassGenerator
 * on: Fri Jan 15 16:55:14 CET 2010
 */

package org.objectweb.fractal.api;


public class ComponentInterceptorIntent
extends org.ow2.frascati.tinfi.TinfiComponentInterceptor
implements org.objectweb.fractal.api.Component,org.objectweb.fractal.julia.Interceptor {

  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.getFcInterface((java.lang.String)intentMethodArguments[0]);
    }
    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() ) {
      return intentTarget.getFcType();
    }
    else {
      return super.proceed();
    }
  }

}

private static class IntentJoinPointImplForMethod2
extends org.ow2.frascati.tinfi.control.intent.IntentJoinPointImpl {

  public Object proceed() throws Throwable  {
    if( index == handlers.size() ) {
      return intentTarget.getFcInterfaces();
    }
    else {
      return super.proceed();
    }
  }

}
  public ComponentInterceptorIntent()  {
  }

  public ComponentInterceptorIntent(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()  {
    ComponentInterceptorIntent clone = new ComponentInterceptorIntent(getFcItfDelegate());
    initFcClone(clone);
    return clone;
  }

  public java.lang.Object getFcInterface(final java.lang.String arg0) throws org.objectweb.fractal.api.NoSuchInterfaceException  {
    java.util.List handlers = intentHandlersMap.get(METHODS[0]);
    try {
      if( handlers.size() == 0 ) {
        java.lang.Object ret = impl.getFcInterface(arg0);
        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],arg0);
    java.lang.Object ret = ijp.proceed();
    return ret;
      }
    }
    catch( Throwable t ) {
      if( t instanceof org.objectweb.fractal.api.NoSuchInterfaceException ) {
        throw (org.objectweb.fractal.api.NoSuchInterfaceException) t;
      }
      if( t instanceof RuntimeException ) {
        throw (RuntimeException) t;
      }
      throw new org.ow2.frascati.tinfi.TinfiRuntimeException(t);
    }
  }

  public org.objectweb.fractal.api.Type getFcType()  {
    java.util.List handlers = intentHandlersMap.get(METHODS[1]);
    try {
      if( handlers.size() == 0 ) {
        org.objectweb.fractal.api.Type ret = impl.getFcType();
        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 IntentJoinPointImplForMethod1();
        ijp.init(handlers,compctx,itf,impl,METHODS[1]);
    org.objectweb.fractal.api.Type ret = (org.objectweb.fractal.api.Type) ijp.proceed();
    return ret;
      }
    }
    catch( Throwable t ) {
      if( t instanceof RuntimeException ) {
        throw (RuntimeException) t;
      }
      throw new org.ow2.frascati.tinfi.TinfiRuntimeException(t);
    }
  }

  public java.lang.Object[] getFcInterfaces()  {
    java.util.List handlers = intentHandlersMap.get(METHODS[2]);
    try {
      if( handlers.size() == 0 ) {
        java.lang.Object[] ret = impl.getFcInterfaces();
        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 IntentJoinPointImplForMethod2();
        ijp.init(handlers,compctx,itf,impl,METHODS[2]);
    java.lang.Object[] ret = (java.lang.Object[]) ijp.proceed();
    return ret;
      }
    }
    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.Component.class.getMethod("getFcInterface",java.lang.String.class),
        org.objectweb.fractal.api.Component.class.getMethod("getFcType"),
        org.objectweb.fractal.api.Component.class.getMethod("getFcInterfaces"),
      };
    }
    catch( NoSuchMethodException e ) {
      throw new org.ow2.frascati.tinfi.TinfiRuntimeException(e);
    }
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy