class ExtensionContext<A extends Action> extends InvokationContext<A>
Modifier and Type | Field and Description |
---|---|
private Registry.RegisteredExtension<A> |
extension |
private boolean |
hasCreatedRenderer |
private ExtensionPointContext<A> |
mainContext |
private Renderer<? super A> |
renderer |
Constructor and Description |
---|
ExtensionContext(ExtensionPointContext<A> mainContext,
Registry.RegisteredExtension<A> extension) |
Modifier and Type | Method and Description |
---|---|
protected void |
clearError()
Clear the registered error for the current extension or extension point.
|
protected A[] |
getActions()
Call
Extension.getActionFactory() and then
ActionFactory.getActions(InvokationContext) on the
returned factory. |
Object |
getAttribute(String name)
Get the value of an attribute that has been registered
for the extension.
|
ClassLoader |
getClassLoader()
The class loader is the class loader that loaded the action
factory of the extension.
|
ClientContext |
getClientContext()
Get the client context that was passed to the
Registry.useExtensions(ClientContext, ExtensionsFilter, String...) |
protected ErrorHandler<? super A> |
getErrorHandler()
Get the error handler used in this context.
|
Extension<A> |
getExtension()
Get information about the extension.
|
ExtensionPoint<? super A> |
getExtensionPoint()
Get information about the extension point.
|
protected Registry |
getRegistry()
Get the registry where this invokation originated from.
|
protected Renderer<? super A> |
getRenderer()
If the extension point allows it and this extension
specifies a renderer factory, create a new renderer from
it.
|
(package private) void |
handleError(A action,
String message,
Throwable t) |
private void |
handleError(String message,
Throwable t) |
(package private) boolean |
prepareActionFactory() |
protected void |
prepareRendererFactory()
Prepare the renderer factory if the extension or extension
point has one.
|
protected void |
setError(A action,
Throwable t)
Register an error for the current extension or extension point.
|
private final ExtensionPointContext<A extends Action> mainContext
private final Registry.RegisteredExtension<A extends Action> extension
private boolean hasCreatedRenderer
ExtensionContext(ExtensionPointContext<A> mainContext, Registry.RegisteredExtension<A> extension)
public ClientContext getClientContext()
InvokationContext
Registry.useExtensions(ClientContext, ExtensionsFilter, String...)
method.getClientContext
in class InvokationContext<A extends Action>
public ExtensionPoint<? super A> getExtensionPoint()
InvokationContext
getExtensionPoint
in class InvokationContext<A extends Action>
public Extension<A> getExtension()
InvokationContext
RendererFactory
methods are called
for a renderer factory attached to an extension point
and for the ErrorHandlerFactory
methods.getExtension
in class InvokationContext<A extends Action>
public ClassLoader getClassLoader()
getClassLoader
in class InvokationContext<A extends Action>
public Object getAttribute(String name)
InvokationContext
getAttribute
in class InvokationContext<A extends Action>
name
- The name of the attributeRegistry.getAttribute(String, String)
protected Registry getRegistry()
InvokationContext
getRegistry
in class InvokationContext<A extends Action>
protected void prepareRendererFactory()
InvokationContext
prepareRendererFactory
in class InvokationContext<A extends Action>
protected Renderer<? super A> getRenderer()
getRenderer
in class InvokationContext<A extends Action>
protected A[] getActions()
Extension.getActionFactory()
and then
ActionFactory.getActions(InvokationContext)
on the
returned factory.getActions
in class InvokationContext<A extends Action>
protected void setError(A action, Throwable t)
InvokationContext
Registry.getLastExtensionError(String)
and Registry.getLastExtensionPointError(String)
setError
in class InvokationContext<A extends Action>
action
- The action that caused the errort
- The errorprotected void clearError()
InvokationContext
clearError
in class InvokationContext<A extends Action>
protected ErrorHandler<? super A> getErrorHandler()
InvokationContext
getErrorHandler
in class InvokationContext<A extends Action>
boolean prepareActionFactory()