/**
 * Endpoint accessor mixin
 */
export default function EndpointsMixin(superclass) {
  return class extends superclass {
    constructor() {
      super();

      Object.defineProperty(this, 'endpoints', {
        value: {}
      });
    }

    /**
		 * Add a endpoint
		 * @param {Endpoint} ep
		 * @return {Endpoint} the added endpoint
		 */
    addEndpoint(ep) {
      this.endpoints[ep.name] = ep;
      return ep;
    }

    /**
     * creates a new endpoint form a defintion
     * @param {string} name of the new endpoint
     * @param {Object} def endpoint attributes
     * @param {Object} interceptorFactory
     */
    createEndpointFromConfig(name, def, interceptorFactory) {
      let ep;

      if (def.in) {
        ep = new ReceiveEndpoint(name, this, this.endpointOptions(name, def));
      } else if (def.out) {
        ep = new SendEndpoint(name, this, this.endpointOptions(name, def));
      }

      this.addEndpoint(ep);

      if (def.interceptors !== undefined) {
        ep.interceptors = def.interceptors.map(icDef =>
          interceptorFactory.createInterceptorInstanceFromConfig(icDef, ep)
        );
      }
    }

    /**
		 * removes a endpoint
		 * @param {string} name name of the endpoint
		 * @return {undefined}
		 */
    removeEndpoint(name) {
      delete this.endpoints[name];
    }

    /**
		 * Deliver an identifier suitable as target name.
		 * @param {Endpoint} ep endpoint to be identified
		 * @return {string} endpoint identifier
		 */
    endpointIdentifier(ep) {
      return `${this.name}${this.endpointParentSeparator}${ep.name}`;
    }
  };
}

@@ -1,34 +1,136 @@
-/**%0A * Endpoint accessor mixin
+import %7B SendEndpoint, ReceiveEndpoint %7D from 'kronos-endpoint';%0A%0A/**%0A * Endpoint accessor mixin%0A * Manages endpoints in a container
 %0A */
@@ -516,32 +516,917 @@
 turn ep;%0A    %7D%0A%0A
+    /**%0A     * Deliver the endpoint options for a given endpoint definition.%0A     * @return %7BObject%7D suiable to pass as options to the endpoint factory%0A     */%0A    endpointOptions(name, def) %7B%0A      let options = %7B%7D;%0A%0A      if (def.opposite) %7B%0A        options.createOpposite = true;%0A      %7D%0A%0A      return options;%0A    %7D%0A%0A    /**%0A     * Creates the endpoint objects defined as a combination from%0A     * implementation and definition%0A     * @param %7BObject%7D def The step configuration%0A     * @param %7BObject%7D interceptorFactory%0A     * @api protected%0A     */%0A    createEndpointsFromConfig(def, interceptorFactory) %7B%0A      if (def !== undefined && def.endpoints !== undefined) %7B%0A        Object.keys(def.endpoints).forEach(name =%3E%0A          this.createEndpointFromConfig(%0A            name,%0A            def.endpoints%5Bname%5D,%0A            interceptorFactory%0A          )%0A        );%0A      %7D%0A    %7D%0A%0A
     /**%0A     * c

add endpointOptions() createEndpointsFromConfig()