Package se.sics.kompics
Class JavaComponent
- All Implemented Interfaces:
Serializable
,Runnable
,Future<Void>
,Component
public class JavaComponent extends ComponentCore
The
ComponentCore
class.
- Version:
- $Id$
- Author:
- Cosmin Arad <[email protected]>, Jim Dowling <[email protected]>, Lars Kroll <[email protected]>
- See Also:
- Serialized Form
-
Nested Class Summary
-
Field Summary
Fields inherited from class se.sics.kompics.ComponentCore
children, childrenLock, childUpdate, conf, parent, parentThreadLocal, readyPorts, scheduler, state, wid, workCount
-
Constructor Summary
Constructors Constructor Description JavaComponent(ComponentDefinition componentDefinition)
Instantiates a new component core. -
Method Summary
Modifier and Type Method Description protected void
cleanPorts()
Positive<ControlPort>
control()
Negative<ControlPort>
createControlPort()
<P extends PortType>
Negative<P>createNegativePort(Class<P> portType)
<P extends PortType>
Positive<P>createPositivePort(Class<P> portType)
<T extends ComponentDefinition>
ComponentdoCreate(Class<T> definition, Optional<Init<T>> initEvent)
<T extends ComponentDefinition>
ComponentdoCreate(Class<T> definition, Optional<Init<T>> initEvent, Optional<ConfigUpdate> update)
boolean
equals(Object o)
void
escalateFault(Fault fault)
void
execute(int wid)
ComponentDefinition
getComponent()
Positive<ControlPort>
getControl()
Gets the control.<P extends PortType>
Negative<P>getNegative(Class<P> portType)
Gets a negative (required) instance of the given port.<P extends PortType>
Positive<P>getPositive(Class<P> portType)
Gets a positive (provided) instance of the given port.int
hashCode()
protected org.slf4j.Logger
logger()
<P extends PortType>
Positive<P>provided(Class<P> portType)
Gets a provided (positive) instance of the given port.<P extends PortType>
Negative<P>required(Class<P> portType)
Gets a required (negative) instance of the given port.protected void
setInactive(Component child)
Methods inherited from class se.sics.kompics.ComponentCore
config, destroyTree, destroyTreeAtParentOf, doDestroy, escalateFaultToKompics, eventReceived, exec, getParent, getRawResult, id, markSubtreeAs, markSubtreeAtAs, run, schedule, setRawResult, setScheduler, state, toString
Methods inherited from class java.util.concurrent.ForkJoinTask
adapt, adapt, adapt, cancel, compareAndSetForkJoinTaskTag, complete, completeExceptionally, fork, get, get, getException, getForkJoinTaskTag, getPool, getQueuedTaskCount, getSurplusQueuedTaskCount, helpQuiesce, inForkJoinPool, invoke, invokeAll, invokeAll, invokeAll, isCancelled, isCompletedAbnormally, isCompletedNormally, isDone, join, peekNextLocalTask, pollNextLocalTask, pollSubmission, pollTask, quietlyComplete, quietlyInvoke, quietlyJoin, reinitialize, setForkJoinTaskTag, tryUnfork
-
Constructor Details
-
JavaComponent
Instantiates a new component core.- Parameters:
componentDefinition
- the component definition
-
-
Method Details
-
logger
- Specified by:
logger
in classComponentCore
-
getControl
Description copied from interface:Component
Gets the control.- Returns:
- the control port
-
control
- Returns:
- the component's control port.
-
getNegative
Description copied from interface:Component
Gets a negative (required) instance of the given port.- Type Parameters:
P
- the type of the port type- Parameters:
portType
- the port type class instance- Returns:
- a negative instance of the port type
-
required
Description copied from interface:Component
Gets a required (negative) instance of the given port. Same asComponent.getNegative(Class)
.- Type Parameters:
P
- the type of the port type- Parameters:
portType
- the port type class instance- Returns:
- a required instance of the port type
-
getPositive
Description copied from interface:Component
Gets a positive (provided) instance of the given port.- Type Parameters:
P
- the type of the port type- Parameters:
portType
- the port type class instance- Returns:
- a positive instance of the port type
-
provided
Description copied from interface:Component
Gets a provided (positive) instance of the given port. Same asComponent.getPositive(Class)
.- Type Parameters:
P
- the type of the port type- Parameters:
portType
- the port type class instance- Returns:
- a provided instance of the port type
-
createNegativePort
- Specified by:
createNegativePort
in classComponentCore
-
createPositivePort
- Specified by:
createPositivePort
in classComponentCore
-
createControlPort
- Specified by:
createControlPort
in classComponentCore
-
cleanPorts
- Specified by:
cleanPorts
in classComponentCore
-
doCreate
public <T extends ComponentDefinition> Component doCreate(Class<T> definition, Optional<Init<T>> initEvent)- Specified by:
doCreate
in classComponentCore
-
doCreate
public <T extends ComponentDefinition> Component doCreate(Class<T> definition, Optional<Init<T>> initEvent, Optional<ConfigUpdate> update)- Specified by:
doCreate
in classComponentCore
-
execute
- Specified by:
execute
in classComponentCore
-
escalateFault
-
getComponent
-
equals
- Overrides:
equals
in classComponentCore
-
hashCode
- Overrides:
hashCode
in classComponentCore
-
setInactive
- Specified by:
setInactive
in classComponentCore
-