source: ComponentRegistry/branches/ggeorgovassilis_workspace/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/services/remote/HttpServiceFactory.as @ 3366

Last change on this file since 3366 was 3366, checked in by g.georgovassilis@mpi.nl, 11 years ago

#269 BaseRemoteService? abstracts HTTP communication away for XML services, added facility for mocking services in unit tests, moved tests into src/test

  • Property svn:mime-type set to text/plain
File size: 693 bytes
Line 
1package clarin.cmdi.componentregistry.services.remote
2{
3/**
4 * HttpService factory returns the right implementation of a RemoteService interface, which would typically be
5 * a ClientHttpService for a flex app running in the browser and a MockHttpService for an app running in a flexunit test
6 */
7       
8        public class HttpServiceFactory
9        {
10               
11                public static var impl:HttpServiceFactory;
12               
13                public static function createRemoteService():RemoteService{
14                        if (impl == null)
15                                impl = new ClientServiceFactoryImpl();
16                        return impl.createNew();
17                }
18               
19                public function createNew():RemoteService{
20                        if (impl == null)
21                                impl = new ClientServiceFactoryImpl();
22                        return impl.createNew();
23                };     
24        }
25}
Note: See TracBrowser for help on using the repository browser.