Class Node
- java.lang.Object
-
- com.yahoo.container.di.componentgraph.core.Node
-
- Direct Known Subclasses:
ComponentNode
,ComponentRegistryNode
,GuiceNode
public abstract class Node extends java.lang.Object
- Author:
- Tony Vaagenes, gjoranv, ollivir
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Optional<java.lang.Object>
instance
-
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 java.lang.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 java.lang.Class<?>
componentType()
abstract java.util.Set<com.yahoo.vespa.config.ConfigKey<com.yahoo.config.ConfigInstance>>
configKeys()
java.util.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(java.util.List<?> edges1, java.util.List<?> edges2)
boolean
equals(java.lang.Object other)
int
hashCode()
java.lang.String
idAndType()
void
inject(Node component)
void
injectAll(java.util.Collection<ComponentNode> componentNodes)
abstract com.google.inject.Key<?>
instanceKey()
abstract java.lang.Class<?>
instanceType()
abstract java.lang.String
label()
protected abstract java.lang.Object
newInstance()
static java.lang.String
packageName(java.lang.Class<?> componentClass)
protected static com.yahoo.component.ComponentId
syntheticComponentId(java.lang.String className, java.lang.Object identityObject, com.yahoo.component.ComponentId namespace)
abstract java.util.List<Node>
usedComponents()
The components actually used by this node.
-
-
-
Method Detail
-
instanceKey
public abstract com.google.inject.Key<?> instanceKey()
-
usedComponents
public abstract java.util.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 java.lang.Object newInstance()
-
constructInstance
public void constructInstance()
Constructs the instance represented by this node, if not already done.
-
component
public java.lang.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 java.util.Set<com.yahoo.vespa.config.ConfigKey<com.yahoo.config.ConfigInstance>> configKeys()
-
inject
public void inject(Node component)
-
injectAll
public void injectAll(java.util.Collection<ComponentNode> componentNodes)
-
instanceType
public abstract java.lang.Class<?> instanceType()
-
componentType
public abstract java.lang.Class<?> componentType()
-
label
public abstract java.lang.String label()
-
idAndType
public java.lang.String idAndType()
-
equalEdges
public static boolean equalEdges(java.util.List<?> edges1, java.util.List<?> edges2)
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equals
in classjava.lang.Object
-
componentId
public com.yahoo.component.ComponentId componentId()
-
constructedInstance
public java.util.Optional<?> constructedInstance()
Returns the already constructed instance in this, if any
-
syntheticComponentId
protected static com.yahoo.component.ComponentId syntheticComponentId(java.lang.String className, java.lang.Object identityObject, com.yahoo.component.ComponentId namespace)
- Parameters:
identityObject
- he identifying object that makes the Node unique
-
packageName
public static java.lang.String packageName(java.lang.Class<?> componentClass)
-
-