01: /*
02: * Copyright 2001-2007 Geert Bevin <gbevin[remove] at uwyn dot com>
03: * Distributed under the terms of either:
04: * - the common development and distribution license (CDDL), v1.0; or
05: * - the GNU Lesser General Public License, v2.1 or later
06: * $Id: ElementDeployer.java 3634 2007-01-08 21:42:24Z gbevin $
07: */
08: package com.uwyn.rife.engine;
09:
10: import com.uwyn.rife.engine.exceptions.EngineException;
11:
12: /**
13: * Classes that are responsible for deploying elements have to extend this
14: * abstract class.
15: * <p>After {@link ElementSupport#setDeploymentClass registering} the
16: * <code>ElementDeployer</code> class with <code>ElementSupport</code>, an
17: * instance of this class will be created when the element is deployed within
18: * a site. The instance's {@link #deploy()} method will be called.
19: * <p>Element deployers are handy if you need to setup element-specific
20: * resources for all instances of the element's implementation.
21: *
22: * @author Geert Bevin (gbevin[remove] at uwyn dot com)
23: * @version $Revision: 3634 $
24: * @see ElementSupport#setDeploymentClass
25: * @since 1.0
26: */
27: public abstract class ElementDeployer {
28: private ElementInfo mElementInfo = null;
29:
30: final void setElementInfo(ElementInfo elementInfo) {
31: mElementInfo = elementInfo;
32: }
33:
34: /**
35: * Retrieves the declaration information about the element that is being
36: * deployed.
37: *
38: * @return the declaration information of the deployed element
39: * @since 1.0
40: */
41: public final ElementInfo getElementInfo() {
42: return mElementInfo;
43: }
44:
45: /**
46: * This method is executed when the deployment should be performed.
47: *
48: * @since 1.0
49: */
50: public abstract void deploy() throws EngineException;
51: }
|