ConfigContextEventpublic class ConfigContextEvent extends Notification event used for notification of changes |
Fields Summary |
---|
public static final String | PRE_ACCESS | public static final String | POST_ACCESS | public static final String | PRE_ADD_CHANGE | public static final String | POST_ADD_CHANGE | public static final String | PRE_UPDATE_CHANGE | public static final String | POST_UPDATE_CHANGE | public static final String | PRE_DELETE_CHANGE | public static final String | POST_DELETE_CHANGE | public static final String | PRE_SET_CHANGE | public static final String | POST_SET_CHANGE | public static final String | PRE_FLUSH_CHANGE | public static final String | POST_FLUSH_CHANGE | private static long | eventCounter | private String | name | private Object | value | private String | choice | private String | beanName | private Object | classObject |
Constructors Summary |
---|
public ConfigContextEvent(ConfigContext ctx, String eventType)Create a new ConfigChangeEvent event.
//</addition>
super(eventType, ctx, ++eventCounter, System.currentTimeMillis());
| public ConfigContextEvent(ConfigContext ctx, String eventType, String name, Object value, String choice)
this(ctx, eventType, name, value, choice, null);
| public ConfigContextEvent(ConfigContext ctx, String eventType, String name, Object value, String choice, String beanName)
this(ctx,eventType);
this.name = name;
this.value = value;
this.choice = choice;
this.beanName = beanName;
|
Methods Summary |
---|
public java.lang.String | getBeanName()
return beanName;
| public java.lang.String | getChoice()
return choice;
| public java.lang.Object | getClassObject()The function returns the classObject which is set through the base config
bean. The classObject represents the actual config bean that has been
invoked through the admin GUI
return classObject;
| public ConfigContext | getConfigContext()Returns ConfigContext which is the source of the event. The difference
return (ConfigContext)getSource();
| public java.lang.String | getName()
return name;
| public java.lang.Object | getObject()
return value;
| public ConfigBean | getValidationTarget()Return the object which is the target of the validation,
given the {@link ConfigContextEvent}
final String choice = this.getChoice();
if (choice.equals("VALIDATE")){
return (ConfigBean) this.getObject();
} else if (choice.equals("ADD")) {
return (ConfigBean) this.getObject();
} else if (choice.equals("DELETE")) {
return (ConfigBean) this.getObject();
} else if (choice.equals("UPDATE")) {
return (ConfigBean) this.getClassObject();
} else if (choice.equals("SET")) {
if (null == this.getBeanName()){
if (this.getName().equals("Description")){
throw new ConfigException("Internal error - invalid condition - attempting to validate a SET operation with a \"Description\" object");
} else {
return (ConfigBean) this.getObject();
}
} else {
return (ConfigBean) this.getClassObject();
}
} else {
throw new ConfigException("Internal error - invalid choice received: \""+choice+"\". Only expecting ADD, DELETE, UPDATE or SET");
}
| public void | setBeanName(java.lang.String beanName)
this.beanName = beanName;
| public void | setClassObject(java.lang.Object obj)The function is called from the ConfigBean class and sets the actual
config bean as the classObject.
this.classObject = obj;
| public java.lang.String | toString()Return a String representation.
return this.getClass().getName() + " -- "
+ " [Id:" + this.getSequenceNumber()
+ ", ts:" + this.getTimeStamp() + "]";
|
|