Source Code Cross Referenced for DeadlineSessionBean.java in  » Workflow-Engines » bonita-v3.1 » hero » session » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Workflow Engines » bonita v3.1 » hero.session 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package hero.session;
002:
003:        /*
004:         * 02/01/2002 - 15:24:07
005:         *
006:         * AllProjectsSessionEJB.java -
007:         * Copyright (C) 2002 Ecoo Team
008:         * valdes@loria.fr
009:         *
010:         *
011:         * This program is free software; you can redistribute it and/or
012:         * modify it under the terms of the GNU Lesser General Public License
013:         * as published by the Free Software Foundation; either version 2
014:         * of the License, or (at your option) any later version.
015:         *
016:         * This program is distributed in the hope that it will be useful,
017:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
018:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
019:         * GNU Lesser General Public License for more details.
020:         *
021:         * You should have received a copy of the GNU Lesser General Public License
022:         * along with this program; if not, write to the Free Software
023:         * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
024:         */
025:
026:        import hero.interfaces.BnProjectLocal;
027:        import hero.interfaces.BnProjectLocalHome;
028:        import hero.interfaces.BnProjectUtil;
029:        import hero.interfaces.Constants;
030:        import hero.util.BonitaProjectLocator;
031:        import hero.util.BonitaServiceValue;
032:        import hero.util.EventConstants;
033:        import hero.util.HeroException;
034:        import hero.util.HeroHookException;
035:        import hero.util.values.BonitaHookValue;
036:        import hero.util.values.BonitaNodeValue;
037:        import hero.util.values.BonitaProjectValue;
038:
039:        import java.util.Collection;
040:        import java.util.Iterator;
041:
042:        import javax.ejb.CreateException;
043:        import javax.ejb.SessionBean;
044:        import javax.ejb.SessionContext;
045:
046:        /**
047:         * Session Bean Template
048:         *
049:         * @ejb:bean name="DeadlineSession"
050:         *           display-name="DeadlineSession Bean"
051:         *           type="Stateless"
052:         *           transaction-type="Container"
053:         *           jndi-name="ejb/hero/DeadlineSession"
054:         *           local-jndi-name="ejb/hero/DeadlineSession_L"
055:         *
056:         * @ejb:transaction type="Supports"
057:         * @ejb.permission unchecked="yes"
058:         * @ejb.security-identity run-as="SuperAdmin"
059:         * @jonas.bean
060:         *      ejb-name="DeadlineSession"
061:         *      jndi-name="ejb/hero/DeadlineSession"
062:         *
063:         * @jboss.container-configuration name="Standard Stateless SessionBean for Bonita"
064:         **/
065:
066:        public class DeadlineSessionBean implements  SessionBean, EventConstants {
067:
068:            // -------------------------------------------------------------------------
069:            // Static
070:            // -------------------------------------------------------------------------
071:
072:            // -------------------------------------------------------------------------
073:            // Members
074:            // -------------------------------------------------------------------------
075:
076:            private SessionContext mContext;
077:
078:            // -------------------------------------------------------------------------
079:            // Methods
080:            // -------------------------------------------------------------------------
081:
082:            /**
083:             * Get all projects
084:             *
085:             * @ejb.permission unchecked="yes"
086:             * @ejb:interface-method view-type="both"
087:             * @ejb:transaction type="Required"
088:             *
089:             **/
090:            public void executeHookDeadline(String type, String projectName,
091:                    String nodeName) throws HeroException {
092:                BnProjectLocal mProject = null;
093:                BonitaProjectValue model;
094:                BonitaNodeValue node;
095:                Collection hooks;
096:
097:                try {
098:                    BnProjectLocalHome pHome = BnProjectUtil.getLocalHome();
099:                    mProject = pHome.findByName(projectName);
100:                } catch (Exception ple) {
101:                    ple.printStackTrace();
102:                }
103:
104:                try {
105:                    BonitaNodeValue nodeLocal;
106:                    if (mProject.getType().equals(Constants.Pj.INSTANCE)) {
107:                        model = BonitaProjectLocator.getInstance()
108:                                .getModelValue(
109:                                        this .getModel(mProject.getName()),
110:                                        this .getModel(mProject.getVersion()));
111:                        node = BonitaServiceValue.getNodeFromCache(model,
112:                                nodeName);
113:
114:                        if (nodeName.matches(".*_instance.*"))
115:                            nodeName = nodeName.substring(0, nodeName
116:                                    .indexOf("_instance"));
117:                        nodeLocal = BonitaServiceValue.getNodeFromCache(model,
118:                                nodeName);
119:                    } else {
120:                        nodeLocal = BonitaServiceValue.getNode(mProject,
121:                                nodeName);
122:                    }
123:
124:                    hooks = nodeLocal.getHooks();
125:                    for (Iterator i = hooks.iterator(); i.hasNext();) {
126:                        BonitaHookValue hk = (BonitaHookValue) i.next();
127:                        if (hk.getEvent().equalsIgnoreCase(
128:                                hero.interfaces.Constants.Nd.ONDEADLINE)) {
129:                            hero.hook.Hook h = hero.hook.Hook.make(
130:                                    hk.getName(),
131:                                    hero.interfaces.Constants.Nd.ONDEADLINE, hk
132:                                            .getType());
133:                            h.execute(this ,
134:                                    hero.interfaces.Constants.Nd.ONDEADLINE,
135:                                    mProject.getBnNode(nodeLocal.getName()));
136:                        }
137:                    }
138:                } catch (Exception hh) {
139:                    mContext.setRollbackOnly();
140:                    throw new HeroHookException("Cannot execute hook "
141:                            + hh.getMessage());
142:                }
143:            }
144:
145:            //	 Get the name of the project model of this instance
146:            private String getModel(String instanceName) {
147:                int i = instanceName.indexOf("_instance");
148:                if (i != -1)
149:                    return (instanceName.substring(0, i));
150:                else
151:                    return (instanceName); // for cooperative processes
152:            }
153:
154:            /**
155:             * Create the All Projects Session Bean
156:             *
157:             * @throws CreateException
158:             *
159:             * @ejb.permission unchecked="yes"
160:             * @ejb:create-method view-type="both"
161:             **/
162:
163:            public void ejbCreate() throws CreateException {
164:            }
165:
166:            public void setSessionContext(final javax.ejb.SessionContext context) {
167:                mContext = context;
168:            }
169:
170:            public void ejbRemove() {
171:            }
172:
173:            public void ejbActivate() {
174:            }
175:
176:            public void ejbPassivate() {
177:            }
178:
179:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.