Package org.glassfish.config.support
Annotation Interface Delete
@Retention(RUNTIME)
@Target(METHOD)
@GenerateServiceFromMethod(implementation="org.glassfish.config.support.GenericDeleteCommand",
advertisedContracts="org.glassfish.api.admin.AdminCommand")
public @interface Delete
Delete command annotation
A method annotated with the Delete annotation will generate a generic implementation of a delete administrative
command responsible for delete instances of the type as referenced by the annotated method.
The deleted type is determine by the annotated method which must follow one of the two following patterns : List
getXs(); or void setX(X x);
X is the type of instance that will be deleted, the name of the method is actually immaterial. So for example, the
following
@Delete
public List getAllMyFoos();
@Delete
public void setMySuperFoo(Foo foo);
@Delete
public List getFoos();
@Delete
public List getFoo();
will all be valid annotated methods.
The instance to be removed from the parent must be resolved by the resolver attribute. The resolver can use injection
or the command invocation parameters (using the Param annotation) to get enough information
to look up or retrieve the instance to be deleted.
Usually, most instances can be looked up by using the instance type and its key (provided by the --name or --target
parameters for instance).
See Create for initialization information- Author:
- Jerome Dochez
-
Required Element Summary
Required Elements -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionorg.glassfish.api.admin.ExecuteOnReturns the desired behaviors in a clustered environment.Class<? extends DeletionDecorator>Returns a decorator type that should be looked up and called when a configuration element of the annotated type is deleted.Class<? extends CrudResolver>Returns the instance of the configured object that should be deleted.
-
Element Details
-
value
Name of the command that will be used to register this generic command implementation under.- Returns:
- the command name as the user types it.
-
i18n
org.glassfish.api.I18n i18nReturns the i18n key that will be used to look up a localized string in the annotated type module.- Returns:
- the key to look up localized description for the command.
-
-
-
resolver
Class<? extends CrudResolver> resolverReturns the instance of the configured object that should be deleted. The implementation of that interface can use the command parameters to make a determination about which instance should be used.- Returns:
- the instance targeted for deletion.
- Default:
- org.glassfish.config.support.CrudResolver.DefaultResolver.class
-
decorator
Class<? extends DeletionDecorator> decoratorReturns a decorator type that should be looked up and called when a configuration element of the annotated type is deleted.- Returns:
- a deletion decorator for the annotated type
- Default:
- org.glassfish.config.support.DeletionDecorator.NoDecoration.class
-
cluster
org.glassfish.api.admin.ExecuteOn clusterReturns the desired behaviors in a clustered environment. By default, using all theExecuteOndefault values- Returns:
- the cluster information
- Default:
- @org.glassfish.api.admin.ExecuteOn
-