01: // THIS SOFTWARE IS PROVIDED BY SOFTARIS PTY.LTD. AND OTHER METABOSS
02: // CONTRIBUTORS ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING,
03: // BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
04: // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SOFTARIS PTY.LTD.
05: // OR OTHER METABOSS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
06: // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
07: // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
08: // OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
09: // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
10: // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
11: // EVEN IF SOFTARIS PTY.LTD. OR OTHER METABOSS CONTRIBUTORS ARE ADVISED OF THE
12: // POSSIBILITY OF SUCH DAMAGE.
13: //
14: // Copyright 2000-2005 © Softaris Pty.Ltd. All Rights Reserved.
15: package com.metaboss.sdlctools.models.impl.metabossmodel.enterprisemodel;
16:
17: import java.util.Collection;
18:
19: import javax.jmi.reflect.ConstraintViolationException;
20:
21: import org.netbeans.mdr.storagemodel.StorableObject;
22:
23: import com.metaboss.sdlctools.models.impl.metabossmodel.ModelElementImpl;
24: import com.metaboss.sdlctools.models.metabossmodel.enterprisemodel.SystemDependency;
25:
26: public abstract class SystemDependencyImpl extends ModelElementImpl
27: implements SystemDependency {
28: // Required constructor
29: protected SystemDependencyImpl(StorableObject storable) {
30: super (storable);
31: }
32:
33: // Verify certain constraints
34: protected Collection _verify(Collection pViolations) {
35: // First call superclass
36: Collection lViolations = super ._verify(pViolations);
37:
38: // Constraint #1 - client and server system must not be the same
39: {
40: com.metaboss.sdlctools.models.metabossmodel.enterprisemodel.System lClientSystem = getClient();
41: com.metaboss.sdlctools.models.metabossmodel.enterprisemodel.System lServantSystem = getServant();
42: if (lClientSystem != null && lServantSystem != null
43: && lServantSystem.equals(lClientSystem))
44: lViolations
45: .add(new ConstraintViolationException(this ,
46: refMetaObject(),
47: "Client and Servant systems can not be the same."));
48: }
49: return lViolations;
50: }
51: }
|