Package org.glassfish.config.support
Class GenericCrudCommand
- java.lang.Object
-
- org.glassfish.config.support.GenericCrudCommand
-
- All Implemented Interfaces:
AdminCommandSecurity.Preauthorization
,CommandModelProvider
,org.glassfish.hk2.api.PostConstruct
- Direct Known Subclasses:
GenericCreateCommand
,GenericDeleteCommand
,GenericListCommand
public abstract class GenericCrudCommand extends Object implements CommandModelProvider, org.glassfish.hk2.api.PostConstruct, AdminCommandSecurity.Preauthorization
services pertinent to generic CRUD command implementations- Author:
- Jerome Dochez
-
-
Field Summary
Fields Modifier and Type Field Description protected String
commandName
protected static Level
level
protected static LocalStringManagerImpl
LOCAL_STRINGS
protected static Logger
LOGGER
protected Class
parentType
protected Method
targetMethod
protected Class
targetType
-
Constructor Summary
Constructors Constructor Description GenericCrudCommand()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static Properties
convertStringToProperties(String propsString, char sep)
Convert a String with the following format to Properties: name1=value1:name2=value2:name3=value3:...static String
elementName(DomDocument document, Class<?> parent, Class<?> child)
Returns the element name used by the parent to store instances of the childprotected <T extends Annotation>
TgetAnnotation(Method target, Class<T> type)
abstract Class
getDecoratorClass()
Decorator class if particular commandInjectionResolver<Param>
getInjectionResolver()
protected Class<?>
loadClass(String type)
void
postConstruct()
boolean
preAuthorization(AdminCommandContext adminCommandContext)
void
setInjectionResolver(InjectionResolver<Param> injector)
we need to have access to the injector instance that has all the parameters context-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.glassfish.api.admin.CommandModelProvider
getModel
-
-
-
-
Field Detail
-
LOGGER
protected static final Logger LOGGER
-
LOCAL_STRINGS
protected static final LocalStringManagerImpl LOCAL_STRINGS
-
commandName
protected String commandName
-
parentType
protected Class parentType
-
targetType
protected Class targetType
-
targetMethod
protected Method targetMethod
-
level
protected static final Level level
-
-
Method Detail
-
preAuthorization
public boolean preAuthorization(AdminCommandContext adminCommandContext)
- Specified by:
preAuthorization
in interfaceAdminCommandSecurity.Preauthorization
-
postConstruct
public void postConstruct()
- Specified by:
postConstruct
in interfaceorg.glassfish.hk2.api.PostConstruct
-
getAnnotation
protected <T extends Annotation> T getAnnotation(Method target, Class<T> type)
-
setInjectionResolver
public void setInjectionResolver(InjectionResolver<Param> injector)
we need to have access to the injector instance that has all the parameters context- Parameters:
injector
- the original command injector
-
getInjectionResolver
public InjectionResolver<Param> getInjectionResolver()
-
loadClass
protected Class<?> loadClass(String type) throws ClassNotFoundException
- Throws:
ClassNotFoundException
-
convertStringToProperties
public static Properties convertStringToProperties(String propsString, char sep)
Convert a String with the following format to Properties: name1=value1:name2=value2:name3=value3:... The Properties object contains elements: {name1=value1, name2=value2, name3=value3, ...}- Parameters:
propsString
- the String to convertsep
- the separator character- Returns:
- Properties containing the elements in String
-
elementName
public static String elementName(DomDocument document, Class<?> parent, Class<?> child) throws ClassNotFoundException
Returns the element name used by the parent to store instances of the child- Parameters:
document
- the dom document this configuration element lives in.parent
- type of the parentchild
- type of the child- Returns:
- the element name holding child's instances in the parent
- Throws:
ClassNotFoundException
- when subclasses cannot be loaded
-
getDecoratorClass
public abstract Class getDecoratorClass()
Decorator class if particular command- Returns:
-
-