Package org.dellroad.stuff.vaadin7
Vaadin-related classes, especially relating to Spring integration.
This package contains classes that add some missing "glue" between Vaadin and Spring. In addition, these classes help address the "scope mismatch" between Vaadin application scope and Spring web application context scope that leads to memory leaks when a Vaadin application closes.
The key features included are:
- Automatic management of per-Vaadin application Spring application contexts, with lifecycle management of Vaadin application beans
- Autowiring of Spring-configured beans (both per-Vaadin application and "servlet global") into Vaadin beans
- An AOP aspect that allows
@VaadinConfigurableapplication beans to be autowired on instantiation using the curent Vaadin application's Spring application context - A safe and clearly defined interface for background threads needing to interact with a Vaadin application
- A custom Spring scope that matches Vaadin application scope
- Support for Vaadin application beans as listeners on non-Vaadin application event sources
Key classes include:
SpringVaadinServletassociates a Spring application context with each "Vaadin application" instance (i.e., eachVaadinSession) using theSpringVaadinSessionListenerclass (which does the bulk of the work). The parent context is the application context associated with the overall servlet context already set up by Spring. This is analogous to what Spring'sDispatcherServletdoes for each servlet instance. Beans inside this context have a lifecycle which exactly tracks the Vaadin application, eliminating a major source of thread and memory leaks.- An AOP aspect that works on
@VaadinConfigurablebeans, allowing them to be autowired by the Spring application context associated with the current Vaadin application instance bySpringVaadinServlet(note: not just the parent context). Arbitrary beans get autowired into the Vaadin application's context at the time of construction. VaadinApplicationScope, which adds a custom Spring scope so you can define application scoped beans in XML withscope="vaadinApplication"(for example, in the parent context).VaadinExternalListener, a support superclass for listeners scoped to a Vaadin application that avoids memory leaks when listening to more widely scoped event sources. In particular, the subclassVaadinApplicationListenersupports listeners for Spring application events multicasted in a (non-Vaadin application scoped) parent context.- The
VaadinApplicationclass can serve as an application-wide singleton for a Vaadin application just like the Vaadin 6.x class of the same name used to do. VaadinUtilprovides some utility and convenience methods.
The classes in this package are also available as a Vaadin Add-on and sample code is available on GitHub.
-
Interface Summary Interface Description BackedItem<T> Extension of theIteminterface for implementations that are backed by an underlying Java object.BackedProperty<T,V> Extension of thePropertyinterface for implementations that are backed by an underlying Java object.Connectable Generic interface supporting connection and disconnection.PropertyExtractor<T> Classes that can extractPropertyvalues from Java objects.QueryList<T> Cacheable list of Java objects backing anAbstractQueryContainer.SortingPropertyExtractor<T> PropertyExtractorthat also sorts properties, given two instances of the target Java type.VaadinConfigurableObject Marker interface used by theVaadinConfigurableAspect. -
Class Summary Class Description AbstractQueryContainer<T> AbstractSimpleContainer<I,T> AbstractUnsizedContainer<T> A specialization ofAbstractQueryContainerthat doesn't require up-front knowledge of the underlying data's size.AlwaysInvalidQueryList<T> AQueryListthat always throwsInvalidQueryListException.BlobField ConvertedProperty<P,M> EnumComboBox EnumContainer<T extends Enum<T>> Container backed by the instances of anEnumtype.FieldBuilder Automatically builds and binds fields for a Java bean annotated withFieldBuilderannotations.FieldBuilder.AnnotationApplier<A extends Annotation,F extends AbstractField<?>> Class that knows how to apply annotation properties to a corresponding field.FieldLayout<T> AHorizontalLayoutthat also exposes an internally wrappedField.PropertyDef<T> Defines a Vaadin property, having a name, which is also the property ID, and its type.ProvidesPropertyScanner<T> Scans a Java class hierarchy for@ProvidesPropertyand@ProvidesPropertySortannotated getter methods and creates a corresponding set ofPropertyDefproperty definitions and aSortingPropertyExtractorthat will extract the properties from instances of the given class and sort them accordingly.ReadOnlyProperty<V> Support superclass forPropertys with read-only values.SelfKeyedContainer<T> ASimpleKeyedContainerwhere the item IDs are the underlying container objects themselves.SimpleContainer<T> AnAbstractSimpleContainerwithIntegeritem IDs.SimpleItem<T> Simple read-onlyItemimplementation backed by a Java object.SimpleKeyedContainer<I,T> AnAbstractSimpleContainerwhere the item IDs are generated from the items themselves by the subclass-provided methodSimpleKeyedContainer.getKeyFor(T).SimpleProperty<T,V> Simple read-onlyPropertyimplementation backed by a Java object.SimpleQueryList<T> SpringVaadinServlet AVaadinServletthat associates and manages a SpringConfigurableWebApplicationContextwith eachVaadinSession(aka, "Vaadin application" in the old terminology).SpringVaadinSessionListener Manages an associated SpringWebApplicationContextwith eachVaadinSession(aka, "Vaadin application").StringValuePropertyDef VaadinApplication A globally accessible "Vaadin application" singleton.VaadinApplicationListener<E extends ApplicationEvent> A SpringApplicationListenersupport superclass customized for use by listeners that are part of a Vaadin application when listening to non-Vaadin application event sources.VaadinApplicationScope A Spring customScopefor Vaadin applications.VaadinDelayedAction DelayedActionfor actions that are associated with a Vaadin appliction.VaadinExternalListener<S> Support superclass customized for use by listeners that are part of a Vaadin application when listening to non-Vaadin ("external") event sources.VaadinSessionContainer<T extends VaadinSessionInfo> Container containing activeVaadinSessions.VaadinSessionInfo Represents oneVaadinSessionin aVaadinSessionContainer.VaadinUtil Miscellaneous utility methods.WindowQueryList<T> QueryListimplementation that only actually holds a portion, or "window" of a larger list.WritableResource Support superclass forStreamResourceimplementations that can be more easily implemented by writing to anOutputStreamthan providing anInputStream. -
Exception Summary Exception Description InvalidQueryListException Exception thrown byQueryList.get(long)when the list has become invalid. -
Annotation Types Summary Annotation Type Description FieldBuilder.AbstractField Specifies how a Java property should be edited in Vaadin using anAbstractField.FieldBuilder.AbstractSelect Specifies how a Java property should be edited in Vaadin using anAbstractSelect.FieldBuilder.AbstractTextField Specifies how a Java property should be edited in Vaadin using aAbstractTextField.FieldBuilder.CheckBox Specifies how a Java property should be edited in Vaadin using anCheckBox.FieldBuilder.ComboBox Specifies how a Java property should be edited in Vaadin using anComboBox.FieldBuilder.DateField Specifies how a Java property should be edited in Vaadin using anDateField.FieldBuilder.EnumComboBox Specifies how a Java property should be edited in Vaadin using anEnumComboBox.FieldBuilder.ListSelect Specifies how a Java property should be edited in Vaadin using anListSelect.FieldBuilder.PasswordField Specifies how a Java property should be edited in Vaadin using aPasswordField.FieldBuilder.ProvidesField Specifies that the annotated method will return anAbstractFieldsuitable for editing the specified property.FieldBuilder.TextArea Specifies how a Java property should be edited in Vaadin using aTextArea.FieldBuilder.TextField Specifies how a Java property should be edited in Vaadin using aTextField.ProvidesProperty ProvidesPropertySort Declares that a Java method provides either aComparablevalue or aComparatorthat should be used to determine property sort ordering in a Java class whose instances back the items in aContainer.VaadinConfigurable Indicates that the class is a candidate for configuration using theVaadinConfigurableAspectaspect.