diff options
Diffstat (limited to 'sandbox/ant/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DASInvokerFactory.java')
-rw-r--r-- | sandbox/ant/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DASInvokerFactory.java | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/sandbox/ant/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DASInvokerFactory.java b/sandbox/ant/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DASInvokerFactory.java new file mode 100644 index 0000000000..f81cf29202 --- /dev/null +++ b/sandbox/ant/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DASInvokerFactory.java @@ -0,0 +1,50 @@ +/* + * 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.implementation.das; + +import org.apache.tuscany.das.rdb.DAS; +import org.apache.tuscany.sca.assembly.ComponentType; +import org.apache.tuscany.sca.interfacedef.Operation; +import org.apache.tuscany.sca.invocation.Invoker; +import org.apache.tuscany.sca.runtime.RuntimeComponent; +import org.apache.tuscany.sca.spi.InvokerFactory; +import org.osoa.sca.ServiceRuntimeException; + +public class DASInvokerFactory implements InvokerFactory { + + DASImplementation impl; + DataAccessEngineManager dataAccessEngineManager; + + public DASInvokerFactory(RuntimeComponent rc, ComponentType ct, DASImplementation impl, DataAccessEngineManager dataAccessEngineManager) { + this.impl = impl; + this.dataAccessEngineManager = dataAccessEngineManager; + } + + public Invoker createInvoker(Operation operation) { + DAS das = null; + try { + das = dataAccessEngineManager.getDAS(impl.getConfig()); + } catch(Exception e) { + throw new ServiceRuntimeException(e); + } + return new DASInvoker(operation, new DataAccessEngine(das) ); + } + +} |