001: /*
002: * Copyright 2006 Pentaho Corporation. All rights reserved.
003: * This software was developed by Pentaho Corporation and is provided under the terms
004: * of the Mozilla Public License, Version 1.1, or any later version. You may not use
005: * this file except in compliance with the license. If you need a copy of the license,
006: * please go to http://www.mozilla.org/MPL/MPL-1.1.txt. The Original Code is the Pentaho
007: * BI Platform. The Initial Developer is Pentaho Corporation.
008: *
009: * Software distributed under the Mozilla Public License is distributed on an "AS IS"
010: * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. Please refer to
011: * the license for the specific language governing your rights and limitations.
012: *
013: * @created Jun 21, 2005
014: * @author James Dixon
015: */
016:
017: package org.pentaho.core.component;
018:
019: import java.util.List;
020:
021: import org.dom4j.Element;
022: import org.dom4j.Node;
023: import org.pentaho.actionsequence.dom.actions.ActionDefinition;
024: import org.pentaho.core.audit.IAuditable;
025: import org.pentaho.core.runtime.IRuntimeContext;
026: import org.pentaho.core.session.IPentahoSession;
027: import org.pentaho.util.logging.ILogger;
028:
029: /**
030: * A Component is the smallest module in the platform architecture and
031: * represents a unit of work, or an action to be performed. Different Component
032: * implementations provide new channels of functionality as well as multiple
033: * implementations of similar features (.ie, the BIRT Reporting Component and
034: * the Jasper Reports Reporting Component).
035: */
036: public interface IComponent extends IAuditable, ILogger {
037:
038: /**
039: * Initialize the Component. This method is typically called on
040: * construction.
041: *
042: * @return returns true if the Component initialized successfully, otherwise
043: * returns false
044: */
045: public boolean init();
046:
047: /**
048: * Validate that the Component has all the necessary inputs, outputs and
049: * resources it needs to execute successfully. Also may validate a schema
050: * here.
051: *
052: * @return one of IRuntimeContext validation conditions
053: * @see org.pentaho.core.runtime.IRuntimeContext
054: */
055: public int validate();
056:
057: /**
058: * Perform the Component execution; logic for what this Component does goes
059: * here.
060: *
061: * @return one of IRuntimeContext execution conditions
062: * @see org.pentaho.core.runtime.IRuntimeContext
063: */
064: public int execute();
065:
066: /**
067: * Allows the component to perform any cleanup after the execution of the
068: * action.
069: *
070: */
071: public void done();
072:
073: public void setInstanceId(String instanceId);
074:
075: public String getInstanceId();
076:
077: public void setActionName(String actionName);
078:
079: public String getActionName();
080:
081: public void setProcessId(String processId);
082:
083: public String getProcessId();
084:
085: public void setComponentDefinition(Node componentDefinition);
086:
087: public Node getComponentDefinition();
088:
089: public void setRuntimeContext(IRuntimeContext runtimeContext);
090:
091: public IRuntimeContext getRuntimeContext();
092:
093: public void setSession(IPentahoSession session);
094:
095: public IPentahoSession getSession();
096:
097: public void setMessages(List messaes);
098:
099: public List getMessages();
100:
101: public void setActionDefinition(ActionDefinition actionDefinition);
102:
103: public ActionDefinition getActionDefinition();
104: }
|