| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| Provider |
|
| 1.0;1 |
| 1 | /* | |
| 2 | * Copyright (C) 1998-2000 Semiotek Inc. All Rights Reserved. | |
| 3 | * | |
| 4 | * Redistribution and use in source and binary forms, with or without | |
| 5 | * modification, are permitted under the terms of either of the following | |
| 6 | * Open Source licenses: | |
| 7 | * | |
| 8 | * The GNU General Public License, version 2, or any later version, as | |
| 9 | * published by the Free Software Foundation | |
| 10 | * (http://www.fsf.org/copyleft/gpl.html); | |
| 11 | * | |
| 12 | * or | |
| 13 | * | |
| 14 | * The Semiotek Public License (http://webmacro.org/LICENSE.) | |
| 15 | * | |
| 16 | * This software is provided "as is", with NO WARRANTY, not even the | |
| 17 | * implied warranties of fitness to purpose, or merchantability. You | |
| 18 | * assume all risks and liabilities associated with its use. | |
| 19 | * | |
| 20 | * See www.webmacro.org for more information on the WebMacro project. | |
| 21 | */ | |
| 22 | ||
| 23 | ||
| 24 | package org.webmacro; | |
| 25 | ||
| 26 | import org.webmacro.util.Settings; | |
| 27 | ||
| 28 | /** | |
| 29 | * A Provider is an object responsible or loading and managing | |
| 30 | * instances of a given type. The Provider is used by the Broker | |
| 31 | * to look up objects on demand. | |
| 32 | * <p> | |
| 33 | * By implementing new Provider types and registering them with | |
| 34 | * the broker via WebMacro.properties you can extend or change | |
| 35 | * WebMacro's behavior. | |
| 36 | */ | |
| 37 | public interface Provider | |
| 38 | { | |
| 39 | ||
| 40 | /** | |
| 41 | * Return an array representing the types this provider serves up | |
| 42 | */ | |
| 43 | public String getType (); | |
| 44 | ||
| 45 | /** | |
| 46 | * Initialize this provider based on the specified config. | |
| 47 | */ | |
| 48 | public void init (Broker b, Settings config) throws InitException; | |
| 49 | ||
| 50 | /** | |
| 51 | * Clear any cache this provider may be maintaining | |
| 52 | */ | |
| 53 | public void flush (); | |
| 54 | ||
| 55 | /** | |
| 56 | * Close down this provider, freeing any allocated resources. | |
| 57 | */ | |
| 58 | public void destroy (); | |
| 59 | ||
| 60 | /** | |
| 61 | * Get the object associated with the specified query | |
| 62 | */ | |
| 63 | public Object get (String query) throws ResourceException; | |
| 64 | ||
| 65 | } | |
| 66 |