| java.lang.Object org.apache.ivy.core.IvyContext
IvyContext | public class IvyContext (Code) | | This class represents an execution context of an Ivy action. It contains several getters to
retrieve information, like the used Ivy instance, the cache location...
See Also: IvyThread |
IvyContext | public IvyContext()(Code) | | |
checkInterrupted | public void checkInterrupted()(Code) | | |
getIvy | public Ivy getIvy()(Code) | | Returns the current ivy instance.
When calling any public ivy method on an ivy instance, a reference to this instance is put in
this context, and thus accessible using this method, until no code reference this instance
and the garbage collector collects it.
Then, or if no ivy method has been called, a default ivy instance is returned by this method,
so that it never returns null .
the current ivy instance |
peek | public Object peek(String key)(Code) | | Reads the first object from the list saved under given key in the context. If value under key
represents non List object then a RuntimeException is thrown.
Parameters: key - context key for the string top object from the list (index 0) or null if no key or list empty |
peekInContextStack | public static Object peekInContextStack(String key)(Code) | | Reads the first object from the list saved under given key in the first context from the
context stack in which this key is defined. If value under key in any of the contexts form
the stack represents non List object then a RuntimeException is thrown.
This methods does a similar job to
IvyContext.peek(String) , except that it considers the whole
context stack and not only one instance.
Parameters: key - context key for the string top object from the list (index 0) of the first context in the stack containing thiskey or null if no key or list empty in all contexts from the context stack See Also: IvyContext.peek(String) |
peekIvy | public Ivy peekIvy()(Code) | | Returns the Ivy instance associated with this context, or null if no such
instance is currently associated with this context.
If you want get a default Ivy instance in case no instance if currently associated, use
IvyContext.getIvy() .
the current ivy instance, or null if there is no current ivy instance. |
pop | public Object pop(String key)(Code) | | Removes and returns first object from the list saved under given key in the context. If value
under key represents non List object then a RuntimeException is thrown.
Parameters: key - context key for the string top object from the list (index 0) or null if no key or list empty |
pop | public boolean pop(String key, Object expectedValue)(Code) | | Removes and returns first object from the list saved under given key in the context but only
if it equals the given expectedValue - if not a false value is returned. If value under key
represents non List object then a RuntimeException is thrown.
Parameters: key - context key for the string true if the r |
push | public void push(String key, Object value)(Code) | | Puts a new object at the start of the list saved under given key in the context. If value
under key represents non List object then a RuntimeException is thrown. If no list exists
under given key a new LinkedList is created. This is kept without WeakReference in opposite
to the put() results.
Parameters: key - key context key for the string Parameters: value - value to be saved under the key |
pushContext | public static IvyContext pushContext(IvyContext context)(Code) | | Changes the context associated with this thread. This is especially useful when launching a
new thread, to associate it with the same context as the initial one. Do not forget to call
IvyContext.popContext() when done.
Parameters: context - the new context to use in this thread. the pushed context |
pushNewContext | public static IvyContext pushNewContext()(Code) | | Creates a new IvyContext and pushes it as the current context in the current thread.
IvyContext.popContext() should usually be called when the job for which this context has been
pushed is finished.
the newly pushed context |
pushNewCopyContext | public static IvyContext pushNewCopyContext()(Code) | | Creates a new IvyContext as a copy of the current one and pushes it as the current context in
the current thread.
IvyContext.popContext() should usually be called when the job for which this context has been
pushed is finished.
the newly pushed context |
|
|