diff options
Diffstat (limited to 'branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/RuntimeComponentReferenceImpl.java')
-rw-r--r-- | branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/RuntimeComponentReferenceImpl.java | 86 |
1 files changed, 0 insertions, 86 deletions
diff --git a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/RuntimeComponentReferenceImpl.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/RuntimeComponentReferenceImpl.java deleted file mode 100644 index 128ae29b81..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/RuntimeComponentReferenceImpl.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * 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.core.runtime; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.apache.tuscany.sca.assembly.Binding; -import org.apache.tuscany.sca.assembly.impl.ComponentReferenceImpl; -import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper; -import org.apache.tuscany.sca.interfacedef.Operation; -import org.apache.tuscany.sca.invocation.InvocationChain; -import org.apache.tuscany.sca.invocation.Invoker; -import org.apache.tuscany.sca.provider.ReferenceBindingProvider; -import org.apache.tuscany.sca.runtime.RuntimeComponentReference; -import org.apache.tuscany.sca.runtime.RuntimeWire; - -public class RuntimeComponentReferenceImpl extends ComponentReferenceImpl implements RuntimeComponentReference { - private List<RuntimeWire> wires = new ArrayList<RuntimeWire>(); - private Map<Binding, ReferenceBindingProvider> bindingProviders = new HashMap<Binding, ReferenceBindingProvider>(); - private InterfaceContractMapper mapper; - - public RuntimeComponentReferenceImpl(InterfaceContractMapper mapper) { - super(); - this.mapper = mapper; - } - - public void addRuntimeWire(RuntimeWire wire) { - wires.add(wire); - } - - public List<RuntimeWire> getRuntimeWires() { - return wires; - } - - public RuntimeWire getRuntimeWire(Binding binding) { - for (RuntimeWire wire : wires) { - if (wire.getSource().getBinding() == binding) { - return wire; - } - } - return null; - } - - public ReferenceBindingProvider getBindingProvider(Binding binding) { - return bindingProviders.get(binding); - } - - public void setBindingProvider(Binding binding, ReferenceBindingProvider bindingProvider) { - bindingProviders.put(binding, bindingProvider); - } - - public Invoker getInvoker(Binding binding, Operation operation) { - RuntimeWire wire = getRuntimeWire(binding); - if (wire == null) { - return null; - } - for (InvocationChain chain : wire.getInvocationChains()) { - Operation op = chain.getSourceOperation(); - if (mapper.isCompatible(operation, op, op.getInterface().isRemotable())) { - return chain.getHeadInvoker(); - } - } - return null; - } - -} |