1 /* 2 * Copyright the original author or authors. 3 * 4 * Licensed under the MOZILLA PUBLIC LICENSE, Version 1.1 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.mozilla.org/MPL/MPL-1.1.html 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 import org.as2lib.io.conn.core.client.ClientServiceProxy; 18 import org.as2lib.io.conn.core.client.ClientServiceProxyFactory; 19 import org.as2lib.io.conn.core.client.AbstractClientServiceProxyFactory; 20 import org.as2lib.io.conn.local.client.LocalClientServiceProxy; 21 22 /** 23 * {@code SimpleClientServiceProxyFactory} is the simplest implementation of a client 24 * service proxy factory. 25 * 26 * <p>It allows only the {@link #getClientServiceProxyByUrl} method to be used and 27 * not the {@code getClientServiceProxyByUrlAndType} method. 28 * 29 * <code> 30 * var clientFactory:SimpleClientServiceProxyFactory = new SimpleClientServiceProxyFactory(); 31 * var client:ClientServiceProxy = clientFactory.getClientServiceProxy("local.as2lib.org/myService"); 32 * </code> 33 * 34 * @author Simon Wacker 35 */ 36 class org.as2lib.io.conn.local.client.SimpleClientServiceProxyFactory extends AbstractClientServiceProxyFactory implements ClientServiceProxyFactory { 37 38 /** 39 * Constructs a new {@code SimpleClientServiceProxyFactory} instance. 40 */ 41 public function SimpleClientServiceProxyFactory(Void) { 42 } 43 44 /** 45 * Returns a client service proxy for the service specified by the passed-in 46 * {@code url}. 47 * 48 * <p>You can use this proxy to invoke methods on the 'remote' service and to handle 49 * responses. The returned client service proxy is an instance of class 50 * {@link LocalClientServiceProxy}. 51 * 52 * @param url the url of the 'remote' service 53 * @return a client service proxy to invoke methods on the 'remote' service 54 */ 55 public function getClientServiceProxyByUrl(url:String):ClientServiceProxy { 56 return new LocalClientServiceProxy(url); 57 } 58 59 }