getType() {
- return (_type);
- }
-
- /**
- * Appends the specified element to the end of this list (optional
- * operation).
- *
- * Lists that support this operation may place limitations on what
- * elements may be added to this list. In particular, some
- * lists will refuse to add null elements, and others will impose
- * restrictions on the type of elements that may be added. List
- * classes should clearly specify in their documentation any restrictions
- * on what elements may be added.
- *
- * @param o element to be appended to this list.
- * @return true (as per the general contract of the
- * Collection.add method).
- */
- public boolean add(E o) {
- boolean ret=super.add(o);
-
- if (ret) {
- o.setParent(_parent);
- }
-
- return (ret);
- }
-
- /**
- * Removes the first occurrence in this list of the specified element
- * (optional operation). If this list does not contain the element, it is
- * unchanged. More formally, removes the element with the lowest index i
- * such that (o==null ? get(i)==null : o.equals(get(i))) (if
- * such an element exists).
- *
- * @param o element to be removed from this list, if present.
- * @return true if this list contained the specified element.
- */
- public boolean remove(Object o) {
- boolean ret=super.remove(o);
-
- if (ret && o instanceof ModelObject) {
- ((ModelObject) o).setParent(null);
- }
-
- return (ret);
- }
-
- /**
- * Appends all of the elements in the specified collection to the end of
- * this list, in the order that they are returned by the specified
- * collection's iterator (optional operation). The behavior of this
- * operation is unspecified if the specified collection is modified while
- * the operation is in progress. (Note that this will occur if the
- * specified collection is this list, and it's nonempty.)
- *
- * @param c collection whose elements are to be added to this list.
- * @return true if this list changed as a result of the call.
- * @see #add(Object)
- */
- public boolean addAll(Collection extends E> c) {
- boolean ret=super.addAll(c);
-
- if (ret) {
- java.util.Iterator extends E> iter=c.iterator();
-
- while (iter.hasNext()) {
- iter.next().setParent(_parent);
- }
- }
-
- return (ret);
- }
-
- /**
- * Inserts all of the elements in the specified collection into this
- * list at the specified position (optional operation). Shifts the
- * element currently at that position (if any) and any subsequent
- * elements to the right (increases their indices). The new elements
- * will appear in this list in the order that they are returned by the
- * specified collection's iterator. The behavior of this operation is
- * unspecified if the specified collection is modified while the
- * operation is in progress. (Note that this will occur if the specified
- * collection is this list, and it's nonempty.)
- *
- * @param index index at which to insert first element from the specified
- * collection.
- * @param c elements to be inserted into this list.
- * @return true if this list changed as a result of the call.
- */
- public boolean addAll(int index, Collection extends E> c) {
- boolean ret=super.addAll(index, c);
-
- if (ret) {
- java.util.Iterator extends E> iter=c.iterator();
-
- while (iter.hasNext()) {
- iter.next().setParent(_parent);
- }
- }
-
- return (ret);
- }
-
- /**
- * Removes from this list all the elements that are contained in the
- * specified collection (optional operation).
- *
- * @param c collection that defines which elements will be removed from
- * this list.
- * @return true if this list changed as a result of the call.
- * @see #remove(Object)
- * @see #contains(Object)
- */
- public boolean removeAll(Collection> c) {
- boolean ret=super.removeAll(c);
-
- if (ret) {
- java.util.Iterator> iter=c.iterator();
-
- while (iter.hasNext()) {
- Object val=iter.next();
- if (val instanceof ModelObject) {
- ((ModelObject) val).setParent(null);
- }
- }
- }
-
- return (ret);
- }
-
- /**
- * Retains only the elements in this list that are contained in the
- * specified collection (optional operation). In other words, removes
- * from this list all the elements that are not contained in the specified
- * collection.
- *
- * @param c collection that defines which elements this set will retain.
- *
- * @return true if this list changed as a result of the call.
- * @see #remove(Object)
- * @see #contains(Object)
- */
- public boolean retainAll(Collection> c) {
- return (super.retainAll(c));
- }
-
- /**
- * Removes all of the elements from this list (optional operation). This
- * list will be empty after this call returns (unless it throws an
- * exception).
- */
- public void clear() {
- java.util.Iterator extends E> iter=iterator();
-
- while (iter.hasNext()) {
- iter.next().setParent(null);
- }
-
- super.clear();
- }
-
- /**
- * Replaces the element at the specified position in this list with the
- * specified element (optional operation).
- *
- * @param index index of element to replace.
- * @param element element to be stored at the specified position.
- * @return the element previously at the specified position.
- */
- public E set(int index, E element) {
- E ret=super.set(index, element);
-
- if (element != null) {
- element.setParent(_parent);
- }
-
- if (ret != null) {
- ret.setParent(null);
- }
-
- return (ret);
- }
-
- /**
- * Inserts the specified element at the specified position in this list
- * (optional operation). Shifts the element currently at that position
- * (if any) and any subsequent elements to the right (adds one to their
- * indices).
- *
- * @param index index at which the specified element is to be inserted.
- * @param element element to be inserted.
- *
- */
- public void add(int index, E element) {
- super.add(index, element);
-
- if (element != null) {
- element.setParent(_parent);
- }
- }
-
- /**
- * Removes the element at the specified position in this list (optional
- * operation). Shifts any subsequent elements to the left (subtracts one
- * from their indices). Returns the element that was removed from the
- * list.
- *
- * @param index the index of the element to removed.
- * @return the element previously at the specified position.
- */
- public E remove(int index) {
- E ret=super.remove(index);
-
- if (ret != null) {
- ret.setParent(null);
- }
-
- return (ret);
- }
-}
diff --git a/modules/core/src/main/java/org/scribble/model/ImportDecl.java b/modules/core/src/main/java/org/scribble/model/ImportDecl.java
deleted file mode 100644
index 365e08744..000000000
--- a/modules/core/src/main/java/org/scribble/model/ImportDecl.java
+++ /dev/null
@@ -1,188 +0,0 @@
-/*
- * Copyright 2009 www.scribble.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.scribble.model;
-
-/**
- * This class represents an imported protocol.
- *
- */
-public class ImportDecl extends ModelObject {
-
- private String _moduleName=null;
- private String _memberName=null;
- private String _alias=null;
-
- /**
- * The default constructor.
- */
- public ImportDecl() {
- }
-
- /**
- * The copy constructor.
- *
- * @param copy The copy
- */
- public ImportDecl(ImportDecl copy) {
- super(copy);
- _moduleName = copy.getModuleName();
- _memberName = copy.getMemberName();
- _alias = copy.getAlias();
- }
-
- /**
- * This method returns the optional module name.
- *
- * @return The optional module name
- */
- public String getModuleName() {
- return (_moduleName);
- }
-
- /**
- * This method sets the optional module name.
- *
- * @param module The optional module name
- */
- public void setModuleName(String module) {
- _moduleName = module;
- }
-
- /**
- * This method returns the name of the
- * member being imported.
- *
- * @return The member name
- */
- public String getMemberName() {
- return (_memberName);
- }
-
- /**
- * This method sets the name of the
- * member being imported.
- *
- * @param name The member name
- */
- public void setMemberName(String name) {
- _memberName = name;
- }
-
- /**
- * This method returns the optional alias.
- *
- * @return The optional alias
- */
- public String getAlias() {
- return (_alias);
- }
-
- /**
- * This method sets the optional alias.
- *
- * @param alias The optionalalias
- */
- public void setAlias(String alias) {
- _alias = alias;
- }
-
- /**
- * This method returns the declaration name.
- *
- * @return The declaration name
- */
- public String getDeclarationName() {
- String ret=null;
-
- if (getAlias() != null) {
- ret = getAlias();
- } else if (getMemberName() != null) {
- ret = getModuleName().toString()+"."+getMemberName();
- } else {
- ret = getModuleName().toString();
- }
-
- return (ret);
- }
-
- /**
- * This method visits the model object using the supplied
- * visitor.
- *
- * @param visitor The visitor
- */
- public void visit(Visitor visitor) {
- visitor.accept(this);
- }
-
- @Override
- public String toString() {
- String ret=getMemberName();
-
- if (ret == null) {
- ret = "";
- }
-
- return (ret);
- }
-
- /**
- * {@inheritDoc}
- */
- public void toText(StringBuffer buf, int level) {
- indent(buf, level);
-
- /*
- buf.append("import ");
-
- if (_memberName != null) {
- buf.append(_memberName);
-
- buf.append(" from ");
- }
-
- buf.append(_moduleName);
-
- if (_memberName != null && _alias != null) {
- buf.append(" as ");
-
- buf.append(_alias);
- }
- */
-
- if (_memberName != null) {
- buf.append("from ");
- } else {
- buf.append("import ");
- }
-
- buf.append(_moduleName);
-
- if (_memberName != null) {
- buf.append(" import ");
- buf.append(_memberName);
- }
-
- if (_alias != null) {
- buf.append(" as ");
-
- buf.append(_alias);
- }
-
- buf.append(";\n");
- }
-}
diff --git a/modules/core/src/main/java/org/scribble/model/Message.java b/modules/core/src/main/java/org/scribble/model/Message.java
deleted file mode 100644
index d73ef3614..000000000
--- a/modules/core/src/main/java/org/scribble/model/Message.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- * Copyright 2009 www.scribble.org
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.scribble.model;
-
-/**
- * This class represents a message.
- * Message signatures can be either a simple signature with
- * a unique TypeReference, or an operation name with several
- * TypeReferences as arguments.
- */
-public class Message extends ModelObject {
-
- private String _parameter=null;
- private MessageSignature _messageSignature=null;
-
- /**
- * The default constructor.
- */
- public Message() {
- }
-
- public Message(Message copy) {
- _parameter = copy._parameter;
-
- if (copy._messageSignature != null) {
- _messageSignature = new MessageSignature(copy._messageSignature);
- }
- }
-
- /**
- * This method returns the optional parameter.
- *
- * @return The optional parameter
- */
- public String getParameter() {
- return (_parameter);
- }
-
- /**
- * This method sets the parameter. This property
- * is mutually exclusive with the operator and
- * types list, which represent the message
- * signature.
- *
- * @param parameter The parameter
- */
- public void setParameter(String parameter) {
- _parameter = parameter;
- }
-
- /**
- * This method returns the message signature.
- *
- * @return The message signature
- */
- public MessageSignature getMessageSignature() {
- return (_messageSignature);
- }
-
- /**
- * This method sets the message signature.
- *
- * @param sig The message signature
- */
- public void setMessageSignature(MessageSignature sig) {
- if (_messageSignature != null) {
- _messageSignature.setParent(null);
- }
-
- _messageSignature = sig;
-
- if (_messageSignature != null) {
- _messageSignature.setParent(this);
- }
- }
-
- @Override
- public int hashCode() {
- int result = 13;
- result = 31 * result + (_parameter == null ? 0 : _parameter.hashCode());
- result = 31 * result + (_messageSignature == null ? 0 : _messageSignature.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- boolean ret=false;
-
- if (obj instanceof Message) {
- Message other=(Message)obj;
-
- if (other._parameter != null && _parameter != null) {
- ret = other._parameter.equals(_parameter);
- } else if (other._parameter == null && _parameter == null) {
- ret = true;
- }
-
- if (ret) {
- if (other._messageSignature != null && _messageSignature != null) {
- ret = other._messageSignature.equals(_messageSignature);
- } else if (other._messageSignature == null && _messageSignature == null) {
- ret = true;
- }
- }
- }
-
- return (ret);
- }
-
- @Override
- public String toString() {
- String ret="";
-
- if (getMessageSignature() != null) {
- ret += getMessageSignature();
- } else if (getParameter() != null &&
- getParameter().trim().length() > 0) {
- ret += getParameter();
- }
-
- if (ret.equals("")) {
- ret = "";
- }
-
- return (ret);
- }
-
- /**
- * This method visits the model object using the supplied
- * visitor.
- *
- * @param visitor The visitor
- */
- public void visit(Visitor visitor) {
- }
-
- /**
- * {@inheritDoc}
- */
- public void toText(StringBuffer buf, int level) {
-
- if (_messageSignature != null) {
- _messageSignature.toText(buf, level);
- } else if (_parameter != null) {
- buf.append(_parameter);
- }
- }
-}
diff --git a/modules/core/src/main/java/org/scribble/model/MessageSignature.java b/modules/core/src/main/java/org/scribble/model/MessageSignature.java
deleted file mode 100644
index fa46fdb8b..000000000
--- a/modules/core/src/main/java/org/scribble/model/MessageSignature.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- * Copyright 2009 www.scribble.org
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.scribble.model;
-
-/**
- * This class represents a message signature.
- * Message signatures can be either a simple signature with
- * a unique TypeReference, or an operation name with several
- * TypeReferences as arguments.
- */
-public class MessageSignature extends ModelObject {
-
- private String _operator=null;
- private java.util.List _types=new ContainmentList(this, PayloadElement.class);
-
- /**
- * The default constructor.
- */
- public MessageSignature() {
- }
-
- /**
- * Constructor for MessageSignatures that comprise an operation.
- * @param operator The operation name.
- * @param types The arguments for the operation.
- */
- public MessageSignature(String operator, java.util.List types) {
- _operator = operator;
- _types.addAll(types);
- }
-
- /**
- * The copy constructor.
- *
- * @param msig The message signature
- */
- public MessageSignature(MessageSignature msig) {
- super(msig);
-
- _operator = msig.getOperator();
-
- for (PayloadElement tref : msig.getPayloadElements()) {
- _types.add(new PayloadElement(tref));
- }
- }
-
- /**
- * This method returns the optional operator.
- *
- * @return The optional operator
- */
- public String getOperator() {
- return (_operator);
- }
-
- /**
- * This method sets the operator.
- *
- * @param operator The operator
- */
- public void setOperator(String operator) {
- _operator = operator;
- }
-
- /**
- * This method returns the list of types. If
- * no operation is defined, then only one type reference
- * should be defined.
- *
- * @return The list of types
- */
- public java.util.List getPayloadElements() {
- return (_types);
- }
-
- @Override
- public int hashCode() {
- int result = 13;
- result = 31 * result + _types.hashCode();
- result = 31 * result + (_operator == null ? 0 : _operator.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- boolean ret=false;
-
- if (obj instanceof MessageSignature) {
- MessageSignature other=(MessageSignature) obj;
-
- if (other.getPayloadElements().size() == getPayloadElements().size()) {
- if (other._operator != null && _operator != null) {
- ret = other._operator.equals(_operator);
- } else if (other._operator == null && _operator == null) {
- ret = true;
- }
-
- for (int i=0; ret && i < getPayloadElements().size(); i++) {
- ret = getPayloadElements().get(i).equals(other.getPayloadElements().get(i));
- }
- }
- }
-
- return (ret);
- }
-
- @Override
- public String toString() {
- String ret="";
-
- ret += getOperator() + "(";
-
- for (int i=0; i < _types.size(); i++) {
- if (i > 0) {
- ret += ",";
- }
- ret += _types.get(i).getName();
- }
-
- ret += ")";
-
- if (ret.equals("")) {
- ret = "";
- }
-
- return (ret);
- }
-
- /**
- * This method visits the model object using the supplied
- * visitor.
- *
- * @param visitor The visitor
- */
- public void visit(Visitor visitor) {
- }
-
- /**
- * {@inheritDoc}
- */
- public void toText(StringBuffer buf, int level) {
-
- buf.append(_operator);
- buf.append('(');
-
- for (int i=0; i < getPayloadElements().size(); i++) {
- if (i > 0) {
- buf.append(',');
- }
- getPayloadElements().get(i).toText(buf, level);
- }
-
- buf.append(')');
- }
-}
diff --git a/modules/core/src/main/java/org/scribble/model/ModelObject.java b/modules/core/src/main/java/org/scribble/model/ModelObject.java
deleted file mode 100644
index a148f4928..000000000
--- a/modules/core/src/main/java/org/scribble/model/ModelObject.java
+++ /dev/null
@@ -1,185 +0,0 @@
-/*
- * Copyright 2009 www.scribble.org
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.scribble.model;
-
-/**
- * This is the generic object from which all Scribble model objects
- * are derived.
- */
-public abstract class ModelObject {
-
- /**
- * The start line in the document at which the issue has been detected.
- */
- public static final String START_LINE = "start.line";
-
- /**
- * The start column in the document at which the issue has been detected.
- */
- public static final String START_COLUMN = "start.column";
-
- /**
- * The end line in the document at which the issue has been detected.
- */
- public static final String END_LINE = "end.line";
-
- /**
- * The end column in the document at which the issue has been detected.
- */
- public static final String END_COLUMN = "end.column";
-
- /**
- * The start position in the document at which the issue has been detected.
- */
- public static final String START_POSITION = "position.start";
-
- /**
- * The end position in the document at which the issue has been detected.
- */
- public static final String END_POSITION = "position.end";
-
- /**
- * The optional resource URL associated with the issue.
- */
- public static final String RESOURCE_URL = "resource.url";
-
- private ModelObject _parent=null;
- private java.util.Map _properties=
- new java.util.HashMap();
-
- /**
- * This is the default constructor for the model object.
- */
- public ModelObject() {
- }
-
- /**
- * This is the copy constructor.
- *
- * @param obj The object to copy
- */
- public ModelObject(ModelObject obj) {
- _properties.putAll(obj.getProperties());
- }
-
- /**
- * This method returns the parent of this
- * model object.
- *
- * @return The parent, or null if top model
- * object
- */
- public ModelObject getParent() {
- return (_parent);
- }
-
- /**
- * This method returns the parent with the specified type.
- *
- * @param type The class of the required parent
- * @return The appropriate parent, or null if not found
- */
- public T getParent(Class type) {
- if (type.isAssignableFrom(getClass())) {
- return (type.cast(this));
- } else if (_parent != null) {
- return (_parent.getParent(type));
- }
- return (null);
- }
-
- /**
- * This method sets the parent model object.
- *
- * @param parent The parent
- */
- public void setParent(ModelObject parent) {
- _parent = parent;
- }
-
- /**
- * This method establishes the necessary information to
- * indicate that the current model object is derived
- * from the supplied source model object.
- *
- * @param modelObj The source model object
- */
- public void derivedFrom(ModelObject modelObj) {
- if (modelObj != null) {
- _properties = new java.util.HashMap(modelObj.getProperties());
- }
- }
-
- /**
- * This method returns the properties associated
- * with this model object.
- *
- * @return The properties
- */
- public java.util.Map getProperties() {
- return (_properties);
- }
-
- /**
- * This method returns the protocol model in which this
- * object is contained.
- *
- * @return The protocol model, or null if not found
- */
- public Module getModule() {
- Module ret=null;
- ModelObject cur=this;
-
- while (ret == null && cur != null) {
-
- if (cur instanceof Module) {
- ret = (Module) cur;
- } else {
- cur = cur.getParent();
- }
- }
-
- return (ret);
- }
-
- /**
- * This method visits the model object using the supplied
- * visitor.
- *
- * @param visitor The visitor
- */
- public abstract void visit(Visitor visitor);
-
- /**
- * This method generates a text representation of the protocol component.
- *
- * @param buf The text buffer
- * @param level The indentation level, if relevant
- */
- public abstract void toText(StringBuffer buf, int level);
-
- /**
- * This method indents the text.
- *
- * @param buf The buffer
- * @param level The indentation level
- */
- protected static void indent(StringBuffer buf, int level) {
- for (int i=0; i < level; i++) {
- buf.append('\t');
- }
- }
-}
diff --git a/modules/core/src/main/java/org/scribble/model/ModelProperties.java b/modules/core/src/main/java/org/scribble/model/ModelProperties.java
deleted file mode 100644
index 266c0c6b2..000000000
--- a/modules/core/src/main/java/org/scribble/model/ModelProperties.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright 2009 www.scribble.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.scribble.model;
-
-/**
- * This interface provides the definitions for the properties
- * associated with objects in the model.
- */
-public interface ModelProperties {
-
- /**
- * This construct defines the start location in a textual description of
- * a scribble construct.
- */
- public static final String START_LOCATION="scribble.start.location";
-
- /**
- * This construct defines the end location in a textual description of
- * a scribble construct.
- */
- public static final String END_LOCATION="scribble.end.location";
-
- /**
- * This construct defines the URI for locating the source component.
- */
- public static final String URI="scribble.uri";
-
-}
diff --git a/modules/core/src/main/java/org/scribble/model/Module.java b/modules/core/src/main/java/org/scribble/model/Module.java
deleted file mode 100644
index 26c4652a1..000000000
--- a/modules/core/src/main/java/org/scribble/model/Module.java
+++ /dev/null
@@ -1,225 +0,0 @@
-/*
- * Copyright 2009 www.scribble.org
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.scribble.model;
-
-/**
- * This class represents the base class for models associated with
- * specific notations. The details associated with the notation are
- * contained within derived classes.
- *
- */
-public class Module extends ModelObject {
-
- private String _name=null;
- private java.util.List _imports=
- new ContainmentList(this, ImportDecl.class);
- private java.util.List _payloadTypes=
- new ContainmentList(this, PayloadTypeDecl.class);
- private java.util.List _protocols=
- new ContainmentList(this, ProtocolDecl.class);
-
- /**
- * The default constructor for the model.
- */
- public Module() {
- }
-
- /**
- * This method returns the fully qualified name.
- *
- * @return The fully qualified name
- */
- public String getName() {
- return (_name);
- }
-
- /**
- * This method sets the fully qualified name.
- *
- * @param fqn The fully qualified name
- */
- public void setName(String fqn) {
- _name = fqn;
- }
-
- /**
- * This method returns the last component of the fully
- * qualified name.
- *
- * @return The local name
- */
- public String getLocalName() {
- String ret=_name;
-
- if (_name != null) {
- int ind=_name.lastIndexOf('.');
- if (ind != -1) {
- ret = _name.substring(ind+1);
- }
- }
-
- return (ret);
- }
-
- /**
- * This method returns the role associated with a local module.
- * If the module is a global module, then null is returned.
- *
- * @return The located role, if the module is local
- */
- public Role getLocatedRole() {
- Role ret=null;
-
- if (_protocols.size() > 0
- && _protocols.get(0) instanceof org.scribble.model.local.LProtocolDecl) {
- ret = ((org.scribble.model.local.LProtocolDecl)_protocols.get(0)).getLocalRole();
- }
-
- return (ret);
- }
-
- /**
- * This method returns the list of import definitions.
- *
- * @return The import definitions
- */
- public java.util.List getImports() {
- return (_imports);
- }
-
- /**
- * This method returns the list of payload types.
- *
- * @return The payload types
- */
- public java.util.List getPayloadTypeDeclarations() {
- return (_payloadTypes);
- }
-
- /**
- * This method returns the payload type associated
- * with the supplied name.
- *
- * @param name The name
- * @return The payload type, or null if not found
- */
- public PayloadTypeDecl getTypeDeclaration(String name) {
- for (PayloadTypeDecl ptd : _payloadTypes) {
- if (ptd.getAlias() != null && ptd.getAlias().equals(name)) {
- return (ptd);
- }
- }
-
- return (null);
- }
-
- /**
- * This method returns the list of protocols.
- *
- * @return The protocols
- */
- public java.util.List getProtocols() {
- return (_protocols);
- }
-
- /**
- * This method returns the protocol associated
- * with the supplied name.
- *
- * @param name The name
- * @return The protocol, or null if not found
- */
- public ProtocolDecl getProtocol(String name) {
- for (ProtocolDecl p : _protocols) {
- if (p.getName().equals(name)) {
- return (p);
- }
- }
-
- return (null);
- }
-
- /**
- * This method visits the model object using the supplied
- * visitor.
- *
- * @param visitor The visitor
- */
- public void visit(Visitor visitor) {
-
- for (ImportDecl imp : getImports()) {
- imp.visit(visitor);
- }
-
- for (PayloadTypeDecl ptd : getPayloadTypeDeclarations()) {
- ptd.visit(visitor);
- }
-
- for (ProtocolDecl protocol : getProtocols()) {
- protocol.visit(visitor);
- }
- }
-
- /**
- * {@inheritDoc}
- */
- public String toString() {
- StringBuffer buf=new StringBuffer();
- toText(buf, 0);
-
- return (buf.toString());
- }
-
- /**
- * {@inheritDoc}
- */
- public void toText(StringBuffer buf, int level) {
- if (_name != null) {
- indent(buf, level);
-
- buf.append("module ");
-
- buf.append(_name);
-
- buf.append(";\n\n");
- }
-
- for (ImportDecl imp : getImports()) {
- imp.toText(buf, level);
- }
-
- if (getImports().size() > 0) {
- buf.append("\n");
- }
-
- for (PayloadTypeDecl ptd : getPayloadTypeDeclarations()) {
- ptd.toText(buf, level);
- }
-
- if (getPayloadTypeDeclarations().size() > 0) {
- buf.append("\n");
- }
-
- for (int i=0; i < getProtocols().size(); i++) {
- ProtocolDecl protocol=getProtocols().get(i);
- if (i > 0) {
- buf.append("\n");
- }
- protocol.toText(buf, level);
- }
- }
-
-}
diff --git a/modules/core/src/main/java/org/scribble/model/Parameter.java b/modules/core/src/main/java/org/scribble/model/Parameter.java
deleted file mode 100644
index 44ddf2afd..000000000
--- a/modules/core/src/main/java/org/scribble/model/Parameter.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Copyright 2009 www.scribble.org
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.scribble.model;
-
-/**
- * This class represents a parameter.
- *
- */
-public class Parameter extends ModelObject {
-
- private String _name=null;
-
- /**
- * This is the default constructor.
- */
- public Parameter() {
- }
-
- /**
- * This is the copy constructor.
- *
- * @param p The parameter
- */
- public Parameter(Parameter p) {
- super(p);
- _name = p.getName();
- }
-
- /**
- * This method sets the name of the role.
- *
- * @param name The name
- */
- public void setName(String name) {
- _name = name;
- }
-
- /**
- * This method returns the name of the role.
- *
- * @return The name
- */
- public String getName() {
- return (_name);
- }
-
- @Override
- public boolean equals(Object obj) {
- boolean ret=false;
-
- if (obj instanceof Parameter) {
- Parameter other=(Parameter)obj;
-
- if (other.getName() != null && other.getName().equals(_name)) {
- ret = true;
- }
- }
-
- return (ret);
- }
-
- @Override
- public int hashCode() {
- int ret=super.hashCode();
-
- if (_name != null) {
- ret = _name.hashCode();
- }
-
- return (ret);
- }
-
- @Override
- public String toString() {
- String ret=getName();
-
- if (ret == null) {
- ret = "";
- }
-
- return (ret);
- }
-
- /**
- * This method visits the model object using the supplied
- * visitor.
- *
- * @param visitor The visitor
- */
- public void visit(Visitor visitor) {
- }
-
- /**
- * {@inheritDoc}
- */
- public void toText(StringBuffer buf, int level) {
-
- if (_name != null) {
- buf.append("sig ");
- buf.append(_name);
- }
- }
-}
diff --git a/modules/core/src/main/java/org/scribble/model/ParameterDecl.java b/modules/core/src/main/java/org/scribble/model/ParameterDecl.java
deleted file mode 100644
index 919605363..000000000
--- a/modules/core/src/main/java/org/scribble/model/ParameterDecl.java
+++ /dev/null
@@ -1,189 +0,0 @@
-/*
- * Copyright 2009 www.scribble.org
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.scribble.model;
-
-/**
- * This class represents a parameter declaration.
- *
- */
-public class ParameterDecl extends ModelObject {
-
- private String _name=null;
- private String _alias=null;
- private ParameterType _parameterType=null;
-
- /**
- * This is the default constructor.
- */
- public ParameterDecl() {
- }
-
- /**
- * This is the copy constructor.
- *
- * @param pd The role
- */
- public ParameterDecl(ParameterDecl pd) {
- super(pd);
- _name = pd.getName();
- _alias = pd.getAlias();
- _parameterType = pd.getType();
- }
-
- /**
- * This method returns the name of the parameter declaration.
- *
- * @return The name
- */
- public String getName() {
- return (_name);
- }
-
- /**
- * This method sets the name of the parameter declaration.
- *
- * @param name The name
- */
- public void setName(String name) {
- _name = name;
- }
-
- /**
- * This method returns the alias of the parameter declaration.
- *
- * @return The alias
- */
- public String getAlias() {
- return (_alias);
- }
-
- /**
- * This method sets the alias of the parameter declaration.
- *
- * @param alias The alias
- */
- public void setAlias(String alias) {
- _alias = alias;
- }
-
- /**
- * This method returns the type of the parameter declaration.
- *
- * @return The type
- */
- public ParameterType getType() {
- return (_parameterType);
- }
-
- /**
- * This method sets the type of the parameter declaration.
- *
- * @param type The type
- */
- public void setType(ParameterType type) {
- _parameterType = type;
- }
-
- /**
- * This method returns the declaration name for the parameter
- * declaration.
- *
- * @return The declaration name
- */
- public String getDeclarationName() {
- String ret=_alias;
-
- if (ret == null) {
- ret = _name;
- }
-
- return (ret);
- }
-
- @Override
- public boolean equals(Object obj) {
- boolean ret=false;
-
- if (obj instanceof ParameterDecl) {
- ParameterDecl other=(ParameterDecl)obj;
-
- if (other.getName() != null && other.getName().equals(_name)) {
- ret = true;
- }
- }
-
- return (ret);
- }
-
- @Override
- public int hashCode() {
- int ret=super.hashCode();
-
- if (_name != null) {
- ret = _name.hashCode();
- }
-
- return (ret);
- }
-
- @Override
- public String toString() {
- String ret=getName();
-
- if (ret == null) {
- ret = "";
- }
-
- return (ret);
- }
-
- /**
- * This method visits the model object using the supplied
- * visitor.
- *
- * @param visitor The visitor
- */
- public void visit(Visitor visitor) {
- }
-
- /**
- * {@inheritDoc}
- */
- public void toText(StringBuffer buf, int level) {
- buf.append(getType().name().toLowerCase());
- buf.append(" ");
-
- if (_name != null) {
- buf.append(_name);
- }
-
- if (_alias != null) {
- buf.append(" as "+_alias);
- }
- }
-
- /**
- * Parameter declaration type.
- *
- */
- public enum ParameterType {
- // Type
- Type,
-
- //Signature
- Sig
- }
-}
diff --git a/modules/core/src/main/java/org/scribble/model/PayloadElement.java b/modules/core/src/main/java/org/scribble/model/PayloadElement.java
deleted file mode 100644
index dbc06d4f1..000000000
--- a/modules/core/src/main/java/org/scribble/model/PayloadElement.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Copyright 2009 www.scribble.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.scribble.model;
-
-/**
- * This class represents a payload element associated with a model.
- *
- */
-public class PayloadElement extends ModelObject {
-
- private String _annotation=null;
- private String _name=null;
-
- /**
- * The default constructor.
- */
- public PayloadElement() {
- }
-
- /**
- * The copy constructor.
- *
- * @param copy The copy
- */
- public PayloadElement(PayloadElement copy) {
- _annotation = copy.getAnnotation();
- _name = copy.getName();
- }
-
- /**
- * This method returns the optional annotation.
- *
- * @return The optional annotation
- */
- public String getAnnotation() {
- return (_annotation);
- }
-
- /**
- * This method sets the optional annotation.
- *
- * @param annotation The annotation
- */
- public void setAnnotation(String annotation) {
- _annotation = annotation;
- }
-
- /**
- * This method returns the payload type or
- * parameter name.
- *
- * @return The name
- */
- public String getName() {
- return (_name);
- }
-
- /**
- * This method sets the payload type or
- * parameter name.
- *
- * @param name The name
- */
- public void setName(String name) {
- _name = name;
- }
-
- @Override
- public String toString() {
- String ret=getName();
-
- if (ret == null) {
- ret = "";
- }
-
- if (_annotation != null) {
- ret = _annotation+":"+ret;
- }
-
- return (ret);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void visit(Visitor visitor) {
-
- }
-
- /**
- * {@inheritDoc}
- */
- public void toText(StringBuffer buf, int level) {
- if (_annotation != null) {
- buf.append(_annotation);
- buf.append(':');
- }
- buf.append(_name);
- }
-}
diff --git a/modules/core/src/main/java/org/scribble/model/PayloadTypeDecl.java b/modules/core/src/main/java/org/scribble/model/PayloadTypeDecl.java
deleted file mode 100644
index 3c40a8394..000000000
--- a/modules/core/src/main/java/org/scribble/model/PayloadTypeDecl.java
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
- * Copyright 2009 www.scribble.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.scribble.model;
-
-/**
- * This class represents an imported type associated with a model.
- *
- */
-public class PayloadTypeDecl extends ModelObject {
-
- private String _format=null;
- private String _type=null;
- private String _schema=null;
- private String _alias=null;
-
- /**
- * The default constructor.
- */
- public PayloadTypeDecl() {
- }
-
- /**
- * The copy constructor.
- *
- * @param copy The copy
- */
- public PayloadTypeDecl(PayloadTypeDecl copy) {
- super(copy);
- _format = copy.getFormat();
- _type = copy.getType();
- _schema = copy.getSchema();
- _alias = copy.getAlias();
- }
-
- /**
- * This method returns the schema format.
- *
- * @return The name
- */
- public String getFormat() {
- return (_format);
- }
-
- /**
- * This method sets the schema format.
- *
- * @param format The format
- */
- public void setFormat(String format) {
- _format = format;
- }
-
- /**
- * This method returns the schema format.
- *
- * @return The name
- */
- public String getType() {
- return (_type);
- }
-
- /**
- * This method sets the type.
- *
- * @param type The type
- */
- public void setType(String type) {
- _type = type;
- }
-
- /**
- * This method returns the schema.
- *
- * @return The schema
- */
- public String getSchema() {
- return (_schema);
- }
-
- /**
- * This method sets the schema.
- *
- * @param schema The schema
- */
- public void setSchema(String schema) {
- _schema = schema;
- }
-
- /**
- * This method returns the alias.
- *
- * @return The optional alias
- */
- public String getAlias() {
- return (_alias);
- }
-
- /**
- * This method sets the alias.
- *
- * @param alias The alias
- */
- public void setAlias(String alias) {
- _alias = alias;
- }
-
- /**
- * This method visits the model object using the supplied
- * visitor.
- *
- * @param visitor The visitor
- */
- public void visit(Visitor visitor) {
- visitor.accept(this);
- }
-
- @Override
- public String toString() {
- String ret=getType();
-
- if (ret == null) {
- ret = "";
- }
-
- return (ret);
- }
-
- /**
- * {@inheritDoc}
- */
- public void toText(StringBuffer buf, int level) {
- indent(buf, level);
-
- buf.append("type ");
-
- if (_format != null) {
- buf.append('<');
- buf.append(_format);
- buf.append("> ");
- }
-
- if (_type != null) {
- buf.append("\"");
- buf.append(_type);
- buf.append("\"");
- }
-
- if (_schema != null) {
- buf.append(" from ");
- buf.append("\"");
- buf.append(_schema);
- buf.append("\"");
- }
-
- if (_alias != null) {
- buf.append(" as ");
- buf.append(_alias);
- }
-
- buf.append(";\n");
- }
-}
diff --git a/modules/core/src/main/java/org/scribble/model/ProtocolDecl.java b/modules/core/src/main/java/org/scribble/model/ProtocolDecl.java
deleted file mode 100644
index 35381f233..000000000
--- a/modules/core/src/main/java/org/scribble/model/ProtocolDecl.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * Copyright 2009 www.scribble.org
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.scribble.model;
-
-/**
- * This class represents the protocol notation.
- */
-public abstract class ProtocolDecl extends ModelObject {
-
- private String _name=null;
- private java.util.List _roleDecls=new java.util.ArrayList();
- private java.util.List _parameterDecls=new java.util.ArrayList();
-
- /**
- * The default constructor.
- */
- public ProtocolDecl() {
- }
-
- /**
- * This method returns the name.
- *
- * @return The name
- */
- public String getName() {
- return (_name);
- }
-
- /**
- * This method sets the name.
- *
- * @param name The name
- */
- public void setName(String name) {
- _name = name;
- }
-
- /**
- * This method returns the role declarations associated with
- * the protocol.
- *
- * @return The role declarations
- */
- public java.util.List getRoleDeclarations() {
- return (_roleDecls);
- }
-
- /**
- * This method returns the role declaration associated
- * with the supplied name.
- *
- * @param name The name
- * @return The role declaration, or null if not found
- */
- public RoleDecl getRoleDeclaration(String name) {
- RoleDecl ret=null;
-
- for (RoleDecl rd : _roleDecls) {
- if (rd.getDeclarationName().equals(name)) {
- ret = rd;
- break;
- }
- }
-
- return (ret);
- }
-
- /**
- * This method returns the parameter declarations associated with
- * the protocol.
- *
- * @return The parameter declarations
- */
- public java.util.List getParameterDeclarations() {
- return (_parameterDecls);
- }
-
- /**
- * This method returns the parameter declaration associated
- * with the supplied name.
- *
- * @param name The name
- * @return The parameter declaration, or null if not found
- */
- public ParameterDecl getParameterDeclaration(String name) {
- ParameterDecl ret=null;
-
- for (ParameterDecl pd : _parameterDecls) {
- if (pd.getName().equals(name) || (pd.getAlias() != null && pd.getAlias().equals(name))) {
- ret = pd;
- break;
- }
- }
-
- return (ret);
- }
-
- /**
- * This method returns the model in which this definition
- * is contained.
- *
- * @return The model, or null if not contained within
- * a model
- */
- public Module getModule() {
- Module ret=null;
- ModelObject cur=this;
-
- while (ret == null && cur != null) {
- if (cur instanceof Module) {
- ret = (Module) cur;
- } else {
- cur = cur.getParent();
- }
- }
-
- return (ret);
- }
-
-}
diff --git a/modules/core/src/main/java/org/scribble/model/Role.java b/modules/core/src/main/java/org/scribble/model/Role.java
deleted file mode 100644
index dd593f343..000000000
--- a/modules/core/src/main/java/org/scribble/model/Role.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * Copyright 2009 www.scribble.org
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.scribble.model;
-
-/**
- * This class represents a role.
- *
- */
-public class Role extends ModelObject {
-
- private String _name=null;
-
- /**
- * This is the default constructor.
- */
- public Role() {
- }
-
- /**
- * This is the copy constructor.
- *
- * @param role The role
- */
- public Role(Role role) {
- super(role);
- _name = role.getName();
- }
-
- /**
- * This is the copy constructor.
- *
- * @param rd The role declaration
- */
- public Role(RoleDecl rd) {
- super(rd);
- _name = rd.getAlias();
-
- if (_name == null || _name.trim().length() == 0) {
- _name = rd.getName();
- }
- }
-
- /**
- * This constructor initializes the role with a name.
- *
- * @param roleName The role name
- */
- public Role(String roleName) {
- _name = roleName;
- }
-
- /**
- * This method returns the name of the role.
- *
- * @return The name
- */
- public String getName() {
- return (_name);
- }
-
- /**
- * This method sets the name of the role.
- *
- * @param name The name
- */
- public void setName(String name) {
- _name = name;
- }
-
- @Override
- public boolean equals(Object obj) {
- boolean ret=false;
-
- if (obj instanceof Role) {
- Role other=(Role)obj;
-
- if (other.getName() != null && other.getName().equals(_name)) {
- ret = true;
- }
- }
-
- return (ret);
- }
-
- @Override
- public int hashCode() {
- int ret=super.hashCode();
-
- if (_name != null) {
- ret = _name.hashCode();
- }
-
- return (ret);
- }
-
- @Override
- public String toString() {
- String ret=getName();
-
- if (ret == null) {
- ret = "";
- }
-
- return (ret);
- }
-
- /**
- * This method visits the model object using the supplied
- * visitor.
- *
- * @param visitor The visitor
- */
- public void visit(Visitor visitor) {
- }
-
- /**
- * {@inheritDoc}
- */
- public void toText(StringBuffer buf, int level) {
- if (_name != null) {
- buf.append(_name);
- }
- }
-
-}
diff --git a/modules/core/src/main/java/org/scribble/model/RoleDecl.java b/modules/core/src/main/java/org/scribble/model/RoleDecl.java
deleted file mode 100644
index 451889627..000000000
--- a/modules/core/src/main/java/org/scribble/model/RoleDecl.java
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
- * Copyright 2009 www.scribble.org
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.scribble.model;
-
-/**
- * This class represents a role.
- *
- */
-public class RoleDecl extends ModelObject {
-
- private String _name=null;
- private String _alias=null;
-
- /**
- * This is the default constructor.
- */
- public RoleDecl() {
- }
-
- /**
- * This is the copy constructor.
- *
- * @param role The role
- */
- public RoleDecl(RoleDecl role) {
- super(role);
- _name = role.getName();
- _alias = role.getAlias();
- }
-
- /**
- * This constructor initializes the role with a name.
- *
- * @param roleName The role name
- */
- public RoleDecl(String roleName) {
- _name = roleName;
- }
-
- /**
- * This method returns the name of the role.
- *
- * @return The name
- */
- public String getName() {
- return (_name);
- }
-
- /**
- * This method sets the name of the role.
- *
- * @param name The name
- */
- public void setName(String name) {
- _name = name;
- }
-
- /**
- * This method returns the alias of the role.
- *
- * @return The alias
- */
- public String getAlias() {
- return (_alias);
- }
-
- /**
- * This method sets the alias of the role.
- *
- * @param alias The alias
- */
- public void setAlias(String alias) {
- _alias = alias;
- }
-
- /**
- * Determines whether the role declaration is associated with the
- * supplied role.
- *
- * @param role The role
- * @return Whether the role is equivalent to the declaration
- */
- public boolean isRole(Role role) {
- return ((_name != null && _name.equals(role.getName())) ||
- (_alias != null && _alias.equals(role.getName())));
- }
-
- /**
- * This method returns the declaration name for the role
- * declaration.
- *
- * @return The declaration name
- */
- public String getDeclarationName() {
- String ret=_alias;
-
- if (ret == null) {
- ret = _name;
- }
-
- return (ret);
- }
-
- @Override
- public boolean equals(Object obj) {
- boolean ret=false;
-
- if (obj instanceof RoleDecl) {
- RoleDecl other=(RoleDecl)obj;
-
- if (other.getName() != null && other.getName().equals(_name)) {
- ret = true;
- }
- }
-
- return (ret);
- }
-
- @Override
- public int hashCode() {
- int ret=super.hashCode();
-
- if (_name != null) {
- ret = _name.hashCode();
- }
-
- return (ret);
- }
-
- @Override
- public String toString() {
- String ret=getName();
-
- if (ret == null) {
- ret = "";
- }
-
- return (ret);
- }
-
- /**
- * This method visits the model object using the supplied
- * visitor.
- *
- * @param visitor The visitor
- */
- public void visit(Visitor visitor) {
- }
-
- /**
- * {@inheritDoc}
- */
- public void toText(StringBuffer buf, int level) {
- if (_name != null) {
- buf.append(_name);
- }
-
- if (_alias != null) {
- buf.append(" as "+_alias);
- }
- }
-
-}
diff --git a/modules/core/src/main/java/org/scribble/model/RoleInstantiation.java b/modules/core/src/main/java/org/scribble/model/RoleInstantiation.java
deleted file mode 100644
index 34e7021ad..000000000
--- a/modules/core/src/main/java/org/scribble/model/RoleInstantiation.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * Copyright 2009 www.scribble.org
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.scribble.model;
-
-/**
- * This class represents a role instantiation.
- *
- */
-public class RoleInstantiation extends ModelObject {
-
- private String _name=null;
- private String _alias=null;
-
- /**
- * This is the default constructor.
- */
- public RoleInstantiation() {
- }
-
- /**
- * This is the copy constructor.
- *
- * @param role The role
- */
- public RoleInstantiation(RoleInstantiation role) {
- super(role);
- _name = role.getName();
- _alias = role.getAlias();
- }
-
- /**
- * This method returns the name of the role.
- *
- * @return The name
- */
- public String getName() {
- return (_name);
- }
-
- /**
- * This method sets the name of the role.
- *
- * @param name The name
- */
- public void setName(String name) {
- _name = name;
- }
-
- /**
- * This method returns the alias of the role.
- *
- * @return The alias
- */
- public String getAlias() {
- return (_alias);
- }
-
- /**
- * This method sets the alias of the role.
- *
- * @param alias The alias
- */
- public void setAlias(String alias) {
- _alias = alias;
- }
-
- @Override
- public boolean equals(Object obj) {
- boolean ret=false;
-
- if (obj instanceof RoleInstantiation) {
- RoleInstantiation other=(RoleInstantiation)obj;
-
- if (other.getName() != null && other.getName().equals(_name)) {
- ret = true;
- }
- }
-
- return (ret);
- }
-
- @Override
- public int hashCode() {
- int ret=super.hashCode();
-
- if (_name != null) {
- ret = _name.hashCode();
- }
-
- return (ret);
- }
-
- @Override
- public String toString() {
- String ret=getName();
-
- if (ret == null) {
- ret = "";
- }
-
- return (ret);
- }
-
- /**
- * This method visits the model object using the supplied
- * visitor.
- *
- * @param visitor The visitor
- */
- public void visit(Visitor visitor) {
- }
-
- /**
- * {@inheritDoc}
- */
- public void toText(StringBuffer buf, int level) {
- if (_name != null) {
- buf.append(_name);
- }
-
- if (_alias != null) {
- buf.append(" as "+_alias);
- }
- }
-}
diff --git a/modules/core/src/main/java/org/scribble/model/Visitor.java b/modules/core/src/main/java/org/scribble/model/Visitor.java
deleted file mode 100644
index 072d0b78f..000000000
--- a/modules/core/src/main/java/org/scribble/model/Visitor.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright 2009 www.scribble.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.scribble.model;
-
-/**
- * This interface represents a visitor which can be used
- * to traverse a model.
- */
-public interface Visitor {
-
- /**
- * This method visits a type import component.
- *
- * @param elem The type import
- */
- public void accept(PayloadTypeDecl elem);
-
- /**
- * This method visits a protocol import component.
- *
- * @param elem The protocol import
- */
- public void accept(ImportDecl elem);
-
-}
diff --git a/modules/core/src/main/java/org/scribble/model/global/DefaultGVisitor.java b/modules/core/src/main/java/org/scribble/model/global/DefaultGVisitor.java
deleted file mode 100644
index 7e985514f..000000000
--- a/modules/core/src/main/java/org/scribble/model/global/DefaultGVisitor.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
- * Copyright 2009 www.scribble.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.scribble.model.global;
-
-import org.scribble.model.ImportDecl;
-import org.scribble.model.PayloadTypeDecl;
-import org.scribble.model.global.GChoice;
-
-/**
- * This class represents the default visitor which can be used
- * to traverse a model.
- */
-public class DefaultGVisitor implements GVisitor {
-
- /**
- * {@inheritDoc}
- */
- public boolean start(GBlock elem) {
- return (true);
- }
-
- /**
- * {@inheritDoc}
- */
- public void end(GBlock elem) {
- }
-
- /**
- * {@inheritDoc}
- */
- public boolean start(GChoice elem) {
- return (true);
- }
-
- /**
- * {@inheritDoc}
- */
- public void end(GChoice elem) {
- }
-
- /**
- * {@inheritDoc}
- */
- public boolean start(GParallel elem) {
- return (true);
- }
-
- /**
- * {@inheritDoc}
- */
- public void end(GParallel elem) {
- }
-
- /**
- * {@inheritDoc}
- */
- public boolean start(GProtocolDefinition elem) {
- return (true);
- }
-
- /**
- * {@inheritDoc}
- */
- public void end(GProtocolDefinition elem) {
- }
-
- /**
- * {@inheritDoc}
- */
- public boolean start(GRecursion elem) {
- return (true);
- }
-
- /**
- * {@inheritDoc}
- */
- public void end(GRecursion elem) {
- }
-
- /**
- * {@inheritDoc}
- */
- public boolean start(GInterruptible elem) {
- return (true);
- }
-
- /**
- * {@inheritDoc}
- */
- public void end(GInterruptible elem) {
- }
-
- /**
- * {@inheritDoc}
- */
- public void accept(GProtocolInstance elem) {
- }
-
- /**
- * {@inheritDoc}
- */
- public void accept(GMessageTransfer elem) {
- }
-
- /**
- * {@inheritDoc}
- */
- public void accept(GContinue elem) {
- }
-
- /**
- * {@inheritDoc}
- */
- public void accept(GDo elem) {
- }
-
- /**
- * {@inheritDoc}
- */
- public void accept(GCustomActivity elem) {
- }
-
- /**
- * {@inheritDoc}
- */
- public void accept(PayloadTypeDecl elem) {
- }
-
- /**
- * {@inheritDoc}
- */
- public void accept(ImportDecl elem) {
- }
-
-}
diff --git a/modules/core/src/main/java/org/scribble/model/global/GActivity.java b/modules/core/src/main/java/org/scribble/model/global/GActivity.java
deleted file mode 100644
index 6fa0ae7e2..000000000
--- a/modules/core/src/main/java/org/scribble/model/global/GActivity.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright 2009 www.scribble.org
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.scribble.model.global;
-
-import org.scribble.model.ModelObject;
-import org.scribble.model.Role;
-import org.scribble.model.RoleDecl;
-import org.scribble.model.Visitor;
-
-/**
- * This class represents the base class for all Scribble definition
- * context.
- */
-public abstract class GActivity extends ModelObject {
-
- /**
- * The default constructor.
- */
- public GActivity() {
- }
-
- /**
- * The copy constructor.
- *
- * @param act The activity
- */
- public GActivity(GActivity act) {
- super(act);
- }
-
- /**
- * This method determines whether the supplied role is 'involved'
- * in this global activity.
- *
- * @param r The role
- * @return Whether the role is involved
- */
- public abstract boolean isRoleInvolved(RoleDecl role);
-
- /**
- * This method builds up the set of roles involved in the global
- * activity.
- *
- * @param roles The set of involved roles
- */
- public abstract void identifyInvolvedRoles(java.util.Set roles);
-
- /**
- * {@inheritDoc}
- */
- public void visit(Visitor visitor) {
- if (visitor instanceof GVisitor) {
- visit((GVisitor)visitor);
- }
- }
-
- /**
- * This method visits the model object using the supplied
- * visitor.
- *
- * @param visitor The visitor
- */
- public abstract void visit(GVisitor visitor);
-
-}
diff --git a/modules/core/src/main/java/org/scribble/model/global/GBlock.java b/modules/core/src/main/java/org/scribble/model/global/GBlock.java
deleted file mode 100644
index 4cf60a2ad..000000000
--- a/modules/core/src/main/java/org/scribble/model/global/GBlock.java
+++ /dev/null
@@ -1,175 +0,0 @@
-/*
- * Copyright 2009 www.scribble.org
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.scribble.model.global;
-
-import org.scribble.model.ContainmentList;
-import org.scribble.model.Role;
-import org.scribble.model.RoleDecl;
-
-/**
- * This class represents a group of activities.
- *
- */
-public class GBlock extends GActivity {
-
- private java.util.List _contents=
- new ContainmentList(this, GActivity.class);
-
- /**
- * {@inheritDoc}
- */
- public boolean isRoleInvolved(RoleDecl role) {
- boolean ret=false;
-
- for (int i=0; !ret && i < _contents.size(); i++) {
- ret = _contents.get(i).isRoleInvolved(role);
- }
-
- return (ret);
- }
-
- /**
- * {@inheritDoc}
- */
- public void identifyInvolvedRoles(java.util.Set roles) {
- for (GActivity act : _contents) {
- act.identifyInvolvedRoles(roles);
- }
- }
-
- /**
- * This method returns the contents associated with
- * the block.
- *
- * @return The contents
- */
- public java.util.List getContents() {
- return (_contents);
- }
-
- /**
- * This method adds an activity to the block.
- *
- * @param act The activity
- * @return Whether the activity has been added
- */
- public boolean add(GActivity act) {
- return (_contents.add(act));
- }
-
- /**
- * This method removes an activity from the block.
- *
- * @param act The activity
- * @return Whether the activity has been removed
- */
- public boolean remove(GActivity act) {
- return (_contents.remove(act));
- }
-
- /**
- * This method returns the number of activities
- * in the block.
- *
- * @return The number of activities
- */
- public int size() {
- return (_contents.size());
- }
-
- /**
- * This method returns the activity at the specified
- * index.
- *
- * @param index The index The index
- * @return The activity The activity
- * @throws IndexOutOfBoundsException Out of bounds
- */
- public GActivity get(int index) throws IndexOutOfBoundsException {
- return (_contents.get(index));
- }
-
- /**
- * This method returns the index of the supplied activity.
- *
- * @param act The activity
- * @return The index, or -1 if the activity is not found
- */
- public int indexOf(GActivity act) {
- return (_contents.indexOf(act));
- }
-
- /**
- * This method visits the model object using the supplied
- * visitor.
- *
- * @param visitor The visitor
- */
- public void visit(GVisitor visitor) {
-
- if (((GVisitor)visitor).start(this)) {
-
- for (int i=0; i < getContents().size(); i++) {
- getContents().get(i).visit(visitor);
- }
- }
-
- visitor.end(this);
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
-
- GBlock that = (GBlock) o;
-
- return _contents.equals(that._contents);
- }
-
- @Override
- public int hashCode() {
- return _contents.hashCode();
- }
-
- @Override
- public String toString() {
- String result = "{\n";
- for (GActivity act : _contents) {
- result += act + "\n";
- }
- return result + "}";
- }
-
- /**
- * {@inheritDoc}
- */
- public void toText(StringBuffer buf, int level) {
-
- buf.append("{\n");
-
- for (GActivity act : _contents) {
- act.toText(buf, level+1);
- }
-
- indent(buf, level);
- buf.append("}");
- }
-}
diff --git a/modules/core/src/main/java/org/scribble/model/global/GChoice.java b/modules/core/src/main/java/org/scribble/model/global/GChoice.java
deleted file mode 100644
index 5f106fab5..000000000
--- a/modules/core/src/main/java/org/scribble/model/global/GChoice.java
+++ /dev/null
@@ -1,177 +0,0 @@
-/*
- * Copyright 2009 www.scribble.org
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.scribble.model.global;
-
-import org.scribble.model.ContainmentList;
-import org.scribble.model.Role;
-import org.scribble.model.RoleDecl;
-
-/**
- * This class represents the Choice construct between
- * two or more paths.
- *
- */
-public class GChoice extends GMultiPathActivity {
-
- private Role _role=null;
- private java.util.List _blocks=new ContainmentList(this, GBlock.class);
-
- /**
- * This is the default constructor.
- *
- */
- public GChoice() {
- }
-
- /**
- * {@inheritDoc}
- */
- public boolean isRoleInvolved(RoleDecl role) {
- boolean ret=false;
-
- if (_role != null) {
- ret = role.isRole(_role);
- }
-
- for (int i=0; !ret && i < _blocks.size(); i++) {
- ret = _blocks.get(i).isRoleInvolved(role);
- }
-
- return (ret);
- }
-
- /**
- * {@inheritDoc}
- */
- public void identifyInvolvedRoles(java.util.Set roles) {
-
- if (_role != null) {
- roles.add(_role);
- }
-
- for (GBlock b : _blocks) {
- b.identifyInvolvedRoles(roles);
- }
- }
-
- /**
- * This method returns the role.
- *
- * @return The role
- */
- public Role getRole() {
- return (_role);
- }
-
- /**
- * This method sets the role.
- *
- * @param role The role
- */
- public void setRole(Role role) {
- _role = role;
- }
-
- /**
- * This method returns the list of mutually exclusive
- * activity blocks that comprise the multi-path construct.
- *
- * @return The list of choice paths
- */
- public java.util.List getPaths() {
- return (_blocks);
- }
-
- /**
- * This method visits the model object using the supplied
- * visitor.
- *
- * @param visitor The visitor
- */
- public void visit(GVisitor visitor) {
- if (visitor.start(this)) {
-
- for (GBlock b : getPaths()) {
- b.visit(visitor);
- }
- }
-
- visitor.end(this);
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
-
- GChoice that = (GChoice) o;
-
- return !(_role != null
- ? !_role.equals(that._role)
- : that._role != null)
- && _blocks.equals(that._blocks);
- }
-
- @Override
- public int hashCode() {
- int result = _blocks.hashCode();
- result = 31 * result + (_role != null ? _role.hashCode() : 0);
- return result;
- }
-
- @Override
- public String toString() {
- String result = "choice ";
- if (_role != null) {
- result += "at " + _role+" ";
- }
- for (GBlock b : _blocks) {
- if (_blocks.indexOf(b) > 0) {
- result += "or ";
- }
- result += b + "\n";
- }
- return result;
- }
-
- /**
- * {@inheritDoc}
- */
- public void toText(StringBuffer buf, int level) {
-
- indent(buf, level);
-
- buf.append("choice at ");
-
- if (_role != null) {
- buf.append(_role);
- buf.append(" ");
- }
-
- for (int i=0; i < getPaths().size(); i++) {
- if (i > 0) {
- buf.append(" or ");
- }
- getPaths().get(i).toText(buf, level);
- }
-
- buf.append("\n");
- }
-}
diff --git a/modules/core/src/main/java/org/scribble/model/global/GContinue.java b/modules/core/src/main/java/org/scribble/model/global/GContinue.java
deleted file mode 100644
index bda2ac6cf..000000000
--- a/modules/core/src/main/java/org/scribble/model/global/GContinue.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * Copyright 2009 www.scribble.org
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.scribble.model.global;
-
-import org.scribble.model.Role;
-import org.scribble.model.RoleDecl;
-
-/**
- * This class represents the Raise construct.
- *
- */
-public class GContinue extends GActivity {
-
- private String _label=null;
-
- /**
- * This is the default constructor.
- *
- */
- public GContinue() {
- }
-
- /**
- * This is the copy constructor.
- *
- * @param copy The recursion to copy
- */
- public GContinue(GContinue copy) {
- super(copy);
- _label = copy.getLabel();
- }
-
- /**
- * {@inheritDoc}
- */
- public boolean isRoleInvolved(RoleDecl role) {
- return (false);
- }
-
- /**
- * {@inheritDoc}
- */
- public void identifyInvolvedRoles(java.util.Set roles) {
- }
-
- /**
- * This method returns the label associated with the recursion construct.
- *
- * @return The label
- */
- public String getLabel() {
- return (_label);
- }
-
- /**
- * This method sets the label associated with the recursion construct.
- *
- * @param label The label
- */
- public void setLabel(String label) {
- _label = label;
- }
-
- /**
- * This method visits the model object using the supplied
- * visitor.
- *
- * @param visitor The visitor
- */
- public void visit(GVisitor visitor) {
- visitor.accept(this);
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
-
- GContinue that = (GContinue) o;
-
- return !(_label != null
- ? !_label.equals(that._label)
- : that._label != null);
- }
-
- @Override
- public int hashCode() {
- return _label != null ? _label.hashCode() : 0;
- }
-
- @Override
- public String toString() {
- return "continue " + _label;
- }
-
- /**
- * {@inheritDoc}
- */
- public void toText(StringBuffer buf, int level) {
-
- indent(buf, level);
-
- buf.append("continue ");
-
- if (_label != null) {
- buf.append(_label);
- }
-
- buf.append(";\n");
- }
-}
diff --git a/modules/core/src/main/java/org/scribble/model/global/GCustomActivity.java b/modules/core/src/main/java/org/scribble/model/global/GCustomActivity.java
deleted file mode 100644
index 2649618b0..000000000
--- a/modules/core/src/main/java/org/scribble/model/global/GCustomActivity.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Copyright 2009-10 www.scribble.org
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.scribble.model.global;
-
-import org.scribble.model.Role;
-import org.scribble.model.RoleDecl;
-
-/**
- * This class represents a custom activity.
- *
- */
-public class GCustomActivity extends GActivity {
-
- private java.util.List _roles=new java.util.Vector();
-
- /**
- * This is the default constructor.
- *
- */
- public GCustomActivity() {
- }
-
- /**
- * This is the copy constructor.
- *
- * @param act The custom activity to copy
- */
- public GCustomActivity(GCustomActivity act) {
- super(act);
- }
-
- /**
- * {@inheritDoc}
- */
- public boolean isRoleInvolved(RoleDecl role) {
- boolean ret=false;
-
- for (int i=0; !ret && i < _roles.size(); i++) {
- Role r=new Role(_roles.get(i));
- ret = role.isRole(r);
- }
-
- return (ret);
- }
-
- /**
- * {@inheritDoc}
- */
- public void identifyInvolvedRoles(java.util.Set roles) {
- for (int i=0; i < _roles.size(); i++) {
- roles.add(new Role(_roles.get(i)));
- }
- }
-
- /**
- * This method returns the roles associated with the custom activity.
- *
- * @return The roles
- */
- public java.util.List getRoles() {
- return(_roles);
- }
-
- /**
- * This method visits the model object using the supplied
- * visitor.
- *
- * @param visitor The visitor
- */
- public void visit(GVisitor visitor) {
- visitor.accept(this);
- }
-
- /**
- * {@inheritDoc}
- */
- public void toText(StringBuffer buf, int level) {
-
- indent(buf, level);
-
- buf.append("custom at ");
-
- for (int i=0; i < _roles.size(); i++) {
- if (i > 0) {
- buf.append(",");
- }
- buf.append(_roles.get(i));
- }
-
- buf.append(";\n");
- }
-}
diff --git a/modules/core/src/main/java/org/scribble/model/global/GDo.java b/modules/core/src/main/java/org/scribble/model/global/GDo.java
deleted file mode 100644
index 2d0e7f688..000000000
--- a/modules/core/src/main/java/org/scribble/model/global/GDo.java
+++ /dev/null
@@ -1,208 +0,0 @@
-/*
- * Copyright 2009 www.scribble.org
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.scribble.model.global;
-
-import org.scribble.model.Argument;
-import org.scribble.model.ContainmentList;
-import org.scribble.model.Role;
-import org.scribble.model.RoleDecl;
-import org.scribble.model.RoleInstantiation;
-
-/**
- * This class represents the Run construct.
- *
- */
-public class GDo extends GActivity {
-
- private String _protocol=null;
- private String _scopeName=null;
- private java.util.List _arguments=new ContainmentList(this, Argument.class);
- private java.util.List _roleInstantiations=new ContainmentList(this,
- RoleInstantiation.class);
-
- /**
- * This is the default constructor.
- *
- */
- public GDo() {
- }
-
- /**
- * This is the copy constructor.
- *
- * @param copy The copy
- */
- public GDo(GDo copy) {
- super(copy);
- _protocol = copy.getProtocol();
-
- for (Argument arg : copy.getArguments()) {
- _arguments.add(new Argument(arg));
- }
-
- for (RoleInstantiation ri : copy.getRoleInstantiations()) {
- _roleInstantiations.add(new RoleInstantiation(ri));
- }
- }
-
- /**
- * {@inheritDoc}
- */
- public boolean isRoleInvolved(RoleDecl role) {
- boolean ret=false;
-
- for (int i=0; !ret && i < _roleInstantiations.size(); i++) {
- RoleInstantiation ri=_roleInstantiations.get(i);
-
- ret = role.isRole(new Role(ri.getName()));
- }
-
- return (ret);
- }
-
- /**
- * {@inheritDoc}
- */
- public void identifyInvolvedRoles(java.util.Set roles) {
-
- for (int i=0; i < _roleInstantiations.size(); i++) {
- RoleInstantiation ri=_roleInstantiations.get(i);
-
- roles.add(new Role(ri.getName()));
- }
- }
-
- /**
- * This method returns the protocol.
- *
- * @return The protocol
- */
- public String getProtocol() {
- return (_protocol);
- }
-
- /**
- * This method sets the protocol.
- *
- * @param protocol The protocol
- */
- public void setProtocol(String protocol) {
- _protocol = protocol;
- }
-
- /**
- * This method returns the optional scope name.
- *
- * @return The scope name
- */
- public String getScope() {
- return (_scopeName);
- }
-
- /**
- * This method sets the optional scope name.
- *
- * @param scope The scope name
- */
- public void setScope(String scope) {
- _scopeName = scope;
- }
-
- /**
- * This method returns the argument list.
- *
- * @return The list of arguments
- */
- public java.util.List getArguments() {
- return (_arguments);
- }
-
- /**
- * This method returns the argument list.
- *
- * @return The list of arguments
- */
- public java.util.List getRoleInstantiations() {
- return (_roleInstantiations);
- }
-
- /**
- * This method returns the role instantiation associated with the supplied
- * role name, or null if not found.
- *
- * @param role The role
- * @return The role instantiation, or null if not found
- */
- public RoleInstantiation getRoleInstantiation(RoleDecl role) {
- for (RoleInstantiation ri : _roleInstantiations) {
- if (role.isRole(new Role(ri.getName()))) {
- return (ri);
- }
- }
-
- return (null);
- }
-
- /**
- * This method visits the model object using the supplied
- * visitor.
- *
- * @param visitor The visitor
- */
- public void visit(GVisitor visitor) {
- visitor.accept(this);
- }
-
- /**
- * {@inheritDoc}
- */
- public void toText(StringBuffer buf, int level) {
-
- indent(buf, level);
-
- buf.append("do ");
-
- if (_scopeName != null) {
- buf.append(_scopeName);
- buf.append(": ");
- }
-
- if (_protocol != null) {
- buf.append(_protocol);
- }
-
- if (_arguments.size() > 0) {
- buf.append('<');
- for (int i=0; i < _arguments.size(); i++) {
- if (i > 0) {
- buf.append(",");
- }
- buf.append(_arguments.get(i));
- }
- buf.append(">");
- }
-
- buf.append("(");
- for (int i=0; i < _roleInstantiations.size(); i++) {
- if (i > 0) {
- buf.append(",");
- }
- _roleInstantiations.get(i).toText(buf, level);
- }
-
- buf.append(");\n");
- }
-}
diff --git a/modules/core/src/main/java/org/scribble/model/global/GInterruptible.java b/modules/core/src/main/java/org/scribble/model/global/GInterruptible.java
deleted file mode 100644
index 4decc4d59..000000000
--- a/modules/core/src/main/java/org/scribble/model/global/GInterruptible.java
+++ /dev/null
@@ -1,279 +0,0 @@
-/*
- * Copyright 2009-10 www.scribble.org
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.scribble.model.global;
-
-import org.scribble.model.ContainmentList;
-import org.scribble.model.Message;
-import org.scribble.model.ModelObject;
-import org.scribble.model.Role;
-import org.scribble.model.RoleDecl;
-import org.scribble.model.Visitor;
-
-/**
- * This class represents the interruptible construct.
- *
- */
-public class GInterruptible extends GSinglePathActivity {
-
- private String _scope=null;
- private GBlock _block=new GBlock();
- private java.util.List _interrupts=new ContainmentList(this, Interrupt.class);
-
- /**
- * This is the default constructor.
- *
- */
- public GInterruptible() {
- _block.setParent(this);
- }
-
- /**
- * {@inheritDoc}
- */
- public boolean isRoleInvolved(RoleDecl role) {
- boolean ret=_block.isRoleInvolved(role);
-
- for (int i=0; !ret && i < _interrupts.size(); i++) {
- if (_interrupts.get(i).getRole() != null) {
- ret = role.isRole(_interrupts.get(i).getRole());
- }
- }
-
- return (ret);
- }
-
- /**
- * {@inheritDoc}
- */
- public void identifyInvolvedRoles(java.util.Set roles) {
- _block.identifyInvolvedRoles(roles);
-
- for (int i=0; i < _interrupts.size(); i++) {
- if (_interrupts.get(i).getRole() != null) {
- roles.add(_interrupts.get(i).getRole());
- }
- }
- }
-
- /**
- * This method returns the scope name.
- *
- * @return The scope name
- */
- public String getScope() {
- return (_scope);
- }
-
- /**
- * This method sets the scope name.
- *
- * @param scope The scope name
- */
- public void setScope(String scope) {
- _scope = scope;
- }
-
- /**
- * This method returns the activities.
- *
- * @return The block of activities
- */
- public GBlock getBlock() {
- return (_block);
- }
-
- /**
- * This method sets the block.
- *
- * @param block The block
- */
- public void setBlock(GBlock block) {
- if (_block != null) {
- _block.setParent(null);
- }
-
- _block = block;
-
- if (_block != null) {
- _block.setParent(this);
- }
- }
-
- /**
- * This method sets the interrupts.
- *
- * @param interrupts The interrupts
- */
- public void setInterrupts(java.util.List interrupts) {
- _interrupts = interrupts;
- }
-
- /**
- * This method gets the interrupts.
- *
- * @return The interrupts
- */
- public java.util.List getInterrupts() {
- return (_interrupts);
- }
-
- /**
- * This method visits the model object using the supplied
- * visitor.
- *
- * @param visitor The visitor
- */
- public void visit(GVisitor visitor) {
- if (visitor.start(this)) {
-
- if (getBlock() != null) {
- getBlock().visit(visitor);
- }
- }
-
- visitor.end(this);
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
-
- GInterruptible that = (GInterruptible) o;
-
- return !(_scope != null
- ? !_scope.equals(that._scope)
- : that._scope != null)
- && !(_block != null
- ? !_block.equals(that._block)
- : that._block != null);
- }
-
- @Override
- public int hashCode() {
- int result = _scope != null ? _scope.hashCode() : 0;
- return 31 * result + (_block != null ? _block.hashCode() : 0);
- }
-
- @Override
- public String toString() {
- return "interruptible "+_scope+" "+_block;
- }
-
- /**
- * {@inheritDoc}
- */
- public void toText(StringBuffer buf, int level) {
-
- indent(buf, level);
-
- buf.append("interruptible ");
-
- if (_scope != null) {
- buf.append(_scope);
- buf.append(": ");
- }
-
- if (_block != null) {
- _block.toText(buf, level);
- }
-
- buf.append(" with {\n");
-
- for (Interrupt i : getInterrupts()) {
- i.toText(buf, level+1);
- }
-
- indent(buf, level);
-
- buf.append("}\n");
- }
-
- /**
- * This class represents the interrupt definition.
- *
- */
- public static class Interrupt extends ModelObject {
-
- private Role _role=null;
- private java.util.List _messages=new ContainmentList(this, Message.class);
-
- public Interrupt() {
- }
-
- /**
- * This method sets the 'by' role.
- *
- * @param role The 'by' role
- */
- public void setRole(Role role) {
- _role = role;
- }
-
- /**
- * This method gets the 'by' role.
- *
- * @return The 'by' role
- */
- public Role getRole() {
- return (_role);
- }
-
- /**
- * This method sets the interrupt messages.
- *
- * @param mesgs The messages
- */
- public void setMessages(java.util.List mesgs) {
- _messages = mesgs;
- }
-
- /**
- * This method gets the interrupt messages.
- *
- * @return The messages
- */
- public java.util.List getMessages() {
- return (_messages);
- }
-
- @Override
- public void visit(Visitor visitor) {
- }
-
- public void toText(StringBuffer buf, int level) {
-
- GInterruptible.indent(buf, level);
-
- for (int i=0; i < _messages.size(); i++) {
- if (i > 0) {
- buf.append(",");
- }
- _messages.get(i).toText(buf, level);
- }
-
- buf.append(" by ");
-
- _role.toText(buf, level);
-
- buf.append(";\n");
- }
- }
-}
diff --git a/modules/core/src/main/java/org/scribble/model/global/GMessageTransfer.java b/modules/core/src/main/java/org/scribble/model/global/GMessageTransfer.java
deleted file mode 100644
index 8d95f5da5..000000000
--- a/modules/core/src/main/java/org/scribble/model/global/GMessageTransfer.java
+++ /dev/null
@@ -1,270 +0,0 @@
-/*
- * Copyright 2009 www.scribble.org
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.scribble.model.global;
-
-import org.scribble.model.Message;
-import org.scribble.model.Role;
-import org.scribble.model.RoleDecl;
-import org.scribble.model.global.GActivity;
-
-/**
- * This class represents an interaction: the communication
- * of a message from one role to another, or several others.
- *
- */
-public class GMessageTransfer extends GActivity {
-
- private Message _message=null;
- private Role _fromRole=null;
- private java.util.List _toRoles=new java.util.ArrayList();
-
- /**
- * The default constructor.
- */
- public GMessageTransfer() {
- }
-
- /**
- * The copy constructor.
- *
- * @param i The interaction to copy
- */
- public GMessageTransfer(GMessageTransfer i) {
- super(i);
-
- if (i._message != null) {
- _message = new Message(i._message);
- }
-
- _fromRole = i._fromRole;
-
- for (Role r : i._toRoles) {
- _toRoles.add(new Role(r));
- }
- }
-
- /**
- * This method initializes the 'from' and 'to' roles, and
- * message signature.
- *
- * @param sig The message signature
- * @param fromRole The 'from' role
- * @param toRoles The 'to' roles
- */
- public GMessageTransfer(Message sig, Role fromRole, java.util.List toRoles) {
- _message = sig;
- _fromRole = fromRole;
- _toRoles = toRoles;
- }
-
- /**
- * {@inheritDoc}
- */
- public boolean isRoleInvolved(RoleDecl role) {
- boolean ret=false;
-
- if (_fromRole != null) {
- ret = role.isRole(_fromRole);
- }
-
- for (int i=0; !ret && i < _toRoles.size(); i++) {
- ret = role.isRole(_toRoles.get(i));
- }
-
- return (ret);
- }
-
- /**
- * {@inheritDoc}
- */
- public void identifyInvolvedRoles(java.util.Set roles) {
-
- if (_fromRole != null) {
- roles.add(_fromRole);
- }
-
- roles.addAll(_toRoles);
- }
-
- /**
- * This method returns the message.
- *
- * @return The message
- */
- public Message getMessage() {
- return (_message);
- }
-
- /**
- * This method sets the message.
- *
- * @param message The message
- */
- public void setMessage(Message message) {
-
- if (_message != null) {
- _message.setParent(null);
- }
-
- _message = message;
-
- if (_message != null) {
- _message.setParent(this);
- }
- }
-
- /**
- * This method returns the 'from' role.
- *
- * @return The 'from' role
- */
- public Role getFromRole() {
- return (_fromRole);
- }
-
- /**
- * This method sets the 'from' role.
- *
- * @param part The 'from' role
- */
- public void setFromRole(Role part) {
- _fromRole = part;
- }
-
- /**
- * This method returns the 'to' roles.
- *
- * @return The 'to' roles
- */
- public java.util.List getToRoles() {
- return (_toRoles);
- }
-
- /**
- * This method sets the 'to' roles.
- *
- * @param part The 'to' roles
- */
- public void setToRoles(java.util.List part) {
- _toRoles = part;
- }
-
-
- @Override
- public String toString() {
- StringBuffer ret=new StringBuffer();
-
- if (getMessage() != null) {
- ret.append(getMessage());
- ret.append(" ");
- }
-
- ret.append(getFromRole());
- ret.append("->");
-
- for (int i=0; i < getToRoles().size(); i++) {
- if (i > 0) {
- ret.append(",");
- }
- ret.append(getToRoles().get(i));
- }
-
- return (ret.toString());
- }
-
- /**
- * This method visits the model object using the supplied
- * visitor.
- *
- * @param visitor The visitor
- */
- public void visit(GVisitor visitor) {
- visitor.accept(this);
-
- if (getMessage() != null) {
- getMessage().visit(visitor);
- }
-
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
-
- GMessageTransfer that = (GMessageTransfer) o;
-
- boolean ret=!(_fromRole != null
- ? !_fromRole.equals(that._fromRole)
- : that._fromRole != null)
- && !(_message != null
- ? !_message.equals(that._message)
- : that._message != null);
-
- if (ret) {
- if (_toRoles.size() != that.getToRoles().size()) {
- return false;
- }
- for (int i=0; i < _toRoles.size(); i++) {
- Role r=_toRoles.get(i);
- if (!r.equals(that.getToRoles().get(i))) {
- return false;
- }
- }
- }
-
- return ret;
- }
-
- @Override
- public int hashCode() {
- int result = _message != null ? _message.hashCode() : 0;
- result = 31 * result + (_fromRole != null ? _fromRole.hashCode() : 0);
- return result;
- }
-
- /**
- * {@inheritDoc}
- */
- public void toText(StringBuffer buf, int level) {
-
- indent(buf, level);
-
- _message.toText(buf, level);
-
- if (_fromRole != null) {
- buf.append(" from ");
- _fromRole.toText(buf, level);
- }
-
- if (_toRoles != null) {
- buf.append(" to ");
- for (int i=0; i < getToRoles().size(); i++) {
- if (i > 0) {
- buf.append(",");
- }
- _toRoles.get(i).toText(buf, level);
- }
-
- }
-
- buf.append(";\n");
- }
-}
diff --git a/modules/core/src/main/java/org/scribble/model/global/GMultiPathActivity.java b/modules/core/src/main/java/org/scribble/model/global/GMultiPathActivity.java
deleted file mode 100644
index 040526067..000000000
--- a/modules/core/src/main/java/org/scribble/model/global/GMultiPathActivity.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright 2009 www.scribble.org
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.scribble.model.global;
-
-/**
- * This class represents the base class for all multi-path activities.
- */
-public abstract class GMultiPathActivity extends GActivity {
-
- /**
- * The default constructor.
- */
- public GMultiPathActivity() {
- }
-
- /**
- * The copy constructor.
- *
- * @param act The activity
- */
- public GMultiPathActivity(GMultiPathActivity act) {
- super(act);
- }
-
- /**
- * This method returns the list of paths.
- *
- * @return The paths
- */
- public abstract java.util.List getPaths();
-
-}
diff --git a/modules/core/src/main/java/org/scribble/model/global/GParallel.java b/modules/core/src/main/java/org/scribble/model/global/GParallel.java
deleted file mode 100644
index 222c3655b..000000000
--- a/modules/core/src/main/java/org/scribble/model/global/GParallel.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * Copyright 2009 www.scribble.org
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.scribble.model.global;
-
-import org.scribble.model.ContainmentList;
-import org.scribble.model.Role;
-import org.scribble.model.RoleDecl;
-
-/**
- * This class represents the Parallel construct with
- * two or more concurrent paths.
- *
- */
-public class GParallel extends GMultiPathActivity {
-
- private java.util.List _blocks=new ContainmentList(this, GBlock.class);
-
- /**
- * This is the default constructor.
- *
- */
- public GParallel() {
- }
-
- /**
- * {@inheritDoc}
- */
- public boolean isRoleInvolved(RoleDecl role) {
- boolean ret=false;
-
- for (int i=0; !ret && i < _blocks.size(); i++) {
- ret = _blocks.get(i).isRoleInvolved(role);
- }
-
- return (ret);
- }
-
- /**
- * {@inheritDoc}
- */
- public void identifyInvolvedRoles(java.util.Set roles) {
-
- for (GBlock b : _blocks) {
- b.identifyInvolvedRoles(roles);
- }
- }
-
- /**
- * This method returns the list of concurrent
- * activity blocks that comprise the multi-path construct.
- *
- * @return The list of concurrent paths
- */
- public java.util.List getPaths() {
- return (_blocks);
- }
-
- /**
- * This method visits the model object using the supplied
- * visitor.
- *
- * @param visitor The visitor
- */
- public void visit(GVisitor visitor) {
- if (visitor.start(this)) {
-
- for (GBlock b : getPaths()) {
- b.visit(visitor);
- }
- }
-
- visitor.end(this);
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
-
- GParallel that = (GParallel) o;
-
- return _blocks.equals(that._blocks);
- }
-
- @Override
- public int hashCode() {
- int result = _blocks.hashCode();
- return result;
- }
-
- @Override
- public String toString() {
- String result = "parallel ";
- for (GBlock b : _blocks) {
- if (_blocks.indexOf(b) > 0) {
- result += "and ";
- }
- result += b + "\n";
- }
- return result;
- }
-
- /**
- * {@inheritDoc}
- */
- public void toText(StringBuffer buf, int level) {
-
- indent(buf, level);
-
- buf.append("par ");
-
- for (int i=0; i < getPaths().size(); i++) {
- if (i > 0) {
- buf.append(" and ");
- }
- getPaths().get(i).toText(buf, level);
- }
-
- buf.append("\n");
- }
-}
diff --git a/modules/core/src/main/java/org/scribble/model/global/GProtocolDefinition.java b/modules/core/src/main/java/org/scribble/model/global/GProtocolDefinition.java
deleted file mode 100644
index bdf7166da..000000000
--- a/modules/core/src/main/java/org/scribble/model/global/GProtocolDefinition.java
+++ /dev/null
@@ -1,175 +0,0 @@
-/*
- * Copyright 2009 www.scribble.org
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.scribble.model.global;
-
-import org.scribble.model.ParameterDecl;
-import org.scribble.model.ProtocolDecl;
-import org.scribble.model.RoleDecl;
-import org.scribble.model.Visitor;
-
-/**
- * This class represents the protocol notation.
- */
-public class GProtocolDefinition extends ProtocolDecl {
-
- private GBlock _block=null;
-
- /**
- * The default constructor.
- */
- public GProtocolDefinition() {
- }
-
- /**
- * This method returns the block of activities associated
- * with the definition.
- *
- * @return The block of activities
- */
- public GBlock getBlock() {
-
- if (_block == null) {
- _block = new GBlock();
- _block.setParent(this);
- }
-
- return (_block);
- }
-
- /**
- * This method sets the block of activities associated
- * with the definition.
- *
- * @param block The block of activities
- */
- public void setBlock(GBlock block) {
- if (_block != null) {
- _block.setParent(null);
- }
-
- _block = block;
-
- if (_block != null) {
- _block.setParent(this);
- }
- }
-
- /**
- * This method visits the model object using the supplied
- * visitor.
- *
- * @param visitor The visitor
- */
- public void visit(Visitor visitor) {
-
- if (visitor instanceof GVisitor) {
- if (((GVisitor)visitor).start(this)) {
-
- if (getBlock() != null) {
- getBlock().visit(visitor);
- }
- }
-
- ((GVisitor)visitor).end(this);
- }
- }
-
- public String toString() {
- String ret="global protocol "+getName();
-
- if (getParameterDeclarations().size() > 0) {
- ret += " <";
-
- for (int i=0; i < getParameterDeclarations().size(); i++) {
- ParameterDecl pd=getParameterDeclarations().get(i);
-
- if (i > 0) {
- ret += ",";
- }
-
- ret += (pd.getType().name().toLowerCase()+" "+pd.getName());
- if (pd.getAlias() != null) {
- ret += " as "+pd.getAlias();
- }
- }
-
- ret += ">";
- }
-
- ret += " ( ";
-
- for (int i=0; i < getRoleDeclarations().size(); i++) {
- RoleDecl role=getRoleDeclarations().get(i);
-
- if (i > 0) {
- ret += ",";
- }
-
- ret += ("role "+role.getName()+" ");
- if (role.getAlias() != null) {
- ret += " as "+role.getAlias();
- }
- }
-
- ret += ")\n";
-
- ret += getBlock();
-
- return(ret);
- }
-
- /**
- * {@inheritDoc}
- */
- public void toText(StringBuffer buf, int level) {
-
- indent(buf, level);
-
- buf.append("global protocol ");
-
- buf.append(getName());
-
- if (getParameterDeclarations().size() > 0) {
- buf.append("<");
-
- for (int i=0; i < getParameterDeclarations().size(); i++) {
- if (i > 0) {
- buf.append(",");
- }
- getParameterDeclarations().get(i).toText(buf, level);
- }
- buf.append(">");
- }
-
- buf.append("(");
-
- for (int i=0; i < getRoleDeclarations().size(); i++) {
- if (i > 0) {
- buf.append(",");
- }
- buf.append("role ");
- getRoleDeclarations().get(i).toText(buf, level);
- }
- buf.append(") ");
-
-
- if (_block != null) {
- _block.toText(buf, level);
- }
-
- buf.append("\n");
- }
-}
diff --git a/modules/core/src/main/java/org/scribble/model/global/GProtocolInstance.java b/modules/core/src/main/java/org/scribble/model/global/GProtocolInstance.java
deleted file mode 100644
index 732999efa..000000000
--- a/modules/core/src/main/java/org/scribble/model/global/GProtocolInstance.java
+++ /dev/null
@@ -1,213 +0,0 @@
-/*
- * Copyright 2009 www.scribble.org
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.scribble.model.global;
-
-import org.scribble.model.Argument;
-import org.scribble.model.ContainmentList;
-import org.scribble.model.ParameterDecl;
-import org.scribble.model.ProtocolDecl;
-import org.scribble.model.Role;
-import org.scribble.model.RoleDecl;
-import org.scribble.model.RoleInstantiation;
-import org.scribble.model.Visitor;
-
-/**
- * This class represents the protocol notation.
- */
-public class GProtocolInstance extends ProtocolDecl {
-
- private String _memberName=null;
- private java.util.List _arguments=new ContainmentList(this, Argument.class);
- private java.util.List _roleInstantiations=new ContainmentList(this,
- RoleInstantiation.class);
-
- /**
- * The default constructor.
- */
- public GProtocolInstance() {
- }
-
- /**
- * This method returns the member name.
- *
- * @return The name
- */
- public String getMemberName() {
- return (_memberName);
- }
-
- /**
- * This method sets the member name.
- *
- * @param name The name
- */
- public void setMemberName(String name) {
- _memberName = name;
- }
-
- /**
- * This method returns the role declarations associated with
- * the protocol.
- *
- * @return The role declarations
- */
- public java.util.List getRoleInstantiations() {
- return (_roleInstantiations);
- }
-
- /**
- * This method returns the role instantiation associated with the supplied
- * role name, or null if not found.
- *
- * @param role The role
- * @return The role instantiation, or null if not found
- */
- public RoleInstantiation getRoleInstantiation(RoleDecl role) {
- for (RoleInstantiation ri : _roleInstantiations) {
- if (role.isRole(new Role(ri.getName()))) {
- return (ri);
- }
- }
-
- return (null);
- }
-
- /**
- * This method returns the parameter declarations associated with
- * the protocol.
- *
- * @return The parameter declarations
- */
- public java.util.List getArguments() {
- return (_arguments);
- }
-
- /**
- * This method visits the model object using the supplied
- * visitor.
- *
- * @param visitor The visitor
- */
- public void visit(Visitor visitor) {
- if (visitor instanceof GVisitor) {
- ((GVisitor)visitor).accept(this);
- }
- }
-
- public String toString() {
- String ret="global protocol "+getName();
-
- if (getParameterDeclarations().size() > 0) {
- ret += " <";
-
- for (int i=0; i < getParameterDeclarations().size(); i++) {
- ParameterDecl pd=getParameterDeclarations().get(i);
-
- if (i > 0) {
- ret += ",";
- }
-
- ret += (pd.getType().name().toLowerCase()+" "+pd.getName());
- if (pd.getAlias() != null) {
- ret += " as "+pd.getAlias();
- }
- }
-
- ret += ">";
- }
-
- ret += " ( ";
-
- for (int i=0; i < getRoleDeclarations().size(); i++) {
- RoleDecl role=getRoleDeclarations().get(i);
-
- if (i > 0) {
- ret += ",";
- }
-
- ret += ("role "+role.getName()+" ");
- if (role.getAlias() != null) {
- ret += " as "+role.getAlias();
- }
- }
-
- ret += ") instantiates ";
-
- ret += _memberName;
-
- return(ret);
- }
-
- /**
- * {@inheritDoc}
- */
- public void toText(StringBuffer buf, int level) {
-
- indent(buf, level);
-
- buf.append("global protocol ");
-
- buf.append(getName());
-
- if (getParameterDeclarations().size() > 0) {
- buf.append("<");
-
- for (int i=0; i < getParameterDeclarations().size(); i++) {
- if (i > 0) {
- buf.append(",");
- }
- getParameterDeclarations().get(i).toText(buf, level);
- }
- buf.append(">");
- }
-
- buf.append("(");
-
- for (int i=0; i < getRoleDeclarations().size(); i++) {
- if (i > 0) {
- buf.append(",");
- }
- buf.append("role ");
- getRoleDeclarations().get(i).toText(buf, level);
- }
- buf.append(") instantiates ");
-
- buf.append(getMemberName());
-
- if (getArguments().size() > 0) {
- buf.append("<");
-
- for (int i=0; i < getArguments().size(); i++) {
- if (i > 0) {
- buf.append(",");
- }
- getArguments().get(i).toText(buf, level);
- }
- buf.append(">");
- }
-
- buf.append("(");
-
- for (int i=0; i < getRoleInstantiations().size(); i++) {
- if (i > 0) {
- buf.append(",");
- }
- getRoleInstantiations().get(i).toText(buf, level);
- }
-
- buf.append(");\n");
- }
-}
diff --git a/modules/core/src/main/java/org/scribble/model/global/GRecursion.java b/modules/core/src/main/java/org/scribble/model/global/GRecursion.java
deleted file mode 100644
index 8530f7417..000000000
--- a/modules/core/src/main/java/org/scribble/model/global/GRecursion.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * Copyright 2009-10 www.scribble.org
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.scribble.model.global;
-
-import org.scribble.model.Role;
-import org.scribble.model.RoleDecl;
-
-/**
- * This class represents the Recur construct.
- *
- */
-public class GRecursion extends GSinglePathActivity {
-
- private String _label=null;
- private GBlock _block=new GBlock();
-
- /**
- * This is the default constructor.
- *
- */
- public GRecursion() {
- _block.setParent(this);
- }
-
- /**
- * {@inheritDoc}
- */
- public boolean isRoleInvolved(RoleDecl role) {
- return (_block.isRoleInvolved(role));
- }
-
- /**
- * {@inheritDoc}
- */
- public void identifyInvolvedRoles(java.util.Set roles) {
- _block.identifyInvolvedRoles(roles);
- }
-
- /**
- * This method returns the label associated with the labelled block construct.
- *
- * @return The label
- */
- public String getLabel() {
- return (_label);
- }
-
- /**
- * This method sets the label associated with the labelled block construct.
- *
- * @param label The label
- */
- public void setLabel(String label) {
- _label = label;
- }
-
- /**
- * This method returns the activities.
- *
- * @return The block of activities
- */
- public GBlock getBlock() {
- return (_block);
- }
-
- /**
- * This method sets the block.
- *
- * @param block The block
- */
- public void setBlock(GBlock block) {
- if (_block != null) {
- _block.setParent(null);
- }
-
- _block = block;
-
- if (_block != null) {
- _block.setParent(this);
- }
- }
-
- /**
- * This method visits the model object using the supplied
- * visitor.
- *
- * @param visitor The visitor
- */
- public void visit(GVisitor visitor) {
- if (visitor.start(this)) {
-
- if (getBlock() != null) {
- getBlock().visit(visitor);
- }
- }
-
- visitor.end(this);
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
-
- GRecursion that = (GRecursion) o;
-
- return !(_label != null
- ? !_label.equals(that._label)
- : that._label != null)
- && !(_block != null
- ? !_block.equals(that._block)
- : that._block != null);
- }
-
- @Override
- public int hashCode() {
- int result = _label != null ? _label.hashCode() : 0;
- return 31 * result + (_block != null ? _block.hashCode() : 0);
- }
-
- @Override
- public String toString() {
- return "rec "+_label+" "+_block;
- }
-
- /**
- * {@inheritDoc}
- */
- public void toText(StringBuffer buf, int level) {
-
- indent(buf, level);
-
- buf.append("rec ");
-
- buf.append(_label);
-
- buf.append(" ");
-
- if (_block != null) {
- _block.toText(buf, level);
- }
-
- buf.append("\n");
- }
-}
diff --git a/modules/core/src/main/java/org/scribble/model/global/GSinglePathActivity.java b/modules/core/src/main/java/org/scribble/model/global/GSinglePathActivity.java
deleted file mode 100644
index f47a54e6e..000000000
--- a/modules/core/src/main/java/org/scribble/model/global/GSinglePathActivity.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright 2009 www.scribble.org
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.scribble.model.global;
-
-/**
- * This class represents the base class for all single-path activities.
- */
-public abstract class GSinglePathActivity extends GActivity {
-
- /**
- * The default constructor.
- */
- public GSinglePathActivity() {
- }
-
- /**
- * The copy constructor.
- *
- * @param act The activity
- */
- public GSinglePathActivity(GSinglePathActivity act) {
- super(act);
- }
-
- /**
- * This method returns the single path.
- *
- * @return The single path
- */
- public abstract GBlock getBlock();
-
-}
diff --git a/modules/core/src/main/java/org/scribble/model/global/GVisitor.java b/modules/core/src/main/java/org/scribble/model/global/GVisitor.java
deleted file mode 100644
index 1184b9181..000000000
--- a/modules/core/src/main/java/org/scribble/model/global/GVisitor.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * Copyright 2009 www.scribble.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.scribble.model.global;
-
-import org.scribble.model.Visitor;
-import org.scribble.model.global.GChoice;
-
-/**
- * This interface represents a visitor which can be used
- * to traverse a model.
- */
-public interface GVisitor extends Visitor {
-
- /**
- * This method indicates the start of a
- * block.
- *
- * @param elem The block
- * @return Whether to process the contents
- */
- public boolean start(GBlock elem);
-
- /**
- * This method indicates the end of a
- * block.
- *
- * @param elem The block
- */
- public void end(GBlock elem);
-
- /**
- * This method indicates the start of a
- * choice.
- *
- * @param elem The choice
- * @return Whether to process the contents
- */
- public boolean start(GChoice elem);
-
- /**
- * This method indicates the end of a
- * choice.
- *
- * @param elem The choice
- */
- public void end(GChoice elem);
-
- /**
- * This method indicates the start of a
- * parallel.
- *
- * @param elem The parallel
- * @return Whether to process the contents
- */
- public boolean start(GParallel elem);
-
- /**
- * This method indicates the end of a
- * parallel.
- *
- * @param elem The parallel
- */
- public void end(GParallel elem);
-
- /**
- * This method indicates the start of a
- * protocol.
- *
- * @param elem The protocol
- * @return Whether to process the contents
- */
- public boolean start(GProtocolDefinition elem);
-
- /**
- * This method indicates the end of a
- * protocol.
- *
- * @param elem The protocol
- */
- public void end(GProtocolDefinition elem);
-
- /**
- * This method indicates the start of a
- * labelled block.
- *
- * @param elem The labelled block
- * @return Whether to process the contents
- */
- public boolean start(GRecursion elem);
-
- /**
- * This method indicates the end of a
- * labelled block.
- *
- * @param elem The labelled block
- */
- public void end(GRecursion elem);
-
- /**
- * This method indicates the start of an
- * interruptible block.
- *
- * @param elem The interruptible
- * @return Whether to process the contents
- */
- public boolean start(GInterruptible elem);
-
- /**
- * This method indicates the end of an
- * interruptible block.
- *
- * @param elem The interruptible
- */
- public void end(GInterruptible elem);
-
- /**
- * This method visits a protocol instance.
- *
- * @param elem The protocol instances
- */
- public void accept(GProtocolInstance elem);
-
- /**
- * This method visits an interaction component.
- *
- * @param elem The interaction
- */
- public void accept(GMessageTransfer elem);
-
- /**
- * This method visits a recursion component.
- *
- * @param elem The recursion
- */
- public void accept(GContinue elem);
-
- /**
- * This method visits a do component.
- *
- * @param elem The do
- */
- public void accept(GDo elem);
-
- /**
- * This method visits a custom activity.
- *
- * @param elem The custom activity
- */
- public void accept(GCustomActivity elem);
-
-}
diff --git a/modules/core/src/main/java/org/scribble/model/local/LActivity.java b/modules/core/src/main/java/org/scribble/model/local/LActivity.java
deleted file mode 100644
index 0cb1a2ac3..000000000
--- a/modules/core/src/main/java/org/scribble/model/local/LActivity.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright 2009 www.scribble.org
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.scribble.model.local;
-
-import org.scribble.model.ModelObject;
-import org.scribble.model.Visitor;
-
-/**
- * This class represents the base class for all Scribble definition
- * context.
- */
-public abstract class LActivity extends ModelObject {
-
- /**
- * The default constructor.
- */
- public LActivity() {
- }
-
- /**
- * The copy constructor.
- *
- * @param act The activity
- */
- public LActivity(LActivity act) {
- super(act);
- }
-
- /**
- * {@inheritDoc}
- */
- public void visit(Visitor visitor) {
- if (visitor instanceof LVisitor) {
- visit((LVisitor)visitor);
- }
- }
-
- /**
- * This method visits the model object using the supplied
- * visitor.
- *
- * @param visitor The visitor
- */
- public abstract void visit(LVisitor visitor);
-
-}
diff --git a/modules/core/src/main/java/org/scribble/model/local/LBlock.java b/modules/core/src/main/java/org/scribble/model/local/LBlock.java
deleted file mode 100644
index 13dcc9ebf..000000000
--- a/modules/core/src/main/java/org/scribble/model/local/LBlock.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * Copyright 2009 www.scribble.org
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.scribble.model.local;
-
-import org.scribble.model.ContainmentList;
-
-/**
- * This class represents a group of activities.
- *
- */
-public class LBlock extends LActivity {
-
- private java.util.List _contents=
- new ContainmentList(this, LActivity.class);
-
- /**
- * This method returns the contents associated with
- * the block.
- *
- * @return The contents
- */
- public java.util.List getContents() {
- return (_contents);
- }
-
- /**
- * This method adds an activity to the block.
- *
- * @param act The activity
- * @return Whether the activity has been added
- */
- public boolean add(LActivity act) {
- return (_contents.add(act));
- }
-
- /**
- * This method removes an activity from the block.
- *
- * @param act The activity
- * @return Whether the activity has been removed
- */
- public boolean remove(LActivity act) {
- return (_contents.remove(act));
- }
-
- /**
- * This method returns the number of activities
- * in the block.
- *
- * @return The number of activities
- */
- public int size() {
- return (_contents.size());
- }
-
- /**
- * This method returns the activity at the specified
- * index.
- *
- * @param index The index The index
- * @return The activity The activity
- * @throws IndexOutOfBoundsException Out of bounds
- */
- public LActivity get(int index) throws IndexOutOfBoundsException {
- return (_contents.get(index));
- }
-
- /**
- * This method returns the index of the supplied activity.
- *
- * @param act The activity
- * @return The index, or -1 if the activity is not found
- */
- public int indexOf(LActivity act) {
- return (_contents.indexOf(act));
- }
-
- /**
- * This method visits the model object using the supplied
- * visitor.
- *
- * @param visitor The visitor
- */
- public void visit(LVisitor visitor) {
-
- if (visitor.start(this)) {
-
- for (int i=0; i < getContents().size(); i++) {
- getContents().get(i).visit(visitor);
- }
- }
-
- visitor.end(this);
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
-
- LBlock that = (LBlock) o;
-
- return _contents.equals(that._contents);
- }
-
- @Override
- public int hashCode() {
- return _contents.hashCode();
- }
-
- @Override
- public String toString() {
- String result = "{\n";
- for (LActivity act : _contents) {
- result += act + "\n";
- }
- return result + "}";
- }
-
- /**
- * {@inheritDoc}
- */
- public void toText(StringBuffer buf, int level) {
-
- buf.append("{\n");
-
- for (LActivity act : _contents) {
- act.toText(buf, level+1);
- }
-
- indent(buf, level);
- buf.append("}");
- }
-}
diff --git a/modules/core/src/main/java/org/scribble/model/local/LChoice.java b/modules/core/src/main/java/org/scribble/model/local/LChoice.java
deleted file mode 100644
index f210bc963..000000000
--- a/modules/core/src/main/java/org/scribble/model/local/LChoice.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * Copyright 2009 www.scribble.org
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.scribble.model.local;
-
-import org.scribble.model.ContainmentList;
-import org.scribble.model.Role;
-
-/**
- * This class represents the Choice construct between
- * two or more paths.
- *
- */
-public class LChoice extends LActivity {
-
- private Role _role=null;
- private java.util.List _blocks=new ContainmentList(this, LBlock.class);
-
- /**
- * This is the default constructor.
- *
- */
- public LChoice() {
- }
-
- /**
- * This method returns the role.
- *
- * @return The role
- */
- public Role getRole() {
- return (_role);
- }
-
- /**
- * This method sets the role.
- *
- * @param role The role
- */
- public void setRole(Role role) {
- _role = role;
- }
-
- /**
- * This method returns the list of mutually exclusive
- * activity blocks that comprise the multi-path construct.
- *
- * @return The list of choice paths
- */
- public java.util.List getPaths() {
- return (_blocks);
- }
-
- /**
- * This method visits the model object using the supplied
- * visitor.
- *
- * @param visitor The visitor
- */
- public void visit(LVisitor visitor) {
-
- if (visitor.start(this)) {
-
- for (LBlock b : getPaths()) {
- b.visit(visitor);
- }
- }
-
- visitor.end(this);
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
-
- LChoice that = (LChoice) o;
-
- return !(_role != null
- ? !_role.equals(that._role)
- : that._role != null)
- && _blocks.equals(that._blocks);
- }
-
- @Override
- public int hashCode() {
- int result = _blocks.hashCode();
- result = 31 * result + (_role != null ? _role.hashCode() : 0);
- return result;
- }
-
- @Override
- public String toString() {
- String result = "choice ";
- if (_role != null) {
- result += "at " + _role+" ";
- }
- for (LBlock b : _blocks) {
- if (_blocks.indexOf(b) > 0) {
- result += "or ";
- }
- result += b + "\n";
- }
- return result;
- }
-
- /**
- * {@inheritDoc}
- */
- public void toText(StringBuffer buf, int level) {
-
- indent(buf, level);
-
- buf.append("choice at ");
-
- if (_role != null) {
- buf.append(_role);
- buf.append(" ");
- }
-
- for (int i=0; i < getPaths().size(); i++) {
- if (i > 0) {
- buf.append(" or ");
- }
- getPaths().get(i).toText(buf, level);
- }
-
- buf.append("\n");
- }
-}
diff --git a/modules/core/src/main/java/org/scribble/model/local/LContinue.java b/modules/core/src/main/java/org/scribble/model/local/LContinue.java
deleted file mode 100644
index 02205de06..000000000
--- a/modules/core/src/main/java/org/scribble/model/local/LContinue.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Copyright 2009 www.scribble.org
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.scribble.model.local;
-
-/**
- * This class represents the Raise construct.
- *
- */
-public class LContinue extends LActivity {
-
- private String _label=null;
-
- /**
- * This is the default constructor.
- *
- */
- public LContinue() {
- }
-
- /**
- * This is the copy constructor.
- *
- * @param copy The recursion to copy
- */
- public LContinue(LContinue copy) {
- super(copy);
- _label = copy.getLabel();
- }
-
- /**
- * This method returns the label associated with the recursion construct.
- *
- * @return The label
- */
- public String getLabel() {
- return (_label);
- }
-
- /**
- * This method sets the label associated with the recursion construct.
- *
- * @param label The label
- */
- public void setLabel(String label) {
- _label = label;
- }
-
- /**
- * This method visits the model object using the supplied
- * visitor.
- *
- * @param visitor The visitor
- */
- public void visit(LVisitor visitor) {
- visitor.accept(this);
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
-
- LContinue that = (LContinue) o;
-
- return !(_label != null
- ? !_label.equals(that._label)
- : that._label != null);
- }
-
- @Override
- public int hashCode() {
- return _label != null ? _label.hashCode() : 0;
- }
-
- @Override
- public String toString() {
- return "continue " + _label;
- }
-
- /**
- * {@inheritDoc}
- */
- public void toText(StringBuffer buf, int level) {
-
- indent(buf, level);
-
- buf.append("continue ");
-
- if (_label != null) {
- buf.append(_label);
- }
-
- buf.append(";\n");
- }
-}
diff --git a/modules/core/src/main/java/org/scribble/model/local/LCustomActivity.java b/modules/core/src/main/java/org/scribble/model/local/LCustomActivity.java
deleted file mode 100644
index 638ced645..000000000
--- a/modules/core/src/main/java/org/scribble/model/local/LCustomActivity.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright 2009-10 www.scribble.org
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.scribble.model.local;
-
-/**
- * This class represents a custom activity.
- *
- */
-public class LCustomActivity extends LActivity {
-
- private java.util.List _roles=new java.util.Vector();
-
- /**
- * This is the default constructor.
- *
- */
- public LCustomActivity() {
- }
-
- /**
- * This is the copy constructor.
- *
- * @param act The custom activity to copy
- */
- public LCustomActivity(LCustomActivity act) {
- super(act);
- }
-
- /**
- * This method returns the roles associated with the custom activity.
- *
- * @return The roles
- */
- public java.util.List getRoles() {
- return(_roles);
- }
-
- /**
- * This method visits the model object using the supplied
- * visitor.
- *
- * @param visitor The visitor
- */
- public void visit(LVisitor visitor) {
- visitor.accept(this);
- }
-
- /**
- * {@inheritDoc}
- */
- public void toText(StringBuffer buf, int level) {
-
- indent(buf, level);
-
- buf.append("custom at ");
-
- for (int i=0; i < _roles.size(); i++) {
- if (i > 0) {
- buf.append(",");
- }
- buf.append(_roles.get(i));
- }
-
- buf.append(";\n");
- }
-}
diff --git a/modules/core/src/main/java/org/scribble/model/local/LDo.java b/modules/core/src/main/java/org/scribble/model/local/LDo.java
deleted file mode 100644
index 9069cf677..000000000
--- a/modules/core/src/main/java/org/scribble/model/local/LDo.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- * Copyright 2009 www.scribble.org
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.scribble.model.local;
-
-import org.scribble.model.Argument;
-import org.scribble.model.ContainmentList;
-import org.scribble.model.RoleInstantiation;
-
-/**
- * This class represents the Run construct.
- *
- */
-public class LDo extends LActivity {
- private String _protocol=null;
- private String _scope=null;
- private java.util.List _arguments=new ContainmentList(this, Argument.class);
- private java.util.List _roleInstantiations=new ContainmentList(this,
- RoleInstantiation.class);
-
- /**
- * This is the default constructor.
- *
- */
- public LDo() {
- }
-
- /**
- * This is the copy constructor.
- *
- * @param copy The copy
- */
- public LDo(LDo copy) {
- super(copy);
- _protocol = copy.getProtocol();
-
- for (Argument arg : copy.getArguments()) {
- _arguments.add(new Argument(arg));
- }
-
- for (RoleInstantiation ri : copy.getRoleInstantiations()) {
- _roleInstantiations.add(new RoleInstantiation(ri));
- }
- }
-
- /**
- * This method returns the protocol.
- *
- * @return The protocol
- */
- public String getProtocol() {
- return (_protocol);
- }
-
- /**
- * This method sets the protocol.
- *
- * @param protocol The protocol
- */
- public void setProtocol(String protocol) {
- _protocol = protocol;
- }
-
- /**
- * This method returns the optional scope name.
- *
- * @return The scope name
- */
- public String getScope() {
- return (_scope);
- }
-
- /**
- * This method sets the optional scope name.
- *
- * @param scope The scope name
- */
- public void setScope(String scope) {
- _scope = scope;
- }
-
- /**
- * This method returns the argument list.
- *
- * @return The list of arguments
- */
- public java.util.List getArguments() {
- return (_arguments);
- }
-
- /**
- * This method returns the argument list.
- *
- * @return The list of arguments
- */
- public java.util.List getRoleInstantiations() {
- return (_roleInstantiations);
- }
-
- /**
- * This method visits the model object using the supplied
- * visitor.
- *
- * @param visitor The visitor
- */
- public void visit(LVisitor visitor) {
- visitor.accept(this);
- }
-
- /**
- * {@inheritDoc}
- */
- public void toText(StringBuffer buf, int level) {
-
- indent(buf, level);
-
- buf.append("do ");
-
- if (_scope != null) {
- buf.append(_scope);
- buf.append(": ");
- }
-
- if (_protocol != null) {
- buf.append(_protocol);
- }
-
- if (_arguments.size() > 0) {
- buf.append('<');
- for (int i=0; i < _arguments.size(); i++) {
- if (i > 0) {
- buf.append(",");
- }
- buf.append(_arguments.get(i));
- }
- buf.append(">");
- }
-
- buf.append("(");
- for (int i=0; i < _roleInstantiations.size(); i++) {
- if (i > 0) {
- buf.append(",");
- }
- _roleInstantiations.get(i).toText(buf, level);
- }
-
- buf.append(");\n");
- }
-}
diff --git a/modules/core/src/main/java/org/scribble/model/local/LInterruptible.java b/modules/core/src/main/java/org/scribble/model/local/LInterruptible.java
deleted file mode 100644
index 886ab4f4b..000000000
--- a/modules/core/src/main/java/org/scribble/model/local/LInterruptible.java
+++ /dev/null
@@ -1,374 +0,0 @@
-/*
- * Copyright 2009-10 www.scribble.org
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.scribble.model.local;
-
-import org.scribble.model.ContainmentList;
-import org.scribble.model.Message;
-import org.scribble.model.ModelObject;
-import org.scribble.model.Role;
-import org.scribble.model.Visitor;
-
-/**
- * This class represents the interruptible construct.
- *
- */
-public class LInterruptible extends LActivity {
-
- private String _scope=null;
- private LBlock _block=new LBlock();
- private Throw _throws=null;
- private java.util.List _catches=new ContainmentList(this, Catch.class);
-
- /**
- * This is the default constructor.
- *
- */
- public LInterruptible() {
- _block.setParent(this);
- }
-
- /**
- * This method returns the scope name.
- *
- * @return The scope name
- */
- public String getScope() {
- return (_scope);
- }
-
- /**
- * This method sets the scope name.
- *
- * @param scope The scope name
- */
- public void setScope(String scope) {
- _scope = scope;
- }
-
- /**
- * This method returns the activities.
- *
- * @return The block of activities
- */
- public LBlock getBlock() {
- return (_block);
- }
-
- /**
- * This method sets the block.
- *
- * @param block The block
- */
- public void setBlock(LBlock block) {
- if (_block != null) {
- _block.setParent(null);
- }
-
- _block = block;
-
- if (_block != null) {
- _block.setParent(this);
- }
- }
-
- /**
- * This method sets the catches.
- *
- * @param catches The catches
- */
- public void setCatches(java.util.List catches) {
- _catches = catches;
- }
-
- /**
- * This method gets the catches.
- *
- * @return The catches
- */
- public java.util.List getCatches() {
- return (_catches);
- }
-
- /**
- * This method sets the throws clause.
- *
- * @param t The throw
- */
- public void setThrows(Throw t) {
- if (_throws != null) {
- _throws.setParent(null);
- }
-
- _throws = t;
-
- if (_throws != null) {
- _throws.setParent(this);
- }
- }
-
- /**
- * This method gets the throws clause.
- *
- * @return The throw
- */
- public Throw getThrows() {
- return (_throws);
- }
-
- /**
- * This method visits the model object using the supplied
- * visitor.
- *
- * @param visitor The visitor
- */
- public void visit(LVisitor visitor) {
- if (visitor.start(this)) {
-
- if (getBlock() != null) {
- getBlock().visit(visitor);
- }
- }
-
- visitor.end(this);
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
-
- LInterruptible that = (LInterruptible) o;
-
- return !(_scope != null
- ? !_scope.equals(that._scope)
- : that._scope != null)
- && !(_block != null
- ? !_block.equals(that._block)
- : that._block != null);
- }
-
- @Override
- public int hashCode() {
- int result = _scope != null ? _scope.hashCode() : 0;
- return 31 * result + (_block != null ? _block.hashCode() : 0);
- }
-
- @Override
- public String toString() {
- return "interruptible "+_scope+" "+_block;
- }
-
- /**
- * {@inheritDoc}
- */
- public void toText(StringBuffer buf, int level) {
-
- indent(buf, level);
-
- buf.append("interruptible ");
-
- if (_scope != null) {
- buf.append(_scope);
- buf.append(": ");
- }
-
- if (_block != null) {
- _block.toText(buf, level);
- }
-
- buf.append(" with {\n");
-
- if (getThrows() != null) {
- getThrows().toText(buf, level+1);
- }
-
- for (Catch i : getCatches()) {
- i.toText(buf, level+1);
- }
-
- indent(buf, level);
-
- buf.append("}\n");
- }
-
- /**
- * This class represents the throw definition.
- *
- */
- public static class Throw extends ModelObject {
-
- private java.util.List _toRoles=new ContainmentList(this, Role.class);
- private java.util.List _messages=new ContainmentList(this, Message.class);
-
- public Throw() {
- }
-
- /**
- * This method returns the 'to' roles.
- *
- * @return The 'to' roles
- */
- public java.util.List getToRoles() {
- return (_toRoles);
- }
-
- /**
- * This method sets the 'to' roles.
- *
- * @param part The 'to' roles
- */
- public void setToRoles(java.util.List part) {
- _toRoles = part;
- }
-
- /**
- * This method sets the interrupt messages.
- *
- * @param mesgs The messages
- */
- public void setMessages(java.util.List mesgs) {
- _messages = mesgs;
- }
-
- /**
- * This method gets the interrupt messages.
- *
- * @return The messages
- */
- public java.util.List getMessages() {
- return (_messages);
- }
-
- public void toText(StringBuffer buf, int level) {
-
- LInterruptible.indent(buf, level);
-
- buf.append("throws ");
-
- for (int i=0; i < _messages.size(); i++) {
- if (i > 0) {
- buf.append(",");
- }
- _messages.get(i).toText(buf, level);
- }
-
- buf.append(" to ");
-
- for (int i=0; i < _toRoles.size(); i++) {
- if (i > 0) {
- buf.append(",");
- }
- Role r=_toRoles.get(i);
- r.toText(buf, level);
- }
-
- buf.append(";\n");
- }
-
- @Override
- public void visit(Visitor visitor) {
- // TODO Auto-generated method stub
-
- }
- }
-
- /**
- * This class represents the catch definition.
- *
- */
- public static class Catch extends ModelObject {
-
- private Role _role=null;
- private java.util.List _messages=new ContainmentList(this, Message.class);
-
- public Catch() {
- }
-
- /**
- * This method sets the 'from' role.
- *
- * @param role The 'from' role
- */
- public void setRole(Role role) {
- if (_role != null) {
- _role.setParent(null);
- }
-
- _role = role;
-
- if (_role != null) {
- _role.setParent(this);
- }
- }
-
- /**
- * This method gets the 'from' role.
- *
- * @return The 'from' role
- */
- public Role getRole() {
- return (_role);
- }
-
- /**
- * This method sets the interrupt messages.
- *
- * @param mesgs The messages
- */
- public void setMessages(java.util.List mesgs) {
- _messages = mesgs;
- }
-
- /**
- * This method gets the interrupt messages.
- *
- * @return The messages
- */
- public java.util.List getMessages() {
- return (_messages);
- }
-
- public void toText(StringBuffer buf, int level) {
-
- LInterruptible.indent(buf, level);
-
- buf.append("catches ");
-
- for (int i=0; i < _messages.size(); i++) {
- if (i > 0) {
- buf.append(",");
- }
- _messages.get(i).toText(buf, level);
- }
-
- buf.append(" from ");
-
- _role.toText(buf, level);
-
- buf.append(";\n");
- }
-
- @Override
- public void visit(Visitor visitor) {
- // TODO Auto-generated method stub
-
- }
- }
-}
diff --git a/modules/core/src/main/java/org/scribble/model/local/LParallel.java b/modules/core/src/main/java/org/scribble/model/local/LParallel.java
deleted file mode 100644
index 57d8402a7..000000000
--- a/modules/core/src/main/java/org/scribble/model/local/LParallel.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Copyright 2009 www.scribble.org
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.scribble.model.local;
-
-import org.scribble.model.ContainmentList;
-
-/**
- * This class represents the Parallel construct with
- * two or more concurrent paths.
- *
- */
-public class LParallel extends LActivity {
-
- private java.util.List _blocks=new ContainmentList(this, LBlock.class);
-
- /**
- * This is the default constructor.
- *
- */
- public LParallel() {
- }
-
- /**
- * This method returns the list of concurrent
- * activity blocks that comprise the multi-path construct.
- *
- * @return The list of concurrent paths
- */
- public java.util.List getPaths() {
- return (_blocks);
- }
-
- /**
- * This method visits the model object using the supplied
- * visitor.
- *
- * @param visitor The visitor
- */
- public void visit(LVisitor visitor) {
- if (visitor.start(this)) {
-
- for (LBlock b : getPaths()) {
- b.visit(visitor);
- }
- }
-
- visitor.end(this);
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
-
- LParallel that = (LParallel) o;
-
- return _blocks.equals(that._blocks);
- }
-
- @Override
- public int hashCode() {
- int result = _blocks.hashCode();
- return result;
- }
-
- @Override
- public String toString() {
- String result = "parallel ";
- for (LBlock b : _blocks) {
- if (_blocks.indexOf(b) > 0) {
- result += "and ";
- }
- result += b + "\n";
- }
- return result;
- }
-
- /**
- * {@inheritDoc}
- */
- public void toText(StringBuffer buf, int level) {
-
- indent(buf, level);
-
- buf.append("par ");
-
- for (int i=0; i < getPaths().size(); i++) {
- if (i > 0) {
- buf.append(" and ");
- }
- getPaths().get(i).toText(buf, level);
- }
-
- buf.append("\n");
- }
-}
diff --git a/modules/core/src/main/java/org/scribble/model/local/LProtocolDecl.java b/modules/core/src/main/java/org/scribble/model/local/LProtocolDecl.java
deleted file mode 100644
index 602310b9f..000000000
--- a/modules/core/src/main/java/org/scribble/model/local/LProtocolDecl.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright 2009 www.scribble.org
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.scribble.model.local;
-
-import org.scribble.model.ProtocolDecl;
-import org.scribble.model.Role;
-
-/**
- * This class represents the local protocol declaration.
- */
-public abstract class LProtocolDecl extends ProtocolDecl {
-
- private Role _localRole=null;
-
- /**
- * The default constructor.
- */
- public LProtocolDecl() {
- }
-
- /**
- * This method returns the local role. This
- * field is set when the protocol represents a local
- * model.
- *
- * @return The local role
- */
- public Role getLocalRole() {
- return (_localRole);
- }
-
- /**
- * This method sets the local role. This
- * field is set when the protocol represents a local
- * model.
- *
- * @param role The local role
- */
- public void setLocalRole(Role role) {
- _localRole = role;
- }
-
-}
diff --git a/modules/core/src/main/java/org/scribble/model/local/LProtocolDefinition.java b/modules/core/src/main/java/org/scribble/model/local/LProtocolDefinition.java
deleted file mode 100644
index 5dc6e2123..000000000
--- a/modules/core/src/main/java/org/scribble/model/local/LProtocolDefinition.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
- * Copyright 2009 www.scribble.org
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.scribble.model.local;
-
-import org.scribble.model.RoleDecl;
-import org.scribble.model.Visitor;
-
-/**
- * This class represents the protocol notation.
- */
-public class LProtocolDefinition extends LProtocolDecl {
-
- private LBlock _block=null;
-
- /**
- * The default constructor.
- */
- public LProtocolDefinition() {
- }
-
- /**
- * This method returns the block of activities associated
- * with the definition.
- *
- * @return The block of activities
- */
- public LBlock getBlock() {
-
- if (_block == null) {
- _block = new LBlock();
- _block.setParent(this);
- }
-
- return (_block);
- }
-
- /**
- * This method sets the block of activities associated
- * with the definition.
- *
- * @param block The block of activities
- */
- public void setBlock(LBlock block) {
- if (_block != null) {
- _block.setParent(null);
- }
-
- _block = block;
-
- if (_block != null) {
- _block.setParent(this);
- }
- }
-
- /**
- * This method visits the model object using the supplied
- * visitor.
- *
- * @param visitor The visitor
- */
- public void visit(Visitor visitor) {
-
- if (visitor instanceof LVisitor) {
- if (((LVisitor)visitor).start(this)) {
-
- if (getBlock() != null) {
- getBlock().visit(visitor);
- }
- }
-
- ((LVisitor)visitor).end(this);
- }
- }
-
- public String toString() {
- String ret="local protocol "+getName()+" ( ";
-
- for (RoleDecl role : getRoleDeclarations()) {
- ret += "role " + role.getName() + " ";
- }
-
- ret += ")\n";
-
- ret += getBlock();
-
- return(ret);
- }
-
- /**
- * {@inheritDoc}
- */
- public void toText(StringBuffer buf, int level) {
-
- indent(buf, level);
-
- buf.append("local protocol ");
-
- buf.append(getName());
-
- buf.append(" at ");
-
- if (getLocalRole() != null) {
- getLocalRole().toText(buf, level);
- }
-
- if (getParameterDeclarations().size() > 0) {
- buf.append("<");
-
- for (int i=0; i < getParameterDeclarations().size(); i++) {
- if (i > 0) {
- buf.append(",");
- }
- getParameterDeclarations().get(i).toText(buf, level);
- }
- buf.append(">");
- }
-
- buf.append("(");
-
- for (int i=0; i < getRoleDeclarations().size(); i++) {
- if (i > 0) {
- buf.append(",");
- }
- buf.append("role ");
- getRoleDeclarations().get(i).toText(buf, level);
- }
- buf.append(") ");
-
-
- if (_block != null) {
- _block.toText(buf, level);
- }
-
- buf.append("\n");
- }
-}
diff --git a/modules/core/src/main/java/org/scribble/model/local/LProtocolInstance.java b/modules/core/src/main/java/org/scribble/model/local/LProtocolInstance.java
deleted file mode 100644
index 7c863a946..000000000
--- a/modules/core/src/main/java/org/scribble/model/local/LProtocolInstance.java
+++ /dev/null
@@ -1,200 +0,0 @@
-/*
- * Copyright 2009 www.scribble.org
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.scribble.model.local;
-
-import org.scribble.model.Argument;
-import org.scribble.model.ContainmentList;
-import org.scribble.model.ParameterDecl;
-import org.scribble.model.RoleDecl;
-import org.scribble.model.RoleInstantiation;
-import org.scribble.model.Visitor;
-
-/**
- * This class represents the protocol notation.
- */
-public class LProtocolInstance extends LProtocolDecl {
-
- private String _memberName=null;
- private java.util.List _arguments=new ContainmentList(this, Argument.class);
- private java.util.List _roleInstantiations=new ContainmentList(this,
- RoleInstantiation.class);
-
- /**
- * The default constructor.
- */
- public LProtocolInstance() {
- }
-
- /**
- * This method returns the member name.
- *
- * @return The name
- */
- public String getMemberName() {
- return (_memberName);
- }
-
- /**
- * This method sets the member name.
- *
- * @param name The name
- */
- public void setMemberName(String name) {
- _memberName = name;
- }
-
- /**
- * This method returns the role declarations associated with
- * the protocol.
- *
- * @return The role declarations
- */
- public java.util.List getRoleInstantiations() {
- return (_roleInstantiations);
- }
-
- /**
- * This method returns the parameter declarations associated with
- * the protocol.
- *
- * @return The parameter declarations
- */
- public java.util.List getArguments() {
- return (_arguments);
- }
-
- /**
- * This method visits the model object using the supplied
- * visitor.
- *
- * @param visitor The visitor
- */
- public void visit(Visitor visitor) {
- if (visitor instanceof LVisitor) {
- ((LVisitor)visitor).accept(this);
- }
- }
-
- public String toString() {
- String ret="local protocol "+getName();
-
- if (getParameterDeclarations().size() > 0) {
- ret += " <";
-
- for (int i=0; i < getParameterDeclarations().size(); i++) {
- ParameterDecl pd=getParameterDeclarations().get(i);
-
- if (i > 0) {
- ret += ",";
- }
-
- ret += (pd.getType().name().toLowerCase()+" "+pd.getName());
- if (pd.getAlias() != null) {
- ret += " as "+pd.getAlias();
- }
- }
-
- ret += ">";
- }
-
- ret += " ( ";
-
- for (int i=0; i < getRoleDeclarations().size(); i++) {
- RoleDecl role=getRoleDeclarations().get(i);
-
- if (i > 0) {
- ret += ",";
- }
-
- ret += ("role "+role.getName()+" ");
- if (role.getAlias() != null) {
- ret += " as "+role.getAlias();
- }
- }
-
- ret += ") instantiates ";
-
- ret += _memberName;
-
- return(ret);
- }
-
- /**
- * {@inheritDoc}
- */
- public void toText(StringBuffer buf, int level) {
-
- indent(buf, level);
-
- buf.append("local protocol ");
-
- buf.append(getName());
-
- buf.append(" at ");
-
- if (getLocalRole() != null) {
- getLocalRole().toText(buf, level);
- }
-
- if (getParameterDeclarations().size() > 0) {
- buf.append("<");
-
- for (int i=0; i < getParameterDeclarations().size(); i++) {
- if (i > 0) {
- buf.append(",");
- }
- getParameterDeclarations().get(i).toText(buf, level);
- }
- buf.append(">");
- }
-
- buf.append("(");
-
- for (int i=0; i < getRoleDeclarations().size(); i++) {
- if (i > 0) {
- buf.append(",");
- }
- buf.append("role ");
- getRoleDeclarations().get(i).toText(buf, level);
- }
- buf.append(") instantiates ");
-
- buf.append(getMemberName());
-
- if (getArguments().size() > 0) {
- buf.append("<");
-
- for (int i=0; i < getArguments().size(); i++) {
- if (i > 0) {
- buf.append(",");
- }
- getArguments().get(i).toText(buf, level);
- }
- buf.append(">");
- }
-
- buf.append("(");
-
- for (int i=0; i < getRoleInstantiations().size(); i++) {
- if (i > 0) {
- buf.append(",");
- }
- getRoleInstantiations().get(i).toText(buf, level);
- }
-
- buf.append(");\n");
- }
-}
diff --git a/modules/core/src/main/java/org/scribble/model/local/LReceive.java b/modules/core/src/main/java/org/scribble/model/local/LReceive.java
deleted file mode 100644
index 41789f425..000000000
--- a/modules/core/src/main/java/org/scribble/model/local/LReceive.java
+++ /dev/null
@@ -1,178 +0,0 @@
-/*
- * Copyright 2009 www.scribble.org
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.scribble.model.local;
-
-import org.scribble.model.Message;
-import org.scribble.model.Role;
-
-/**
- * This class represents an interaction: the communication
- * of a message from one role to another, or several others.
- *
- */
-public class LReceive extends LActivity {
-
- private Message _message=null;
- private Role _fromRole=null;
-
- /**
- * The default constructor.
- */
- public LReceive() {
- }
-
- /**
- * The copy constructor.
- *
- * @param i The interaction to copy
- */
- public LReceive(LReceive i) {
- super(i);
-
- if (i._message != null) {
- _message = new Message(i._message);
- }
- _fromRole = i._fromRole;
- }
-
- /**
- * This constructor initializes the 'from' role and message
- * signature.
- *
- * @param sig The message signature
- * @param fromRole The 'from' role
- */
- public LReceive(Message sig, Role fromRole) {
- _message = sig;
- _fromRole = fromRole;
- }
-
- /**
- * This method returns the message.
- *
- * @return The message
- */
- public Message getMessage() {
- return (_message);
- }
-
- /**
- * This method sets the message.
- *
- * @param message The message
- */
- public void setMessage(Message message) {
-
- if (_message != null) {
- _message.setParent(null);
- }
-
- _message = message;
-
- if (_message != null) {
- _message.setParent(this);
- }
- }
-
- /**
- * This method returns the optional 'from' role.
- *
- * @return The optional 'from' role
- */
- public Role getFromRole() {
- return (_fromRole);
- }
-
- /**
- * This method sets the optional 'from' role.
- *
- * @param part The optional 'from' role
- */
- public void setFromRole(Role part) {
- _fromRole = part;
- }
-
- @Override
- public String toString() {
- StringBuffer ret=new StringBuffer();
-
- if (getMessage() != null) {
- ret.append(getMessage());
- }
-
- ret.append(" from ");
- ret.append(getFromRole());
-
- return (ret.toString());
- }
-
- /**
- * This method visits the model object using the supplied
- * visitor.
- *
- * @param visitor The visitor
- */
- public void visit(LVisitor visitor) {
- visitor.accept(this);
-
- if (getMessage() != null) {
- getMessage().visit(visitor);
- }
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
-
- LReceive that = (LReceive) o;
-
- return !(_fromRole != null
- ? !_fromRole.equals(that._fromRole)
- : that._fromRole != null)
- && !(_message != null
- ? !_message.equals(that._message)
- : that._message != null);
- }
-
- @Override
- public int hashCode() {
- int result = _message != null ? _message.hashCode() : 0;
- result = 31 * result + (_fromRole != null ? _fromRole.hashCode() : 0);
- return result;
- }
-
- /**
- * {@inheritDoc}
- */
- public void toText(StringBuffer buf, int level) {
-
- indent(buf, level);
-
- _message.toText(buf, level);
-
- if (_fromRole != null) {
- buf.append(" from ");
- _fromRole.toText(buf, level);
- }
-
- buf.append(";\n");
- }
-}
diff --git a/modules/core/src/main/java/org/scribble/model/local/LRecursion.java b/modules/core/src/main/java/org/scribble/model/local/LRecursion.java
deleted file mode 100644
index e66c324a5..000000000
--- a/modules/core/src/main/java/org/scribble/model/local/LRecursion.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * Copyright 2009-10 www.scribble.org
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.scribble.model.local;
-
-/**
- * This class represents the Recur construct.
- *
- */
-public class LRecursion extends LActivity {
-
- private String _label=null;
- private LBlock _block=new LBlock();
-
- /**
- * This is the default constructor.
- *
- */
- public LRecursion() {
- _block.setParent(this);
- }
-
- /**
- * This method returns the label associated with the labelled block construct.
- *
- * @return The label
- */
- public String getLabel() {
- return (_label);
- }
-
- /**
- * This method sets the label associated with the labelled block construct.
- *
- * @param label The label
- */
- public void setLabel(String label) {
- _label = label;
- }
-
- /**
- * This method returns the activities.
- *
- * @return The block of activities
- */
- public LBlock getBlock() {
- return (_block);
- }
-
- /**
- * This method sets the block.
- *
- * @param block The block
- */
- public void setBlock(LBlock block) {
- if (_block != null) {
- _block.setParent(null);
- }
-
- _block = block;
-
- if (_block != null) {
- _block.setParent(this);
- }
- }
-
- /**
- * This method visits the model object using the supplied
- * visitor.
- *
- * @param visitor The visitor
- */
- public void visit(LVisitor visitor) {
- if (visitor.start(this)) {
-
- if (getBlock() != null) {
- getBlock().visit(visitor);
- }
- }
-
- visitor.end(this);
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
-
- LRecursion that = (LRecursion) o;
-
- return !(_label != null
- ? !_label.equals(that._label)
- : that._label != null)
- && !(_block != null
- ? !_block.equals(that._block)
- : that._block != null);
- }
-
- @Override
- public int hashCode() {
- int result = _label != null ? _label.hashCode() : 0;
- return 31 * result + (_block != null ? _block.hashCode() : 0);
- }
-
- @Override
- public String toString() {
- return "rec "+_label+" "+_block;
- }
-
- /**
- * {@inheritDoc}
- */
- public void toText(StringBuffer buf, int level) {
-
- indent(buf, level);
-
- buf.append("rec ");
-
- buf.append(_label);
-
- buf.append(" ");
-
- if (_block != null) {
- _block.toText(buf, level);
- }
-
- buf.append("\n");
- }
-}
diff --git a/modules/core/src/main/java/org/scribble/model/local/LSend.java b/modules/core/src/main/java/org/scribble/model/local/LSend.java
deleted file mode 100644
index 3efcca9ad..000000000
--- a/modules/core/src/main/java/org/scribble/model/local/LSend.java
+++ /dev/null
@@ -1,204 +0,0 @@
-/*
- * Copyright 2009 www.scribble.org
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.scribble.model.local;
-
-import org.scribble.model.Message;
-import org.scribble.model.Role;
-
-/**
- * This class represents an interaction: the communication
- * of a message from one role to another, or several others.
- *
- */
-public class LSend extends LActivity {
-
- private Message _message=null;
- private java.util.List _toRoles=new java.util.ArrayList();
-
- /**
- * The default constructor.
- */
- public LSend() {
- }
-
- /**
- * The copy constructor.
- *
- * @param i The interaction to copy
- */
- public LSend(LSend i) {
- super(i);
-
- if (i._message != null) {
- _message = new Message(i._message);
- }
- for (Role r : i._toRoles) {
- _toRoles.add(new Role(r));
- }
- }
-
- /**
- * This constructor initializes the 'to' role and message
- * signature.
- *
- * @param sig The message signature
- * @param toRole The 'to' role
- */
- public LSend(Message sig, Role toRole) {
- _message = sig;
- _toRoles.add(toRole);
- }
-
- /**
- * This method returns the message.
- *
- * @return The message
- */
- public Message getMessage() {
- return (_message);
- }
-
- /**
- * This method sets the message.
- *
- * @param message The message
- */
- public void setMessage(Message message) {
-
- if (_message != null) {
- _message.setParent(null);
- }
-
- _message = message;
-
- if (_message != null) {
- _message.setParent(this);
- }
- }
-
- /**
- * This method returns the 'to' roles.
- *
- * @return The 'to' roles
- */
- public java.util.List getToRoles() {
- return (_toRoles);
- }
-
- /**
- * This method sets the 'to' roles.
- *
- * @param part The 'to' roles
- */
- public void setToRoles(java.util.List part) {
- _toRoles = part;
- }
-
- @Override
- public String toString() {
- StringBuffer ret=new StringBuffer();
-
- if (getMessage() != null) {
- ret.append(getMessage());
- }
-
- ret.append(" to ");
-
- for (int i=0; i < getToRoles().size(); i++) {
- if (i > 0) {
- ret.append(",");
- }
- ret.append(getToRoles().get(i));
- }
-
- return (ret.toString());
- }
-
- /**
- * This method visits the model object using the supplied
- * visitor.
- *
- * @param visitor The visitor
- */
- public void visit(LVisitor visitor) {
- visitor.accept(this);
-
- if (getMessage() != null) {
- getMessage().visit(visitor);
- }
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
-
- LSend that = (LSend) o;
-
- boolean ret = !(_message != null
- ? !_message.equals(that._message)
- : that._message != null);
-
- if (ret) {
- if (_toRoles.size() != that.getToRoles().size()) {
- return false;
- }
- for (int i=0; i < _toRoles.size(); i++) {
- Role r=_toRoles.get(i);
- if (!r.equals(that.getToRoles().get(i))) {
- return false;
- }
- }
- }
-
- return ret;
- }
-
- @Override
- public int hashCode() {
- int result = _message != null ? _message.hashCode() : 0;
- result = 31 * result + (_toRoles.size()>0 ? _toRoles.get(0).hashCode() : 0);
- return result;
- }
-
-
- /**
- * {@inheritDoc}
- */
- public void toText(StringBuffer buf, int level) {
-
- indent(buf, level);
-
- _message.toText(buf, level);
-
- if (_toRoles != null) {
- buf.append(" to ");
- for (int i=0; i < getToRoles().size(); i++) {
- if (i > 0) {
- buf.append(",");
- }
- _toRoles.get(i).toText(buf, level);
- }
-
- }
-
- buf.append(";\n");
- }
-}
diff --git a/modules/core/src/main/java/org/scribble/model/local/LVisitor.java b/modules/core/src/main/java/org/scribble/model/local/LVisitor.java
deleted file mode 100644
index 87a75ed7a..000000000
--- a/modules/core/src/main/java/org/scribble/model/local/LVisitor.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/*
- * Copyright 2009 www.scribble.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.scribble.model.local;
-
-import org.scribble.model.Visitor;
-
-/**
- * This interface represents a visitor which can be used
- * to traverse a model.
- */
-public interface LVisitor extends Visitor {
-
- /**
- * This method indicates the start of a
- * block.
- *
- * @param elem The block
- * @return Whether to process the contents
- */
- public boolean start(LBlock elem);
-
- /**
- * This method indicates the end of a
- * block.
- *
- * @param elem The block
- */
- public void end(LBlock elem);
-
- /**
- * This method indicates the start of a
- * choice.
- *
- * @param elem The choice
- * @return Whether to process the contents
- */
- public boolean start(LChoice elem);
-
- /**
- * This method indicates the end of a
- * choice.
- *
- * @param elem The choice
- */
- public void end(LChoice elem);
-
- /**
- * This method indicates the start of a
- * parallel.
- *
- * @param elem The parallel
- * @return Whether to process the contents
- */
- public boolean start(LParallel elem);
-
- /**
- * This method indicates the end of a
- * parallel.
- *
- * @param elem The parallel
- */
- public void end(LParallel elem);
-
- /**
- * This method indicates the start of a
- * protocol.
- *
- * @param elem The protocol
- * @return Whether to process the contents
- */
- public boolean start(LProtocolDefinition elem);
-
- /**
- * This method indicates the end of a
- * protocol.
- *
- * @param elem The protocol
- */
- public void end(LProtocolDefinition elem);
-
- /**
- * This method indicates the start of a
- * labelled block.
- *
- * @param elem The labelled block
- * @return Whether to process the contents
- */
- public boolean start(LRecursion elem);
-
- /**
- * This method indicates the end of a
- * labelled block.
- *
- * @param elem The labelled block
- */
- public void end(LRecursion elem);
-
- /**
- * This method indicates the start of an
- * interruptible block.
- *
- * @param elem The interruptible
- * @return Whether to process the contents
- */
- public boolean start(LInterruptible elem);
-
- /**
- * This method indicates the end of an
- * interruptible block.
- *
- * @param elem The interruptible
- */
- public void end(LInterruptible elem);
-
- /**
- * This method visits a protocol instance.
- *
- * @param elem The protocol instances
- */
- public void accept(LProtocolInstance elem);
-
- /**
- * This method visits a send component.
- *
- * @param elem The send
- */
- public void accept(LSend elem);
-
- /**
- * This method visits a receive component.
- *
- * @param elem The receive
- */
- public void accept(LReceive elem);
-
- /**
- * This method visits a recursion component.
- *
- * @param elem The recursion
- */
- public void accept(LContinue elem);
-
- /**
- * This method visits a do component.
- *
- * @param elem The do
- */
- public void accept(LDo elem);
-
- /**
- * This method visits a
- * custom activity construct.
- *
- * @param elem The custom activity
- */
- public void accept(LCustomActivity elem);
-
-}
diff --git a/modules/core/src/main/java/org/scribble/resources/AbstractResource.java b/modules/core/src/main/java/org/scribble/resources/AbstractResource.java
deleted file mode 100644
index 2bd5bd307..000000000
--- a/modules/core/src/main/java/org/scribble/resources/AbstractResource.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright 2009-11 www.scribble.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.scribble.resources;
-
-/**
- * This class represents the resource.
- *
- */
-public abstract class AbstractResource implements Resource {
-
- private String _path=null;
-
- /**
- * The constructor.
- *
- * @param path The path to the resource
- */
- public AbstractResource(String path) {
- _path = path;
- }
-
- /**
- * {@inheritDoc}
- */
- public String getPath() {
- return (_path);
- }
-
-}
diff --git a/modules/core/src/main/java/org/scribble/resources/DirectoryResourceLocator.java b/modules/core/src/main/java/org/scribble/resources/DirectoryResourceLocator.java
deleted file mode 100644
index 7f18ad07a..000000000
--- a/modules/core/src/main/java/org/scribble/resources/DirectoryResourceLocator.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Copyright 2009-11 www.scribble.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.scribble.resources;
-
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- * This class provides a directory based resource locator.
- *
- */
-public class DirectoryResourceLocator implements ResourceLocator {
-
- private static final Logger LOG=Logger.getLogger(DirectoryResourceLocator.class.getName());
-
- private String[] _paths=null;
-
- /**
- * This is the constructor for the directory resource
- * locator, initialised with a ':' separated list
- * of root directories.
- *
- * @param paths The ':' separated list of directory paths
- */
- public DirectoryResourceLocator(String paths) {
- _paths = paths.split(":");
- }
-
- /**
- * This method returns the root location containing the supplied
- * resource.
- *
- * @return The resource's root location
- */
- public String getResourceRoot(Resource resource) {
- String ret=null;
-
- for (String path : _paths) {
- String fullPath=path+java.io.File.separator+resource.getPath();
-
- java.io.File f=new java.io.File(fullPath);
-
- if (f.exists()) {
- ret = path;
- break;
- }
- }
-
- return (ret);
- }
-
- /**
- * {@inheritDoc}
- */
- public Resource getResource(String relativePath) {
- Resource ret=null;
-
- // Find module
- for (String path : _paths) {
- String fullPath=path;
-
- if (!fullPath.endsWith(java.io.File.separator)) {
- fullPath += java.io.File.separator;
- }
-
- fullPath += relativePath;
-
- java.io.File f=new java.io.File(fullPath);
-
- if (f.isFile()) {
- try {
- ret = new InputStreamResource(relativePath, new java.io.FileInputStream(f));
-
- break;
- } catch (Exception e) {
- LOG.log(Level.SEVERE, "Failed to create file input stream for '"+f+"'", e);
- }
- }
- }
-
- return (ret);
- }
-
-}
diff --git a/modules/core/src/main/java/org/scribble/resources/InputStreamResource.java b/modules/core/src/main/java/org/scribble/resources/InputStreamResource.java
deleted file mode 100644
index 1a6946a41..000000000
--- a/modules/core/src/main/java/org/scribble/resources/InputStreamResource.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright 2009-11 www.scribble.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.scribble.resources;
-
-/**
- * This class represents the resource.
- *
- */
-public class InputStreamResource extends AbstractResource {
-
- private java.io.InputStream _inputStream=null;
-
- /**
- * The constructor.
- *
- * @param path The optional resource path
- * @param is The input stream
- */
- public InputStreamResource(String path, java.io.InputStream is) {
- super(path);
-
- _inputStream = is;
- }
-
- /**
- * {@inheritDoc}
- */
- public java.io.InputStream getInputStream() {
- return (_inputStream);
- }
-
-}
diff --git a/modules/core/src/main/java/org/scribble/resources/Resource.java b/modules/core/src/main/java/org/scribble/resources/Resource.java
deleted file mode 100644
index e95084869..000000000
--- a/modules/core/src/main/java/org/scribble/resources/Resource.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright 2009-11 www.scribble.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.scribble.resources;
-
-/**
- * This class represents the resource.
- *
- */
-public interface Resource {
-
- /**
- * This method returns the resource path.
- *
- * @return The resource path
- */
- public String getPath();
-
- /**
- * This method returns an input stream containing the
- * resource content.
- *
- * @return The input stream
- */
- public java.io.InputStream getInputStream();
-
-}
diff --git a/modules/core/src/main/java/org/scribble/resources/ResourceLocator.java b/modules/core/src/main/java/org/scribble/resources/ResourceLocator.java
deleted file mode 100644
index 693555bb3..000000000
--- a/modules/core/src/main/java/org/scribble/resources/ResourceLocator.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright 2009-11 www.scribble.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.scribble.resources;
-
-
-/**
- * This interface provides the resource location capability.
- *
- */
-public interface ResourceLocator {
-
- /**
- * This method obtains the resource associated with the
- * supplied path.
- *
- * @param path The resource path
- * @return The resource, or null if not found
- */
- public Resource getResource(String path);
-
-}
diff --git a/modules/core/src/main/resources/org/scribble/protocol/Messages.properties b/modules/core/src/main/resources/org/scribble/protocol/Messages.properties
deleted file mode 100644
index 28c2fcffc..000000000
--- a/modules/core/src/main/resources/org/scribble/protocol/Messages.properties
+++ /dev/null
@@ -1,35 +0,0 @@
-#/*
-# * Copyright 2009-10 Scribble.org
-# *
-# * Licensed under the Apache License, Version 2.0 (the "License");
-# * you may not use this file except in compliance with the License.
-# * You may obtain a copy of the License at
-# *
-# * http://www.apache.org/licenses/LICENSE-2.0
-# *
-# * Unless required by applicable law or agreed to in writing, software
-# * distributed under the License is distributed on an "AS IS" BASIS,
-# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# * See the License for the specific language governing permissions and
-# * limitations under the License.
-# *
-# */
-
-# Export messages
-_EXPORT_FAILED=Export failed due to: {0}
-
-# Validation rule messages
-_AMBIGUOUS_CHOICE=Choice is ambiguous, multiple paths have a common interaction(s) ''{0}''
-_CANNOT_USE_RESERVED_WORD= Name ''{0}'' is a reserved word
-_EXISTING_DECLARATION=Declaration already exists for name ''{0}''
-_NO_ENCLOSING_RECUR=No enclosing block found with label ''{0}''
-_NO_TYPE_IMPORT=Import statement does not exist for type ''{0}''
-_NOT_FOUND_BOUND_DECLARATION=Bound declaration ''{0}'' not found in definition ''{1}''
-_NOT_FOUND_REFERENCE=Definition ''{0}'' of type ''{1}'' could not be found
-_INTERACTION_ROLE=Interaction needs to define a ''{0}'' role
-_NAME_ALREADY_DEFINED=Name ''{0}'' has already been declared
-_RAISED_TYPE_NOT_CAUGHT=Raised type ''{0}'' is not caught within the enclosing definition
-_UNKNOWN_ROLE=Unknown role ''{0}''
-_UNCONNECTED_ROLE=Activity at role ''{0}'' is not connected to preceding activities
-_UNPROJECTABLE_ROLES=Role(s) ''{0}'' cannot be projected
-_UNRELATED_TO_LOCATED_ROLE=Unrelated to located role ''{0}''
diff --git a/modules/core/src/test/java/org/scribble/model/ModuleTest.java b/modules/core/src/test/java/org/scribble/model/ModuleTest.java
deleted file mode 100644
index 343da5c1e..000000000
--- a/modules/core/src/test/java/org/scribble/model/ModuleTest.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright 2009-11 www.scribble.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.scribble.model;
-
-import static org.junit.Assert.*;
-
-import org.junit.Test;
-
-public class ModuleTest {
-
- private static final String SINGLE_PART = "Single";
- private static final String MULTIPLE_PART = "Multiple.Parts";
- private static final String MULTIPLE_LAST_PART = "Parts";
-
- @Test
- public void testLastPartSinglePart() {
- Module module=new Module();
-
- module.setName(SINGLE_PART);
-
- if (!module.getLocalName().equals(SINGLE_PART)) {
- fail("Didn't return single part");
- }
- }
-
- @Test
- public void testLastPartMultipleParts() {
- Module module=new Module();
-
- module.setName(MULTIPLE_PART);
-
- if (!module.getLocalName().equals(MULTIPLE_LAST_PART)) {
- fail("Didn't return multiple last part");
- }
- }
-
-}
diff --git a/modules/monitor/pom.xml b/modules/monitor/pom.xml
deleted file mode 100644
index c8dc471f6..000000000
--- a/modules/monitor/pom.xml
+++ /dev/null
@@ -1,89 +0,0 @@
-
- 4.0.0
- scribble-monitor
- jar
- 0.3.2-SNAPSHOT
- Scribble::Modules::Monitor
-
-
- org.scribble
- modules
- 0.3.2-SNAPSHOT
-
-
-
-
- org.scribble
- scribble-core
- ${project.version}
-
-
- org.codehaus.jackson
- jackson-core-asl
- provided
-
-
- org.codehaus.jackson
- jackson-mapper-asl
- provided
-
-
-
- org.scribble
- scribble-parser
- ${project.version}
- test
-
-
- junit
- junit
- test
-
-
-
-
-
-
- maven-javadoc-plugin
-
-
- generate-javadoc
- package
-
- jar
-
-
-
-
- org.jboss.apiviz.APIviz
-
- org.jboss.apiviz
- apiviz
- 1.2.4.GA
-
- true
- false
-
- -d ${project.build.directory}/javadoc
- -charset UTF-8
- -docencoding UTF-8
- -version
- -author
- -breakiterator
- -windowtitle "${project.name} ${project.version} API Reference"
- -doctitle "${project.name} ${project.version} API Reference"
- -bottom "Copyright © ${project.inceptionYear}-Present ${project.organization.name}. All Rights Reserved."
- -link http://java.sun.com/javase/6/docs/api/
- -sourceclasspath ${project.build.outputDirectory}
-
- UTF-8
- en_US
-
- org.scribble.monitor
-
-
-
-
-
-
diff --git a/modules/monitor/src/main/java/org/scribble/monitor/export/MonitorExporter.java b/modules/monitor/src/main/java/org/scribble/monitor/export/MonitorExporter.java
deleted file mode 100644
index d821f77a9..000000000
--- a/modules/monitor/src/main/java/org/scribble/monitor/export/MonitorExporter.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright 2009-11 www.scribble.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.scribble.monitor.export;
-
-import org.scribble.context.ModuleContext;
-import org.scribble.model.local.LProtocolDefinition;
-import org.scribble.monitor.export.rules.ExportState;
-import org.scribble.monitor.export.rules.NodeExporter;
-import org.scribble.monitor.export.rules.NodeExporterFactory;
-import org.scribble.monitor.model.SessionType;
-
-/**
- * This class exports a local protocol definition to a monitor model.
- *
- */
-public class MonitorExporter {
-
- /**
- * This method returns the session type associated with the supplied protocol.
- *
- * @param context The module context
- * @param protocol The local protocol
- * @return The session type
- */
- public SessionType export(ModuleContext context, LProtocolDefinition protocol) {
- SessionType ret=new SessionType();
-
- NodeExporter ne=NodeExporterFactory.getNodeExporter(protocol.getBlock());
-
- if (ne != null) {
- ne.export(context, new ExportState(), protocol.getBlock(), ret);
- }
-
- return (ret);
- }
-
-}
diff --git a/modules/monitor/src/main/java/org/scribble/monitor/export/rules/ExportState.java b/modules/monitor/src/main/java/org/scribble/monitor/export/rules/ExportState.java
deleted file mode 100644
index 832a4793c..000000000
--- a/modules/monitor/src/main/java/org/scribble/monitor/export/rules/ExportState.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * Copyright 2009-11 www.scribble.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.scribble.monitor.export.rules;
-
-/**
- * This class represents state information associated with the exported
- * protocols.
- *
- */
-public class ExportState {
-
- private java.util.Stack _state=new java.util.Stack();
-
- /**
- * This method pushes state information to the stack.
- */
- public void push() {
- _state.push(new StateInformation());
- }
-
- /**
- * This method pops state information from the stack.
- */
- public void pop() {
- _state.pop();
- }
-
- /**
- * This method registers the label against the index.
- *
- * @param label The label
- * @param index The index
- */
- public void registerLabelIndex(String label, int index) {
- _state.peek().registerLabelIndex(label, index);
- }
-
- /**
- * This method unregisters the label.
- *
- * @param label The label
- */
- public void unregisterLabel(String label) {
- _state.peek().unregisterLabel(label);
- }
-
- /**
- * This method returns the index associated with the
- * supplied label.
- *
- * @param label The label
- * @return The index, or -1 if not found
- */
- public int getLabelIndex(String label) {
- int ret=-1;
-
- for (int i=_state.size()-1; ret == -1 && i >= 0; i--) {
- ret = _state.get(i).getLabelIndex(label);
- }
-
- return (ret);
- }
-
- /**
- * This class represents the state information on the stack.
- *
- */
- public static class StateInformation {
-
- private java.util.Map _labelIndexes=new java.util.HashMap();
-
- /**
- * This method registers the label against the index.
- *
- * @param label The label
- * @param index The index
- */
- public void registerLabelIndex(String label, int index) {
- _labelIndexes.put(label, index);
- }
-
- /**
- * This method unregisters the label.
- *
- * @param label The label
- */
- public void unregisterLabel(String label) {
- _labelIndexes.remove(label);
- }
-
- /**
- * This method returns the index associated with the
- * supplied label.
- *
- * @param label The label
- * @return The index, or -1 if not found
- */
- public int getLabelIndex(String label) {
- if (_labelIndexes.containsKey(label)) {
- return (_labelIndexes.get(label));
- }
- return (-1);
- }
- }
-}
diff --git a/modules/monitor/src/main/java/org/scribble/monitor/export/rules/LBlockNodeExporter.java b/modules/monitor/src/main/java/org/scribble/monitor/export/rules/LBlockNodeExporter.java
deleted file mode 100644
index 6d58b65a6..000000000
--- a/modules/monitor/src/main/java/org/scribble/monitor/export/rules/LBlockNodeExporter.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright 2009-11 www.scribble.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.scribble.monitor.export.rules;
-
-import org.scribble.context.ModuleContext;
-import org.scribble.model.ModelObject;
-import org.scribble.model.local.LActivity;
-import org.scribble.model.local.LBlock;
-import org.scribble.monitor.model.Node;
-import org.scribble.monitor.model.SessionType;
-
-/**
- * This class exports a block into a session type
- * to be monitored.
- *
- */
-public class LBlockNodeExporter implements NodeExporter {
-
- /**
- * {@inheritDoc}
- */
- public void export(ModuleContext context, ExportState state, ModelObject mobj, SessionType type) {
- LBlock block=(LBlock)mobj;
- Node lastNode=null;
-
- state.push();
-
- for (LActivity act : block.getContents()) {
- NodeExporter ne=NodeExporterFactory.getNodeExporter(act);
- int size=type.getNodes().size();
-
- if (ne != null) {
- ne.export(context, state, act, type);
-
- if (lastNode != null) {
- lastNode.setNext(size);
- }
-
- lastNode = type.getNode(size);
- }
- }
-
- state.pop();
- }
-
-}
diff --git a/modules/monitor/src/main/java/org/scribble/monitor/export/rules/LChoiceNodeExporter.java b/modules/monitor/src/main/java/org/scribble/monitor/export/rules/LChoiceNodeExporter.java
deleted file mode 100644
index db174c49b..000000000
--- a/modules/monitor/src/main/java/org/scribble/monitor/export/rules/LChoiceNodeExporter.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright 2009-11 www.scribble.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.scribble.monitor.export.rules;
-
-import org.scribble.context.ModuleContext;
-import org.scribble.model.ModelObject;
-import org.scribble.model.local.LBlock;
-import org.scribble.model.local.LChoice;
-import org.scribble.monitor.model.Choice;
-import org.scribble.monitor.model.SessionType;
-
-/**
- * This class exports a choice into a session type
- * to be monitored.
- *
- */
-public class LChoiceNodeExporter implements NodeExporter {
-
- /**
- * {@inheritDoc}
- */
- public void export(ModuleContext context, ExportState state, ModelObject mobj, SessionType type) {
- LChoice choice=(LChoice)mobj;
-
- Choice choiceNode=new Choice();
-
- type.getNodes().add(choiceNode);
-
- for (LBlock block : choice.getPaths()) {
- choiceNode.getPathIndexes().add(type.getNodes().size());
-
- NodeExporter ne=NodeExporterFactory.getNodeExporter(block);
-
- ne.export(context, state, block, type);
- }
- }
-
-}
diff --git a/modules/monitor/src/main/java/org/scribble/monitor/export/rules/LContinueNodeExporter.java b/modules/monitor/src/main/java/org/scribble/monitor/export/rules/LContinueNodeExporter.java
deleted file mode 100644
index 13ea59bbe..000000000
--- a/modules/monitor/src/main/java/org/scribble/monitor/export/rules/LContinueNodeExporter.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright 2009-11 www.scribble.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.scribble.monitor.export.rules;
-
-import org.scribble.context.ModuleContext;
-import org.scribble.model.ModelObject;
-import org.scribble.model.local.LContinue;
-import org.scribble.monitor.model.Continue;
-import org.scribble.monitor.model.SessionType;
-
-/**
- * This class exports a receive into a session type
- * to be monitored.
- *
- */
-public class LContinueNodeExporter implements NodeExporter {
-
- /**
- * {@inheritDoc}
- */
- public void export(ModuleContext context, ExportState state, ModelObject mobj, SessionType type) {
- LContinue elem=(LContinue)mobj;
-
- Continue continueNode=new Continue();
- continueNode.setNext(state.getLabelIndex(elem.getLabel()));
-
- type.getNodes().add(continueNode);
- }
-
-}
diff --git a/modules/monitor/src/main/java/org/scribble/monitor/export/rules/LDoNodeExporter.java b/modules/monitor/src/main/java/org/scribble/monitor/export/rules/LDoNodeExporter.java
deleted file mode 100644
index ff66d3b50..000000000
--- a/modules/monitor/src/main/java/org/scribble/monitor/export/rules/LDoNodeExporter.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright 2009-11 www.scribble.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.scribble.monitor.export.rules;
-
-import org.scribble.context.ModuleContext;
-import org.scribble.model.ModelObject;
-import org.scribble.model.local.LBlock;
-import org.scribble.model.local.LDo;
-import org.scribble.model.local.LProtocolDefinition;
-import org.scribble.monitor.model.Do;
-import org.scribble.monitor.model.SessionType;
-
-/**
- * This class exports a Do into a session type
- * to be monitored.
- *
- */
-public class LDoNodeExporter implements NodeExporter {
-
- /**
- * {@inheritDoc}
- */
- public void export(ModuleContext context, ExportState state, ModelObject mobj, SessionType type) {
- LDo elem=(LDo)mobj;
-
- Do doNode=new Do();
-
- type.getNodes().add(doNode);
-
- ModelObject mo=context.getMember(elem.getProtocol());
-
- // TODO: Need to handle cyclic dependencies - store protocol definition when
- // first used, against the index
-
- // TODO: Handle different instantiations of a protocol if parameterised or
- // using protocol instance
-
- if (mo instanceof LProtocolDefinition) {
- doNode.setProtocolIndex(type.getNodes().size());
-
- LBlock block=((LProtocolDefinition)mo).getBlock();
-
- NodeExporter ne=NodeExporterFactory.getNodeExporter(block);
-
- ne.export(context, state, block, type);
- }
- }
-
-}
diff --git a/modules/monitor/src/main/java/org/scribble/monitor/export/rules/LInterruptibleNodeExporter.java b/modules/monitor/src/main/java/org/scribble/monitor/export/rules/LInterruptibleNodeExporter.java
deleted file mode 100644
index f5defe093..000000000
--- a/modules/monitor/src/main/java/org/scribble/monitor/export/rules/LInterruptibleNodeExporter.java
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- * Copyright 2009-11 www.scribble.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.scribble.monitor.export.rules;
-
-import org.scribble.context.ModuleContext;
-import org.scribble.model.Message;
-import org.scribble.model.ModelObject;
-import org.scribble.model.PayloadElement;
-import org.scribble.model.PayloadTypeDecl;
-import org.scribble.model.local.LBlock;
-import org.scribble.model.local.LInterruptible;
-import org.scribble.monitor.model.Choice;
-import org.scribble.monitor.model.Interruptible;
-import org.scribble.monitor.model.Receive;
-import org.scribble.monitor.model.Send;
-import org.scribble.monitor.model.SessionType;
-import org.scribble.monitor.model.Parameter;
-
-/**
- * This class exports an Interruptible into a session type
- * to be monitored.
- *
- */
-public class LInterruptibleNodeExporter implements NodeExporter {
-
- /**
- * {@inheritDoc}
- */
- public void export(ModuleContext context, ExportState state, ModelObject mobj, SessionType type) {
- LInterruptible elem=(LInterruptible)mobj;
-
- Interruptible interruptibleNode=new Interruptible();
-
- type.getNodes().add(interruptibleNode);
-
- interruptibleNode.setBlockIndex(type.getNodes().size());
-
- LBlock block=elem.getBlock();
-
- NodeExporter ne=NodeExporterFactory.getNodeExporter(block);
-
- ne.export(context, state, block, type);
-
- // Export throws
- if (elem.getThrows() != null && elem.getThrows().getMessages().size() > 0) {
-
- interruptibleNode.setThrows(type.getNodes().size());
-
- if (elem.getThrows().getMessages().size() > 1) {
- Choice choiceNode=new Choice();
- type.getNodes().add(choiceNode);
-
- for (Message mesg : elem.getThrows().getMessages()) {
- choiceNode.getPathIndexes().add(type.getNodes().size());
-
- exportThrow(context, state, elem, type, mesg);
- }
- } else {
- exportThrow(context, state, elem, type, elem.getThrows().getMessages().get(0));
- }
- }
-
- // Export catches
- if (elem.getCatches().size() > 0) {
-
- interruptibleNode.setCatches(type.getNodes().size());
-
- if (elem.getCatches().size() > 1 || elem.getCatches().get(0).getMessages().size() > 1) {
- Choice choiceNode=new Choice();
- type.getNodes().add(choiceNode);
-
- for (LInterruptible.Catch c : elem.getCatches()) {
-
- for (Message mesg : c.getMessages()) {
- choiceNode.getPathIndexes().add(type.getNodes().size());
-
- exportCatch(context, state, c, type, mesg);
- }
- }
- } else {
- exportCatch(context, state, elem.getCatches().get(0),
- type, elem.getCatches().get(0).getMessages().get(0));
- }
- }
- }
-
- protected void exportThrow(ModuleContext context, ExportState state, LInterruptible elem,
- SessionType type, Message mesg) {
- Send sendNode=new Send();
- sendNode.setOperator(mesg.getMessageSignature().getOperator());
-
- for (PayloadElement pe : mesg.getMessageSignature().getPayloadElements()) {
-
- // TODO: Need to provide utility functions for extracting the payload type
- // and make sure the context methods are as clear as possible
-
- PayloadTypeDecl ptype=elem.getModule().getTypeDeclaration(pe.getName());
-
- if (ptype == null) {
- ModelObject alias=context.getMember(pe.getName());
-
- if (alias instanceof PayloadTypeDecl) {
- ptype = (PayloadTypeDecl)alias;
- }
- }
-
- if (ptype != null) {
- sendNode.getParameters().add(new Parameter(ptype.getType()));
- }
- }
-
- // TODO: Ned to cater for list of 'to' roles
- sendNode.setToRole(elem.getThrows().getToRoles().get(0).getName());
-
- type.getNodes().add(sendNode);
- }
-
- protected void exportCatch(ModuleContext context, ExportState state, LInterruptible.Catch elem,
- SessionType type, Message mesg) {
- // TODO: Handle parameter
-
- Receive recvNode=new Receive();
- recvNode.setOperator(mesg.getMessageSignature().getOperator());
-
- for (PayloadElement pe : mesg.getMessageSignature().getPayloadElements()) {
- PayloadTypeDecl ptype=elem.getModule().getTypeDeclaration(pe.getName());
-
- if (ptype == null) {
- ModelObject alias=context.getMember(pe.getName());
-
- if (alias instanceof PayloadTypeDecl) {
- ptype = (PayloadTypeDecl)alias;
- }
- }
-
- if (ptype != null) {
- recvNode.getParameters().add(new Parameter(ptype.getType()));
- }
- }
-
- // TODO: Ned to cater for list of 'to' roles
- recvNode.setFromRole(elem.getRole().getName());
-
- type.getNodes().add(recvNode);
- }
-}
diff --git a/modules/monitor/src/main/java/org/scribble/monitor/export/rules/LParallelNodeExporter.java b/modules/monitor/src/main/java/org/scribble/monitor/export/rules/LParallelNodeExporter.java
deleted file mode 100644
index 64426fb98..000000000
--- a/modules/monitor/src/main/java/org/scribble/monitor/export/rules/LParallelNodeExporter.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright 2009-11 www.scribble.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.scribble.monitor.export.rules;
-
-import org.scribble.context.ModuleContext;
-import org.scribble.model.ModelObject;
-import org.scribble.model.local.LBlock;
-import org.scribble.model.local.LParallel;
-import org.scribble.monitor.model.Parallel;
-import org.scribble.monitor.model.SessionType;
-
-/**
- * This class exports a parallel into a session type
- * to be monitored.
- *
- */
-public class LParallelNodeExporter implements NodeExporter {
-
- /**
- * {@inheritDoc}
- */
- public void export(ModuleContext context, ExportState state, ModelObject mobj, SessionType type) {
- LParallel parallel=(LParallel)mobj;
-
- Parallel parallelNode=new Parallel();
-
- type.getNodes().add(parallelNode);
-
- for (LBlock block : parallel.getPaths()) {
- int newIndex=type.getNodes().size();
-
- NodeExporter ne=NodeExporterFactory.getNodeExporter(block);
-
- ne.export(context, state, block, type);
-
- // Check if items have been exported, then add path index
- if (type.getNodes().size() != newIndex) {
- parallelNode.getPathIndexes().add(newIndex);
- }
- }
-
- // If no paths have been exported, then remove parallel node
- if (parallelNode.getPathIndexes().size() == 0) {
- type.getNodes().remove(parallelNode);
- }
- }
-
-}
diff --git a/modules/monitor/src/main/java/org/scribble/monitor/export/rules/LReceiveNodeExporter.java b/modules/monitor/src/main/java/org/scribble/monitor/export/rules/LReceiveNodeExporter.java
deleted file mode 100644
index e1ae51eca..000000000
--- a/modules/monitor/src/main/java/org/scribble/monitor/export/rules/LReceiveNodeExporter.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright 2009-11 www.scribble.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.scribble.monitor.export.rules;
-
-import org.scribble.context.ModuleContext;
-import org.scribble.model.ModelObject;
-import org.scribble.model.PayloadElement;
-import org.scribble.model.PayloadTypeDecl;
-import org.scribble.model.local.LReceive;
-import org.scribble.monitor.model.Receive;
-import org.scribble.monitor.model.SessionType;
-import org.scribble.monitor.model.Parameter;
-
-/**
- * This class exports a receive into a session type
- * to be monitored.
- *
- */
-public class LReceiveNodeExporter implements NodeExporter {
-
- /**
- * {@inheritDoc}
- */
- public void export(ModuleContext context, ExportState state, ModelObject mobj, SessionType type) {
- LReceive recv=(LReceive)mobj;
-
- // TODO: Handle parameter
-
- Receive recvNode=new Receive();
- recvNode.setOperator(recv.getMessage().getMessageSignature().getOperator());
-
- for (PayloadElement pe : recv.getMessage().getMessageSignature().getPayloadElements()) {
- PayloadTypeDecl ptype=recv.getModule().getTypeDeclaration(pe.getName());
-
- if (ptype == null) {
- ModelObject alias=context.getMember(pe.getName());
-
- if (alias instanceof PayloadTypeDecl) {
- ptype = (PayloadTypeDecl)alias;
- }
- }
-
- if (ptype != null) {
- recvNode.getParameters().add(new Parameter(ptype.getType()));
- }
- }
-
- // TODO: Ned to cater for list of 'to' roles
- recvNode.setFromRole(recv.getFromRole().getName());
-
- type.getNodes().add(recvNode);
- }
-
-}
diff --git a/modules/monitor/src/main/java/org/scribble/monitor/export/rules/LRecursionNodeExporter.java b/modules/monitor/src/main/java/org/scribble/monitor/export/rules/LRecursionNodeExporter.java
deleted file mode 100644
index f9038558c..000000000
--- a/modules/monitor/src/main/java/org/scribble/monitor/export/rules/LRecursionNodeExporter.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright 2009-11 www.scribble.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.scribble.monitor.export.rules;
-
-import org.scribble.context.ModuleContext;
-import org.scribble.model.ModelObject;
-import org.scribble.model.local.LBlock;
-import org.scribble.model.local.LRecursion;
-import org.scribble.monitor.model.Recursion;
-import org.scribble.monitor.model.SessionType;
-
-/**
- * This class exports a Recursion into a session type
- * to be monitored.
- *
- */
-public class LRecursionNodeExporter implements NodeExporter {
-
- /**
- * {@inheritDoc}
- */
- public void export(ModuleContext context, ExportState state, ModelObject mobj, SessionType type) {
- LRecursion elem=(LRecursion)mobj;
-
- Recursion recursionNode=new Recursion();
-
- type.getNodes().add(recursionNode);
-
- recursionNode.setBlockIndex(type.getNodes().size());
-
- state.registerLabelIndex(elem.getLabel(), type.getNodes().size());
-
- LBlock block=elem.getBlock();
-
- NodeExporter ne=NodeExporterFactory.getNodeExporter(block);
-
- ne.export(context, state, block, type);
-
- state.unregisterLabel(elem.getLabel());
- }
-
-}
diff --git a/modules/monitor/src/main/java/org/scribble/monitor/export/rules/LSendNodeExporter.java b/modules/monitor/src/main/java/org/scribble/monitor/export/rules/LSendNodeExporter.java
deleted file mode 100644
index 5d38e0a51..000000000
--- a/modules/monitor/src/main/java/org/scribble/monitor/export/rules/LSendNodeExporter.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright 2009-11 www.scribble.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.scribble.monitor.export.rules;
-
-import org.scribble.context.ModuleContext;
-import org.scribble.model.ModelObject;
-import org.scribble.model.PayloadElement;
-import org.scribble.model.PayloadTypeDecl;
-import org.scribble.model.local.LSend;
-import org.scribble.monitor.model.Send;
-import org.scribble.monitor.model.SessionType;
-import org.scribble.monitor.model.Parameter;
-
-/**
- * This class exports a send into a session type
- * to be monitored.
- *
- */
-public class LSendNodeExporter implements NodeExporter {
-
- /**
- * {@inheritDoc}
- */
- public void export(ModuleContext context, ExportState state, ModelObject mobj, SessionType type) {
- LSend send=(LSend)mobj;
-
- // TODO: Handle parameter
-
- Send sendNode=new Send();
- sendNode.setOperator(send.getMessage().getMessageSignature().getOperator());
-
- for (PayloadElement pe : send.getMessage().getMessageSignature().getPayloadElements()) {
-
- // TODO: Need to provide utility functions for extracting the payload type
- // and make sure the context methods are as clear as possible
-
- PayloadTypeDecl ptype=send.getModule().getTypeDeclaration(pe.getName());
-
- if (ptype == null) {
- ModelObject alias=context.getMember(pe.getName());
-
- if (alias instanceof PayloadTypeDecl) {
- ptype = (PayloadTypeDecl)alias;
- }
- }
-
- if (ptype != null) {
- sendNode.getParameters().add(new Parameter(ptype.getType()));
- }
- }
-
- // TODO: Need to cater for list of 'to' roles
- sendNode.setToRole(send.getToRoles().get(0).getName());
-
- type.getNodes().add(sendNode);
- }
-
-}
diff --git a/modules/monitor/src/main/java/org/scribble/monitor/export/rules/NodeExporter.java b/modules/monitor/src/main/java/org/scribble/monitor/export/rules/NodeExporter.java
deleted file mode 100644
index d1a90af89..000000000
--- a/modules/monitor/src/main/java/org/scribble/monitor/export/rules/NodeExporter.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright 2009-11 www.scribble.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.scribble.monitor.export.rules;
-
-import org.scribble.context.ModuleContext;
-import org.scribble.model.ModelObject;
-import org.scribble.monitor.model.SessionType;
-
-/**
- * This class exports local protocol objects into a session type
- * to be monitored.
- *
- */
-public interface NodeExporter {
-
- /**
- * This method exports the model object to the session type.
- *
- * @param context The module context
- * @param state The export state
- * @param mobj The local protocol object
- * @param type The session type
- */
- public void export(ModuleContext context, ExportState state, ModelObject mobj, SessionType type);
-
-}
diff --git a/modules/monitor/src/main/java/org/scribble/monitor/export/rules/NodeExporterFactory.java b/modules/monitor/src/main/java/org/scribble/monitor/export/rules/NodeExporterFactory.java
deleted file mode 100644
index e3da9a8d2..000000000
--- a/modules/monitor/src/main/java/org/scribble/monitor/export/rules/NodeExporterFactory.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright 2009-11 www.scribble.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.scribble.monitor.export.rules;
-
-import org.scribble.model.ModelObject;
-import org.scribble.model.local.LBlock;
-import org.scribble.model.local.LChoice;
-import org.scribble.model.local.LContinue;
-import org.scribble.model.local.LDo;
-import org.scribble.model.local.LInterruptible;
-import org.scribble.model.local.LParallel;
-import org.scribble.model.local.LReceive;
-import org.scribble.model.local.LRecursion;
-import org.scribble.model.local.LSend;
-
-/**
- * This class provides a factory for node exporters related to
- * local protocol objects.
- *
- */
-public class NodeExporterFactory {
-
- private static java.util.Map, NodeExporter> _nodeExporters=
- new java.util.HashMap, NodeExporter>();
-
- static {
- _nodeExporters.put(LBlock.class, new LBlockNodeExporter());
- _nodeExporters.put(LChoice.class, new LChoiceNodeExporter());
- _nodeExporters.put(LContinue.class, new LContinueNodeExporter());
- _nodeExporters.put(LDo.class, new LDoNodeExporter());
- _nodeExporters.put(LInterruptible.class, new LInterruptibleNodeExporter());
- _nodeExporters.put(LParallel.class, new LParallelNodeExporter());
- _nodeExporters.put(LReceive.class, new LReceiveNodeExporter());
- _nodeExporters.put(LRecursion.class, new LRecursionNodeExporter());
- _nodeExporters.put(LSend.class, new LSendNodeExporter());
- }
-
- /**
- * This method returns a node exporter associated with the
- * supplied model object.
- *
- * @param mobj The model object
- * @return The node exporter, or null if not found
- */
- public static NodeExporter getNodeExporter(ModelObject mobj) {
- return (_nodeExporters.get(mobj.getClass()));
- }
-
-}
diff --git a/modules/monitor/src/main/java/org/scribble/monitor/model/Annotation.java b/modules/monitor/src/main/java/org/scribble/monitor/model/Annotation.java
deleted file mode 100644
index c8baaa070..000000000
--- a/modules/monitor/src/main/java/org/scribble/monitor/model/Annotation.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * Copyright 2009-14 www.scribble.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.scribble.monitor.model;
-
-/**
- * This class represents an annotation.
- *
- */
-public class Annotation {
-
- private String _name;
- private java.util.List _properties=new java.util.ArrayList();
-
- /**
- * This method returns the name.
- *
- * @return The name
- */
- public String getName() {
- return (_name);
- }
-
- /**
- * This method sets the name.
- *
- * @param name The name
- */
- public void setName(String name) {
- _name = name;
- }
-
- /**
- * This method returns the properties.
- *
- * @return The properties
- */
- public java.util.List getProperties() {
- return (_properties);
- }
-
- /**
- * This method sets the properties.
- *
- * @param properties The properties
- */
- public void setProperties(java.util.List properties) {
- _properties = properties;
- }
-
- /**
- * This method adds a property to the annotation.
- *
- * @param name The name
- * @param value The value
- */
- public void addProperty(String name, String value) {
- _properties.add(new NameValuePair(name, value));
- }
-
- /**
- * This method returns the value associated with the specified
- * name.
- *
- * @param name The name
- * @return The value, or null if not found
- */
- public String getValue(String name) {
- for (NameValuePair nvp : _properties) {
- if (nvp.getName().equals(name)) {
- return (nvp.getValue());
- }
- }
-
- return (null);
- }
-
- /**
- * This class represents a name/value pair.
- *
- */
- public static class NameValuePair {
-
- private String _name;
- private String _value;
-
- /**
- * This is the default constructor.
- */
- public NameValuePair() {
- }
-
- /**
- * This constructor initializes the name and value.
- *
- * @param name The name
- * @param value The value
- */
- public NameValuePair(String name, String value) {
- _name = name;
- _value = value;
- }
-
- /**
- * This method returns the name.
- *
- * @return The name
- */
- public String getName() {
- return (_name);
- }
-
- /**
- * This method sets the name.
- *
- * @param name The name
- */
- public void setName(String name) {
- _name = name;
- }
-
- /**
- * This method returns the value.
- *
- * @return The value
- */
- public String getValue() {
- return (_value);
- }
-
- /**
- * This method sets the value.
- *
- * @param value The value
- */
- public void setValue(String value) {
- _value = value;
- }
- }
-}
diff --git a/modules/monitor/src/main/java/org/scribble/monitor/model/Choice.java b/modules/monitor/src/main/java/org/scribble/monitor/model/Choice.java
deleted file mode 100644
index fe1e1a1e4..000000000
--- a/modules/monitor/src/main/java/org/scribble/monitor/model/Choice.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Copyright 2009-11 www.scribble.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.scribble.monitor.model;
-
-import org.scribble.monitor.runtime.MonitorContext;
-import org.scribble.monitor.runtime.SessionScope;
-
-/**
- * This class represents a Choice action.
- *
- */
-public class Choice extends Node {
-
- private java.util.List _pathIndexes=new java.util.ArrayList();
-
- /**
- * {@inheritDoc}
- */
- protected void init(MonitorContext context) {
- }
-
- /**
- * This method returns the choice path indexes.
- *
- * @return The choice path indexes
- */
- public java.util.List getPathIndexes() {
- return (_pathIndexes);
- }
-
- /**
- * This method sets the choice path indexes.
- *
- * @param indexes The choice path indexes
- */
- public void getPathIndexes(java.util.List indexes) {
- _pathIndexes = indexes;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean evaluate(SessionType type, int index, SessionScope scope) {
-
- java.util.List subs=new java.util.ArrayList();
-
- // Create a sub-scope per path
- for (int i=0; i < _pathIndexes.size(); i++) {
- SessionScope sub=new SessionScope();
-
- if (Node._nameSessions) {
- sub.setName("Choice/"+index+"/"+i);
- }
-
- int subIndex=_pathIndexes.get(i);
-
- Node node=type.getNode(subIndex);
-
- if (node.evaluate(type, subIndex, sub)) {
- sub.setCompletionIndex(getNext());
- scope.addSubScope(sub);
- return (false);
- } else {
- subs.add(sub);
- }
- }
-
- // Need to add sub scopes to mutually exclusive scope
- SessionScope choiceScope=new SessionScope();
-
- if (Node._nameSessions) {
- choiceScope.setName("Choice/"+index);
- }
-
- choiceScope.setCompletionIndex(getNext());
- choiceScope.setMutuallyExclusive(true);
- choiceScope.setSubScopes(subs);
-
- scope.addSubScope(choiceScope);
-
- return (false);
- }
-
-}
diff --git a/modules/monitor/src/main/java/org/scribble/monitor/model/Continue.java b/modules/monitor/src/main/java/org/scribble/monitor/model/Continue.java
deleted file mode 100644
index e589438b3..000000000
--- a/modules/monitor/src/main/java/org/scribble/monitor/model/Continue.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright 2009-11 www.scribble.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.scribble.monitor.model;
-
-import org.scribble.monitor.runtime.MonitorContext;
-import org.scribble.monitor.runtime.SessionScope;
-
-/**
- * This class represents a Continue action.
- *
- */
-public class Continue extends Node {
-
- /**
- * {@inheritDoc}
- */
- protected void init(MonitorContext context) {
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean evaluate(SessionType type, int index, SessionScope scope) {
-
- handled(type, scope, -1);
-
- return (false);
- }
-
-}
diff --git a/modules/monitor/src/main/java/org/scribble/monitor/model/Do.java b/modules/monitor/src/main/java/org/scribble/monitor/model/Do.java
deleted file mode 100644
index 19de0e73a..000000000
--- a/modules/monitor/src/main/java/org/scribble/monitor/model/Do.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright 2009-11 www.scribble.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.scribble.monitor.model;
-
-import org.scribble.monitor.runtime.MonitorContext;
-import org.scribble.monitor.runtime.SessionScope;
-
-/**
- * This class represents a Choice action.
- *
- */
-public class Do extends Node {
-
- private int _protocolIndex;
-
- /**
- * {@inheritDoc}
- */
- protected void init(MonitorContext context) {
- }
-
- /**
- * This method returns the protocol index.
- *
- * @return The protocol index
- */
- public int getProtocolIndex() {
- return (_protocolIndex);
- }
-
- /**
- * This method sets the protocol index.
- *
- * @param protocolIndex The protocol index
- */
- public void setProtocolIndex(int protocolIndex) {
- _protocolIndex = protocolIndex;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean evaluate(SessionType type, int index, SessionScope scope) {
- SessionScope subScope=new SessionScope();
-
- if (Node._nameSessions) {
- subScope.setName("Do/"+index);
- }
-
- subScope.setCompletionIndex(getNext());
-
- Node protocolNode=type.getNode(getProtocolIndex());
- protocolNode.evaluate(type, getProtocolIndex(), subScope);
-
- scope.addSubScope(subScope);
-
- return (false);
- }
-
-}
diff --git a/modules/monitor/src/main/java/org/scribble/monitor/model/Interruptible.java b/modules/monitor/src/main/java/org/scribble/monitor/model/Interruptible.java
deleted file mode 100644
index 0ab37de7e..000000000
--- a/modules/monitor/src/main/java/org/scribble/monitor/model/Interruptible.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * Copyright 2009-11 www.scribble.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.scribble.monitor.model;
-
-import org.scribble.monitor.runtime.MonitorContext;
-import org.scribble.monitor.runtime.SessionScope;
-
-/**
- * This class represents an Interruptible action.
- *
- */
-public class Interruptible extends Node {
-
- /**
- * {@inheritDoc}
- */
- protected void init(MonitorContext context) {
- }
-
- private int _blockIndex;
- private int _catches=-1;
- private int _throws=-1;
-
- /**
- * This method returns the block index.
- *
- * @return The block index
- */
- public int getBlockIndex() {
- return (_blockIndex);
- }
-
- /**
- * This method sets the block index.
- *
- * @param blockIndex The block index
- */
- public void setBlockIndex(int blockIndex) {
- _blockIndex = blockIndex;
- }
-
- /**
- * This method returns the node index associated with catch
- * specifications.
- *
- * @return The catch node index
- */
- public int getCatches() {
- return (_catches);
- }
-
- /**
- * This method sets the node index associated with catch
- * specifications.
- *
- * @param index The catch node index
- */
- public void setCatches(int index) {
- _catches = index;
- }
-
- /**
- * This method returns the node index associated with throw
- * specifications.
- *
- * @return The throw node index
- */
- public int getThrows() {
- return (_throws);
- }
-
- /**
- * This method sets the node index associated with throw
- * specifications.
- *
- * @param index The throw node index
- */
- public void setThrows(int index) {
- _throws = index;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean evaluate(SessionType type, int index, SessionScope scope) {
- SessionScope subScope=new SessionScope();
-
- if (Node._nameSessions) {
- subScope.setName("Interruptible/"+index);
- }
-
- subScope.setCompletionIndex(getNext());
-
- subScope.setCatches(_catches);
- subScope.setThrows(_throws);
-
- Node blockNode=type.getNode(getBlockIndex());
- blockNode.evaluate(type, getBlockIndex(), subScope);
-
- scope.addSubScope(subScope);
-
- return (false);
- }
-
-}
diff --git a/modules/monitor/src/main/java/org/scribble/monitor/model/MessageNode.java b/modules/monitor/src/main/java/org/scribble/monitor/model/MessageNode.java
deleted file mode 100644
index fee3e55a7..000000000
--- a/modules/monitor/src/main/java/org/scribble/monitor/model/MessageNode.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Copyright 2009-11 www.scribble.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.scribble.monitor.model;
-
-import org.scribble.monitor.runtime.MessageComparator;
-import org.scribble.monitor.runtime.MonitorContext;
-import org.scribble.monitor.runtime.SessionScope;
-
-/**
- * This class represents the base class for message related
- * nodes.
- *
- */
-public abstract class MessageNode extends Node {
-
- private String _operator;
- private java.util.List _types=new java.util.ArrayList();
-
- private MessageComparator _comparator;
-
- /**
- * {@inheritDoc}
- */
- protected void init(MonitorContext context) {
- _comparator = context.getMessageComparator(this);
- }
-
- /**
- * This method returns the operator.
- *
- * @return The operator
- */
- public String getOperator() {
- return (_operator);
- }
-
- /**
- * This method sets the operator.
- *
- * @param operator The operator
- */
- public void setOperator(String operator) {
- _operator = operator;
- }
-
- /**
- * This method returns the types.
- *
- * @return The types
- */
- public java.util.List getParameters() {
- return (_types);
- }
-
- /**
- * This method sets the types.
- *
- * @param types The types
- */
- public void setTypes(java.util.List types) {
- _types = types;
- }
-
- /**
- * This method checks the message against the message node.
- *
- * @param type The session type
- * @param scope The scope
- * @param scopeIndex The scope index
- * @param message The message
- * @return Whether the message is valid
- */
- protected boolean checkMessage(SessionType type,
- SessionScope scope, int scopeIndex, Object message) {
- if (_comparator.isMatch(message)) {
- handled(type, scope, scopeIndex);
- return (true);
- }
-
- return (false);
- }
-}
diff --git a/modules/monitor/src/main/java/org/scribble/monitor/model/Node.java b/modules/monitor/src/main/java/org/scribble/monitor/model/Node.java
deleted file mode 100644
index ca163c2c9..000000000
--- a/modules/monitor/src/main/java/org/scribble/monitor/model/Node.java
+++ /dev/null
@@ -1,186 +0,0 @@
-/*
- * Copyright 2009-11 www.scribble.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.scribble.monitor.model;
-
-import org.codehaus.jackson.annotate.JsonSubTypes;
-import org.codehaus.jackson.annotate.JsonSubTypes.Type;
-import org.codehaus.jackson.annotate.JsonTypeInfo;
-import org.scribble.monitor.runtime.MonitorContext;
-import org.scribble.monitor.runtime.SessionScope;
-
-/**
- * This class represents the base class for all session nodes.
- *
- */
-@JsonTypeInfo(use=JsonTypeInfo.Id.NAME, include=JsonTypeInfo.As.PROPERTY, property="type")
-@JsonSubTypes({@Type(value=Choice.class),
- @Type(value=Continue.class),
- @Type(value=Do.class),
- @Type(value=Interruptible.class),
- @Type(value=MessageNode.class),
- @Type(value=Parallel.class),
- @Type(value=Receive.class),
- @Type(value=Recursion.class),
- @Type(value=Send.class) })
-public abstract class Node {
-
- protected static boolean _nameSessions=false;
-
- private int _next=-1;
-
- private java.util.List _annotations=new java.util.ArrayList();
-
- /**
- * This method initializes the monitoring node.
- *
- * @param context The monitor context
- */
- protected abstract void init(MonitorContext context);
-
- /**
- * This method sets whether to name the
- * sessions.
- *
- * @param name Whether to name the sessions
- */
- public static void setNameNodes(boolean name) {
- _nameSessions = name;
- }
-
- /**
- * This method returns the next index.
- *
- * @return The next index, or -1 if not defined
- */
- public int getNext() {
- return (_next);
- }
-
- /**
- * This method sets the next index.
- *
- * @param next The next index, or -1 if not defined
- */
- public void setNext(int next) {
- _next = next;
- }
-
- /**
- * This method returns the annotations.
- *
- * @return The annotations
- */
- public java.util.List getAnnotations() {
- return (_annotations);
- }
-
- /**
- * This method sets the annotations.
- *
- * @param annotations The annotations
- */
- public void setAnnotations(java.util.List annotations) {
- _annotations = annotations;
- }
-
- /**
- * This method returns the annotation with the specified name.
- *
- * @param name The name
- * @return The annotation, or null if not found
- */
- public Annotation getAnnotation(String name) {
- for (int i=0; i < _annotations.size(); i++) {
- if (_annotations.get(i).getName().equals(name)) {
- return (_annotations.get(i));
- }
- }
-
- return (null);
- }
-
- /**
- * This method checks whether the node can be evaluated without external trigger. If
- * not, then the index should be added to the scope for later processing.
- *
- * @param type The session type
- * @param index The index
- * @param scope The session scope
- * @return Whether the node was evaluated
- */
- public boolean evaluate(SessionType type, int index, SessionScope scope) {
-
- // Associate the node index with the scope, as it cannot be evaluated
- scope.addNodeIndex(index);
-
- return (false);
- }
-
- /**
- * This method unschedules the current node, if part of the session scope, and
- * if a next index is identified, this will be evaluated.
- *
- * @param type The session type
- * @param scope The scope
- * @param scopeIndex The index in the scope, or -1 if not contained in the scope
- */
- protected void handled(SessionType type, SessionScope scope, int scopeIndex) {
-
- if (scopeIndex != -1) {
- // Remove index from scope
- scope.getNodeIndexes().remove(scopeIndex);
- }
-
- if (getNext() != -1) {
- // Check if node can be directly evaluated
- Node nextNode=type.getNode(getNext());
-
- nextNode.evaluate(type, getNext(), scope);
- }
- }
-
- /**
- * This method checks whether the sent message is valid.
- *
- * @param type The session type
- * @param scope The session scope
- * @param scopeIndex The index within the scope, or -1 if not currently part of scope
- * @param message The message
- * @param toRole The optional 'to' role
- * @return Whether the sent message was expected
- */
- public boolean sent(SessionType type,
- SessionScope scope, int scopeIndex, Object message, String toRole) {
- return (false);
- }
-
- /**
- * This method checks whether the sent message is valid.
- *
- * @param type The session type
- * @param scope The session scope
- * @param scopeIndex The index within the scope, or -1 if not currently part of scope
- * @param message The message
- * @param fromRole The optional 'from' role
- * @return Whether the sent message was expected
- */
- public boolean received(SessionType type,
- SessionScope scope, int scopeIndex, Object message, String fromRole) {
- return (false);
- }
-
-}
diff --git a/modules/monitor/src/main/java/org/scribble/monitor/model/Parallel.java b/modules/monitor/src/main/java/org/scribble/monitor/model/Parallel.java
deleted file mode 100644
index f52047052..000000000
--- a/modules/monitor/src/main/java/org/scribble/monitor/model/Parallel.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright 2009-11 www.scribble.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.scribble.monitor.model;
-
-import org.scribble.monitor.runtime.MonitorContext;
-import org.scribble.monitor.runtime.SessionScope;
-
-/**
- * This class represents a Parallel action.
- *
- */
-public class Parallel extends Node {
-
- private java.util.List _pathIndexes=new java.util.ArrayList();
-
- /**
- * {@inheritDoc}
- */
- protected void init(MonitorContext context) {
- }
-
- /**
- * This method returns the choice path indexes.
- *
- * @return The choice path indexes
- */
- public java.util.List getPathIndexes() {
- return (_pathIndexes);
- }
-
- /**
- * This method sets the choice path indexes.
- *
- * @param indexes The choice path indexes
- */
- public void getPathIndexes(java.util.List indexes) {
- _pathIndexes = indexes;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean evaluate(SessionType type, int index, SessionScope scope) {
-
- SessionScope parallelScope=new SessionScope();
- parallelScope.setName("Parallel/"+index);
-
- // Create a sub-scope per path
- for (int i=0; i < _pathIndexes.size(); i++) {
- SessionScope sub=new SessionScope();
-
- if (Node._nameSessions) {
- sub.setName("Parallel/"+index+"/"+i);
- }
-
- int subIndex=_pathIndexes.get(i);
- Node nextNode=type.getNode(_pathIndexes.get(i));
-
- // Evaluate node on sub-scope
- nextNode.evaluate(type, subIndex, sub);
-
- // Check if should add
- if (!sub.completed()) {
- parallelScope.addSubScope(sub);
- }
- }
-
- if (!parallelScope.completed()) {
- parallelScope.setCompletionIndex(getNext());
- scope.addSubScope(parallelScope);
- }
-
- return (parallelScope.completed());
- }
-
-}
diff --git a/modules/monitor/src/main/java/org/scribble/monitor/model/Parameter.java b/modules/monitor/src/main/java/org/scribble/monitor/model/Parameter.java
deleted file mode 100644
index 729f428fc..000000000
--- a/modules/monitor/src/main/java/org/scribble/monitor/model/Parameter.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * Copyright 2009-11 www.scribble.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.scribble.monitor.model;
-
-/**
- * This class represents the type name.
- *
- */
-public class Parameter {
-
- private String _name;
- private String _type;
- private java.util.List _annotations=new java.util.ArrayList();
-
- /**
- * This is the default constructor.
- */
- public Parameter() {
- }
-
- /**
- * This constructor initializes the parameter type.
- *
- * @param type The type
- */
- public Parameter(String type) {
- _type = type;
- }
-
- /**
- * This constructor initializes the parameter name and type.
- *
- * @param name The name
- */
- public Parameter(String name, String type) {
- _name = name;
- _type = type;
- }
-
- /**
- * This method returns the name.
- *
- * @return The name
- */
- public String getName() {
- return (_name);
- }
-
- /**
- * This method sets the name.
- *
- * @param name The name
- */
- public void setName(String name) {
- _name = name;
- }
-
- /**
- * This method returns the type.
- *
- * @return The type
- */
- public String getType() {
- return (_type);
- }
-
- /**
- * This method sets the type.
- *
- * @param type The type
- */
- public void setType(String type) {
- _type = type;
- }
-
- /**
- * This method returns the annotations.
- *
- * @return The annotations
- */
- public java.util.List getAnnotations() {
- return (_annotations);
- }
-
- /**
- * This method sets the annotations.
- *
- * @param annotations The annotations
- */
- public void setAnnotations(java.util.List annotations) {
- _annotations = annotations;
- }
-
- /**
- * This method returns the annotation with the specified name.
- *
- * @param name The name
- * @return The annotation, or null if not found
- */
- public Annotation getAnnotation(String name) {
- for (int i=0; i < _annotations.size(); i++) {
- if (_annotations.get(i).getName().equals(name)) {
- return (_annotations.get(i));
- }
- }
-
- return (null);
- }
-
-}
diff --git a/modules/monitor/src/main/java/org/scribble/monitor/model/Receive.java b/modules/monitor/src/main/java/org/scribble/monitor/model/Receive.java
deleted file mode 100644
index 1901afe50..000000000
--- a/modules/monitor/src/main/java/org/scribble/monitor/model/Receive.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright 2009-11 www.scribble.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.scribble.monitor.model;
-
-import org.scribble.monitor.runtime.SessionScope;
-
-/**
- * This class represents a Receive action.
- *
- */
-public class Receive extends MessageNode {
-
- private String _fromRole;
-
- /**
- * This method sets the 'from' role.
- *
- * @param role The 'from' role
- */
- public void setFromRole(String role) {
- _fromRole = role;
- }
-
- /**
- * This method returns the 'from' role.
- *
- * @return The 'from' role
- */
- public String getFromRole() {
- return (_fromRole);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean received(SessionType type,
- SessionScope scope, int scopeIndex, Object message, String fromRole) {
- if (fromRole != null && !fromRole.equals(_fromRole)) {
- return (false);
- }
- return (checkMessage(type, scope, scopeIndex, message));
- }
-
-}
diff --git a/modules/monitor/src/main/java/org/scribble/monitor/model/Recursion.java b/modules/monitor/src/main/java/org/scribble/monitor/model/Recursion.java
deleted file mode 100644
index 93de54015..000000000
--- a/modules/monitor/src/main/java/org/scribble/monitor/model/Recursion.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright 2009-11 www.scribble.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.scribble.monitor.model;
-
-import org.scribble.monitor.runtime.MonitorContext;
-import org.scribble.monitor.runtime.SessionScope;
-
-/**
- * This class represents a Recursion action.
- *
- */
-public class Recursion extends Node {
-
- private int _blockIndex;
-
- /**
- * {@inheritDoc}
- */
- protected void init(MonitorContext context) {
- }
-
- /**
- * This method returns the block index.
- *
- * @return The block index
- */
- public int getBlockIndex() {
- return (_blockIndex);
- }
-
- /**
- * This method sets the block index.
- *
- * @param blockIndex The block index
- */
- public void setBlockIndex(int blockIndex) {
- _blockIndex = blockIndex;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean evaluate(SessionType type, int index, SessionScope scope) {
- SessionScope subScope=new SessionScope();
-
- if (Node._nameSessions) {
- subScope.setName("Recursion/"+index);
- }
-
- subScope.setCompletionIndex(getNext());
-
- Node blockNode=type.getNode(getBlockIndex());
- blockNode.evaluate(type, getBlockIndex(), subScope);
-
- scope.addSubScope(subScope);
-
- return (false);
- }
-
-}
diff --git a/modules/monitor/src/main/java/org/scribble/monitor/model/Send.java b/modules/monitor/src/main/java/org/scribble/monitor/model/Send.java
deleted file mode 100644
index bae230873..000000000
--- a/modules/monitor/src/main/java/org/scribble/monitor/model/Send.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright 2009-11 www.scribble.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.scribble.monitor.model;
-
-import org.scribble.monitor.runtime.SessionScope;
-
-/**
- * This class represents a Send action.
- *
- */
-public class Send extends MessageNode {
-
- private String _toRole;
-
- /**
- * This method sets the 'to' role.
- *
- * @param role The 'to' role
- */
- public void setToRole(String role) {
- _toRole = role;
- }
-
- /**
- * This method returns the 'to' role.
- *
- * @return The 'to' role
- */
- public String getToRole() {
- return (_toRole);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean sent(SessionType type,
- SessionScope scope, int scopeIndex, Object message, String toRole) {
- if (toRole != null && !toRole.equals(_toRole)) {
- return (false);
- }
- return (checkMessage(type, scope, scopeIndex, message));
- }
-
-}
diff --git a/modules/monitor/src/main/java/org/scribble/monitor/model/SessionType.java b/modules/monitor/src/main/java/org/scribble/monitor/model/SessionType.java
deleted file mode 100644
index 0001ba9e8..000000000
--- a/modules/monitor/src/main/java/org/scribble/monitor/model/SessionType.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Copyright 2009-11 www.scribble.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.scribble.monitor.model;
-
-import org.scribble.monitor.runtime.MonitorContext;
-import org.scribble.monitor.runtime.SessionInstance;
-import org.scribble.monitor.runtime.SessionScope;
-
-/**
- * This class represents the monitorable version of a local protocol.
- *
- */
-public class SessionType {
-
- private java.util.List _nodes=new java.util.ArrayList();
-
- /**
- * This method initializes the supplied session instance to monitor
- * against this session type.
- *
- * @param context The monitor context
- * @param instance The new session instance
- */
- public void initialize(MonitorContext context, SessionInstance instance) {
-
- for (Node node : _nodes) {
- node.init(context);
- }
-
- // Create a new top level session scope
- SessionScope scope=new SessionScope();
-
- if (Node._nameSessions) {
- scope.setName("Main");
- }
-
- Node node=getNode(0);
-
- node.evaluate(this, 0, scope);
-
- instance.setScope(scope);
- }
-
- /**
- * This method returns the nodes.
- *
- * @return The nodes
- */
- public java.util.List getNodes() {
- return (_nodes);
- }
-
- /**
- * This method sets the nodes.
- *
- * @param nodes The nodes
- */
- public void setNodes(java.util.List