3232
3333package com .adobe .cairngorm .business ;
3434
35+ #if feathersui_rpc_services
3536import feathers .rpc .remoting .RemoteObject ;
3637import feathers .rpc .AbstractInvoker ;
3738import feathers .rpc .AbstractService ;
3839import feathers .rpc .http .HTTPService ;
40+ #end
3941
4042/**
4143 The ServiceLocator allows service to be located and security
@@ -51,9 +53,12 @@ import feathers.rpc.http.HTTPService;
5153class ServiceLocator implements IServiceLocator {
5254 private static var _instance : ServiceLocator ;
5355
56+ #if feathersui_rpc_services
5457 private var _httpServices : HTTPServices ;
5558 private var _remoteObjects : RemoteObjects ;
59+
5660 // private var _webServices:WebServices;
61+ #end
5762 private var _timeout : Int = 0 ;
5863
5964 public static var instance (get , never ): ServiceLocator ;
@@ -96,6 +101,7 @@ class ServiceLocator implements IServiceLocator {
96101 _instance = this ;
97102 }
98103
104+ #if feathersui_rpc_services
99105 /**
100106 Deprecated.
101107
@@ -156,6 +162,7 @@ class ServiceLocator implements IServiceLocator {
156162 // public function getWebService(name:String):WebService {
157163 // return cast(webServices.getService(name), WebService);
158164 // }
165+ #end
159166
160167 /**
161168 Set the credentials for all registered services.
@@ -164,9 +171,11 @@ class ServiceLocator implements IServiceLocator {
164171 @param password the password to set.
165172 **/
166173 public function setCredentials (username : String , password : String ): Void {
174+ #if feathersui_rpc_services
167175 httpServices .setCredentials (username , password );
168176 // remoteObjects.setCredentials(username, password);
169177 // webServices.setCredentials(username, password);
178+ #end
170179 }
171180
172181 /**
@@ -175,15 +184,18 @@ class ServiceLocator implements IServiceLocator {
175184 @param password the password to set.
176185 **/
177186 public function setRemoteCredentials (username : String , password : String ): Void {
187+ #if feathersui_rpc_services
178188 httpServices .setRemoteCredentials (username , password );
179189 // remoteObjects.setRemoteCredentials(username, password);
180190 // webServices.setRemoteCredentials(username, password);
191+ #end
181192 }
182193
183194 /**
184195 Logs the user out of all registered services.
185196 **/
186197 public function logout (): Void {
198+ #if feathersui_rpc_services
187199 // First release the resources held by the service. We release the
188200 // resources first as the logout logs the user out at a channel level.
189201 httpServices .release ();
@@ -194,6 +206,7 @@ class ServiceLocator implements IServiceLocator {
194206 httpServices .logout ();
195207 // remoteObjects.logout();
196208 // webServices.logout();
209+ #end
197210 }
198211
199212 public var timeout (get , set ): Int ;
@@ -207,6 +220,7 @@ class ServiceLocator implements IServiceLocator {
207220 return _timeout ;
208221 }
209222
223+ #if feathersui_rpc_services
210224 private var httpServices (get , never ): HTTPServices ;
211225
212226 private function get_httpServices (): HTTPServices {
@@ -238,6 +252,7 @@ class ServiceLocator implements IServiceLocator {
238252 // }
239253 // return _webServices;
240254 // }
255+ #end
241256
242257 /**
243258 Return the service with the given id.
0 commit comments