01: /**
02: * @author <a href="mailto:novotny@gridsphere.org">Jason Novotny</a>
03: * @version $Id: ComponentLifecycle.java 6404 2007-12-13 16:26:14Z novotny $
04: */package org.gridsphere.layout;
05:
06: import org.gridsphere.portletcontainer.GridSphereEvent;
07:
08: import javax.portlet.PortletRequest;
09: import java.util.List;
10:
11: /**
12: * The <code>ComponentLifecycle</code> represents the lifecycle methods required by any
13: * PortletComponent.
14: */
15: public interface ComponentLifecycle extends Cloneable {
16:
17: /**
18: * Initializes the portlet component. Since the components are isolated
19: * after Castor unmarshalls from XML, the ordering is determined by a
20: * passed in List containing the previous portlet components in the tree.
21: *
22: * @param req the portlet request
23: * @param list a list of component identifiers
24: * @return a list of updated component identifiers
25: * @see ComponentIdentifier
26: */
27: public List<ComponentIdentifier> init(PortletRequest req,
28: List<ComponentIdentifier> list);
29:
30: /**
31: * Performs an action on this portlet component
32: *
33: * @param event a gridsphere event
34: */
35: public void actionPerformed(GridSphereEvent event);
36:
37: /**
38: * Renders the portlet component
39: *
40: * @param event a gridsphere event
41: */
42: public void doRender(GridSphereEvent event);
43:
44: public Object clone() throws CloneNotSupportedException;
45:
46: /**
47: * Destroys this portlet component
48: */
49: public void destroy();
50:
51: /**
52: * Returns the associated portlet component id
53: *
54: * @return the portlet component id
55: */
56: public int getComponentID();
57:
58: /**
59: * Returns the associated portlet component id
60: *
61: * @return the portlet component id
62: */
63: public String getComponentIDAsString();
64:
65: /**
66: * Sets the associated portlet component id
67: *
68: * @param compId the portlet component id
69: */
70: public void setComponentID(int compId);
71:
72: }
|