Project

General

Profile

Actions

"Any" Components (type org.z2env.any)

Any components are not bound to any specific interface type but may implement essentially any interface type. At times, it can be very handy to simply have some interface implementation readily available for lookup as z2 component or via JNDI Support.

An implementation of of an any component only needs to specify the type and then implementation class, for example like this:

org.z2env.component.type=org.z2env.any
component.className=mypackage.MyClass

Standard component properties such as state dependencies may be specified.

An implementation of the component type org.z2env.any has essentially two choices.

One possibility is to extends the base Resource class (JAVADOC). In that case, all resolution of typed lookups will be delegated to the as(...) (JAVADOC) method. Likewise the invalidate(...) (JAVADOC) method will be invoked when the component is invalidated.

Alternatively and in simple cases more conveniently, an implementation may choose to be of some other type hierarchy. In that case, z2 will test of the implementation instance implements a given interface that was specific via the lookup. If so, the instance will be returned. Otherwise null will be returned.

Properties

name values
org.z2env.component.type org.z2env.any
component.className Name of the class that implements the any components

Updated by Henning Blohm almost 9 years ago · 2 revisions