public class ProxyLookup extends Lookup
Lookup.Item<T>, Lookup.Provider, Lookup.Result<T>, Lookup.Template<T>
Modifier | Constructor and Description |
---|---|
protected |
ProxyLookup()
Create a lookup initially proxying to no others.
|
|
ProxyLookup(Lookup... lookups)
Create a proxy to some other lookups.
|
Modifier and Type | Method and Description |
---|---|
protected void |
beforeLookup(Lookup.Template<?> template)
Notifies subclasses that a query is about to be processed.
|
protected Lookup[] |
getLookups()
Getter for the delegates.
|
<T> T |
lookup(Class<T> clazz)
Look up an object matching a given interface.
|
<T> Lookup.Result<T> |
lookup(Lookup.Template<T> template)
The general lookup method.
|
<T> Lookup.Item<T> |
lookupItem(Lookup.Template<T> template)
Look up the first item matching a given template.
|
protected void |
setLookups(Executor notifyIn,
Lookup... lookups)
Changes the delegates immediatelly, notifies the listeners in provided
executor, potentially later.
|
protected void |
setLookups(Lookup... lookups)
Changes the delegates.
|
String |
toString() |
getDefault, lookupAll, lookupResult
public ProxyLookup(Lookup... lookups)
lookups
- the initial delegatesprotected ProxyLookup()
protected final Lookup[] getLookups()
protected final void setLookups(Lookup... lookups)
lookups
- the new lookups to delegate toprotected final void setLookups(Executor notifyIn, Lookup... lookups)
lookups
- the new lookups to delegate tonotifyIn
- executor to deliver the notification to listeners or nullprotected void beforeLookup(Lookup.Template<?> template)
setLookups
method
to change/update the set of objects the proxy delegates to.template
- the template of the querypublic final <T> T lookup(Class<T> clazz)
Lookup
public final <T> Lookup.Item<T> lookupItem(Lookup.Template<T> template)
Lookup
lookupItem
in class Lookup
template
- the template to checknull
public final <T> Lookup.Result<T> lookup(Lookup.Template<T> template)
Lookup
template
, request more info about
them in form of Lookup.Item
and attach a listener to
this be notified about changes. The general interface does not
specify whether subsequent calls with the same template produce new
instance of the Lookup.Result
or return shared instance. The
prefered behaviour however is to return shared one.Built on June 4 2024. | Copyright © 2017-2024 Apache Software Foundation. All Rights Reserved.