Class Node
- java.lang.Object
-
- com.yahoo.container.di.componentgraph.core.Node
-
- Direct Known Subclasses:
ComponentNode
,ComponentRegistryNode
,GuiceNode
public abstract class Node extends Object
- Author:
- Tony Vaagenes, gjoranv, ollivir
-
-
Constructor Summary
Constructors Constructor Description Node(com.yahoo.component.ComponentId componentId)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Object
component()
Returns the component represented by this - which is either the instance, or if the instance is a provider, the component returned by it.com.yahoo.component.ComponentId
componentId()
abstract Class<?>
componentType()
abstract Set<com.yahoo.vespa.config.ConfigKey<com.yahoo.config.ConfigInstance>>
configKeys()
Optional<?>
constructedInstance()
Returns the already constructed instance in this, if anyvoid
constructInstance()
Constructs the instance represented by this node, if not already done.static boolean
equalEdges(List<?> edges1, List<?> edges2)
boolean
equals(Object other)
int
hashCode()
String
idAndType()
void
inject(Node component)
void
injectAll(Collection<ComponentNode> componentNodes)
abstract com.google.inject.Key<?>
instanceKey()
abstract Class<?>
instanceType()
abstract String
label()
protected abstract Object
newInstance()
static String
packageName(Class<?> componentClass)
protected static com.yahoo.component.ComponentId
syntheticComponentId(String className, Object identityObject, com.yahoo.component.ComponentId namespace)
String
toString()
abstract List<Node>
usedComponents()
The components actually used by this node.
-
-
-
Method Detail
-
instanceKey
public abstract com.google.inject.Key<?> instanceKey()
-
usedComponents
public abstract List<Node> usedComponents()
The components actually used by this node. Consist of a subset of the injected nodes + subset of the global nodes.
-
newInstance
protected abstract Object newInstance()
-
constructInstance
public void constructInstance()
Constructs the instance represented by this node, if not already done.
-
component
public Object component()
Returns the component represented by this - which is either the instance, or if the instance is a provider, the component returned by it.
-
configKeys
public abstract Set<com.yahoo.vespa.config.ConfigKey<com.yahoo.config.ConfigInstance>> configKeys()
-
inject
public void inject(Node component)
-
injectAll
public void injectAll(Collection<ComponentNode> componentNodes)
-
instanceType
public abstract Class<?> instanceType()
-
componentType
public abstract Class<?> componentType()
-
label
public abstract String label()
-
idAndType
public String idAndType()
-
componentId
public com.yahoo.component.ComponentId componentId()
-
constructedInstance
public Optional<?> constructedInstance()
Returns the already constructed instance in this, if any
-
syntheticComponentId
protected static com.yahoo.component.ComponentId syntheticComponentId(String className, Object identityObject, com.yahoo.component.ComponentId namespace)
- Parameters:
identityObject
- he identifying object that makes the Node unique
-
-