Package restx.factory
Class Factory.LocalMachines
java.lang.Object
restx.factory.Factory.LocalMachines
- Enclosing class:
- Factory
-
Method Summary
Modifier and TypeMethodDescriptionaddMachine(FactoryMachine machine) voidclear()static Factory.LocalMachinescontextLocal(String ctxName) Returns a LocalMachines associated with given context name.getId()static Factory.LocalMachinesAn alias for threadLocal() which makes the intention of using it to override components clearer.removeMachine(FactoryMachine machine) set(int priority, NamedComponent<T> namedComponent) set(NamedComponent<T> namedComponent) static Factory.LocalMachinesReturns a LocalMachines associated with current thread.static Factory.LocalMachinesReturn LocalMachines associated with another thread, by id.
-
Method Details
-
overrideComponents
An alias for threadLocal() which makes the intention of using it to override components clearer.It's usually used like this:
overrideComponents().set("componentName", "componentValue");Note that it doesn't do anything special to actually override components: they will be used only in Factory relying on threadLocal() LocalMachines is built after the call.
- Returns:
- LocalMachines associated with current thread.
-
threadLocal
Returns a LocalMachines associated with current thread.This is often used when building a Factory, the Factory.newInstance() use it for instance.
Thanks to client affinity, it can also be shared between client and server.
- Returns:
- a LocalMachines associated with current thread.
-
threadLocalFrom
Return LocalMachines associated with another thread, by id.You must know the id of the threadlocal from the other thread to be able to access it.
From the other thread do Factory.LocalMachines.threadLocal().getId()
- Parameters:
id- the other thread threadLocal() LocalMachines id- Returns:
- the LocalMachines associated with the other thread, or an empty LocalMachines which is not automatically registered if none is found.
-
contextLocal
Returns a LocalMachines associated with given context name.- Parameters:
ctxName- the context name- Returns:
- a LocalMachines associated with given context name.
-
addMachine
-
removeMachine
-
clear
public void clear() -
getId
-
set
-
set
-
set
-
set
-
set
-
set
-