Author: slaws
Date: Fri May 16 00:40:54 2008
New Revision: 656954

URL: http://svn.apache.org/viewvc?rev=656954&view=rev
Log:
Add Endpoint model, factory and builder 

Added:
    
incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/DefaultEndpointFactory.java
   (with props)
    
incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Endpoint.java
   (with props)
    
incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/EndpointFactory.java
   (with props)
    
incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/DefaultEndpointBuilder.java
   (with props)
    
incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/EndpointBuilder.java
   (with props)
    
incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/EndpointBuilderImpl.java
   (with props)
    
incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/EndpointFactoryImpl.java
   (with props)
    
incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/EndpointImpl.java
   (with props)
    
incubator/tuscany/java/sca/modules/assembly/src/main/resources/META-INF/services/org.apache.tuscany.sca.assembly.EndpointFactory

Added: 
incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/DefaultEndpointFactory.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/DefaultEndpointFactory.java?rev=656954&view=auto
==============================================================================
--- 
incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/DefaultEndpointFactory.java
 (added)
+++ 
incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/DefaultEndpointFactory.java
 Fri May 16 00:40:54 2008
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.sca.assembly;
+
+
+import org.apache.tuscany.sca.assembly.impl.EndpointFactoryImpl;
+
+/**
+ * A default factory for the Endpoint model.
+ * 
+ * @version $Rev$ $Date$
+ */
+public class DefaultEndpointFactory extends EndpointFactoryImpl {
+    
+}

Propchange: 
incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/DefaultEndpointFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/DefaultEndpointFactory.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: 
incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Endpoint.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Endpoint.java?rev=656954&view=auto
==============================================================================
--- 
incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Endpoint.java
 (added)
+++ 
incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Endpoint.java
 Fri May 16 00:40:54 2008
@@ -0,0 +1,151 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.sca.assembly;
+
+import java.util.List;
+
+/**
+ * Represents an endpoint (primarily a combination of a target service name 
and a set of
+ * candidate bindings)
+ * 
+ * @version $Rev$ $Date$
+ */
+public interface Endpoint extends Base, Cloneable {
+    
+    /**
+     * Get the name of the target service that this endpoint refers to
+     * 
+     * @return target service name
+     */
+    String getTargetName();
+    
+    /**
+     * Set the name of the target service that this endpoint refers to
+     * 
+     * @param targetName
+     */
+    void setTargetName(String targetName);    
+    
+    /**
+     * Get the source component model object
+     * 
+     * @return source component
+     */
+    Component getSourceComponent();
+    
+    /**
+     * Set the source component model object
+     * 
+     * @param component the source component for the endpoint
+     */
+    void setSourceComponent(Component component);
+    
+    /**
+     * Get the source component reference model object
+     * 
+     * @return reference the source component reference  for the endpoint
+     */
+    ComponentReference getSourceComponentReference();
+    
+    /**
+     * Set the source component reference model object
+     * 
+     * @param reference
+     */
+    void setSourceComponentReference(ComponentReference reference);   
+    
+    /**
+     * Get the resolved source binding 
+     * 
+     * @return binding the resolved source binding
+     */
+    Binding getSourceBinding();
+    
+    /**
+     * Set the resolved source binding 
+     * 
+     * @param binding the resolved source binding
+     */
+    void setSourceBinding(Binding binding);
+
+    /**
+     * Get the resolved source callback binding 
+     * 
+     * @return binding the resolved source callback binding
+     */
+    Binding getSourceCallbackBinding();
+    
+    /**
+     * Set the resolved source callback binding
+     * 
+     * @param binding the resolved source callback binding
+     */
+    void setSourceCallbackBinding(Binding binding);  
+    
+    /**
+     * Get the list of candidate bindings that could be used to 
+     * communication with the target service
+     * 
+     * @return list of candidate bindings
+     */
+    List<Binding> getCandidateBindings();
+    
+    
+    /**
+     * Get the target component model object
+     * 
+     * @return target component
+     */
+    Component getTargetComponent();
+    
+    /**
+     * Set the target component model object
+     * 
+     * @param component target component
+     */
+    void setTargetComponent(Component component);
+    
+    /**
+     * Get the target component service model object
+     * 
+     * @return target component service
+     */
+    ComponentService getTargetComponentService();
+    
+    /**
+     * Set the target component service model object
+     * 
+     * @param service
+     */
+    void setTargetComponentService(ComponentService service);
+    
+    /**
+     * Get the resolved target binding 
+     * 
+     * @return target binding
+     */
+    Binding getTargetBinding();
+    
+    /**
+     * Set the resolved target binding
+     * 
+     * @param binding target binding
+     */
+    void setTargetBinding(Binding binding);       
+}

Propchange: 
incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Endpoint.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Endpoint.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: 
incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/EndpointFactory.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/EndpointFactory.java?rev=656954&view=auto
==============================================================================
--- 
incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/EndpointFactory.java
 (added)
+++ 
incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/EndpointFactory.java
 Fri May 16 00:40:54 2008
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.sca.assembly;
+
+import org.apache.tuscany.sca.assembly.builder.EndpointBuilder;
+import org.apache.tuscany.sca.monitor.Monitor;
+
+
+/**
+ * A factory for the endpoint model
+ * 
+ * @version $Rev$ $Date$
+ */
+public interface EndpointFactory {
+
+    /**
+     * Create a new endpoint model object 
+     * 
+     * @return a new endpoint
+     */
+    Endpoint createEndpoint();
+    
+}

Propchange: 
incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/EndpointFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/EndpointFactory.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: 
incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/DefaultEndpointBuilder.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/DefaultEndpointBuilder.java?rev=656954&view=auto
==============================================================================
--- 
incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/DefaultEndpointBuilder.java
 (added)
+++ 
incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/DefaultEndpointBuilder.java
 Fri May 16 00:40:54 2008
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.sca.assembly.builder;
+
+import org.apache.tuscany.sca.assembly.builder.impl.EndpointBuilderImpl;
+import org.apache.tuscany.sca.monitor.Monitor;
+
+/**
+ * A default builder.
+ * 
+ * @version $Rev$ $Date$
+ */
+public class DefaultEndpointBuilder extends EndpointBuilderImpl {
+    public DefaultEndpointBuilder (Monitor monitor){
+        super(monitor);
+    }
+}

Propchange: 
incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/DefaultEndpointBuilder.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/DefaultEndpointBuilder.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: 
incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/EndpointBuilder.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/EndpointBuilder.java?rev=656954&view=auto
==============================================================================
--- 
incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/EndpointBuilder.java
 (added)
+++ 
incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/EndpointBuilder.java
 Fri May 16 00:40:54 2008
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.sca.assembly.builder;
+
+import org.apache.tuscany.sca.assembly.Endpoint;
+
+/**
+ * A builder that handles the configuration of reference endpoints
+ * It collects together the logic so that it can be used at build time
+ * or later on during late binding scenarios
+ *
+ * @version $Rev$ $Date$
+ */
+public interface EndpointBuilder {
+    
+    /**
+     * Build an endpoint.
+     * 
+     * @param endpoint
+     */
+    void build(Endpoint endpoint);
+    
+}

Propchange: 
incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/EndpointBuilder.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/EndpointBuilder.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: 
incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/EndpointBuilderImpl.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/EndpointBuilderImpl.java?rev=656954&view=auto
==============================================================================
--- 
incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/EndpointBuilderImpl.java
 (added)
+++ 
incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/EndpointBuilderImpl.java
 Fri May 16 00:40:54 2008
@@ -0,0 +1,115 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.sca.assembly.builder.impl;
+
+import org.apache.tuscany.sca.assembly.Binding;
+import org.apache.tuscany.sca.assembly.ComponentService;
+import org.apache.tuscany.sca.assembly.CompositeService;
+import org.apache.tuscany.sca.assembly.Endpoint;
+import org.apache.tuscany.sca.assembly.Service;
+import org.apache.tuscany.sca.assembly.builder.EndpointBuilder;
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.Problem;
+import org.apache.tuscany.sca.monitor.Problem.Severity;
+
+/**
+ * A factory for the Endpoint model.
+ * 
+ * @version $Rev$ $Date$
+ */
+public abstract class EndpointBuilderImpl implements EndpointBuilder {
+    
+    private Monitor monitor;
+    
+    public EndpointBuilderImpl (Monitor monitor){
+        this.monitor = monitor;
+    }
+    
+    private void warning(String message, Object model, String... 
messageParameters) {
+        Problem problem = new ProblemImpl(this.getClass().getName(), 
"assembly-validation-messages", Severity.WARNING, model, message, 
(Object[])messageParameters);
+        monitor.problem(problem);
+    }    
+
+    /**
+     * Resolve an endpoint against the provided target information and the 
+     * set of candidate bindings. 
+     */
+    public void build(Endpoint endpoint) {
+
+        // If this endpoint is not fully configured then don't try and resolve 
it
+        if (endpoint.getTargetComponentService() == null){
+            return;
+        }
+        
+        // Does the reference expect callbacks
+        boolean bidirectional = false;
+        
+        if (endpoint.getSourceComponentReference().getInterfaceContract() != 
null && 
+            
endpoint.getSourceComponentReference().getInterfaceContract().getCallbackInterface()
 != null) {
+            bidirectional = true;
+        }
+        
+        // if the target service is a promoted service then find the
+        // service it promotes
+        if (endpoint.getTargetComponentService().getService() instanceof 
CompositeService) {
+            CompositeService compositeService = (CompositeService) 
endpoint.getTargetComponentService().getService();
+            // Find the promoted component service
+            
endpoint.setTargetComponentService(ServiceConfigurationUtil.getPromotedComponentService(compositeService));
+        }
+        
+        try  {
+            
PolicyConfigurationUtil.determineApplicableBindingPolicySets(endpoint.getSourceComponentReference(),
 
+                                                                         
endpoint.getTargetComponentService());
+        } catch ( Exception e ) {
+            warning("Policy related exception: " + e, e);
+        }    
+        
+
+        // Match the binding against the bindings of the target service
+        Binding resolvedBinding = 
BindingConfigurationUtil.matchBinding(endpoint.getTargetComponent(),
+                                                                        
endpoint.getTargetComponentService(),
+                                                                        
endpoint.getCandidateBindings(),
+                                                                        
endpoint.getTargetComponentService().getBindings());
+        if (resolvedBinding == null) {
+            warning("NoMatchingBinding", 
+                    endpoint.getSourceComponentReference(),
+                    endpoint.getSourceComponentReference().getName(), 
+                    endpoint.getTargetComponentService().getName());
+        } else {
+            endpoint.setSourceBinding(resolvedBinding);
+        }
+        
+        if (bidirectional) {
+            Binding resolvedCallbackBinding = 
BindingConfigurationUtil.matchBinding(endpoint.getTargetComponent(),
+                                                                               
     endpoint.getTargetComponentService(),
+                                                                               
     endpoint.getSourceComponentReference().getCallback().getBindings(),
+                                                                               
     endpoint.getTargetComponentService().getCallback().getBindings());
+            if (resolvedBinding == null) {
+                warning("NoMatchingCallbackBinding", 
+                        endpoint.getSourceComponentReference(),
+                        endpoint.getSourceComponentReference().getName(), 
+                        endpoint.getTargetComponentService().getName());
+            } else {
+                endpoint.setSourceCallbackBinding(resolvedCallbackBinding);
+            }
+        }       
+    }  
+    
+}

Propchange: 
incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/EndpointBuilderImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/EndpointBuilderImpl.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: 
incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/EndpointFactoryImpl.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/EndpointFactoryImpl.java?rev=656954&view=auto
==============================================================================
--- 
incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/EndpointFactoryImpl.java
 (added)
+++ 
incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/EndpointFactoryImpl.java
 Fri May 16 00:40:54 2008
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.sca.assembly.impl;
+
+
+import org.apache.tuscany.sca.assembly.Endpoint;
+import org.apache.tuscany.sca.assembly.EndpointFactory;
+import org.apache.tuscany.sca.assembly.builder.DefaultEndpointBuilder;
+import org.apache.tuscany.sca.assembly.builder.EndpointBuilder;
+import org.apache.tuscany.sca.monitor.Monitor;
+
+/**
+ * A factory for the Endpoint model.
+ * 
+ * @version $Rev$ $Date$
+ */
+public abstract class EndpointFactoryImpl implements EndpointFactory {
+    
+    public EndpointFactoryImpl (){
+        
+    }
+
+    public Endpoint createEndpoint() {
+        return new EndpointImpl();
+    } 
+    
+}

Propchange: 
incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/EndpointFactoryImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/EndpointFactoryImpl.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: 
incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/EndpointImpl.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/EndpointImpl.java?rev=656954&view=auto
==============================================================================
--- 
incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/EndpointImpl.java
 (added)
+++ 
incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/EndpointImpl.java
 Fri May 16 00:40:54 2008
@@ -0,0 +1,143 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.sca.assembly.impl;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.tuscany.sca.assembly.Binding;
+import org.apache.tuscany.sca.assembly.Component;
+import org.apache.tuscany.sca.assembly.ComponentReference;
+import org.apache.tuscany.sca.assembly.ComponentService;
+import org.apache.tuscany.sca.assembly.Endpoint;
+
+/**
+ * The assembly model object for an endpoint.
+ * 
+ * @version $Rev$ $Date$
+ */
+public class EndpointImpl implements Endpoint {
+   
+    private String targetName;
+        
+    private Component sourceComponent;
+    private ComponentReference sourceComponentReference;
+    private Binding resolvedBinding;
+    private Binding resolvedCallbackBinding;
+    
+    private List<Binding> candidateBindings = new ArrayList<Binding>();
+    
+    private Component targetComponent;
+    private ComponentService targetComponentService;
+    private Binding targetBinding;
+    private Binding targetCallbackBinding;
+    
+    protected EndpointImpl() {
+    }
+          
+    public boolean isUnresolved() {
+        return resolvedBinding == null;
+    }
+    
+    public void setUnresolved(boolean unresolved) {
+        // do nothing as the status is determined by having
+        // a resolved source binding
+    }
+
+    @Override
+    public Object clone() throws CloneNotSupportedException {
+        return super.clone();
+    }
+    
+    public String getTargetName(){
+        return targetName;
+    }
+    
+    public void setTargetName(String targetName){
+        this.targetName = targetName;
+    }
+
+    public Component getSourceComponent() {
+        return sourceComponent;
+    }
+
+    public void setSourceComponent(Component sourceComponent) {
+        this.sourceComponent = sourceComponent;
+    }
+
+    public ComponentReference getSourceComponentReference() {
+        return sourceComponentReference;
+    }
+
+    public void setSourceComponentReference(ComponentReference 
sourceComponentReference) {
+        this.sourceComponentReference = sourceComponentReference;
+    }    
+    
+    public Binding getSourceBinding() {
+        return resolvedBinding;
+    }
+
+    public void setSourceBinding(Binding resolvedBinding) {
+        this.resolvedBinding = resolvedBinding;
+    }
+    
+    public Binding getSourceCallbackBinding(){
+        return resolvedCallbackBinding;
+    }
+
+    public void setSourceCallbackBinding(Binding resolvedCallbackBinding){
+        this.resolvedCallbackBinding = resolvedCallbackBinding;   
+    }    
+
+    public List<Binding> getCandidateBindings() {
+        return candidateBindings;
+    }
+    
+    public Component getTargetComponent() {
+        return targetComponent;
+    }
+
+    public void setTargetComponent(Component targetComponent) {
+        this.targetComponent = targetComponent;
+    }
+
+    public ComponentService getTargetComponentService() {
+        return targetComponentService;
+    }
+
+    public void setTargetComponentService(ComponentService 
targetComponentService) {
+        this.targetComponentService = targetComponentService;
+    }
+    
+    public Binding getTargetBinding() {
+        return targetBinding;
+    }
+
+    public void setTargetBinding(Binding targetBinding) {
+        this.targetBinding = targetBinding;
+    }
+    
+    public Binding getTargetCallbackBinding(){
+        return targetCallbackBinding;
+    }
+    
+    public void setTargetCallbackBinding(Binding targetCallbackBinding){
+        this.targetCallbackBinding = targetCallbackBinding;   
+    } 
+}

Propchange: 
incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/EndpointImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/EndpointImpl.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: 
incubator/tuscany/java/sca/modules/assembly/src/main/resources/META-INF/services/org.apache.tuscany.sca.assembly.EndpointFactory
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/assembly/src/main/resources/META-INF/services/org.apache.tuscany.sca.assembly.EndpointFactory?rev=656954&view=auto
==============================================================================
--- 
incubator/tuscany/java/sca/modules/assembly/src/main/resources/META-INF/services/org.apache.tuscany.sca.assembly.EndpointFactory
 (added)
+++ 
incubator/tuscany/java/sca/modules/assembly/src/main/resources/META-INF/services/org.apache.tuscany.sca.assembly.EndpointFactory
 Fri May 16 00:40:54 2008
@@ -0,0 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you 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. 
+
+org.apache.tuscany.sca.assembly.DefaultEndpointFactory
\ No newline at end of file


Reply via email to