2 Copyright (C) 2000-2005 SKYRIX Software AG
4 This file is part of SOPE.
6 SOPE is free software; you can redistribute it and/or modify it under
7 the terms of the GNU Lesser General Public License as published by the
8 Free Software Foundation; either version 2, or (at your option) any
11 SOPE is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14 License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with SOPE; see the file COPYING. If not, write to the
18 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
22 #include <NGXmlRpc/NGAsyncResultProxy.h>
25 @implementation NGAsyncResultProxy
28 [self->token release];
29 [self->target release];
30 [self->result release];
43 - (void)setTarget:(id)_target {
44 ASSIGN(self->target, _target);
49 - (void)setAction:(SEL)_action {
50 self->action = _action;
56 - (void)setToken:(NSString *)_token {
57 ASSIGN(self->token, _token);
64 AUTORELEASE(self->keptObjects);
65 self->keptObjects = nil;
67 AUTORELEASE(RETAIN(self));
68 [self->target performSelector:self->action withObject:self];
71 - (void)postResult:(id)_result {
72 //[self logWithFormat:@"post result: %@", _result];
74 ASSIGN(self->result, _result);
77 - (void)postFaultResult:(NSException *)_result {
78 //[self logWithFormat:@"post fault result: %@", _result];
79 ASSIGN(self->result, _result);
84 - (void)retainObject:(id)_object {
85 if (self->keptObjects == nil)
86 self->keptObjects = [[NSMutableArray alloc] initWithCapacity:4];
87 [self->keptObjects addObject:_object];
89 - (void)releaseObject:(id)_object {
90 [[_object retain] autorelease];
91 [self->keptObjects removeObjectIdenticalTo:_object];
96 - (NSString *)description {
99 ms = [NSMutableString stringWithCapacity:128];
101 [ms appendFormat:@"<0x%08X[%@]:", self, NSStringFromClass([self class])];
104 [ms appendFormat:@" ready=%@", self->result];
106 [ms appendString:@" pending"];
108 [ms appendFormat:@" token=%@", self->token];
109 [ms appendFormat:@" target=%@", self->target];
111 if ([self->keptObjects count] > 0)
112 [ms appendFormat:@" keeping=%@", self->keptObjects];
114 [ms appendString:@">"];
119 @end /* NGAsyncResultProxy */