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
    Modifier and Type
    Required Element
    Description
    org.glassfish.api.I18n
    Returns the i18n key that will be used to look up a localized string in the annotated type module.
    Name of the command that will be used to register this generic command implementation under.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    org.glassfish.api.admin.ExecuteOn
    Returns the desired behaviors in a clustered environment.
    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

      @GeneratedServiceName String 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.
    • resolver

      Class<? extends CrudResolver> resolver
      Returns 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> decorator
      Returns 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 cluster
      Returns the desired behaviors in a clustered environment. By default, using all the ExecuteOn default values
      Returns:
      the cluster information
      Default:
      @org.glassfish.api.admin.ExecuteOn
    • i18n

      org.glassfish.api.I18n i18n
      Returns 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.