.. java:import:: java.util Optional .. java:import:: java.lang.reflect Constructor .. java:import:: java.util HashMap .. java:import:: java.util List .. java:import:: java.util Map .. java:import:: java.util UUID .. java:import:: org.slf4j Logger .. java:import:: org.slf4j LoggerFactory .. java:import:: org.slf4j MDC .. java:import:: se.sics.kompics Fault.ResolveAction .. java:import:: se.sics.kompics.config Config .. java:import:: se.sics.kompics.config ConfigUpdate ComponentDefinition =================== .. java:package:: se.sics.kompics :noindex: .. java:type:: public abstract class ComponentDefinition The \ ``ComponentDefinition``\ class. :author: Cosmin Arad , Jim Dowling , Lars Kroll Fields ------ MDC_KEY_CID ^^^^^^^^^^^ .. java:field:: public static final String MDC_KEY_CID :outertype: ComponentDefinition Pre-configured MDC key for the unique component id. See \ `the logback manuel `_\ for how to use this with logback. MDC_KEY_CSTATE ^^^^^^^^^^^^^^ .. java:field:: public static final String MDC_KEY_CSTATE :outertype: ComponentDefinition Pre-configured MDC key for the current component lifecycle state. See \ `the logback manuel `_\ for how to use this with logback. control ^^^^^^^ .. java:field:: protected Negative control :outertype: ComponentDefinition logger ^^^^^^ .. java:field:: protected final Logger logger :outertype: ComponentDefinition Kompics provided slf4j logger with managed diagnostic context. See \ `the logback manuel `_\ for how to use this with logback. loopback ^^^^^^^^ .. java:field:: protected Negative loopback :outertype: ComponentDefinition onSelf ^^^^^^ .. java:field:: protected Positive onSelf :outertype: ComponentDefinition proxy ^^^^^ .. java:field:: public final ComponentProxy proxy :outertype: ComponentDefinition Constructors ------------ ComponentDefinition ^^^^^^^^^^^^^^^^^^^ .. java:constructor:: protected ComponentDefinition() :outertype: ComponentDefinition Instantiates a new component definition. ComponentDefinition ^^^^^^^^^^^^^^^^^^^ .. java:constructor:: @SuppressWarnings protected ComponentDefinition(Class coreClass) :outertype: ComponentDefinition Methods ------- answer ^^^^^^ .. java:method:: protected final

void answer(Direct.Request event) :outertype: ComponentDefinition answer ^^^^^^ .. java:method:: protected final

void answer(Direct.Request req, Direct.Response resp) :outertype: ComponentDefinition config ^^^^^^ .. java:method:: public final Config config() :outertype: ComponentDefinition connect ^^^^^^^ .. java:method:: @Deprecated protected final

Channel

connect(Positive

positive, Negative

negative) :outertype: ComponentDefinition :param

: :param negative: :param positive: connect ^^^^^^^ .. java:method:: @Deprecated protected final

Channel

connect(Negative

negative, Positive

positive) :outertype: ComponentDefinition :param

: :param negative: :param positive: connect ^^^^^^^ .. java:method:: @Deprecated protected

Channel

connect(Positive

positive, Negative

negative, ChannelSelector selector) :outertype: ComponentDefinition :param

: :param negative: :param positive: connect ^^^^^^^ .. java:method:: @Deprecated protected

Channel

connect(Negative

negative, Positive

positive, ChannelSelector selector) :outertype: ComponentDefinition :param

: :param negative: :param positive: connect ^^^^^^^ .. java:method:: protected

Channel

connect(Negative

negative, Positive

positive, ChannelSelector selector, ChannelFactory factory) :outertype: ComponentDefinition connect ^^^^^^^ .. java:method:: protected

Channel

connect(Positive

positive, Negative

negative, ChannelSelector selector, ChannelFactory factory) :outertype: ComponentDefinition connect ^^^^^^^ .. java:method:: protected

Channel

connect(Negative

negative, Positive

positive, ChannelFactory factory) :outertype: ComponentDefinition connect ^^^^^^^ .. java:method:: protected

Channel

connect(Positive

positive, Negative

negative, ChannelFactory factory) :outertype: ComponentDefinition create ^^^^^^ .. java:method:: protected final Component create(Class definition, Init initEvent) :outertype: ComponentDefinition Creates the. :param definition: the definition :param initEvent: init event to be passed to constructor :return: the component create ^^^^^^ .. java:method:: protected final Component create(Class definition, Init.None initEvent) :outertype: ComponentDefinition Creates the. :param definition: the definition :param initEvent: none :return: the component create ^^^^^^ .. java:method:: protected final Component create(Class definition, Init initEvent, ConfigUpdate update) :outertype: ComponentDefinition Creates the. :param definition: the definition :param initEvent: init event to be passed to constructor :return: the component create ^^^^^^ .. java:method:: protected final Component create(Class definition, Init.None initEvent, ConfigUpdate update) :outertype: ComponentDefinition Creates the. :param definition: the definition :param initEvent: none :return: the component destroy ^^^^^^^ .. java:method:: protected final void destroy(Component component) :outertype: ComponentDefinition disconnect ^^^^^^^^^^ .. java:method:: @Deprecated protected final

void disconnect(Negative

negative, Positive

positive) :outertype: ComponentDefinition :param

: :param negative: :param positive: disconnect ^^^^^^^^^^ .. java:method:: @Deprecated protected final

void disconnect(Positive

positive, Negative

negative) :outertype: ComponentDefinition :param

: :param negative: :param positive: disconnect ^^^^^^^^^^ .. java:method:: protected final

void disconnect(Channel

c) :outertype: ComponentDefinition getComponentCore ^^^^^^^^^^^^^^^^ .. java:method:: public final ComponentCore getComponentCore() :outertype: ComponentDefinition getControlPort ^^^^^^^^^^^^^^ .. java:method:: public final Negative getControlPort() :outertype: ComponentDefinition handleFault ^^^^^^^^^^^ .. java:method:: public ResolveAction handleFault(Fault fault) :outertype: ComponentDefinition Override for custom error handling. Default action is ESCALATE. ESCALATE -> Forward fault to parent. IGNORE -> Drop fault. Resume component as if nothing happened. RESOLVED -> Fault has been handled by user. Don't do anything else. :param fault: handleUpdate ^^^^^^^^^^^^ .. java:method:: public UpdateAction handleUpdate(ConfigUpdate update) :outertype: ComponentDefinition Override for custom update handling. Default action is to propagate the original everywhere and apply to self. :param update: id ^^ .. java:method:: public final UUID id() :outertype: ComponentDefinition loggingCtxGet ^^^^^^^^^^^^^ .. java:method:: protected String loggingCtxGet(String key) :outertype: ComponentDefinition Get the value associated with key in the current logging diagnostic context. :param key: :return: the value associated with key loggingCtxPut ^^^^^^^^^^^^^ .. java:method:: protected void loggingCtxPut(String key, String value) :outertype: ComponentDefinition Associate key with value in the logging diagnostic context. See \ `the logback manuel `_\ for how to use this with logback. :param key: :param value: loggingCtxPutAlways ^^^^^^^^^^^^^^^^^^^ .. java:method:: protected void loggingCtxPutAlways(String key, String value) :outertype: ComponentDefinition Associate key permanently with value in the logging diagnostic context. Keys set in this way are not removed by \ :java:ref:`loggingCtxReset()`\ or \ :java:ref:`loggingCtxRemove()`\ . See \ `the logback manuel `_\ for how to use this with logback. :param key: :param value: loggingCtxRemove ^^^^^^^^^^^^^^^^ .. java:method:: protected void loggingCtxRemove(String key) :outertype: ComponentDefinition Disassociate any value with the key in the logging diagnostic context. :param key: loggingCtxReset ^^^^^^^^^^^^^^^ .. java:method:: protected void loggingCtxReset() :outertype: ComponentDefinition Reset the current logging diagnostic context. Removes all items added to context by the user that weren't set with \ :java:ref:`loggingCtxPutAlways(String,String)`\ negative ^^^^^^^^ .. java:method:: protected final

Negative

negative(Class

portType) :outertype: ComponentDefinition Negative. :param portType: the port type :return: the negative < p> positive ^^^^^^^^ .. java:method:: protected final

Positive

positive(Class

portType) :outertype: ComponentDefinition Positive. :param portType: the port type :return: the positive < p> postUpdate ^^^^^^^^^^ .. java:method:: public void postUpdate() :outertype: ComponentDefinition Override to perform actions after a ConfigUpdate was applied and forwarded. provides ^^^^^^^^ .. java:method:: protected final

Negative

provides(Class

portType) :outertype: ComponentDefinition requires ^^^^^^^^ .. java:method:: protected final

Positive

requires(Class

portType) :outertype: ComponentDefinition specifies that this component requires a port of type \ ``portType``\ . :param

: :param portType: separateConfigId ^^^^^^^^^^^^^^^^ .. java:method:: public boolean separateConfigId() :outertype: ComponentDefinition Override to allow components of this type to start their own independent \ :java:ref:`se.sics.kompics.config.Config`\ id lines. This is helpful in simulation, when simulating multiple independent nodes. Make sure that no \ ``ConfigUpdate``\ s are passed to siblings or parents of such nodes! (Override \ :java:ref:`handleUpdate(se.sics.kompics.config.ConfigUpdate)`\ ) :return: Whether to create a new config id line for this component (default: \ ``true``\ ) setMDC ^^^^^^ .. java:method:: protected void setMDC() :outertype: ComponentDefinition Should not be necessary to call usually, as ComponentCore will do it. Protected mainly for use by Kompics Scala. Can also be used to set component MDC when executing related off-kompics work (check for concurrency issues, though!). subscribe ^^^^^^^^^ .. java:method:: protected final void subscribe(Handler handler, Port

port) :outertype: ComponentDefinition Subscribe. :param handler: the handler :param port: the port :throws ConfigurationException: subscribe ^^^^^^^^^ .. java:method:: protected final void subscribe(MatchedHandler handler, Port port) :outertype: ComponentDefinition suicide ^^^^^^^ .. java:method:: public final void suicide() :outertype: ComponentDefinition tearDown ^^^^^^^^ .. java:method:: public void tearDown() :outertype: ComponentDefinition Use for custom cleanup. Will be called after all child components have stopped, but before sending a Stopped message to the parent. trigger ^^^^^^^ .. java:method:: protected final

void trigger(KompicsEvent event, Port

port) :outertype: ComponentDefinition Trigger. :param event: the event :param port: the port unsubscribe ^^^^^^^^^^^ .. java:method:: protected final void unsubscribe(MatchedHandler handler, Port port) :outertype: ComponentDefinition unsubscribe ^^^^^^^^^^^ .. java:method:: protected final void unsubscribe(Handler handler, Port

port) throws ConfigurationException :outertype: ComponentDefinition Unsubscribe. :param handler: the handler :param port: the port :throws ConfigurationException: updateConfig ^^^^^^^^^^^^ .. java:method:: public final void updateConfig(ConfigUpdate update) :outertype: ComponentDefinition