org.apache.ivy.core
Class IvyContext
java.lang.Object
org.apache.ivy.core.IvyContext
public class IvyContext
- extends java.lang.Object
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...
- Author:
- Xavier Hanin, Maarten Coene
- See Also:
IvyThread
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
IvyContext
public IvyContext()
getContext
public static IvyContext getContext()
setContext
public static void setContext(IvyContext context)
- 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.
- Parameters:
context
- the new context to use in this thread.
getIvy
public Ivy getIvy()
- 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.
- Returns:
- the current ivy instance
setIvy
public void setIvy(Ivy ivy)
getCache
public java.io.File getCache()
setCache
public void setCache(java.io.File cache)
getSettings
public IvySettings getSettings()
getCircularDependencyStrategy
public CircularDependencyStrategy getCircularDependencyStrategy()
get
public java.lang.Object get(java.lang.String key)
set
public void set(java.lang.String key,
java.lang.Object value)
getOperatingThread
public java.lang.Thread getOperatingThread()
getMessageImpl
public MessageImpl getMessageImpl()
setMessageImpl
public void setMessageImpl(MessageImpl impl)
getEventManager
public EventManager getEventManager()
getCacheManager
public CacheManager getCacheManager()
checkInterrupted
public void checkInterrupted()
getResolver
public DependencyResolver getResolver()
pushResolver
public void pushResolver(DependencyResolver resolver)
popResolver
public void popResolver()