You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by me...@apache.org on 2007/02/26 23:00:07 UTC
svn commit: r512029 -
/incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/physical/
Author: meerajk
Date: Mon Feb 26 14:00:06 2007
New Revision: 512029
URL: http://svn.apache.org/viewvc?view=rev&rev=512029
Log:
First cut of the physical component definition model.
Modified:
incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/physical/PhysicalChangeSet.java
incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/physical/PhysicalComponentDefinition.java
incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/physical/PhysicalInterceptorDefinition.java
incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/physical/PhysicalOperationDefinition.java
incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/physical/PhysicalReferenceDefinition.java
incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/physical/PhysicalServiceDefinition.java
incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/physical/PhysicalWireDefinition.java
Modified: incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/physical/PhysicalChangeSet.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/physical/PhysicalChangeSet.java?view=diff&rev=512029&r1=512028&r2=512029
==============================================================================
--- incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/physical/PhysicalChangeSet.java (original)
+++ incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/physical/PhysicalChangeSet.java Mon Feb 26 14:00:06 2007
@@ -18,6 +18,7 @@
*/
package org.apache.tuscany.spi.model.physical;
+import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
@@ -40,7 +41,7 @@
* @return Physical component definitions in the changeset.
*/
public Set<? extends PhysicalComponentDefinition> getPhysicalComponentDefinitions() {
- return physicalComponentDefinitions;
+ return Collections.unmodifiableSet(physicalComponentDefinitions);
}
/**
@@ -56,7 +57,7 @@
* @return Wire definitions in the changeset.
*/
public Set<? extends PhysicalWireDefinition> getWireDefinitions() {
- return wireDefinitions;
+ return Collections.unmodifiableSet(wireDefinitions);
}
/**
Modified: incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/physical/PhysicalComponentDefinition.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/physical/PhysicalComponentDefinition.java?view=diff&rev=512029&r1=512028&r2=512029
==============================================================================
--- incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/physical/PhysicalComponentDefinition.java (original)
+++ incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/physical/PhysicalComponentDefinition.java Mon Feb 26 14:00:06 2007
@@ -19,6 +19,9 @@
package org.apache.tuscany.spi.model.physical;
import java.net.URI;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
import org.apache.tuscany.spi.model.ModelObject;
@@ -31,6 +34,12 @@
// Component Id.
private URI componentId;
+
+ // Services exposed by this component
+ private Set<PhysicalServiceDefinition> services = new HashSet<PhysicalServiceDefinition>();
+
+ // References exposed by this component
+ private Set<PhysicalReferenceDefinition> references = new HashSet<PhysicalReferenceDefinition>();
/**
* Gets the component id.
@@ -46,6 +55,38 @@
*/
public void setComponentId(URI componentId) {
this.componentId = componentId;
+ }
+
+ /**
+ * Returns the service definitions available for this component.
+ * @return Service definitions for this operation.
+ */
+ public Set<PhysicalServiceDefinition> getServices() {
+ return Collections.unmodifiableSet(services);
+ }
+
+ /**
+ * Adds a service definition to the component.
+ * @param service Service definition to be added to the component.
+ */
+ public void addService(PhysicalServiceDefinition service) {
+ services.add(service);
+ }
+
+ /**
+ * Returns the reference definitions available for this component.
+ * @return Reference definitions for this operation.
+ */
+ public Set<PhysicalReferenceDefinition> getReferences() {
+ return Collections.unmodifiableSet(references);
+ }
+
+ /**
+ * Adds a reference definition to the component.
+ * @param reference Reference definition to be added to the component.
+ */
+ public void addService(PhysicalReferenceDefinition reference) {
+ references.add(reference);
}
}
Modified: incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/physical/PhysicalInterceptorDefinition.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/physical/PhysicalInterceptorDefinition.java?view=diff&rev=512029&r1=512028&r2=512029
==============================================================================
--- incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/physical/PhysicalInterceptorDefinition.java (original)
+++ incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/physical/PhysicalInterceptorDefinition.java Mon Feb 26 14:00:06 2007
@@ -37,12 +37,16 @@
/**
* Gets the qualified name of the builder.
- * @return
+ * @return Qualified name of the builder.
*/
public QName getBuilder() {
return builder;
}
+ /**
+ * Sets the qualified name of the builder.
+ * @param builder Qualified name of the builder.
+ */
public void setBuilder(QName builder) {
this.builder = builder;
}
Modified: incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/physical/PhysicalOperationDefinition.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/physical/PhysicalOperationDefinition.java?view=diff&rev=512029&r1=512028&r2=512029
==============================================================================
--- incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/physical/PhysicalOperationDefinition.java (original)
+++ incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/physical/PhysicalOperationDefinition.java Mon Feb 26 14:00:06 2007
@@ -18,14 +18,78 @@
*/
package org.apache.tuscany.spi.model.physical;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
import org.apache.tuscany.spi.model.ModelObject;
/**
* Represents an operation.
*
* @version $Revision$ $Date$
+ *
+ * TODO Add parameters, return types and fault types
*
*/
public class PhysicalOperationDefinition extends ModelObject {
+
+ // Name of the operation
+ private String name;
+
+ // Callback
+ private boolean callback;
+
+ // Interceptors defined against the operation
+ private Set<PhysicalInterceptorDefinition> interceptors = new HashSet<PhysicalInterceptorDefinition>();
+
+ /**
+ * Returns the interceptor definitions available for this operation.
+ * @return Inteceptor definitions for this operation.
+ */
+ public Set<PhysicalInterceptorDefinition> getInterceptors() {
+ return Collections.unmodifiableSet(interceptors);
+ }
+
+ /**
+ * Adds an interceptor definition to the operation.
+ * @param interceptors Interceptor definition to be added.
+ */
+ public void addInterceptor(PhysicalInterceptorDefinition interceptor) {
+ interceptors.add(interceptor);
+ }
+
+ /**
+ * Gets the name of the operation.
+ * @return Operation name.
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Sets the name of the operation.
+ * @param name Operation name.
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * Checks whether the operation is a callback.
+ * @return True if this is a callback.
+ */
+ public boolean isCallback() {
+ return callback;
+ }
+
+ /**
+ * Sets whether this is a callback operation or not.
+ * @param callback True if this is a callback.
+ */
+ public void setCallback(boolean callback) {
+ this.callback = callback;
+ }
+
}
Modified: incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/physical/PhysicalReferenceDefinition.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/physical/PhysicalReferenceDefinition.java?view=diff&rev=512029&r1=512028&r2=512029
==============================================================================
--- incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/physical/PhysicalReferenceDefinition.java (original)
+++ incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/physical/PhysicalReferenceDefinition.java Mon Feb 26 14:00:06 2007
@@ -18,6 +18,10 @@
*/
package org.apache.tuscany.spi.model.physical;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
import org.apache.tuscany.spi.model.ModelObject;
/**
@@ -27,5 +31,43 @@
*
*/
public class PhysicalReferenceDefinition extends ModelObject {
+
+ // The name of the reference
+ private String name;
+
+ // Operations available on this wire
+ private Set<PhysicalOperationDefinition> operations = new HashSet<PhysicalOperationDefinition>();
+
+ /**
+ * Returns a read-only view of the available operations.
+ * @return Operations available on the wire.
+ */
+ public Set<PhysicalOperationDefinition> getOperations() {
+ return Collections.unmodifiableSet(operations);
+ }
+
+ /**
+ * Adds an operation definition.
+ * @param operation Operation to be added to the wire.
+ */
+ public void addOperation(PhysicalOperationDefinition operation) {
+ operations.add(operation);
+ }
+
+ /**
+ * Sets the name of the reference.
+ * @param name Name of the reference.
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * Gets the name of the reference.
+ * @return Name of the reference.
+ */
+ public String getName() {
+ return name;
+ }
}
Modified: incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/physical/PhysicalServiceDefinition.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/physical/PhysicalServiceDefinition.java?view=diff&rev=512029&r1=512028&r2=512029
==============================================================================
--- incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/physical/PhysicalServiceDefinition.java (original)
+++ incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/physical/PhysicalServiceDefinition.java Mon Feb 26 14:00:06 2007
@@ -18,6 +18,10 @@
*/
package org.apache.tuscany.spi.model.physical;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
import org.apache.tuscany.spi.model.ModelObject;
/**
@@ -27,5 +31,43 @@
*
*/
public class PhysicalServiceDefinition extends ModelObject {
+
+ // The name of the service
+ private String name;
+
+ // Operations available on this wire
+ private Set<PhysicalOperationDefinition> operations = new HashSet<PhysicalOperationDefinition>();
+
+ /**
+ * Returns a read-only view of the available operations.
+ * @return Operations available on the wire.
+ */
+ public Set<PhysicalOperationDefinition> getOperations() {
+ return Collections.unmodifiableSet(operations);
+ }
+
+ /**
+ * Adds an operation definition.
+ * @param operation Operation to be added to the wire.
+ */
+ public void addOperation(PhysicalOperationDefinition operation) {
+ operations.add(operation);
+ }
+
+ /**
+ * Sets the name of the service.
+ * @param name Name of the service.
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * Gets the name of the service.
+ * @return Name of the service.
+ */
+ public String getName() {
+ return name;
+ }
}
Modified: incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/physical/PhysicalWireDefinition.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/physical/PhysicalWireDefinition.java?view=diff&rev=512029&r1=512028&r2=512029
==============================================================================
--- incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/physical/PhysicalWireDefinition.java (original)
+++ incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/physical/PhysicalWireDefinition.java Mon Feb 26 14:00:06 2007
@@ -33,58 +33,47 @@
* @version $Rev$ $Date$
*/
public class PhysicalWireDefinition extends ModelObject {
+
+ // TODO this should be removed
+ @Deprecated
private QName bindingType;
+
// The resolved source URI of the wire
private URI sourceUri;
+
// The resolved source URI of the wire
private URI targetUri;
- // Interceptors defined against the wire
- private final Set<PhysicalInterceptorDefinition> interceptors = new HashSet<PhysicalInterceptorDefinition>();
+
+ // Operations available on this wire
+ private Set<PhysicalOperationDefinition> operations = new HashSet<PhysicalOperationDefinition>();
/**
* Returns the wire binding type.
- *
* @return the binding type of the wire.
*/
+ @Deprecated
public QName getBindingType() {
return bindingType;
}
/**
- * Sets the wire binding type
- *
- * @param bindingType the wire binding type
+ * Returns a read-only view of the available operations.
+ * @return Operations available on the wire.
*/
- public void setBindingType(QName bindingType) {
- this.bindingType = bindingType;
+ public Set<PhysicalOperationDefinition> getOperations() {
+ return Collections.unmodifiableSet(operations);
}
/**
- * Returns a read-only view of the available interceptors.
- *
- * @return List of interceptors available on the wire.
+ * Adds an operation definition.
+ * @param operation Operation to be added to the wire.
*/
- public Set<PhysicalInterceptorDefinition> getInterceptors() {
- return Collections.unmodifiableSet(interceptors);
- }
-
- /**
- * Adds an interceptor definition.
- *
- * @param interceptorDefinition Interceptor definition to add to the wire.
- */
- public void addInterceptor(PhysicalInterceptorDefinition interceptorDefinition) {
-
- if (interceptorDefinition == null) {
- throw new IllegalArgumentException("Interceptor definition is null");
- }
- interceptors.add(interceptorDefinition);
-
+ public void addOperation(PhysicalOperationDefinition operation) {
+ operations.add(operation);
}
/**
* Sets the Wire source URI.
- *
* @param sourceUri Wire source URI.
*/
public void setSourceUri(URI sourceUri) {
@@ -93,17 +82,14 @@
/**
* Gets the Wire source URI.
- *
* @return Wire source URI.
*/
public URI getSourceUri() {
return sourceUri;
}
-
/**
* Sets the Wire target URI.
- *
* @param targetUri Wire source URI.
*/
public void setTargetUri(URI targetUri) {
@@ -112,7 +98,6 @@
/**
* Gets the Wire target URI.
- *
* @return Wire target URI.
*/
public URI getTargetUri() {
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org