KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > pentaho > core > component > IComponent


1 /*
2  * Copyright 2006 Pentaho Corporation. All rights reserved.
3  * This software was developed by Pentaho Corporation and is provided under the terms
4  * of the Mozilla Public License, Version 1.1, or any later version. You may not use
5  * this file except in compliance with the license. If you need a copy of the license,
6  * please go to http://www.mozilla.org/MPL/MPL-1.1.txt. The Original Code is the Pentaho
7  * BI Platform. The Initial Developer is Pentaho Corporation.
8  *
9  * Software distributed under the Mozilla Public License is distributed on an "AS IS"
10  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. Please refer to
11  * the license for the specific language governing your rights and limitations.
12  *
13  * @created Jun 21, 2005
14  * @author James Dixon
15  */

16
17 package org.pentaho.core.component;
18
19 import java.util.List JavaDoc;
20
21 import org.dom4j.Node;
22 import org.pentaho.core.audit.IAuditable;
23 import org.pentaho.core.runtime.IRuntimeContext;
24 import org.pentaho.core.session.IPentahoSession;
25 import org.pentaho.util.logging.ILogger;
26
27 /**
28  * A Component is the smallest module in the platform architecture and
29  * represents a unit of work, or an action to be performed. Different Component
30  * implementations provide new channels of functionality as well as multiple
31  * implementations of similar features (.ie, the BIRT Reporting Component and
32  * the Jasper Reports Reporting Component).
33  */

34 public interface IComponent extends IAuditable, ILogger {
35
36     /**
37      * Initialize the Component. This method is typically called on
38      * construction.
39      *
40      * @return returns true if the Component initialized successfully, otherwise
41      * returns false
42      */

43     public boolean init();
44
45     /**
46      * Validate that the Component has all the necessary inputs, outputs and
47      * resources it needs to execute successfully. Also may validate a schema
48      * here.
49      *
50      * @return one of IRuntimeContext validation conditions
51      * @see org.pentaho.core.runtime.IRuntimeContext
52      */

53     public int validate();
54
55     /**
56      * Perform the Component execution; logic for what this Component does goes
57      * here.
58      *
59      * @return one of IRuntimeContext execution conditions
60      * @see org.pentaho.core.runtime.IRuntimeContext
61      */

62     public int execute();
63
64     /**
65      * Allows the component to perform any cleanup after the execution of the
66      * action.
67      *
68      */

69     public void done();
70
71     public void setInstanceId( String JavaDoc instanceId );
72     
73     public String JavaDoc getInstanceId();
74
75     public void setActionName( String JavaDoc actionName );
76     
77     public String JavaDoc getActionName( );
78     
79     public void setProcessId( String JavaDoc processId );
80
81     public String JavaDoc getProcessId( );
82
83     public void setComponentDefinition( Node componentDefinition );
84
85     public Node getComponentDefinition();
86
87     public void setRuntimeContext( IRuntimeContext runtimeContext );
88             
89     public IRuntimeContext getRuntimeContext( );
90             
91     public void setSession( IPentahoSession session );
92     
93     public IPentahoSession getSession( );
94     
95     public void setMessages( List JavaDoc messaes );
96     
97     public List JavaDoc getMessages();
98     
99 }
100
Popular Tags