Package fr.imag.adele.apam.declarations.instrumentation

Examples of fr.imag.adele.apam.declarations.instrumentation.CallbackDeclaration


    /*
     * Add automatically a life-cycle callback in case the class implements directly the APAM component interface
     */
    Class<?> pojoClass = this.getClazz();
    if (ApamComponent.class.isAssignableFrom(pojoClass)) {
      implementation.addCallback(AtomicImplementationDeclaration.Event.INIT,    new CallbackDeclaration(implementation, "apamInit"));
      implementation.addCallback(AtomicImplementationDeclaration.Event.REMOVE, new CallbackDeclaration(implementation, "apamRemove"));
    }
   
    /*
     * register callbacks
     */
 
View Full Code Here


  /**
   * parse callback declaration
   */

  private CallbackDeclaration parseCallback(AtomicImplementationDeclaration implementation, String methodName) {
    CallbackDeclaration callback = new CallbackDeclaration(implementation, methodName);
    if (!callback.isValidInstrumentation()) {
      errorHandler.report(Severity.ERROR, implementation.getName() + " : the specified method \"" + methodName + "\" is invalid or not found");
    }
    return callback;

  }
View Full Code Here

    String bindCallback = parseString(component.getName(), element, ATT_BIND, false);
    String unbindCallback = parseString(component.getName(), element, ATT_UNBIND, false);

    if (component instanceof AtomicImplementationDeclaration) {
      if (bindCallback != null) {
        CallbackDeclaration callback = new CallbackDeclaration((AtomicImplementationDeclaration) component, bindCallback,true);
        if (!callback.isValidInstrumentation()) {
          errorHandler.report(Severity.ERROR, component.getName() + " : the specified method \"" + bindCallback + "\" in \"" + ATT_BIND + "\" is invalid or not found");
        }
        relation.addCallback(RelationDeclaration.Event.BIND, callback);
      }
      if (unbindCallback != null) {
        CallbackDeclaration callback = new CallbackDeclaration((AtomicImplementationDeclaration) component, unbindCallback,true);
        if (!callback.isValidInstrumentation()) {
          errorHandler.report(Severity.ERROR, component.getName() + " : the specified method \"" + unbindCallback + "\" in \"" + ATT_UNBIND + "\" is invalid or not found");
        }
        relation.addCallback(RelationDeclaration.Event.UNBIND, callback);
      }
    }
View Full Code Here

TOP

Related Classes of fr.imag.adele.apam.declarations.instrumentation.CallbackDeclaration

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.