⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rmiworksession.java

📁 一个工作流设计及定义的系统,可以直接与数据库结合进行系统工作流程的定义及应用.
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
/* * Copyright (c) 2005, John Mettraux, OpenWFE.org * All rights reserved. *  * Redistribution and use in source and binary forms, with or without  * modification, are permitted provided that the following conditions are met: *  * . Redistributions of source code must retain the above copyright notice, this *   list of conditions and the following disclaimer.   *  * . Redistributions in binary form must reproduce the above copyright notice,  *   this list of conditions and the following disclaimer in the documentation  *   and/or other materials provided with the distribution. *  * . Neither the name of the "OpenWFE" nor the names of its contributors may be *   used to endorse or promote products derived from this software without *   specific prior written permission. *  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE  * POSSIBILITY OF SUCH DAMAGE. * * $Id: RmiWorkSession.java,v 1.8 2005/06/23 17:39:19 jmettraux Exp $ *///// RmiWorkSession.java//// jmettraux@openwfe.org//// generated with // jtmpl 1.0.04 31.10.2002 John Mettraux (jmettraux@openwfe.org)//package openwfe.org.worklist.impl;import java.rmi.RemoteException;import java.security.PermissionCollection;import java.security.PrivilegedActionException;import javax.security.auth.Subject;import openwfe.org.OpenWfeException;import openwfe.org.ApplicationContext;import openwfe.org.auth.PolicyService;import openwfe.org.engine.workitem.LaunchItem;import openwfe.org.engine.workitem.InFlowWorkItem;import openwfe.org.engine.expressions.FlowExpressionId;import openwfe.org.worklist.Header;import openwfe.org.worklist.Launchable;import openwfe.org.worklist.WorkSession;import openwfe.org.worklist.Definitions;import openwfe.org.worklist.store.WorkItemStore;import openwfe.org.worklist.LaunchException;import openwfe.org.worklist.WorkListException;import openwfe.org.worklist.auth.LaunchPermission;import openwfe.org.worklist.auth.DelegationPermission;/** * An implementation of WorkSession based on RMI. * * <p><font size=2>CVS Info : * <br>$Author: jmettraux $ * <br>$Date: 2005/06/23 17:39:19 $ * <br>$Id: RmiWorkSession.java,v 1.8 2005/06/23 17:39:19 jmettraux Exp $ </font> * * @author jmettraux@openwfe.org */public class RmiWorkSession    extends java.rmi.server.UnicastRemoteObject    implements WorkSession{    private final static org.apache.log4j.Logger log = org.apache.log4j.Logger        .getLogger(RmiWorkSession.class.getName());    //    // FIELDS    private ApplicationContext applicationContext = null;    private java.util.Map serviceParams = null;    private Subject subject = null;    private java.util.Map ids = new java.util.HashMap(77);    //    // CONSTRUCTORS    /*     * This constructor must be present to rethrow its super generated      * RemoteException.     */    public RmiWorkSession ()        throws RemoteException    {        super();    }    //    // METHODS from WorkSession    //    // non remote methods    public void init         (final ApplicationContext context,          final java.util.Map params,          final Subject subject)    throws         RemoteException    {        this.applicationContext = context;        this.serviceParams = params;        this.subject = subject;    }    public Subject getSubject ()         throws RemoteException    {         return this.subject;     }    public ApplicationContext getApplicationContext ()    {        return this.applicationContext;    }    //    // remote methods    //    // (a lot of security wrapping)    /*     * This first method is unprotected : everybody (if authenticated)     * may list the storeNames     */    public java.util.List getStoreNames ()        throws RemoteException    {        java.util.ArrayList result = new java.util.ArrayList();        java.util.Iterator it = this.applicationContext.keySet().iterator();        while (it.hasNext())        {            final String serviceName = (String)it.next();            final Object o = this.applicationContext.lookup(serviceName);            if (o instanceof WorkItemStore) result.add(serviceName);        }        result.trimToSize();        return result;    }    public int countWorkItems (String storeName)        throws RemoteException, WorkListException    {        try        {            Object result = Subject.doAs                (this.subject,                  new openwfe.org.wlactions.CountWorkItemsAction                    (this.applicationContext,                     this.subject,                     storeName));            return ((Integer)result).intValue();        }        catch (PrivilegedActionException pae)        {            throw (WorkListException)pae.getException();        }    }    public java.util.List findFlowInstance        (final String storeName, final String workflowInstanceId)    throws         RemoteException, WorkListException    {        try        {            Object result = Subject.doAs                (this.subject,                  new openwfe.org.wlactions.FindFlowInstanceAction                    (this.applicationContext,                     this.subject,                     storeName,                     workflowInstanceId));            final java.util.List feis = (java.util.List)result;            registerIds(feis);            return feis;        }        catch (PrivilegedActionException pae)        {            throw (WorkListException)pae.getException();        }    }    public java.util.List getHeaders         (final String storeName, final int limit)    throws         RemoteException, WorkListException    {        try        {            Object result = Subject.doAs                (this.subject,                  new openwfe.org.wlactions.GetHeadersAction                    (this.applicationContext,                     this.subject,                     storeName,                     limit,                     null));            final java.util.List headers = (java.util.List)result;            registerIds(headers);            return headers;        }        catch (PrivilegedActionException pae)        {            throw (WorkListException)pae.getException();        }    }    public java.util.List getHeaders         (final String storeName,          final int limit,          final java.util.Comparator headerComparator)    throws         RemoteException, WorkListException    {        try        {            Object result = Subject.doAs                (this.subject,                  new openwfe.org.wlactions.GetHeadersAction                    (this.applicationContext,                     this.subject,                     storeName,                     limit,                     headerComparator));            return (java.util.List)result;        }        catch (PrivilegedActionException pae)        {            throw (WorkListException)pae.getException();        }    }    public InFlowWorkItem get         (final String storeName, final FlowExpressionId fei)    throws         RemoteException, WorkListException    {        try        {            Object result = Subject.doAs                (this.subject,                  new openwfe.org.wlactions.GetAction                    (this.applicationContext,                     this.subject,                     storeName,                     fei));            return (InFlowWorkItem)result;        }        catch (PrivilegedActionException pae)        {            throw (WorkListException)pae.getException();        }    }    public InFlowWorkItem get         (final String storeName, final String id)    throws         RemoteException, WorkListException    {        final FlowExpressionId fei = (FlowExpressionId)this.ids.get(id);        return get(storeName, fei);    }    public InFlowWorkItem getAndLock         (final String storeName, final FlowExpressionId fei)    throws         RemoteException, WorkListException    {        log.debug("getAndLock() storeName >"+storeName+"< fei "+fei);        try        {            Object result = Subject.doAs                (this.subject,                  new openwfe.org.wlactions.GetAndLockAction                    (this.applicationContext,                     this.subject,                     storeName,                     fei));            return (InFlowWorkItem)result;        }        catch (PrivilegedActionException pae)        {            throw (WorkListException)pae.getException();        }    }    public InFlowWorkItem getAndLock         (final String storeName, final String id)    throws 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -