public interface Declarable
Any user-defined object in the declarative caching xml file should implement this interface in order to be constructed.
For example, the user can declare a CacheLoader
in a declarative XML file as
follows:
<cache-loader> <class-name>com.company.app.DBLoader</class-name> <parameter name="URL"> <string>jdbc://12.34.56.78/mydb</string> </parameter> </cache-loader>
In this case, com.company.app.DBLoader
must implement both the CacheLoader
and Declarable
interfaces. The cache service will construct a
com.company.app.DBLoader
object by invoking the loader's zero-argument constructor
and then calling the init(java.util.Properties)
method to pass in the parameters.
See package introduction.
Modifier and Type | Method and Description |
---|---|
default void |
init(Properties props)
Deprecated.
as of Geode 1.5 implement initialize instead.
|
default void |
initialize(Cache cache,
Properties properties)
Initializes a user-defined object, owned by the given cache, using the given properties.
|
@Deprecated default void init(Properties props)
Cache
initialization to fail.props
- Contains the parameters declared in the declarative xml file.IllegalArgumentException
- If one of the configuration options in props
is
illegal or malformed.default void initialize(Cache cache, Properties properties)
Cache
initialization to fail.
Note that if this method is implemented then the deprecated init method should not be
implemented.
The product will call both methods assuming that only one will have a non-default
implementation.cache
- the cache that owns this declarableproperties
- Contains the parameters declared in the declarative xml file.IllegalArgumentException
- should be thrown if properties contains something unexpected.