public class EnvironmentImpl extends Object implements Environment, ThreadCleanupListener
Constructor and Description |
---|
EnvironmentImpl() |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears all stacks; no longer used by Tapestry.
|
void |
cloak()
Hides all current environment values, making the Environment object appear empty, until
a call to
Environment.decloak() } restores the original state. |
void |
decloak()
Restores state previously hidden by
Environment.cloak() }. |
<T> T |
peek(Class<T> type)
Peeks at the current top of the indicated stack.
|
<T> T |
peekRequired(Class<T> type)
Peeks at the current top of the indicated stack (which must have a non-null value).
|
<T> T |
pop(Class<T> type)
Removes and returns the top environmental object of the selected type.
|
<T> T |
push(Class<T> type,
T instance)
Pushes a new service onto the stack.
|
void |
threadDidCleanup()
Invoked by
PerthreadManager service when a thread performs and
end-of-request cleanup. |
public EnvironmentImpl()
public <T> T peek(Class<T> type)
Environment
peek
in interface Environment
T
- the type of environmental objecttype
- class used to select the objectpublic <T> T peekRequired(Class<T> type)
Environment
peekRequired
in interface Environment
T
- the type of environmental objecttype
- class used to select the objectpublic <T> T pop(Class<T> type)
Environment
pop
in interface Environment
T
- the type of environmental objecttype
- class used to select the objectpublic <T> T push(Class<T> type, T instance)
Environment
push
in interface Environment
T
- the type of environmental objecttype
- class used to select the objectinstance
- the service objectpublic void clear()
Environment
clear
in interface Environment
public void threadDidCleanup()
ThreadCleanupListener
PerthreadManager
service when a thread performs and
end-of-request cleanup.threadDidCleanup
in interface ThreadCleanupListener
public void cloak()
Environment
Environment.decloak()
} restores the original state.cloak
in interface Environment
public void decloak()
Environment
Environment.cloak()
}.decloak
in interface Environment
Copyright © 2003-2012 The Apache Software Foundation.