You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by js...@apache.org on 2006/02/20 09:15:26 UTC
svn commit: r379052 [2/16] - in /incubator/tuscany/sandbox/sebastien/java:
./ sca/ sca/model/ sca/model/.settings/ sca/model/src/ sca/model/src/main/
sca/model/src/main/java/ sca/model/src/main/java/org/
sca/model/src/main/java/org/apache/ sca/model/sr...
Added: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/ConfiguredService.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/ConfiguredService.java?rev=379052&view=auto
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/ConfiguredService.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/ConfiguredService.java Mon Feb 20 00:15:10 2006
@@ -0,0 +1,37 @@
+/**
+ *
+ * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ * 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.apache.tuscany.model.assembly;
+
+
+/**
+ * Represents a configured service.
+ */
+public interface ConfiguredService extends ConfiguredPort {
+
+ /**
+ * Returns the service definition.
+ * @return
+ */
+ Service getService();
+
+ /**
+ * Sets the service definition.
+ * @param service
+ */
+ void setService(Service service);
+
+}
Propchange: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/ConfiguredService.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/ConfiguredService.java
------------------------------------------------------------------------------
svn:keywords = Rev,Date
Added: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/EntryPoint.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/EntryPoint.java?rev=379052&view=auto
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/EntryPoint.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/EntryPoint.java Mon Feb 20 00:15:10 2006
@@ -0,0 +1,56 @@
+/**
+ *
+ * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ * 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.apache.tuscany.model.assembly;
+
+import java.util.List;
+
+
+/**
+ * Represents an entry point.
+ */
+public interface EntryPoint extends AggregatePart, Extensible {
+
+ /**
+ * Returns the bindings used by this entry point.
+ */
+ List<Binding> getBindings();
+
+ /**
+ * Returns the configured service exposed by this external service.
+ * @return
+ */
+ ConfiguredService getConfiguredService();
+
+ /**
+ * Sets the configured service exposed by this external service.
+ * @param configuredService
+ */
+ void setConfiguredService(ConfiguredService configuredService);
+
+ /**
+ * Returns the configured reference wiring this entry point to the published service.
+ * @return
+ */
+ ConfiguredReference getConfiguredReference();
+
+ /**
+ * Sets the configured reference wiring this entry point to the published service.
+ * @param configuredReference
+ */
+ void setConfiguredReference(ConfiguredReference configuredReference);
+
+}
Propchange: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/EntryPoint.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/EntryPoint.java
------------------------------------------------------------------------------
svn:keywords = Rev,Date
Added: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/Extensible.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/Extensible.java?rev=379052&view=auto
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/Extensible.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/Extensible.java Mon Feb 20 00:15:10 2006
@@ -0,0 +1,38 @@
+/**
+ *
+ * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ * 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.apache.tuscany.model.assembly;
+
+import java.util.List;
+
+/**
+ * Represents an extensible model object.
+ */
+public interface Extensible extends AssemblyModelObject {
+
+ /**
+ * Returns the extensibility elements.
+ * @return
+ */
+ List getExtensibilityElements();
+
+ /**
+ * Returns the extensibility attributes.
+ * @return
+ */
+ List getExtensibilityAttributes();
+
+}
Propchange: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/Extensible.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/Extensible.java
------------------------------------------------------------------------------
svn:keywords = Rev,Date
Added: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/ExternalService.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/ExternalService.java?rev=379052&view=auto
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/ExternalService.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/ExternalService.java Mon Feb 20 00:15:10 2006
@@ -0,0 +1,53 @@
+/**
+ *
+ * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ * 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.apache.tuscany.model.assembly;
+
+import java.util.List;
+
+
+/**
+ * Represents an external service.
+ */
+public interface ExternalService extends AggregatePart, Extensible {
+
+ /**
+ * Returns the bindings configured on this external service.
+ */
+ List<Binding> getBindings();
+
+ /**
+ * Returns the override option.
+ */
+ OverrideOption getOverrideOption();
+
+ /**
+ * Sets the override option.
+ */
+ void setOverrideOption(OverrideOption value);
+
+ /**
+ * Returns the configured service exposed by this external service.
+ * @return
+ */
+ ConfiguredService getConfiguredService();
+
+ /**
+ * Sets the configured service exposed by this external service.
+ * @param configuredService
+ */
+ void setConfiguredService(ConfiguredService configuredService);
+}
Propchange: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/ExternalService.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/ExternalService.java
------------------------------------------------------------------------------
svn:keywords = Rev,Date
Added: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/Module.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/Module.java?rev=379052&view=auto
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/Module.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/Module.java Mon Feb 20 00:15:10 2006
@@ -0,0 +1,40 @@
+/**
+ *
+ * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ * 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.apache.tuscany.model.assembly;
+
+import java.util.List;
+
+
+/**
+ * Represents a module.
+ */
+public interface Module extends Aggregate, ComponentImplementation {
+
+ /**
+ * Returns the module fragments
+ * @return
+ */
+ List<ModuleFragment> getModuleFragments();
+
+ /**
+ * Returns the named module fragment
+ * @param name
+ * @return
+ */
+ ModuleFragment getModuleFragment(String name);
+
+}
Propchange: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/Module.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/Module.java
------------------------------------------------------------------------------
svn:keywords = Rev,Date
Added: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/ModuleComponent.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/ModuleComponent.java?rev=379052&view=auto
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/ModuleComponent.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/ModuleComponent.java Mon Feb 20 00:15:10 2006
@@ -0,0 +1,46 @@
+/**
+ *
+ * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ * 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.apache.tuscany.model.assembly;
+
+/**
+ * Represents a module component.
+ */
+public interface ModuleComponent extends Component {
+
+ /**
+ * Returns the module implementing this module component.
+ * @return
+ */
+ Module getModuleImplementation();
+
+ /**
+ * Set the module implementing this module component.
+ * @param module
+ */
+ void setModuleImplementation(Module module);
+
+ /**
+ * Returns the uri of the module component.
+ */
+ String getURI();
+
+ /**
+ * Sets the uri of the module component.
+ */
+ void setURI(String value);
+
+}
Propchange: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/ModuleComponent.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/ModuleComponent.java
------------------------------------------------------------------------------
svn:keywords = Rev,Date
Added: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/ModuleFragment.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/ModuleFragment.java?rev=379052&view=auto
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/ModuleFragment.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/ModuleFragment.java Mon Feb 20 00:15:10 2006
@@ -0,0 +1,25 @@
+/**
+ *
+ * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ * 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.apache.tuscany.model.assembly;
+
+
+/**
+ * Represents a module fragment.
+ */
+public interface ModuleFragment extends Aggregate {
+
+}
Propchange: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/ModuleFragment.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/ModuleFragment.java
------------------------------------------------------------------------------
svn:keywords = Rev,Date
Added: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/Multiplicity.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/Multiplicity.java?rev=379052&view=auto
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/Multiplicity.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/Multiplicity.java Mon Feb 20 00:15:10 2006
@@ -0,0 +1,30 @@
+/**
+ *
+ * Copyright 2005 BEA Systems Inc.
+ * Copyright 2005 International Business Machines Corporation
+ *
+ * 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.apache.tuscany.model.assembly;
+
+/**
+ * Enumeration for multiplicity.
+ */
+public enum Multiplicity {
+
+ ZERO_ONE,
+ ONE_ONE,
+ ZERO_N,
+ ONE_N,
+
+}
Propchange: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/Multiplicity.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/Multiplicity.java
------------------------------------------------------------------------------
svn:keywords = Rev,Date
Added: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/OverrideOption.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/OverrideOption.java?rev=379052&view=auto
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/OverrideOption.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/OverrideOption.java Mon Feb 20 00:15:10 2006
@@ -0,0 +1,29 @@
+/**
+ *
+ * Copyright 2005 BEA Systems Inc.
+ * Copyright 2005 International Business Machines Corporation
+ *
+ * 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.apache.tuscany.model.assembly;
+
+/**
+ * Enumeration for override options.
+ */
+public enum OverrideOption {
+
+ NO,
+ MAY,
+ MUST;
+
+}
Propchange: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/OverrideOption.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/OverrideOption.java
------------------------------------------------------------------------------
svn:keywords = Rev,Date
Added: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/Port.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/Port.java?rev=379052&view=auto
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/Port.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/Port.java Mon Feb 20 00:15:10 2006
@@ -0,0 +1,48 @@
+/**
+ *
+ * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ * 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.apache.tuscany.model.assembly;
+
+/**
+ * Represents a port (e.g. a service or reference).
+ */
+public interface Port extends AssemblyModelObject {
+
+ /**
+ * Returns the port's service contract (interface and callback interface).
+ * @return
+ */
+ ServiceContract getServiceContract();
+
+ /**
+ * Returns the port's service contract (interface and callback interface).
+ * @param value
+ */
+ void setServiceContract(ServiceContract value);
+
+ /**
+ * Returns the name of the port.
+ * @return
+ */
+ String getName();
+
+ /**
+ * Sets the name of the port.
+ * @param value
+ */
+ void setName(String value);
+
+}
Propchange: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/Port.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/Port.java
------------------------------------------------------------------------------
svn:keywords = Rev,Date
Added: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/Property.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/Property.java?rev=379052&view=auto
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/Property.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/Property.java Mon Feb 20 00:15:10 2006
@@ -0,0 +1,85 @@
+/**
+ *
+ * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ * 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.apache.tuscany.model.assembly;
+
+
+/**
+ * Represents a property definition.
+ */
+public interface Property extends Extensible {
+
+ /**
+ * Returns the default value of the property.
+ * @return
+ */
+ Object getDefaultValue();
+
+ /**
+ * Sets the default value of the property.
+ * @param value
+ */
+ void setDefaultValue(Object value);
+
+ /**
+ * Returns true if the property allows multiple values.
+ * @return
+ */
+ boolean isMany();
+
+ /**
+ * Sets whether or not the property allows many values.
+ * @param value
+ */
+ void setMany(boolean value);
+
+ /**
+ * Returns the property name.
+ * @return
+ */
+ String getName();
+
+ /**
+ * Sets the property name.
+ * @param value
+ */
+ void setName(String value);
+
+ /**
+ * Returns true if the property is required.
+ * @return
+ */
+ boolean isRequired();
+
+ /**
+ * Sets the whether or not the property is required.
+ * @param value
+ */
+ void setRequired(boolean value);
+
+ /**
+ * Returns the property type.
+ * @return
+ */
+ Class getType();
+
+ /**
+ * Sets the property type.
+ * @param value
+ */
+ void setType(Class value);
+
+} // Property
Propchange: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/Property.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/Property.java
------------------------------------------------------------------------------
svn:keywords = Rev,Date
Added: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/Reference.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/Reference.java?rev=379052&view=auto
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/Reference.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/Reference.java Mon Feb 20 00:15:10 2006
@@ -0,0 +1,37 @@
+/**
+ *
+ * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ * 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.apache.tuscany.model.assembly;
+
+
+/**
+ * Represents a reference.
+ */
+public interface Reference extends Port {
+
+ /**
+ * Returns the multiplicity.
+ * @return
+ */
+ Multiplicity getMultiplicity();
+
+ /**
+ * Sets the multiplicity.
+ * @param multiplicity
+ */
+ void setMultiplicity(Multiplicity multiplicity);
+
+}
Propchange: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/Reference.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/Reference.java
------------------------------------------------------------------------------
svn:keywords = Rev,Date
Added: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/RuntimeConfigurationHolder.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/RuntimeConfigurationHolder.java?rev=379052&view=auto
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/RuntimeConfigurationHolder.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/RuntimeConfigurationHolder.java Mon Feb 20 00:15:10 2006
@@ -0,0 +1,36 @@
+/**
+ *
+ * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ * 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.apache.tuscany.model.assembly;
+
+/**
+ * Represents a model object that can hold a runtime configuration object.
+ */
+public interface RuntimeConfigurationHolder {
+
+ /**
+ * Sets the runtime configuration
+ * @param configuration
+ */
+ void setRuntimeConfiguration(Object configuration);
+
+ /**
+ * Returns the runtime configuration
+ * @return
+ */
+ Object getRuntimeConfiguration();
+
+}
Propchange: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/RuntimeConfigurationHolder.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/RuntimeConfigurationHolder.java
------------------------------------------------------------------------------
svn:keywords = Rev,Date
Added: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/Scope.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/Scope.java?rev=379052&view=auto
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/Scope.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/Scope.java Mon Feb 20 00:15:10 2006
@@ -0,0 +1,30 @@
+/**
+ *
+ * Copyright 2005 BEA Systems Inc.
+ * Copyright 2005 International Business Machines Corporation
+ *
+ * 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.apache.tuscany.model.assembly;
+
+/**
+ * A scope enumeration
+ */
+public enum Scope {
+
+ INSTANCE,
+ REQUEST,
+ SESSION,
+ MODULE;
+
+}
Propchange: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/Scope.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/Scope.java
------------------------------------------------------------------------------
svn:keywords = Rev,Date
Added: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/Service.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/Service.java?rev=379052&view=auto
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/Service.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/Service.java Mon Feb 20 00:15:10 2006
@@ -0,0 +1,25 @@
+/**
+ *
+ * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ * 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.apache.tuscany.model.assembly;
+
+
+/**
+ * Represents a service.
+ */
+public interface Service extends Port {
+
+}
Propchange: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/Service.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/Service.java
------------------------------------------------------------------------------
svn:keywords = Rev,Date
Added: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/ServiceContract.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/ServiceContract.java?rev=379052&view=auto
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/ServiceContract.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/ServiceContract.java Mon Feb 20 00:15:10 2006
@@ -0,0 +1,62 @@
+/**
+ *
+ * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ * 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.apache.tuscany.model.assembly;
+
+
+
+/**
+ * Represents service contract.
+ */
+public interface ServiceContract extends Extensible {
+
+ /**
+ * Returns the interface.
+ * @return
+ */
+ Class getInterface();
+
+ /**
+ * Sets the interface.
+ * @param value
+ */
+ void setInterface(Class value);
+
+ /**
+ * Returns the callback interface.
+ * @return
+ */
+ Class getCallbackInterface();
+
+ /**
+ * Sets the callback interface.
+ * @param value
+ */
+ void setCallbackInterface(Class value);
+
+ /**
+ * Returns the scope of this service contract.
+ * @return
+ */
+ Scope getScope();
+
+ /**
+ * Sets the scope.
+ * @param scope of this service contract.
+ */
+ void setScope(Scope scope);
+
+}
Propchange: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/ServiceContract.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/ServiceContract.java
------------------------------------------------------------------------------
svn:keywords = Rev,Date
Added: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/ServiceURI.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/ServiceURI.java?rev=379052&view=auto
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/ServiceURI.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/ServiceURI.java Mon Feb 20 00:15:10 2006
@@ -0,0 +1,53 @@
+/**
+ *
+ * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ * 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.apache.tuscany.model.assembly;
+
+/**
+ * Represents a service URI.
+ */
+public interface ServiceURI {
+
+ /**
+ * Returns true if the address scheme is sca
+ * @return
+ */
+ public boolean isSCAScheme();
+
+ /**
+ * @return Returns the address.
+ */
+ public String getAddress();
+
+ /**
+ * Returns the module component name
+ * @return
+ */
+ public String getModuleComponentName();
+
+ /**
+ * Returns the part name
+ * @return
+ */
+ public String getPartName();
+
+ /**
+ * Returns the service name
+ * @return
+ */
+ public String getServiceName();
+
+}
Propchange: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/ServiceURI.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/ServiceURI.java
------------------------------------------------------------------------------
svn:keywords = Rev,Date
Added: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/SimpleComponent.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/SimpleComponent.java?rev=379052&view=auto
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/SimpleComponent.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/SimpleComponent.java Mon Feb 20 00:15:10 2006
@@ -0,0 +1,26 @@
+/**
+ *
+ * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ * 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.apache.tuscany.model.assembly;
+
+
+/**
+ * Represents a simple component (as opposed to a component implemented by an aggregate, like a module component)
+ */
+public interface SimpleComponent extends Component {
+
+}
+
\ No newline at end of file
Propchange: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/SimpleComponent.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/SimpleComponent.java
------------------------------------------------------------------------------
svn:keywords = Rev,Date
Added: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/Subsystem.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/Subsystem.java?rev=379052&view=auto
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/Subsystem.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/Subsystem.java Mon Feb 20 00:15:10 2006
@@ -0,0 +1,37 @@
+/**
+ *
+ * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ * 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.apache.tuscany.model.assembly;
+
+
+/**
+ * Represents a subsystem.
+ */
+public interface Subsystem extends Aggregate {
+
+ /**
+ * Returns the subsystem uri.
+ * @return
+ */
+ String getURI();
+
+ /**
+ * Sets the subsystem uri.
+ * @param value
+ */
+ void setURI(String value);
+
+} // Subsystem
Propchange: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/Subsystem.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/Subsystem.java
------------------------------------------------------------------------------
svn:keywords = Rev,Date
Added: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/AggregateImpl.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/AggregateImpl.java?rev=379052&view=auto
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/AggregateImpl.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/AggregateImpl.java Mon Feb 20 00:15:10 2006
@@ -0,0 +1,214 @@
+/**
+ *
+ * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ * 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.apache.tuscany.model.assembly.impl;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.tuscany.model.assembly.Aggregate;
+import org.apache.tuscany.model.assembly.AggregatePart;
+import org.apache.tuscany.model.assembly.AssemblyModelContext;
+import org.apache.tuscany.model.assembly.AssemblyModelVisitor;
+import org.apache.tuscany.model.assembly.Component;
+import org.apache.tuscany.model.assembly.ConfiguredService;
+import org.apache.tuscany.model.assembly.EntryPoint;
+import org.apache.tuscany.model.assembly.ExternalService;
+import org.apache.tuscany.model.assembly.ServiceURI;
+
+/**
+ * An implementation of Aggregate.
+ */
+public abstract class AggregateImpl extends ExtensibleImpl implements Aggregate {
+
+ private String name;
+ private List<Component> components=new ArrayList<Component>();
+ private Map<String, Component> componentsMap;
+ private List<EntryPoint> entryPoints=new ArrayList<EntryPoint>();
+ private Map<String, EntryPoint> entryPointsMap;
+ private List<ExternalService> externalServices=new ArrayList<ExternalService>();
+ private Map<String, ExternalService> externalServicesMap;
+ private List<AggregatePart> aggregateParts;
+
+ /**
+ * Constructor
+ */
+ protected AggregateImpl() {
+ }
+
+ /**
+ * @see org.apache.tuscany.model.assembly.Aggregate#getName()
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * @see org.apache.tuscany.model.assembly.Aggregate#setName(java.lang.String)
+ */
+ public void setName(String newName) {
+ checkNotFrozen();
+ name=newName;
+ }
+
+ /**
+ * @see org.apache.tuscany.model.assembly.Aggregate#getComponents()
+ */
+ public List<Component> getComponents() {
+ return components;
+ }
+
+ /**
+ * @see org.apache.tuscany.model.assembly.Aggregate#getComponent(java.lang.String)
+ */
+ public Component getComponent(String name) {
+ checkInitialized();
+ return componentsMap.get(name);
+ }
+
+ /**
+ * @see org.apache.tuscany.model.assembly.Aggregate#getEntryPoints()
+ */
+ public List<EntryPoint> getEntryPoints() {
+ return entryPoints;
+ }
+
+ /**
+ * @see org.apache.tuscany.model.assembly.Aggregate#getEntryPoint(java.lang.String)
+ */
+ public EntryPoint getEntryPoint(String name) {
+ checkInitialized();
+ return entryPointsMap.get(name);
+ }
+
+ /**
+ * @see org.apache.tuscany.model.assembly.Aggregate#getExternalServices()
+ */
+ public List<ExternalService> getExternalServices() {
+ return externalServices;
+ }
+
+ /**
+ * @see org.apache.tuscany.model.assembly.Aggregate#getExternalService(java.lang.String)
+ */
+ public ExternalService getExternalService(String name) {
+ checkInitialized();
+ return externalServicesMap.get(name);
+ }
+
+ /**
+ * @see org.apache.tuscany.model.assembly.Aggregate#getAggregateParts()
+ */
+ public List<AggregatePart> getAggregateParts() {
+ checkInitialized();
+ return aggregateParts;
+ }
+
+ /**
+ * @see org.apache.tuscany.model.assembly.Aggregate#getConfiguredService(org.apache.tuscany.model.assembly.ServiceURI)
+ */
+ public ConfiguredService getConfiguredService(ServiceURI address) {
+ String partName = address.getPartName();
+ String serviceName = address.getServiceName();
+ Component component = getComponent(partName);
+ if (component != null) {
+ if (serviceName != null) {
+ return component.getConfiguredService(serviceName);
+ } else {
+ if (!component.getConfiguredServices().isEmpty()) {
+ return component.getConfiguredServices().get(0);
+ } else {
+ return null;
+ }
+ }
+
+ } else {
+ ExternalService externalService = getExternalService(partName);
+ if (externalService != null) {
+ return externalService.getConfiguredService();
+ } else {
+ return null;
+ }
+ }
+ }
+
+ /**
+ * @see org.apache.tuscany.model.assembly.AssemblyModelObject#initialize(org.apache.tuscany.model.assembly.AssemblyModelContext)
+ */
+ public void initialize(AssemblyModelContext modelContext) {
+ if (isInitialized())
+ return;
+ super.initialize(modelContext);
+
+ // Populate maps of components, entry points and external services
+ aggregateParts = new ArrayList<AggregatePart>();
+ componentsMap = new HashMap<String, Component>();
+ for (Component component : components) {
+ componentsMap.put(component.getName(), component);
+ aggregateParts.add(component);
+ component.initialize(modelContext);
+ ((AggregatePartImpl)component).setAggregate(this);
+ }
+ entryPointsMap = new HashMap<String, EntryPoint>();
+ for (EntryPoint entryPoint : entryPoints) {
+ entryPointsMap.put(entryPoint.getName(), entryPoint);
+ aggregateParts.add(entryPoint);
+ entryPoint.initialize(modelContext);
+ ((AggregatePartImpl)entryPoint).setAggregate(this);
+ }
+ externalServicesMap = new HashMap<String, ExternalService>();
+ for (ExternalService externalService : externalServices) {
+ externalServicesMap.put(externalService.getName(), externalService);
+ aggregateParts.add(externalService);
+ externalService.initialize(modelContext);
+ ((AggregatePartImpl)externalService).setAggregate(this);
+ }
+ }
+
+ /**
+ * @see org.apache.tuscany.model.assembly.AssemblyModelObject#freeze()
+ */
+ public void freeze() {
+ if (isFrozen())
+ return;
+ super.freeze();
+
+ // Freeze lists
+ components=Collections.unmodifiableList(components);
+ freeze(components);
+ entryPoints=Collections.unmodifiableList(entryPoints);
+ freeze(entryPoints);
+ externalServices=Collections.unmodifiableList(externalServices);
+ freeze(externalServices);
+ }
+
+ /**
+ * @see org.apache.tuscany.model.assembly.AssemblyModelObject#accept(org.apache.tuscany.model.assembly.AssemblyModelVisitor)
+ */
+ public boolean accept(AssemblyModelVisitor visitor) {
+ if (!super.accept(visitor))
+ return false;
+
+ if (!accept(aggregateParts, visitor))
+ return false;
+
+ return true;
+ }
+
+} //ModuleImpl
Propchange: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/AggregateImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/AggregateImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev,Date
Added: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/AggregatePartImpl.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/AggregatePartImpl.java?rev=379052&view=auto
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/AggregatePartImpl.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/AggregatePartImpl.java Mon Feb 20 00:15:10 2006
@@ -0,0 +1,67 @@
+/**
+ *
+ * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ * 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.apache.tuscany.model.assembly.impl;
+
+import org.apache.tuscany.model.assembly.Aggregate;
+import org.apache.tuscany.model.assembly.AggregatePart;
+
+/**
+ * Implementation of AggregatePart.
+ */
+public abstract class AggregatePartImpl extends ExtensibleImpl implements AggregatePart {
+ private Aggregate aggregate;
+ private String name;
+
+ /**
+ * Constructor
+ */
+ protected AggregatePartImpl() {
+ }
+
+ /**
+ * @see org.apache.tuscany.model.assembly.AggregatePart#getName()
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * @see org.apache.tuscany.model.assembly.AggregatePart#setName(java.lang.String)
+ */
+ public void setName(String value) {
+ checkNotFrozen();
+ name=value;
+ }
+
+ /**
+ * @see org.apache.tuscany.model.assembly.AggregatePart#getAggregate()
+ */
+ public Aggregate getAggregate() {
+ checkInitialized();
+ return aggregate;
+ }
+
+ /**
+ * Sets the aggregate containing this aggregate part.
+ * @param aggregate
+ */
+ protected void setAggregate(Aggregate aggregate) {
+ checkNotFrozen();
+ this.aggregate=aggregate;
+ }
+
+}
Propchange: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/AggregatePartImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/AggregatePartImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev,Date
Added: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/AssemblyFactoryImpl.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/AssemblyFactoryImpl.java?rev=379052&view=auto
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/AssemblyFactoryImpl.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/AssemblyFactoryImpl.java Mon Feb 20 00:15:10 2006
@@ -0,0 +1,195 @@
+/**
+ *
+ * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ * 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.apache.tuscany.model.assembly.impl;
+
+import javax.xml.namespace.QName;
+
+import org.apache.tuscany.model.assembly.AssemblyFactory;
+import org.apache.tuscany.model.assembly.ComponentType;
+import org.apache.tuscany.model.assembly.ConfiguredPort;
+import org.apache.tuscany.model.assembly.ConfiguredProperty;
+import org.apache.tuscany.model.assembly.ConfiguredReference;
+import org.apache.tuscany.model.assembly.ConfiguredService;
+import org.apache.tuscany.model.assembly.EntryPoint;
+import org.apache.tuscany.model.assembly.ExternalService;
+import org.apache.tuscany.model.assembly.Module;
+import org.apache.tuscany.model.assembly.ModuleComponent;
+import org.apache.tuscany.model.assembly.ModuleFragment;
+import org.apache.tuscany.model.assembly.Property;
+import org.apache.tuscany.model.assembly.Reference;
+import org.apache.tuscany.model.assembly.Service;
+import org.apache.tuscany.model.assembly.ServiceURI;
+import org.apache.tuscany.model.assembly.SimpleComponent;
+import org.apache.tuscany.model.assembly.Subsystem;
+import org.apache.tuscany.model.types.java.JavaServiceContract;
+import org.apache.tuscany.model.types.java.impl.JavaServiceContractImpl;
+import org.apache.tuscany.model.types.wsdl.WSDLServiceContract;
+import org.apache.tuscany.model.types.wsdl.impl.WSDLServiceContractImpl;
+
+/**
+ */
+public class AssemblyFactoryImpl implements AssemblyFactory {
+
+ /**
+ * Constructor
+ */
+ public AssemblyFactoryImpl() {
+ super();
+ }
+
+ /**
+ * @see org.apache.tuscany.model.assembly.AssemblyFactory#createSimpleComponent()
+ */
+ public SimpleComponent createSimpleComponent() {
+ return new SimpleComponentImpl();
+ }
+
+ /**
+ * @see org.apache.tuscany.model.assembly.AssemblyFactory#createComponentType()
+ */
+ public ComponentType createComponentType() {
+ return new ComponentTypeImpl();
+ }
+
+ /**
+ * @see org.apache.tuscany.model.assembly.AssemblyFactory#createEntryPoint()
+ */
+ public EntryPoint createEntryPoint() {
+ return new EntryPointImpl();
+ }
+
+ /**
+ * @see org.apache.tuscany.model.assembly.AssemblyFactory#createExternalService()
+ */
+ public ExternalService createExternalService() {
+ return new ExternalServiceImpl();
+ }
+
+ /**
+ * @see org.apache.tuscany.model.assembly.AssemblyFactory#createJavaServiceContract()
+ */
+ public JavaServiceContract createJavaServiceContract() {
+ return new JavaServiceContractImpl();
+ }
+
+ /**
+ * @see org.apache.tuscany.model.assembly.AssemblyFactory#createModule()
+ */
+ public Module createModule() {
+ return new ModuleImpl();
+ }
+
+ /**
+ * @see org.apache.tuscany.model.assembly.AssemblyFactory#createModuleFragment()
+ */
+ public ModuleFragment createModuleFragment() {
+ return new ModuleFragmentImpl();
+ }
+
+ /**
+ * @see org.apache.tuscany.model.assembly.AssemblyFactory#createModuleComponent()
+ */
+ public ModuleComponent createModuleComponent() {
+ return new ModuleComponentImpl();
+ }
+
+ /**
+ * @see org.apache.tuscany.model.assembly.AssemblyFactory#createProperty()
+ */
+ public Property createProperty() {
+ return new PropertyImpl();
+ }
+
+ /**
+ * @see org.apache.tuscany.model.assembly.AssemblyFactory#createConfiguredProperty()
+ */
+ public ConfiguredProperty createConfiguredProperty() {
+ return new ConfiguredPropertyImpl();
+ }
+
+ /**
+ * @see org.apache.tuscany.model.assembly.AssemblyFactory#createReference()
+ */
+ public Reference createReference() {
+ return new ReferenceImpl();
+ }
+
+ /**
+ * @see org.apache.tuscany.model.assembly.AssemblyFactory#createConfiguredReference()
+ */
+ public ConfiguredReference createConfiguredReference() {
+ return new ConfiguredReferenceImpl();
+ }
+
+ /**
+ * @see org.apache.tuscany.model.assembly.AssemblyFactory#createService()
+ */
+ public Service createService() {
+ return new ServiceImpl();
+ }
+
+ /**
+ * @see org.apache.tuscany.model.assembly.AssemblyFactory#createConfiguredService()
+ */
+ public ConfiguredService createConfiguredService() {
+ return new ConfiguredServiceImpl();
+ }
+
+ /**
+ * @see org.apache.tuscany.model.assembly.AssemblyFactory#createSubsystem()
+ */
+ public Subsystem createSubsystem() {
+ return new SubsystemImpl();
+ }
+
+ /**
+ * @see org.apache.tuscany.model.assembly.AssemblyFactory#createWSDLServiceContract()
+ */
+ public WSDLServiceContract createWSDLServiceContract() {
+ return new WSDLServiceContractImpl();
+ }
+
+ /**
+ * @see org.apache.tuscany.model.assembly.AssemblyFactory#createServiceURI(java.lang.String)
+ */
+ public ServiceURI createServiceURI(String uri) {
+ return new ServiceURIImpl(uri);
+ }
+
+ /**
+ * @see org.apache.tuscany.model.assembly.AssemblyFactory#createServiceURI(org.apache.tuscany.model.assembly.ModuleComponent, java.lang.String)
+ */
+ public ServiceURI createServiceURI(ModuleComponent moduleComponent, String serviceName) {
+ return new ServiceURIImpl(moduleComponent, serviceName);
+ }
+
+ /**
+ * @see org.apache.tuscany.model.assembly.AssemblyFactory#createServiceURI(org.apache.tuscany.model.assembly.ModuleComponent, org.apache.tuscany.model.assembly.ConfiguredPort)
+ */
+ public ServiceURI createServiceURI(ModuleComponent moduleComponent, ConfiguredPort portEndpoint) {
+ return new ServiceURIImpl(moduleComponent, portEndpoint);
+ }
+
+ /**
+ * @see org.apache.tuscany.model.assembly.AssemblyFactory#createQName(java.lang.String)
+ */
+ public QName createQName(String uri) {
+ int h = uri.indexOf('#');
+ return new QName(uri.substring(0, h), uri.substring(h + 1));
+ }
+
+}
Propchange: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/AssemblyFactoryImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/AssemblyFactoryImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev,Date
Added: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/AssemblyModelContextImpl.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/AssemblyModelContextImpl.java?rev=379052&view=auto
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/AssemblyModelContextImpl.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/AssemblyModelContextImpl.java Mon Feb 20 00:15:10 2006
@@ -0,0 +1,72 @@
+/**
+ *
+ * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ * 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.apache.tuscany.model.assembly.impl;
+
+import org.apache.tuscany.common.resource.loader.ResourceLoader;
+import org.apache.tuscany.common.resource.loader.ResourceLoaderFactory;
+import org.apache.tuscany.model.assembly.AssemblyFactory;
+import org.apache.tuscany.model.assembly.AssemblyModelContext;
+
+/**
+ */
+public class AssemblyModelContextImpl implements AssemblyModelContext {
+
+ private AssemblyFactory assemblyFactory;
+ private ResourceLoader resourceLoader;
+
+ /**
+ * Constructor
+ *
+ * @param resourceLoader
+ */
+ public AssemblyModelContextImpl(ResourceLoader resourceLoader) {
+ initialize(resourceLoader);
+ }
+
+ /**
+ * Constructor
+ */
+ public AssemblyModelContextImpl() {
+ ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
+ resourceLoader = ResourceLoaderFactory.getResourceLoader(classLoader);
+ initialize(resourceLoader);
+ }
+
+ /**
+ * Initialize
+ *
+ * @param resourceLoader
+ */
+ private void initialize(ResourceLoader resourceLoader) {
+ this.resourceLoader = resourceLoader;
+ assemblyFactory = new AssemblyFactoryImpl();
+ }
+
+ /**
+ * @see org.apache.tuscany.model.assembly.AssemblyModelContext#getAssemblyFactory()
+ */
+ public AssemblyFactory getAssemblyFactory() {
+ return assemblyFactory;
+ }
+
+ /**
+ * @see org.apache.tuscany.model.assembly.AssemblyModelContext#getResourceLoader()
+ */
+ public ResourceLoader getResourceLoader() {
+ return resourceLoader;
+ }
+}
Propchange: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/AssemblyModelContextImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/AssemblyModelContextImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev,Date
Added: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/AssemblyModelObjectImpl.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/AssemblyModelObjectImpl.java?rev=379052&view=auto
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/AssemblyModelObjectImpl.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/AssemblyModelObjectImpl.java Mon Feb 20 00:15:10 2006
@@ -0,0 +1,132 @@
+/**
+ *
+ * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ * 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.apache.tuscany.model.assembly.impl;
+
+import java.util.Collection;
+
+import org.apache.tuscany.model.assembly.AssemblyModelContext;
+import org.apache.tuscany.model.assembly.AssemblyModelObject;
+import org.apache.tuscany.model.assembly.AssemblyModelVisitor;
+
+/**
+ * A base class for assembly model objects.
+ */
+public abstract class AssemblyModelObjectImpl implements AssemblyModelObject {
+
+ private boolean frozen;
+ private boolean initialized;
+
+ /**
+ * Constructor
+ */
+ protected AssemblyModelObjectImpl() {
+ }
+
+ /**
+ * @see org.apache.tuscany.model.assembly.AssemblyModelObject#accept(org.apache.tuscany.model.assembly.AssemblyModelVisitor)
+ */
+ public boolean accept(AssemblyModelVisitor visitor) {
+ return visitor.visit(this);
+ }
+
+ /**
+ * Walk a visitor through a collection of model objects.
+ * @param collection
+ * @param visitor
+ * @return
+ */
+ protected boolean accept(Collection collection, AssemblyModelVisitor visitor) {
+ for (Object member : collection) {
+ if (member instanceof AssemblyModelObject) {
+ if (!((AssemblyModelObject)member).accept(visitor))
+ return false;
+ }
+ }
+ return true;
+ }
+
+ /**
+ * @see org.apache.tuscany.model.assembly.AssemblyModelObject#freeze()
+ */
+ public void freeze() {
+ if (!frozen)
+ frozen=true;
+ }
+
+ /**
+ * Returns true if the object is frozen
+ */
+ protected boolean isFrozen() {
+ return frozen;
+ }
+
+ /**
+ * Freeze members of a collection
+ */
+ protected void freeze(Collection collection) {
+ for (Object member : collection) {
+ if (member instanceof AssemblyModelObject) {
+ ((AssemblyModelObject)member).freeze();
+ }
+ }
+ }
+
+ /**
+ * Check that the current model object can be modified.
+ * @throws IllegalStateException
+ */
+ protected void checkNotFrozen() {
+ if (frozen)
+ throw new IllegalStateException("Attempt to modify a frozen assembly model");
+ }
+
+ /**
+ * @see org.apache.tuscany.model.assembly.AssemblyModelObject#initialize(org.apache.tuscany.model.assembly.AssemblyModelContext)
+ */
+ public void initialize(AssemblyModelContext modelContext) {
+ if (!initialized)
+ initialized=true;
+ }
+
+ /**
+ * Returns true if the object is initialized
+ */
+ protected boolean isInitialized() {
+ return initialized;
+ }
+
+ /**
+ * Initialize members of a collection
+ */
+ protected void initialize(Collection collection, AssemblyModelContext modelContext) {
+ for (Object member : collection) {
+ if (member instanceof AssemblyModelObject) {
+ ((AssemblyModelObject)member).initialize(modelContext);
+ }
+ }
+ }
+
+ /**
+ * Check that the current model object is initialized.
+ * @throws IllegalStateException
+ */
+ protected void checkInitialized() {
+ if (!initialized)
+ throw new IllegalStateException("Attempt to use an uninitialized assembly model");
+ }
+
+}
Propchange: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/AssemblyModelObjectImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/AssemblyModelObjectImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev,Date
Added: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ComponentImpl.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ComponentImpl.java?rev=379052&view=auto
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ComponentImpl.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ComponentImpl.java Mon Feb 20 00:15:10 2006
@@ -0,0 +1,234 @@
+/**
+ *
+ * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ * 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.apache.tuscany.model.assembly.impl;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.tuscany.model.assembly.AssemblyFactory;
+import org.apache.tuscany.model.assembly.AssemblyModelContext;
+import org.apache.tuscany.model.assembly.AssemblyModelVisitor;
+import org.apache.tuscany.model.assembly.Component;
+import org.apache.tuscany.model.assembly.ComponentImplementation;
+import org.apache.tuscany.model.assembly.ConfiguredProperty;
+import org.apache.tuscany.model.assembly.ConfiguredReference;
+import org.apache.tuscany.model.assembly.ConfiguredService;
+import org.apache.tuscany.model.assembly.Reference;
+import org.apache.tuscany.model.assembly.Service;
+
+/**
+ * An implementation of Component.
+ */
+public class ComponentImpl extends AggregatePartImpl implements Component {
+
+ private List<ConfiguredReference> configuredReferences;
+ private Map<String, ConfiguredReference> configuredReferencesMap;
+ private List<ConfiguredService> configuredServices;
+ private Map<String, ConfiguredService> configuredServicesMap;
+ private List<ConfiguredProperty> configuredProperties;
+ private Map<String, ConfiguredProperty> configuredPropertiesMap;
+ private ComponentImplementation implementation;
+
+ /**
+ * Constructor
+ */
+ protected ComponentImpl() {
+ }
+
+ /**
+ * @see org.apache.tuscany.model.assembly.Component#getComponentImplementation()
+ */
+ public ComponentImplementation getComponentImplementation() {
+ return implementation;
+ }
+
+ /**
+ * @see org.apache.tuscany.model.assembly.Component#setComponentImplementation(org.apache.tuscany.model.assembly.ComponentImplementation)
+ */
+ public void setComponentImplementation(ComponentImplementation value) {
+ checkNotFrozen();
+ implementation=value;
+ }
+
+ /**
+ * @see org.apache.tuscany.model.assembly.Component#getConfiguredServices()
+ */
+ public List<ConfiguredService> getConfiguredServices() {
+ checkInitialized();
+ return configuredServices;
+ }
+
+ public ConfiguredService getConfiguredService(String name) {
+ checkInitialized();
+ return configuredServicesMap.get(name);
+ }
+
+ /**
+ * @see org.apache.tuscany.model.assembly.Component#getConfiguredReferences()
+ */
+ public List<ConfiguredReference> getConfiguredReferences() {
+ checkInitialized();
+ return configuredReferences;
+ }
+
+ /**
+ * @see org.apache.tuscany.model.assembly.Component#getConfiguredReference(java.lang.String)
+ */
+ public ConfiguredReference getConfiguredReference(String name) {
+ checkInitialized();
+ return configuredReferencesMap.get(name);
+ }
+
+ /**
+ * @see org.apache.tuscany.model.assembly.Component#getConfiguredProperties()
+ */
+ public List<ConfiguredProperty> getConfiguredProperties() {
+ checkInitialized();
+ return configuredProperties;
+ }
+
+ /**
+ * @see org.apache.tuscany.model.assembly.Component#getConfiguredProperty(java.lang.String)
+ */
+ public ConfiguredProperty getConfiguredProperty(String name) {
+ checkInitialized();
+ return configuredPropertiesMap.get(name);
+ }
+
+ /**
+ * @see org.apache.tuscany.model.assembly.AssemblyModelObject#initialize(org.apache.tuscany.model.assembly.AssemblyModelContext)
+ */
+ public void initialize(AssemblyModelContext modelContext) {
+ if (isInitialized())
+ return;
+ super.initialize(modelContext);
+
+ // Initialize the implementation
+ ComponentImplementation implementation = getComponentImplementation();
+ if (implementation != null) {
+ implementation.initialize(modelContext);
+ }
+
+ // Derive the configured services, references and properties from the component implementation
+ configuredServices = new ArrayList<ConfiguredService>();
+ configuredServicesMap = new HashMap<String, ConfiguredService>();
+ configuredReferences = new ArrayList<ConfiguredReference>();
+ configuredReferencesMap = new HashMap<String, ConfiguredReference>();
+ configuredProperties = new ArrayList<ConfiguredProperty>();
+ configuredPropertiesMap = new HashMap<String, ConfiguredProperty>();
+ if (implementation != null) {
+ AssemblyFactory factory = modelContext.getAssemblyFactory();
+ for (Service service : implementation.getServices()) {
+ ConfiguredService configuredService = factory.createConfiguredService();
+ configuredService.setPort(service);
+ configuredServices.add(configuredService);
+ configuredServicesMap.put(service.getName(), configuredService);
+ ((ConfiguredPortImpl)configuredService).setAggregatePart(this);
+ configuredService.initialize(modelContext);
+ }
+
+ for (Reference reference : implementation.getReferences()) {
+ ConfiguredReference configuredReference = factory.createConfiguredReference();
+ configuredReference.setPort(reference);
+ configuredReferences.add(configuredReference);
+ configuredReferencesMap.put(reference.getName(), configuredReference);
+ ((ConfiguredPortImpl)configuredReference).setAggregatePart(this);
+ configuredReference.initialize(modelContext);
+ }
+
+ // Populate property values map
+ //TODO Fix this
+// if (super.getPropertyValues() != null) {
+// Sequence sequence = super.getPropertyValues().getAny();
+// for (int p = 0, n = sequence.size(); p < n; p++) {
+//
+// // Get each property value element
+// commonj.sdo.Property propertyElementDef = sequence.getProperty(p);
+// DataObject propertyElement = (DataObject) sequence.getValue(p);
+//
+// // Get the corresponding property definition
+// String propertyName = propertyElementDef.getName();
+// Property property = implementation.getProperty(propertyName);
+// if (property == null) {
+// throw new IllegalArgumentException("Undefined property " + propertyName);
+// }
+//
+// // Create a property value object
+// ConfiguredProperty propertyValue = factory.createConfiguredProperty();
+// propertyValue.setComponent(this);
+// propertyValue.setProperty(property);
+//
+// // Get the property value text and convert to the expected java type
+// Sequence text = propertyElement.getSequence(0);
+// if (text != null && text.size() != 0) {
+// Object rawValue = text.getValue(0);
+// propertyValue.setValue(rawValue);
+// }
+//
+// // Add the property value object to the map
+// configuredProperties.add(propertyValue);
+// configuredPropertiesMap.put(propertyName, propertyValue);
+// }
+// }
+
+ }
+ }
+
+ /**
+ * @see org.apache.tuscany.model.assembly.AssemblyModelObject#freeze()
+ */
+ public void freeze() {
+ if (isFrozen())
+ return;
+ super.freeze();
+
+ // Freeze configured services, references and properties
+ configuredServices=Collections.unmodifiableList(configuredServices);
+ freeze(configuredServices);
+ configuredReferences=Collections.unmodifiableList(configuredReferences);
+ freeze(configuredReferences);
+ configuredProperties=Collections.unmodifiableList(configuredProperties);
+ freeze(configuredProperties);
+ if (implementation!=null)
+ implementation.freeze();
+ }
+
+ /**
+ * @see org.apache.tuscany.model.assembly.impl.AssemblyModelObjectImpl#accept(org.apache.tuscany.model.assembly.AssemblyModelVisitor)
+ */
+ public boolean accept(AssemblyModelVisitor visitor) {
+ if (!super.accept(visitor))
+ return false;
+
+ if (!accept(configuredServices, visitor))
+ return false;
+ if (!accept(configuredReferences, visitor))
+ return false;
+ if (!accept(configuredProperties, visitor))
+ return false;
+ if (implementation!=null) {
+ if (!implementation.accept(visitor))
+ return false;
+ }
+
+ return true;
+ }
+
+}
Propchange: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ComponentImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ComponentImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev,Date
Added: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ComponentTypeImpl.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ComponentTypeImpl.java?rev=379052&view=auto
==============================================================================
--- incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ComponentTypeImpl.java (added)
+++ incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ComponentTypeImpl.java Mon Feb 20 00:15:10 2006
@@ -0,0 +1,152 @@
+/**
+ *
+ * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ * 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.apache.tuscany.model.assembly.impl;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.tuscany.model.assembly.AssemblyModelContext;
+import org.apache.tuscany.model.assembly.AssemblyModelVisitor;
+import org.apache.tuscany.model.assembly.ComponentType;
+import org.apache.tuscany.model.assembly.Property;
+import org.apache.tuscany.model.assembly.Reference;
+import org.apache.tuscany.model.assembly.Service;
+
+/**
+ * An implementation of ComponentType.
+ */
+public class ComponentTypeImpl extends ExtensibleImpl implements ComponentType {
+
+ private List<Reference> references=new ArrayList<Reference>();
+ private Map<String, Reference> referencesMap;
+ private List<Service> services=new ArrayList<Service>();
+ private Map<String, Service> servicesMap;
+ private List<Property> properties=new ArrayList<Property>();
+ private Map<String, Property> propertiesMap;
+
+ /**
+ * Constructor
+ */
+ protected ComponentTypeImpl() {
+ }
+
+ /**
+ * @see org.apache.tuscany.model.assembly.ComponentType#getReferences()
+ */
+ public List<Reference> getReferences() {
+ return references;
+ }
+
+ /**
+ * @see org.apache.tuscany.model.assembly.ComponentType#getReference(java.lang.String)
+ */
+ public Reference getReference(String name) {
+ checkInitialized();
+ return referencesMap.get(name);
+ }
+
+ /**
+ * @see org.apache.tuscany.model.assembly.ComponentType#getServices()
+ */
+ public List<Service> getServices() {
+ return services;
+ }
+
+ /**
+ * @see org.apache.tuscany.model.assembly.ComponentType#getService(java.lang.String)
+ */
+ public Service getService(String name) {
+ checkInitialized();
+ return servicesMap.get(name);
+ }
+
+ /**
+ * @see org.apache.tuscany.model.assembly.ComponentType#getProperties()
+ */
+ public List<Property> getProperties() {
+ return properties;
+ }
+
+ /**
+ * @see org.apache.tuscany.model.assembly.ComponentType#getProperty(java.lang.String)
+ */
+ public Property getProperty(String name) {
+ checkInitialized();
+ return propertiesMap.get(name);
+ }
+
+ /**
+ * @see org.apache.tuscany.model.assembly.AssemblyModelObject#initialize(org.apache.tuscany.model.assembly.AssemblyModelContext)
+ */
+ public void initialize(AssemblyModelContext modelContext) {
+ if (isInitialized())
+ return;
+ super.initialize(modelContext);
+
+ // Populate maps of references, properties and services
+ referencesMap = new HashMap<String, Reference>();
+ for (Reference reference : references) {
+ referencesMap.put(reference.getName(), reference);
+ reference.initialize(modelContext);
+ }
+ propertiesMap = new HashMap<String, Property>();
+ for (Property property : properties) {
+ propertiesMap.put(property.getName(), property);
+ property.initialize(modelContext);
+ }
+ servicesMap = new HashMap<String, Service>();
+ for (Service service : services) {
+ servicesMap.put(service.getName(), service);
+ service.initialize(modelContext);
+ }
+ }
+
+ public void freeze() {
+ if (isFrozen())
+ return;
+ super.freeze();
+
+ // Freeze lists of services, references and properties
+ services=Collections.unmodifiableList(services);
+ freeze(services);
+ references=Collections.unmodifiableList(references);
+ freeze(references);
+ properties=Collections.unmodifiableList(properties);
+ freeze(properties);
+ }
+
+ /**
+ * @see org.apache.tuscany.model.assembly.impl.AssemblyModelObjectImpl#accept(org.apache.tuscany.model.assembly.AssemblyModelVisitor)
+ */
+ public boolean accept(AssemblyModelVisitor visitor) {
+ if (!super.accept(visitor))
+ return false;
+
+ if (!accept(services, visitor))
+ return false;
+ if (!accept(references, visitor))
+ return false;
+ if (!accept(properties, visitor))
+ return false;
+
+ return true;
+ }
+
+}
Propchange: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ComponentTypeImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/sandbox/sebastien/java/sca/model/src/main/java/org/apache/tuscany/model/assembly/impl/ComponentTypeImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev,Date