KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > za > org > coefficient > interceptors > WorkflowSetupInterceptor


1 /*
2  * Coefficient - facilitates project based collaboration
3  * Copyright (C) 2003, Dylan Etkin, CSIR icomtek
4  * PO Box 395
5  * Pretoria 0001, RSA
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  */

19
20 package za.org.coefficient.interceptors;
21
22 import za.org.coefficient.authentication.CoefficientUser;
23 import za.org.coefficient.core.CoefficientInterceptor;
24 import za.org.coefficient.interfaces.CoefficientContext;
25 import za.org.coefficient.util.common.InvokerFactory;
26
27 /**
28  *
29  * @version $Revision: 1.3 $ $Date: 2003/12/03 07:54:56 $
30  * @author <a HREF="mailto:detkin@csir.co.za">Dylan Etkin</a>
31  */

32 public class WorkflowSetupInterceptor extends CoefficientInterceptor {
33     //~ Static fields/initializers =============================================
34

35     private static CoefficientUser workflowUser;
36
37     //~ Methods ================================================================
38

39     protected int handleInvoke(CoefficientContext ctx) throws Exception JavaDoc {
40         int retVal = INVOKE_PROCESS_CHILD;
41
42         if (workflowUser == null) {
43             // find him
44
workflowUser = (CoefficientUser)InvokerFactory
45                 .getRemoteInvoker().invokeMethodOnModule("UserAdmin","findWorkflowUser", new Object JavaDoc[0]);
46         }
47         ctx.setWorkflowUser(workflowUser);
48
49         return retVal;
50     }
51 }
52
Popular Tags