View Javadoc

1   /*
2    * $Id: BPELProcessImpl.java,v 1.1 2004/12/15 14:18:18 patforna Exp $
3    *
4    * Copyright (c) 2004 Patric Fornasier, Pawel Kowalski
5    * Berne University of Applied Sciences
6    * School of Engineering and Information Technology
7    * All rights reserved.
8    */
9   package bexee.model.process.impl;
10  
11  import java.util.ArrayList;
12  import java.util.List;
13  
14  import javax.wsdl.Definition;
15  
16  import bexee.model.FindCreateReceivesVisitor;
17  import bexee.model.process.BPELProcess;
18  import bexee.model.process.Process;
19  
20  /***
21   * A default implementation of a <code>BPELProcess</code>.
22   * 
23   * @version $Revision: 1.1 $, $Date: 2004/12/15 14:18:18 $
24   * @author Patric Fornasier
25   * @author Pawel Kowalski
26   */
27  public class BPELProcessImpl implements BPELProcess {
28  
29      private Process process;
30  
31      private List creationReceives;
32  
33      private Definition wsdl;
34  
35      private List partnerWSDL;
36  
37      private boolean synchronous;
38  
39      public BPELProcessImpl() {
40          partnerWSDL = new ArrayList();
41      }
42  
43      public void setProcess(Process process) {
44          this.process = process;
45      }
46  
47      public Process getProcess() {
48          return process;
49      }
50  
51      public List getCreationReceives() {
52          if (creationReceives == null) {
53              FindCreateReceivesVisitor findReceives = new FindCreateReceivesVisitor();
54              process.accept(findReceives);
55              creationReceives = findReceives.getCreationReceives();
56          }
57          return creationReceives;
58      }
59  
60      public boolean isSynchronous() {
61          return synchronous;
62      }
63  
64      public void setWSDL(Definition definition) {
65          wsdl = definition;
66      }
67  
68      public void addPartnerWSDL(Definition wsdl) {
69          partnerWSDL.add(wsdl);
70      }
71  
72      public void addPartnerWSDL(List wsdl) {
73          partnerWSDL.addAll(wsdl);
74      }
75  
76      public List getPartnerWSDL() {
77          return partnerWSDL;
78      }
79  
80      public Definition getWSDL() {
81          return wsdl;
82      }
83  
84      public void setSynchronous(boolean synchronous) {
85          this.synchronous = synchronous;
86  
87      }
88  
89      public String getName() {
90          return (process == null) ? null : process.getName();
91      }
92  }