An implementation of Context must be in the Singleton scope
| Modifier and Type | Method and Description |
|---|---|
| public boolean | Returns: true if this context has a value associated with this descriptorThe descriptor to look for in this context descriptor)Determines if this context has a value for the given key |
| public void | destroyOne(ActiveDescriptor<?>
A non-null descriptor upon which descriptor)ServiceHandle#destroy()
has been calledThis method is called when |
| public <U> U | Returns: A context instance. This value may NOT be nullThe descriptor to use when creating instances activeDescriptor, ServiceHandle<?> The extended provider for the outermost parent being created root)Creates a contextual instance of this ActiveDescriptor by calling its create method if there is no other matching contextual instance. |
| public Class | Returns: may not return null, must return the scope for which this is a contextThe scope for which this is the context |
| public boolean | Returns: true if this context is active, false otherwiseTrue if this context is active, false otherwise |
| public void | |
| public boolean | Returns: true if null is a legal value from the findOrCreate methodReturns true if the findOrCreate method can return null |
| containsKey | back to summary |
|---|---|
| public boolean containsKey(ActiveDescriptor<?> descriptor) Determines if this context has a value for the given key
| |
| destroyOne | back to summary |
|---|---|
| public void destroyOne(ActiveDescriptor<?> descriptor) This method is called when
| |
| findOrCreate | back to summary |
|---|---|
| public <U> U findOrCreate(ActiveDescriptor<U> activeDescriptor, ServiceHandle<?> root) Creates a contextual instance of this ActiveDescriptor by calling its create method if there is no other matching contextual instance. If there is already a contextual instance it is returned. If parent is null then this must work like the find call
| |
| getScope | back to summary |
|---|---|
| public Class The scope for which this is the context
| |
| isActive | back to summary |
|---|---|
| public boolean isActive() True if this context is active, false otherwise
| |
| shutdown | back to summary |
|---|---|
| public void shutdown() Shut down this context. | |
| supportsNullCreation | back to summary |
|---|---|
| public boolean supportsNullCreation() Returns true if the findOrCreate method can return null
| |