summaryrefslogtreecommitdiff
path: root/swift/src
diff options
context:
space:
mode:
Diffstat (limited to 'swift/src')
-rw-r--r--swift/src/Ice/CommunicatorI.swift12
-rw-r--r--swift/src/Ice/ObjectAdapterI.swift6
-rw-r--r--swift/src/IceObjc/Communicator.h18
-rw-r--r--swift/src/IceObjc/Communicator.mm26
-rw-r--r--swift/src/IceObjc/ObjectAdapter.h2
-rw-r--r--swift/src/IceObjc/ObjectAdapter.mm12
6 files changed, 53 insertions, 23 deletions
diff --git a/swift/src/Ice/CommunicatorI.swift b/swift/src/Ice/CommunicatorI.swift
index 5d210a526f0..c29312b0421 100644
--- a/swift/src/Ice/CommunicatorI.swift
+++ b/swift/src/Ice/CommunicatorI.swift
@@ -242,12 +242,16 @@ class CommunicatorI: LocalObject<ICECommunicator>, Communicator {
}
}
- func getClientDispatchQueue() -> Dispatch.DispatchQueue {
- return _handle.getClientDispatchQueue()
+ func getClientDispatchQueue() throws -> DispatchQueue {
+ return try autoreleasepool {
+ try _handle.getClientDispatchQueue()
+ }
}
- func getServerDispatchQueue() -> Dispatch.DispatchQueue {
- return _handle.getServerDispatchQueue()
+ func getServerDispatchQueue() throws -> DispatchQueue {
+ return try autoreleasepool {
+ try _handle.getServerDispatchQueue()
+ }
}
}
diff --git a/swift/src/Ice/ObjectAdapterI.swift b/swift/src/Ice/ObjectAdapterI.swift
index e23e2f10482..4a192866d25 100644
--- a/swift/src/Ice/ObjectAdapterI.swift
+++ b/swift/src/Ice/ObjectAdapterI.swift
@@ -182,8 +182,10 @@ class ObjectAdapterI: LocalObject<ICEObjectAdapter>, ObjectAdapter, ICEBlobjectF
try _handle.setPublishedEndpoints(newEndpoints.toObjc())
}
- func getDispatchQueue() -> DispatchQueue {
- return _handle.getDispatchQueue()
+ func getDispatchQueue() throws -> DispatchQueue {
+ return try autoreleasepool {
+ try _handle.getDispatchQueue()
+ }
}
func facadeInvoke(_ adapter: ICEObjectAdapter,
diff --git a/swift/src/IceObjc/Communicator.h b/swift/src/IceObjc/Communicator.h
index d36e76fa5d7..c72290d982f 100644
--- a/swift/src/IceObjc/Communicator.h
+++ b/swift/src/IceObjc/Communicator.h
@@ -27,10 +27,10 @@ NS_ASSUME_NONNULL_BEGIN
-(ICEImplicitContext*) getImplicitContext;
-(id<ICELoggerProtocol>) getLogger;
-(nullable ICEObjectPrx*) getDefaultRouter;
--(BOOL) setDefaultRouter:(ICEObjectPrx* _Nullable)router error:(NSError**)error;
+-(BOOL) setDefaultRouter:(ICEObjectPrx* _Nullable)router error:(NSError* _Nullable * _Nullable)error;
-(nullable ICEObjectPrx*) getDefaultLocator;
--(BOOL) setDefaultLocator:(ICEObjectPrx* _Nullable)locator error:(NSError**)error;
--(BOOL) flushBatchRequests:(uint8_t)compress error:(NSError**)error;
+-(BOOL) setDefaultLocator:(ICEObjectPrx* _Nullable)locator error:(NSError* _Nullable * _Nullable)error;
+-(BOOL) flushBatchRequests:(uint8_t)compress error:(NSError* _Nullable * _Nullable)error;
-(BOOL) flushBatchRequestsAsync:(uint8_t)compress
exception:(void (^)(NSError*))exception
sent:(void (^_Nullable)(bool))sent
@@ -41,15 +41,15 @@ NS_ASSUME_NONNULL_BEGIN
error:(NSError**)error;
-(nullable id) getAdmin:(NSError**)error;
-(BOOL) addAdminFacet:(id<ICEBlobjectFacade>)servant facet:(NSString*)facet error:(NSError**)error;
--(nullable id<ICEBlobjectFacade>) removeAdminFacet:(NSString*)facet error:(NSError**)error;
--(nullable id) findAdminFacet:(NSString*)facet error:(NSError**)error;
--(nullable NSDictionary<NSString*, id<ICEBlobjectFacade>>*) findAllAdminFacets:(NSError**)error;
+-(nullable id<ICEBlobjectFacade>) removeAdminFacet:(NSString*)facet error:(NSError* _Nullable * _Nullable)error;
+-(nullable id) findAdminFacet:(NSString*)facet error:(NSError* _Nullable * _Nullable)error;
+-(nullable NSDictionary<NSString*, id<ICEBlobjectFacade>>*) findAllAdminFacets:(NSError* _Nullable * _Nullable)error;
-(ICEProperties*) getProperties;
--(dispatch_queue_t) getClientDispatchQueue;
--(dispatch_queue_t) getServerDispatchQueue;
+-(nullable dispatch_queue_t) getClientDispatchQueue:(NSError* _Nullable * _Nullable)error;
+-(nullable dispatch_queue_t) getServerDispatchQueue:(NSError* _Nullable * _Nullable)error;
// DefaultsAndOverrides
--(void) getDefaultEncoding:(nonnull uint8_t*)major minor:(nonnull uint8_t*)minor
+-(void) getDefaultEncoding:(uint8_t*)major minor:(uint8_t*)minor
NS_SWIFT_NAME(getDefaultEncoding(major:minor:));
-(uint8_t) getDefaultFormat;
diff --git a/swift/src/IceObjc/Communicator.mm b/swift/src/IceObjc/Communicator.mm
index ad76fe04413..006bb07ba03 100644
--- a/swift/src/IceObjc/Communicator.mm
+++ b/swift/src/IceObjc/Communicator.mm
@@ -350,17 +350,33 @@
return [ICEProperties getHandle:props];
}
--(dispatch_queue_t) getClientDispatchQueue
+-(nullable dispatch_queue_t) getClientDispatchQueue:(NSError* _Nullable * _Nullable)error
{
- return self.communicator->getClientDispatchQueue();
+ try
+ {
+ return self.communicator->getClientDispatchQueue();
+ }
+ catch(const std::exception& ex)
+ {
+ *error = convertException(ex);
+ return nil;
+ }
}
--(dispatch_queue_t) getServerDispatchQueue
+-(nullable dispatch_queue_t) getServerDispatchQueue:(NSError* _Nullable * _Nullable)error
{
- return self.communicator->getServerDispatchQueue();
+ try
+ {
+ return self.communicator->getServerDispatchQueue();
+ }
+ catch(const std::exception& ex)
+ {
+ *error = convertException(ex);
+ return nil;
+ }
}
--(void) getDefaultEncoding:(nonnull uint8_t*)major minor:(nonnull uint8_t*)minor
+-(void) getDefaultEncoding:(uint8_t*)major minor:(uint8_t*)minor
{
auto defaultEncoding = IceInternal::getInstance(self.communicator)->defaultsAndOverrides()->defaultEncoding;
*major = defaultEncoding.major;
diff --git a/swift/src/IceObjc/ObjectAdapter.h b/swift/src/IceObjc/ObjectAdapter.h
index 2efb237e2fa..d763bc61c3b 100644
--- a/swift/src/IceObjc/ObjectAdapter.h
+++ b/swift/src/IceObjc/ObjectAdapter.h
@@ -32,7 +32,7 @@ NS_ASSUME_NONNULL_BEGIN
-(BOOL) refreshPublishedEndpoints:(NSError* _Nullable * _Nullable)error;
-(NSArray<ICEEndpoint*>*) getPublishedEndpoints;
-(BOOL) setPublishedEndpoints:(NSArray<ICEEndpoint*>*)newEndpoints error:(NSError* _Nullable * _Nullable)error;
--(dispatch_queue_t) getDispatchQueue;
+-(nullable dispatch_queue_t) getDispatchQueue:(NSError* _Nullable * _Nullable)error;
-(void) registerDefaultServant:(id<ICEBlobjectFacade>)facade NS_SWIFT_NAME(registerDefaultServant(_:));
@end
diff --git a/swift/src/IceObjc/ObjectAdapter.mm b/swift/src/IceObjc/ObjectAdapter.mm
index 7268996c0b5..d2a5dfec592 100644
--- a/swift/src/IceObjc/ObjectAdapter.mm
+++ b/swift/src/IceObjc/ObjectAdapter.mm
@@ -204,9 +204,17 @@
}
}
--(dispatch_queue_t) getDispatchQueue
+-(dispatch_queue_t) getDispatchQueue:(NSError* _Nullable * _Nullable)error
{
- return self.objectAdapter->getDispatchQueue();
+ try
+ {
+ return self.objectAdapter->getDispatchQueue();
+ }
+ catch(const std::exception& ex)
+ {
+ *error = convertException(ex);
+ return nil;
+ }
}
-(void) registerDefaultServant:(id<ICEBlobjectFacade>)facade