@Retention(value=RUNTIME) @Target(value={METHOD,TYPE}) @GenerateServiceFromMethod(implementation="org.glassfish.config.support.GenericCreateCommand", advertisedContracts="org.glassfish.api.admin.AdminCommand") public @interface Create
Param to get parameters
passed to the command invocation (like a name or a target parameter).
The generic command implementation will use the parameters passed to
the command invocation with the Param
annotations on the child type to match command parameters to
configuration attributes.
Sometimes, the creation of a new configuration will require more
work or more attributes/elements creation than what can be provided
or specified during the command invocation. In such a case, the
Create annotation can specify a decorator that will be called during
the generic command execution, with the newly created instance.
The CreationDecorator will be looked up by its type and
normal injection or parameter injection can happen.
Internationalization of generic commands follow the same rule as
described in the AdminCommand javadocs. The I18n
annotation referenced from this annotation will be used as the
top level command annotation, which should provide the command
description and expected result.
Parameters can be annotated with @I18n as well to override the
default mapping and all resources must be located in the target
type module local strings properties file.
Sometimes, the @Create annotation cannot be used in the parent
configuration object because the parent cannot have a direct
reference its children types.
For instance, if you have a declaration like
public interface ParentContainer {| Modifier and Type | Required Element and Description |
|---|---|
org.glassfish.api.I18n |
i18n
Returns the i18n key that will be used to look up a localized string in the annotated
type module.
|
String |
value
Name of the command that will be used to register this generic command implementation under.
|
| Modifier and Type | Optional Element and Description |
|---|---|
org.glassfish.api.admin.ExecuteOn |
cluster
Returns the desired behaviors in a clustered environment.
|
Class<? extends CreationDecorator> |
decorator
Returns a decorator type that should be looked up and called when a new
configuration element of the annotated type is created.
|
Class<? extends CrudResolver> |
resolver
Returns the instance of the parent that should be used to add the newly created
instance under.
|
@GeneratedServiceName public abstract String value
public abstract org.glassfish.api.I18n i18n
public abstract Class<? extends CrudResolver> resolver
public abstract Class<? extends CreationDecorator> decorator
Copyright © 2017–2020 Eclipse Foundation. All rights reserved.