2002-03-06 23:13:23 +00:00
|
|
|
/** GSWDeployedBundle.m - <title>GSWeb: Class GSWDeployedBundle</title>
|
2002-08-04 18:00:11 +00:00
|
|
|
|
2004-12-31 14:33:16 +00:00
|
|
|
Copyright (C) 1999-2004 Free Software Foundation, Inc.
|
2000-01-22 12:49:49 +00:00
|
|
|
|
2002-03-06 23:13:23 +00:00
|
|
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
2003-03-21 14:32:57 +00:00
|
|
|
Date: Mar 1999
|
2000-01-22 12:49:49 +00:00
|
|
|
|
2002-03-06 23:13:23 +00:00
|
|
|
$Revision$
|
|
|
|
$Date$
|
2000-01-22 12:49:49 +00:00
|
|
|
|
2002-03-06 23:13:23 +00:00
|
|
|
<abstract></abstract>
|
|
|
|
|
|
|
|
This file is part of the GNUstep Web Library.
|
|
|
|
|
|
|
|
<license>
|
2000-01-22 12:49:49 +00:00
|
|
|
This library is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU Library General Public
|
|
|
|
License as published by the Free Software Foundation; either
|
|
|
|
version 2 of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
This library is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
Library General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Library General Public
|
|
|
|
License along with this library; if not, write to the Free
|
|
|
|
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
2002-03-06 23:13:23 +00:00
|
|
|
</license>
|
|
|
|
**/
|
2000-01-22 12:49:49 +00:00
|
|
|
|
2003-03-21 14:32:57 +00:00
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
RCS_ID("$Id$")
|
2000-01-22 12:49:49 +00:00
|
|
|
|
2003-01-22 Manuel Guesdon <mguesdon@orange-concept.com>
* GSWeb.framework/Makefile.postamble:
o use $(LN_S) -f in install-WO-headers
o added $(MKDIRS) $(GNUSTEP_HEADERS)/$(GSWExtensions_wo_HEADER_FILES_INSTALL_DIR);
* GSWExtensionsGSW.framework/Makefile.postamble: use $(LN_S) -f in install-WO-headers
2003-01-20 David Ayers <d.ayers@inode.at>
* Makefile.postamble
o added support for make gswnames=(gsw,wo,all) (corrected
typo)
o reinserted support for $(INSTALL_ROOT_DIR)
* config.h.in
o added HAVE_GDL2
* configure
o added support for --with-gswnames=(gsw,wo,all)
o set LIBWRAP during configure
o added config.mak.in as configurable file
* configure.ac
o (see configure)
* config.mak: removed (replaced by config.mak.in)
* config.mak.in: new file
o added support for make gswnames=(gsw,wo,all)
* gsweb.make.in
o add GSANTLR as auxiliary lib
o add gsweb libs to AUXILIARY_GSW_LIBS
o include correct extensions for GSW/WO-libs
* gsweb_wo.make: new file
* GSWeb/GSWConfig.h
o changed support for GSWEB_WONAMES
o conditionally import file GSWWOCompatiblity
here instead of in GSWeb.h
* GSWeb/GNUMakefile
o added support for make gswnames=(gsw,wo,all)
o ensure each lib gets built with its own object files
o removed deactivated framework extension determination code
o removed reference to unused files:
GSWeb.m, GSWWOCompatibility.m
o added references to new files:
GSWExtenstions.h, GSWExtWOCompatibility.h
o added support to create WO header files
* GSWeb/Makefile.postamble
o changed support to install WO header files according to
make gswnames=(gsw,wo,all)
o remove Makefile.preamble during distclean
* GSWeb/Makefile.preamble.in
o fixed typo
* GSWeb/GSWeb.h
o moved GSW/WO-Name-mapping to GSWWOCompatibility.h
o replaced inclusions of
<GSWeb/file.h> with "file.h"
* GSWeb/GSWeb.m: removed
* GSWeb/GSWWOCompatibility.h
o changed GSWEB_WONAMES handling
o removed hybrid namespace WO subclasses
o moved & reorganized GSW/WO-Name-mapping from GSWeb.h
o inlucluded missing GSW/WO-Name-mappings
* GSWeb/GSWWOCompatibility.m: removed
* GSWeb/*.m
o replaced inclusions of
<GSWeb/file.h> with "file.h"
* GSWeb/GSWApplication.m
o remove special GSW/WO handling of WOApp
* GSWeb/WebObject/WO*: removed
* GSWeb/WebObject/WebObjects
o replaced inclusions of
<GSWeb/file.h> with "file.h"
* GSWExtensions/GNUMakefile
o added support for make gswnames=(gsw,wo,all)
o ensure each lib gets built with its own object files
o removed deactivated framework extension determination code
o added references to new files:
GSWExtenstions.h, GSWExtWOCompatibility.h
o added support to create WO header files
* GSWExtensions/Makefile.preamble
o let gnustep make figure whether to link agains debug libs
o added support for make gswnames=(gsw,wo,all)
* GSWExtensions/Makefile.postamble
o changed support to install WO header files according to
make gswnames=(gsw,wo,all)
* GSWExtensions/*.m
o replaced inclusions of
<GSWeb/GSWeb.h> with "GSWExtWOCompatibility.h"
o replaces inclusions of
<GSWExtensions/file.h> with "file.h"
* GSWExtensions/GSWExtensions.h: new file
* GSWExtensions/WOExtensions.h: new file
* GSWExtensions/GSWExtWOCompatibility.h: new file
* GSWExtensionsGSW/GNUMakefile
o added support for make gswnames=(gsw,wo,all)
o ensure each lib gets built with its own object files
o removed deactivated framework extension determination code
o added references to new file GSWExtGSWWOCompatibility.h
o added support to create WO header files
* GSWExtensionsGSW/Makefile.pramble
o let gnustep make figure whether to link agains debug libs
o added support for make gswnames=(gsw,wo,all)
o removed GSWExtensions from ADDITIONAL_LIB_DIRS
* GSWExtensionsGSW/*.m
o replaced inclusions of
<GSWeb/GSWeb.h> with "GSWExtGSWWOCompatibility.h"
* GSWExtensions/GSWExtGSWWOCompatibility.h: new file
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@15675 72102866-910b-0410-8b05-ffd578937521
2003-01-22 12:24:26 +00:00
|
|
|
#include "GSWeb.h"
|
2000-01-22 12:49:49 +00:00
|
|
|
|
|
|
|
//====================================================================
|
|
|
|
@implementation GSWDeployedBundle
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-08-04 18:00:11 +00:00
|
|
|
-(id)initWithPath:(NSString*)aPath
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
LOGObjectFnStart();
|
|
|
|
if ((self=[super init]))
|
2002-08-04 18:00:11 +00:00
|
|
|
{
|
|
|
|
NSDebugMLLog(@"bundles",@"aPath=%@",aPath);
|
2003-11-23 17:59:49 +00:00
|
|
|
|
2002-08-04 18:00:11 +00:00
|
|
|
ASSIGN(_bundlePath,[aPath stringGoodPath]);
|
|
|
|
NSDebugMLLog(@"bundles",@"_bundlePath=%@",_bundlePath);
|
2003-11-23 17:59:49 +00:00
|
|
|
|
|
|
|
ASSIGN(_wrapperName,([_bundlePath lastPathComponent]));
|
|
|
|
NSDebugMLLog(@"bundles",@"_wrapperName=%@",_wrapperName);
|
|
|
|
|
|
|
|
ASSIGN(_projectName,([_wrapperName stringByDeletingPathExtension]));
|
|
|
|
NSDebugMLLog(@"bundles",@"_projectName=%@",_projectName);
|
|
|
|
|
|
|
|
_isFramework=[_bundlePath hasSuffix:GSFrameworkSuffix];//Ok ?
|
|
|
|
|
2002-08-04 18:00:11 +00:00
|
|
|
_relativePathsCache=[GSWMultiKeyDictionary new];
|
2003-11-23 17:59:49 +00:00
|
|
|
_absolutePathsCache=[NSMutableDictionary new];
|
|
|
|
_urlsCache=[NSMutableDictionary new];
|
2000-01-22 12:49:49 +00:00
|
|
|
#ifndef NDEBUG
|
* GSWeb.framework/GSWApplication.m
(GSWApplicationMainReal): Reformat. Use GSCurrentThread
instead of objc_thread_id. Remove \n in NSLog type logs.
(GSWApplicationMain): Ditto.
([GSWApplication init], [GSWApplication lockRequestHandling],
[GSWApplication unlockRequestHandling], [GSWApplication lock],
[GSWApplication unlock], [GSWApplication _sessionClass],
[GSWApplication run],
[GSWApplication addDynCreateClassName:superClassName:],
[GSWApplication pageWithName:],
[GSWApplication dynamicElementWithName:associations:template:]):
Ditto.
* GSWeb.framework/GSWComponent.m
([GSWComponent appendToResponse:inContext:], [GSWComponent
templateWithHTMLString:declarationString:languages:]): Ditto.
* GSWeb.framework/GSWContext.m
([GSWContext dealloc], [GSWContext setValidate:]): Ditto.
* GSWeb.framework/GSWDebug.m
(GSWLogC_, GSWLogDumpObjectFn): Ditto.
* GSWeb.framework/GSWDefaultAdaptor.m
([GSWDefaultAdaptor registerForEvents],
[GSWDefaultAdaptor announceNewConnection:],
[GSWDefaultAdaptor adaptorThreadExited:],
[GSWDefaultAdaptor tryLock]): Ditto.
* GSWeb.framework/GSWDefaultAdaptorThread.m
([GSWDefaultAdaptorThread setPool:destroyLast:],
[GSWDefaultAdaptorThread run:],
[GSWDefaultAdaptorThread threadExited],
[GSWDefaultAdaptorThread isExpired],
[GSWDefaultAdaptorThread sendRetryLasterResponseToStream:],
[GSWDefaultAdaptorThread
sendConnectionRefusedResponseToStream:withMessage:]): Ditto.
* GSWeb.framework/GSWDeployedBundle.m
([GSWDeployedBundle initWithPath:], [GSWDeployedBundle dealloc],
[GSWDeployedBundle lock], [GSWDeployedBundle unlock]): Ditto.
* GSWeb.framework/GSWLifebeatThread.m
([GSWLifebeatThread setPool:destroyLast:],
[GSWLifebeatThread threadExited]): Ditto.
* GSWeb.framework/GSWSession.m
([GSWSession initWithCoder:],
[GSWSession _releaseAutoreleasePool]): Ditto.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@18611 72102866-910b-0410-8b05-ffd578937521
2004-02-17 16:53:36 +00:00
|
|
|
_creation_thread_id=GSCurrentThread();
|
2000-01-22 12:49:49 +00:00
|
|
|
#endif
|
2002-08-04 18:00:11 +00:00
|
|
|
_selfLock=[NSRecursiveLock new];
|
|
|
|
};
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStop();
|
|
|
|
return self;
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(void)dealloc
|
|
|
|
{
|
|
|
|
NSDebugFLog(@"Dealloc GSWDeployedBundle %p",(void*)self);
|
2002-08-04 18:00:11 +00:00
|
|
|
DESTROY(_bundlePath);
|
2003-11-23 17:59:49 +00:00
|
|
|
DESTROY(_wrapperName);
|
|
|
|
DESTROY(_projectName);
|
2002-08-04 18:00:11 +00:00
|
|
|
DESTROY(_relativePathsCache);
|
2003-11-23 17:59:49 +00:00
|
|
|
DESTROY(_absolutePathsCache);
|
|
|
|
DESTROY(_urlsCache);
|
2000-01-22 12:49:49 +00:00
|
|
|
GSWLogC("Dealloc GSWDeployedBundle: selfLock");
|
* GSWeb.framework/GSWApplication.m
(GSWApplicationMainReal): Reformat. Use GSCurrentThread
instead of objc_thread_id. Remove \n in NSLog type logs.
(GSWApplicationMain): Ditto.
([GSWApplication init], [GSWApplication lockRequestHandling],
[GSWApplication unlockRequestHandling], [GSWApplication lock],
[GSWApplication unlock], [GSWApplication _sessionClass],
[GSWApplication run],
[GSWApplication addDynCreateClassName:superClassName:],
[GSWApplication pageWithName:],
[GSWApplication dynamicElementWithName:associations:template:]):
Ditto.
* GSWeb.framework/GSWComponent.m
([GSWComponent appendToResponse:inContext:], [GSWComponent
templateWithHTMLString:declarationString:languages:]): Ditto.
* GSWeb.framework/GSWContext.m
([GSWContext dealloc], [GSWContext setValidate:]): Ditto.
* GSWeb.framework/GSWDebug.m
(GSWLogC_, GSWLogDumpObjectFn): Ditto.
* GSWeb.framework/GSWDefaultAdaptor.m
([GSWDefaultAdaptor registerForEvents],
[GSWDefaultAdaptor announceNewConnection:],
[GSWDefaultAdaptor adaptorThreadExited:],
[GSWDefaultAdaptor tryLock]): Ditto.
* GSWeb.framework/GSWDefaultAdaptorThread.m
([GSWDefaultAdaptorThread setPool:destroyLast:],
[GSWDefaultAdaptorThread run:],
[GSWDefaultAdaptorThread threadExited],
[GSWDefaultAdaptorThread isExpired],
[GSWDefaultAdaptorThread sendRetryLasterResponseToStream:],
[GSWDefaultAdaptorThread
sendConnectionRefusedResponseToStream:withMessage:]): Ditto.
* GSWeb.framework/GSWDeployedBundle.m
([GSWDeployedBundle initWithPath:], [GSWDeployedBundle dealloc],
[GSWDeployedBundle lock], [GSWDeployedBundle unlock]): Ditto.
* GSWeb.framework/GSWLifebeatThread.m
([GSWLifebeatThread setPool:destroyLast:],
[GSWLifebeatThread threadExited]): Ditto.
* GSWeb.framework/GSWSession.m
([GSWSession initWithCoder:],
[GSWSession _releaseAutoreleasePool]): Ditto.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@18611 72102866-910b-0410-8b05-ffd578937521
2004-02-17 16:53:36 +00:00
|
|
|
NSDebugFLog(@"selfLock=%p selfLockn=%d selfLock_thread_id=%@ "
|
|
|
|
@"GSCurrentThread()=%@ creation_thread_id=%@",
|
2002-08-04 18:00:11 +00:00
|
|
|
(void*)_selfLock,
|
|
|
|
_selfLockn,
|
* GSWeb.framework/GSWApplication.m
(GSWApplicationMainReal): Reformat. Use GSCurrentThread
instead of objc_thread_id. Remove \n in NSLog type logs.
(GSWApplicationMain): Ditto.
([GSWApplication init], [GSWApplication lockRequestHandling],
[GSWApplication unlockRequestHandling], [GSWApplication lock],
[GSWApplication unlock], [GSWApplication _sessionClass],
[GSWApplication run],
[GSWApplication addDynCreateClassName:superClassName:],
[GSWApplication pageWithName:],
[GSWApplication dynamicElementWithName:associations:template:]):
Ditto.
* GSWeb.framework/GSWComponent.m
([GSWComponent appendToResponse:inContext:], [GSWComponent
templateWithHTMLString:declarationString:languages:]): Ditto.
* GSWeb.framework/GSWContext.m
([GSWContext dealloc], [GSWContext setValidate:]): Ditto.
* GSWeb.framework/GSWDebug.m
(GSWLogC_, GSWLogDumpObjectFn): Ditto.
* GSWeb.framework/GSWDefaultAdaptor.m
([GSWDefaultAdaptor registerForEvents],
[GSWDefaultAdaptor announceNewConnection:],
[GSWDefaultAdaptor adaptorThreadExited:],
[GSWDefaultAdaptor tryLock]): Ditto.
* GSWeb.framework/GSWDefaultAdaptorThread.m
([GSWDefaultAdaptorThread setPool:destroyLast:],
[GSWDefaultAdaptorThread run:],
[GSWDefaultAdaptorThread threadExited],
[GSWDefaultAdaptorThread isExpired],
[GSWDefaultAdaptorThread sendRetryLasterResponseToStream:],
[GSWDefaultAdaptorThread
sendConnectionRefusedResponseToStream:withMessage:]): Ditto.
* GSWeb.framework/GSWDeployedBundle.m
([GSWDeployedBundle initWithPath:], [GSWDeployedBundle dealloc],
[GSWDeployedBundle lock], [GSWDeployedBundle unlock]): Ditto.
* GSWeb.framework/GSWLifebeatThread.m
([GSWLifebeatThread setPool:destroyLast:],
[GSWLifebeatThread threadExited]): Ditto.
* GSWeb.framework/GSWSession.m
([GSWSession initWithCoder:],
[GSWSession _releaseAutoreleasePool]): Ditto.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@18611 72102866-910b-0410-8b05-ffd578937521
2004-02-17 16:53:36 +00:00
|
|
|
_selfLock_thread_id,
|
|
|
|
GSCurrentThread(),
|
|
|
|
_creation_thread_id);
|
2000-01-22 12:49:49 +00:00
|
|
|
fflush(stderr);
|
2002-08-04 18:00:11 +00:00
|
|
|
DESTROY(_selfLock);
|
2000-01-22 12:49:49 +00:00
|
|
|
GSWLogC("Dealloc GSWDeployedBundle Super");
|
|
|
|
[super dealloc];
|
|
|
|
NSDebugFLog(@"End Dealloc GSWDeployedBundle %p",(void*)self);
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(NSString*)description
|
|
|
|
{
|
|
|
|
NSString* descr=nil;
|
|
|
|
// GSWLogC("GSWDeployedBundle description A");
|
|
|
|
descr=[NSString stringWithFormat:@"<%s %p - ",
|
2010-04-22 04:28:50 +00:00
|
|
|
object_getClassName(self),
|
2002-08-04 18:00:11 +00:00
|
|
|
(void*)self];
|
2000-01-22 12:49:49 +00:00
|
|
|
// GSWLogC("GSWDeployedBundle description B");
|
|
|
|
descr=[descr stringByAppendingFormat:@"bundlePath:%@ ",
|
2002-08-04 18:00:11 +00:00
|
|
|
_bundlePath];
|
2000-01-22 12:49:49 +00:00
|
|
|
// GSWLogC("GSWDeployedBundle description C");
|
|
|
|
descr=[descr stringByAppendingFormat:@"relativePathsCache=%p>",
|
2002-08-04 18:00:11 +00:00
|
|
|
(void*)_relativePathsCache];
|
2000-01-22 12:49:49 +00:00
|
|
|
// GSWLogC("GSWDeployedBundle description D");
|
|
|
|
return descr;
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(GSWProjectBundle*)projectBundle
|
|
|
|
{
|
|
|
|
//OK
|
2002-08-04 18:00:11 +00:00
|
|
|
NSString* projectName=nil;
|
|
|
|
BOOL isFramework=NO;
|
|
|
|
GSWDeployedBundle* projectBundle=nil;
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStart();
|
2002-08-04 18:00:11 +00:00
|
|
|
projectName=[self projectName];
|
|
|
|
NSDebugMLLog(@"bundles",@"projectName=%@",projectName);
|
|
|
|
isFramework=[self isFramework];
|
|
|
|
NSDebugMLLog(@"bundles",@"isFramework=%s",(isFramework ? "YES" : "NO"));
|
|
|
|
projectBundle=[GSWProjectBundle projectBundleForProjectNamed:projectName
|
|
|
|
isFramework:isFramework];
|
|
|
|
NSDebugMLLog(@"bundles",@"projectBundle=%@",projectBundle);
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStop();
|
2002-08-04 18:00:11 +00:00
|
|
|
return (GSWProjectBundle*)projectBundle;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(BOOL)isFramework
|
|
|
|
{
|
2003-11-23 17:59:49 +00:00
|
|
|
return _isFramework;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(NSString*)wrapperName
|
|
|
|
{
|
|
|
|
LOGObjectFnStart();
|
|
|
|
LOGObjectFnStop();
|
2003-11-23 17:59:49 +00:00
|
|
|
return _wrapperName;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(NSString*)projectName
|
|
|
|
{
|
|
|
|
LOGObjectFnStart();
|
|
|
|
LOGObjectFnStop();
|
2003-11-23 17:59:49 +00:00
|
|
|
return _projectName;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(NSString*)bundlePath
|
|
|
|
{
|
2002-08-04 18:00:11 +00:00
|
|
|
return _bundlePath;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
2003-11-23 17:59:49 +00:00
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(NSString*)bundleURLPrefix
|
|
|
|
{
|
|
|
|
NSString* urlPrefix=nil;
|
|
|
|
NSString* wrapperName=nil;
|
|
|
|
|
|
|
|
if ([self isFramework]) // get framework prefix ?
|
|
|
|
urlPrefix = [GSWApplication frameworksBaseURL];
|
|
|
|
else
|
|
|
|
urlPrefix = [GSWApplication applicationBaseURL];
|
|
|
|
|
|
|
|
NSDebugMLLog(@"bundles",@"urlPrefix=%@",urlPrefix);
|
|
|
|
NSAssert([urlPrefix length]>0,@"No urlPrefix");
|
|
|
|
|
|
|
|
wrapperName=[self wrapperName];
|
|
|
|
NSDebugMLLog(@"bundles",@"wrapperName=%@",wrapperName);
|
|
|
|
NSAssert([wrapperName length]>0,@"No wrapperName");
|
|
|
|
|
|
|
|
if (urlPrefix && wrapperName)
|
|
|
|
{
|
|
|
|
urlPrefix=[urlPrefix stringByAppendingPathComponent:wrapperName];
|
|
|
|
NSDebugMLLog(@"bundles",@"urlPrefix=%@",urlPrefix);
|
|
|
|
};
|
|
|
|
return urlPrefix;
|
|
|
|
};
|
|
|
|
|
2000-01-22 12:49:49 +00:00
|
|
|
//--------------------------------------------------------------------
|
2002-08-04 18:00:11 +00:00
|
|
|
-(NSArray*)pathsForResourcesOfType:(NSString*)aType
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
//OK
|
2002-08-04 18:00:11 +00:00
|
|
|
NSArray* paths=nil;
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStart();
|
2002-08-04 18:00:11 +00:00
|
|
|
NSDebugMLLog(@"bundles",@"aType=%@",aType);
|
2000-01-22 12:49:49 +00:00
|
|
|
[self lock];
|
|
|
|
NS_DURING
|
2002-08-04 18:00:11 +00:00
|
|
|
{
|
|
|
|
paths=[self lockedPathsForResourcesOfType:aType];
|
|
|
|
NSDebugMLLog(@"bundles",@"paths=%@",paths);
|
|
|
|
}
|
2000-01-22 12:49:49 +00:00
|
|
|
NS_HANDLER
|
2002-08-04 18:00:11 +00:00
|
|
|
{
|
|
|
|
NSDebugMLLog(@"bundles",@"EXCEPTION:%@ (%@)",
|
|
|
|
localException,[localException reason]);
|
|
|
|
//TODO
|
|
|
|
[self unlock];
|
|
|
|
[localException raise];
|
|
|
|
};
|
2000-01-22 12:49:49 +00:00
|
|
|
NS_ENDHANDLER;
|
|
|
|
[self unlock];
|
2002-08-04 18:00:11 +00:00
|
|
|
return paths;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-08-04 18:00:11 +00:00
|
|
|
-(NSArray*)lockedPathsForResourcesOfType:(NSString*)aType
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
LOGObjectFnNotImplemented(); //TODOFN
|
|
|
|
return nil;
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-08-04 18:00:11 +00:00
|
|
|
-(NSString*)relativePathForResourceNamed:(NSString*)aName
|
2003-11-23 17:59:49 +00:00
|
|
|
language:(NSString*)aLanguage
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
//OK
|
2002-08-04 18:00:11 +00:00
|
|
|
NSString* path=nil;
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStart();
|
|
|
|
[self lock];
|
2002-08-04 18:00:11 +00:00
|
|
|
NSDebugMLLog(@"bundles",@"aName=%@ aLanguage=%@",aName,aLanguage);
|
2000-01-22 12:49:49 +00:00
|
|
|
NS_DURING
|
2002-08-04 18:00:11 +00:00
|
|
|
{
|
|
|
|
path=[self lockedRelativePathForResourceNamed:aName
|
2003-11-23 17:59:49 +00:00
|
|
|
language:aLanguage];
|
2002-08-04 18:00:11 +00:00
|
|
|
NSDebugMLLog(@"bundles",@"path=%@",path);
|
|
|
|
}
|
2000-01-22 12:49:49 +00:00
|
|
|
NS_HANDLER
|
2002-08-04 18:00:11 +00:00
|
|
|
{
|
|
|
|
NSDebugMLLog(@"bundles",@"EXCEPTION:%@ (%@)",
|
|
|
|
localException,[localException reason]);
|
|
|
|
//TODO
|
|
|
|
[self unlock];
|
|
|
|
[localException raise];
|
|
|
|
};
|
2000-01-22 12:49:49 +00:00
|
|
|
NS_ENDHANDLER;
|
|
|
|
[self unlock];
|
2002-08-04 18:00:11 +00:00
|
|
|
return path;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-08-04 18:00:11 +00:00
|
|
|
-(NSString*)relativePathForResourceNamed:(NSString*)aName
|
2003-11-23 17:59:49 +00:00
|
|
|
languages:(NSArray*)someLanguages
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2002-08-04 18:00:11 +00:00
|
|
|
NSString* path=nil;
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStart();
|
2002-08-04 18:00:11 +00:00
|
|
|
NSDebugMLLog(@"bundles",@"aName=%@ someLanguages=%@",aName,someLanguages);
|
2000-01-22 12:49:49 +00:00
|
|
|
[self lock];
|
|
|
|
NS_DURING
|
2002-08-04 18:00:11 +00:00
|
|
|
{
|
|
|
|
path=[self lockedRelativePathForResourceNamed:aName
|
2003-11-23 17:59:49 +00:00
|
|
|
languages:someLanguages];
|
2002-08-04 18:00:11 +00:00
|
|
|
//NSDebugMLLog(@"bundles",@"path=%@",path);
|
|
|
|
}
|
2000-01-22 12:49:49 +00:00
|
|
|
NS_HANDLER
|
2002-08-04 18:00:11 +00:00
|
|
|
{
|
|
|
|
NSDebugMLLog(@"bundles",@"EXCEPTION:%@ (%@)",
|
|
|
|
localException,[localException reason]);
|
|
|
|
//TODO
|
|
|
|
[self unlock];
|
|
|
|
[localException raise];
|
|
|
|
};
|
2000-01-22 12:49:49 +00:00
|
|
|
NS_ENDHANDLER;
|
|
|
|
[self unlock];
|
|
|
|
LOGObjectFnStop();
|
2002-08-04 18:00:11 +00:00
|
|
|
return path;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-08-04 18:00:11 +00:00
|
|
|
-(NSString*)lockedRelativePathForResourceNamed:(NSString*)aName
|
2003-11-23 17:59:49 +00:00
|
|
|
language:(NSString*)aLanguage
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
//OK
|
2002-08-04 18:00:11 +00:00
|
|
|
NSString* path=nil;
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStart();
|
2002-08-04 18:00:11 +00:00
|
|
|
NSDebugMLLog(@"bundles",@"aName=%@ aLanguage=%@",aName,aLanguage);
|
|
|
|
NSDebugMLLog(@"bundles",@"bundlePath=%@ Trying Resources/WebServer",_bundlePath);
|
|
|
|
path=[self lockedRelativePathForResourceNamed:aName
|
|
|
|
inDirectory:@"Resources/WebServer"
|
2003-11-23 17:59:49 +00:00
|
|
|
language:aLanguage];
|
2002-08-04 18:00:11 +00:00
|
|
|
NSDebugMLLog(@"bundles",@"path=%@",path);
|
|
|
|
if (!path)
|
|
|
|
{
|
|
|
|
NSDebugMLLog(@"bundles",@"bundlePath=%@ Trying Resources",_bundlePath);
|
|
|
|
path=[self lockedRelativePathForResourceNamed:aName
|
|
|
|
inDirectory:@"Resources"
|
2003-11-23 17:59:49 +00:00
|
|
|
language:aLanguage];
|
2002-08-04 18:00:11 +00:00
|
|
|
NSDebugMLLog(@"bundles",@"path=%@",path);
|
|
|
|
if (!path)
|
|
|
|
{
|
|
|
|
NSDebugMLLog(@"bundles",@"bundlePath=%@ Trying .",_bundlePath);
|
|
|
|
path=[self lockedRelativePathForResourceNamed:aName
|
|
|
|
inDirectory:@"."
|
2003-11-23 17:59:49 +00:00
|
|
|
language:aLanguage];
|
2002-08-04 18:00:11 +00:00
|
|
|
NSDebugMLLog(@"bundles",@"path=%@",path);
|
|
|
|
};
|
|
|
|
};
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStop();
|
2002-08-04 18:00:11 +00:00
|
|
|
return path;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-08-04 18:00:11 +00:00
|
|
|
-(NSString*)lockedRelativePathForResourceNamed:(NSString*)aName
|
2003-11-23 17:59:49 +00:00
|
|
|
languages:(NSArray*)someLanguages
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
//OK
|
2002-08-04 18:00:11 +00:00
|
|
|
NSString* path=nil;
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStart();
|
2002-08-04 18:00:11 +00:00
|
|
|
NSDebugMLLog(@"bundles",@"aName=%@ someLanguages=%@",aName,someLanguages);
|
|
|
|
NSDebugMLLog(@"bundles",@"bundlePath=%@ Trying Resources/WebServer",_bundlePath);
|
|
|
|
path=[self lockedRelativePathForResourceNamed:aName
|
|
|
|
inDirectory:@"Resources/WebServer"
|
2003-11-23 17:59:49 +00:00
|
|
|
languages:someLanguages];
|
2002-08-04 18:00:11 +00:00
|
|
|
NSDebugMLLog(@"bundles",@"path=%@",path);
|
|
|
|
if (!path)
|
|
|
|
{
|
|
|
|
NSDebugMLLog(@"bundles",@"bundlePath=%@ Trying Resources",_bundlePath);
|
|
|
|
path=[self lockedRelativePathForResourceNamed:aName
|
|
|
|
inDirectory:@"Resources"
|
2003-11-23 17:59:49 +00:00
|
|
|
languages:someLanguages];
|
2002-08-04 18:00:11 +00:00
|
|
|
NSDebugMLLog(@"bundles",@"path=%@",path);
|
|
|
|
if (!path)
|
|
|
|
{
|
|
|
|
NSDebugMLLog(@"bundles",@"bundlePath=%@ Trying .",_bundlePath);
|
|
|
|
path=[self lockedRelativePathForResourceNamed:aName
|
|
|
|
inDirectory:@"."
|
2003-11-23 17:59:49 +00:00
|
|
|
languages:someLanguages];
|
2002-08-04 18:00:11 +00:00
|
|
|
NSDebugMLLog(@"bundles",@"path=%@",path);
|
|
|
|
};
|
|
|
|
};
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStop();
|
2002-08-04 18:00:11 +00:00
|
|
|
return path;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-08-04 18:00:11 +00:00
|
|
|
-(NSString*)lockedRelativePathForResourceNamed:(NSString*)aName
|
2008-08-20 20:32:10 +00:00
|
|
|
inDirectory:(NSString*)aDirectory
|
2004-12-31 14:33:16 +00:00
|
|
|
languages:(NSArray*)someLanguages
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
//OK
|
2002-08-04 18:00:11 +00:00
|
|
|
NSString* path=nil;
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStart();
|
2002-08-04 18:00:11 +00:00
|
|
|
NSDebugMLLog(@"bundles",@"aName=%@ aDirectory=%@ someLanguages=%@",aName,aDirectory,someLanguages);
|
|
|
|
if (someLanguages)
|
|
|
|
{
|
|
|
|
int i=0;
|
2004-12-31 14:33:16 +00:00
|
|
|
int someLanguagesCount=[someLanguages count];
|
|
|
|
for(i=0;!path && i<someLanguagesCount;i++)
|
2002-08-04 18:00:11 +00:00
|
|
|
{
|
|
|
|
path=[self lockedCachedRelativePathForResourceNamed:aName
|
|
|
|
inDirectory:aDirectory
|
2003-11-23 17:59:49 +00:00
|
|
|
language:[someLanguages objectAtIndex:i]];
|
2002-08-04 18:00:11 +00:00
|
|
|
NSDebugMLLog(@"bundles",@"path=%@",path);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
if (!path)
|
|
|
|
path=[self lockedCachedRelativePathForResourceNamed:aName
|
|
|
|
inDirectory:aDirectory
|
2003-11-23 17:59:49 +00:00
|
|
|
language:nil];
|
2002-08-04 18:00:11 +00:00
|
|
|
NSDebugMLLog(@"bundles",@"path=%@",path);
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStop();
|
2002-08-04 18:00:11 +00:00
|
|
|
return path;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-08-04 18:00:11 +00:00
|
|
|
-(NSString*)lockedCachedRelativePathForResourceNamed:(NSString*)aName
|
|
|
|
inDirectory:(NSString*)aDirectory
|
2004-12-31 14:33:16 +00:00
|
|
|
language:(NSString*)aLanguage
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
//OK
|
2002-08-04 18:00:11 +00:00
|
|
|
NSString* path=nil;
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStart();
|
2002-08-04 18:00:11 +00:00
|
|
|
NSDebugMLLog(@"bundles",@"aName=%@ aDirectory=%@ aLanguage=%@",aName,aDirectory,aLanguage);
|
|
|
|
if (aName)
|
|
|
|
{
|
2003-03-03 08:47:29 +00:00
|
|
|
NSAutoreleasePool* arp = [NSAutoreleasePool new];
|
|
|
|
NS_DURING
|
2002-08-04 18:00:11 +00:00
|
|
|
{
|
2004-12-31 14:33:16 +00:00
|
|
|
NSString* emptyString=@"";
|
2003-03-03 08:47:29 +00:00
|
|
|
NSString* bundlePath=[self bundlePath];
|
2004-01-09 11:38:34 +00:00
|
|
|
NSDebugMLLog(@"bundles",@"aName=%@ bundlePath=%@ aDirectory=%@ aLanguage=%@",
|
|
|
|
aName,bundlePath,aDirectory,aLanguage);
|
2003-03-03 08:47:29 +00:00
|
|
|
if ([aDirectory isEqualToString:@"."])
|
|
|
|
aDirectory=nil;
|
2002-08-04 18:00:11 +00:00
|
|
|
if (aLanguage)
|
2004-01-09 11:38:34 +00:00
|
|
|
path=[_relativePathsCache objectForKeys:aName,
|
|
|
|
(bundlePath ? bundlePath : emptyString),
|
|
|
|
(aDirectory ? aDirectory : emptyString),
|
|
|
|
(aLanguage ? aLanguage : emptyString),
|
|
|
|
nil];
|
2002-08-04 18:00:11 +00:00
|
|
|
else
|
2004-01-09 11:38:34 +00:00
|
|
|
path=[_relativePathsCache objectForKeys:aName,
|
|
|
|
(bundlePath ? bundlePath : emptyString),
|
|
|
|
(aDirectory ? aDirectory : emptyString),
|
|
|
|
nil];
|
|
|
|
NSDebugMLLog(@"bundles",@"path=%@",path);
|
2003-03-03 08:47:29 +00:00
|
|
|
if (path==GSNotFoundMarker)
|
|
|
|
path=nil;
|
2003-06-25 15:32:51 +00:00
|
|
|
else if (!path)
|
2003-03-03 08:47:29 +00:00
|
|
|
{
|
2004-12-31 14:33:16 +00:00
|
|
|
//TODO: use a mutable string for path ?
|
2003-11-23 17:59:49 +00:00
|
|
|
//call again _relativePathForResourceNamed:inDirectory:language:
|
2003-03-03 08:47:29 +00:00
|
|
|
NSString* completePathTest=nil;
|
|
|
|
BOOL exists=NO;
|
|
|
|
NSFileManager* fileManager=nil;
|
2004-12-31 14:33:16 +00:00
|
|
|
NSString* pathTest=@"";
|
2003-03-03 08:47:29 +00:00
|
|
|
if (aDirectory)
|
|
|
|
pathTest=[pathTest stringByAppendingPathComponent:aDirectory];
|
|
|
|
//NSDebugMLLog(@"bundles",@"_pathTest=%@",_pathTest);
|
|
|
|
if (aLanguage)
|
|
|
|
pathTest=[pathTest stringByAppendingPathComponent:
|
|
|
|
[aLanguage stringByAppendingString:GSLanguagePSuffix]];
|
|
|
|
//NSDebugMLLog(@"bundles",@"pathTest=%@",pathTest);
|
|
|
|
pathTest=[pathTest stringByAppendingPathComponent:aName];
|
|
|
|
NSDebugMLLog(@"bundles",@"pathTest=%@",pathTest);
|
|
|
|
completePathTest=[bundlePath stringByAppendingPathComponent:pathTest];
|
|
|
|
NSDebugMLLog(@"bundles",@"completePathTest=%@",completePathTest);
|
|
|
|
fileManager=[NSFileManager defaultManager];
|
|
|
|
exists=[fileManager fileExistsAtPath:completePathTest];
|
|
|
|
NSDebugMLLog(@"bundles",@"exists=%s",(exists ? "YES" : "NO"));
|
2004-09-01 16:12:58 +00:00
|
|
|
#ifdef __APPLE__
|
|
|
|
if(!exists)
|
|
|
|
{
|
2004-12-31 14:33:16 +00:00
|
|
|
NSString *aCompletePath = [[[NSBundle bundleWithPath:bundlePath]
|
|
|
|
pathForResource:[aName stringByDeletingPathExtension]
|
|
|
|
ofType:[aName pathExtension]
|
|
|
|
inDirectory:aDirectory
|
|
|
|
forLocalization:aLanguage]
|
2004-09-01 16:12:58 +00:00
|
|
|
stringByResolvingSymlinksInPath];
|
|
|
|
|
|
|
|
if([aCompletePath length] >= ([bundlePath length] + 1))
|
|
|
|
{
|
|
|
|
exists = YES;
|
|
|
|
pathTest = [aCompletePath substringFromIndex:[bundlePath length] + 1];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif //__APPLE__
|
2003-03-03 08:47:29 +00:00
|
|
|
if (exists)
|
|
|
|
{
|
|
|
|
path=pathTest;
|
2004-01-09 11:38:34 +00:00
|
|
|
if (aLanguage)
|
|
|
|
[_relativePathsCache setObject:path
|
|
|
|
forKeys:aName,
|
|
|
|
(bundlePath ? bundlePath : emptyString),
|
|
|
|
(aDirectory ? aDirectory : emptyString),
|
|
|
|
(aLanguage ? aLanguage : emptyString),
|
|
|
|
nil];
|
|
|
|
else
|
|
|
|
[_relativePathsCache setObject:path
|
|
|
|
forKeys:aName,
|
|
|
|
(bundlePath ? bundlePath : emptyString),
|
|
|
|
(aDirectory ? aDirectory : emptyString),
|
|
|
|
nil];
|
2003-03-03 08:47:29 +00:00
|
|
|
}
|
|
|
|
else
|
2004-01-09 11:38:34 +00:00
|
|
|
{
|
|
|
|
if (aLanguage)
|
|
|
|
[_relativePathsCache setObject:GSNotFoundMarker
|
|
|
|
forKeys:aName,
|
|
|
|
(bundlePath ? bundlePath : emptyString),
|
|
|
|
(aDirectory ? aDirectory : emptyString),
|
|
|
|
(aLanguage ? aLanguage : emptyString),
|
|
|
|
nil];
|
|
|
|
else
|
|
|
|
[_relativePathsCache setObject:GSNotFoundMarker
|
|
|
|
forKeys:aName,
|
|
|
|
(bundlePath ? bundlePath : emptyString),
|
|
|
|
(aDirectory ? aDirectory : emptyString),
|
|
|
|
nil];
|
|
|
|
}
|
2003-06-25 15:32:51 +00:00
|
|
|
}
|
2003-03-03 08:47:29 +00:00
|
|
|
}
|
|
|
|
NS_HANDLER
|
|
|
|
{
|
|
|
|
localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException,
|
2003-11-23 17:59:49 +00:00
|
|
|
@"lockedCachedRelativePathForResourceNamed:inDirectory:language:");
|
2003-03-03 08:47:29 +00:00
|
|
|
LOGException(@"%@ (%@)",localException,[localException reason]);
|
|
|
|
RETAIN(localException);
|
|
|
|
DESTROY(arp);
|
|
|
|
AUTORELEASE(localException);
|
|
|
|
[localException raise];
|
|
|
|
}
|
|
|
|
NS_ENDHANDLER;
|
|
|
|
RETAIN(path);
|
|
|
|
DESTROY(arp);
|
|
|
|
AUTORELEASE(path);
|
2002-08-04 18:00:11 +00:00
|
|
|
};
|
|
|
|
NSDebugMLLog(@"bundles",@"path=%@",path);
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStop();
|
2002-08-04 18:00:11 +00:00
|
|
|
return path;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-08-04 18:00:11 +00:00
|
|
|
-(NSString*)lockedRelativePathForResourceNamed:(NSString*)aName
|
|
|
|
inDirectory:(NSString*)aDirectory
|
2003-11-23 17:59:49 +00:00
|
|
|
language:(NSString*)aLanguage
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
//OK
|
2002-08-04 18:00:11 +00:00
|
|
|
NSString* path=nil;
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStart();
|
2002-08-04 18:00:11 +00:00
|
|
|
NSDebugMLLog(@"bundles",@"aName=%@ aDirectory=%@ aLanguage=%@",
|
|
|
|
aName,aDirectory,aLanguage);
|
|
|
|
path=[self lockedCachedRelativePathForResourceNamed:aName
|
|
|
|
inDirectory:aDirectory
|
2003-11-23 17:59:49 +00:00
|
|
|
language:aLanguage];
|
|
|
|
LOGObjectFnStop();
|
|
|
|
return path;
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
/** Returns url for resource anmed aName for languages someLanguages **/
|
|
|
|
-(NSString*)urlForResourceNamed:(NSString*)aName
|
|
|
|
languages:(NSArray*)someLanguages
|
|
|
|
{
|
|
|
|
NSString* url=nil;
|
|
|
|
|
|
|
|
LOGObjectFnStart();
|
|
|
|
|
|
|
|
NSDebugMLLog(@"bundles",@"aName=%@ someLanguages=%@",aName,someLanguages);
|
|
|
|
|
|
|
|
[self lock];
|
|
|
|
NS_DURING
|
|
|
|
{
|
|
|
|
NSString* relativePath=[self lockedRelativePathForResourceNamed:aName
|
|
|
|
languages:someLanguages];
|
|
|
|
NSDebugMLLog(@"bundles",@"relativePath=%@",relativePath);
|
|
|
|
url=[self lockedCachedURLForRelativePath:relativePath];
|
|
|
|
NSDebugMLLog(@"bundles",@"url=%@",url);
|
|
|
|
}
|
|
|
|
NS_HANDLER
|
|
|
|
{
|
|
|
|
NSDebugMLLog(@"bundles",@"EXCEPTION:%@ (%@)",
|
|
|
|
localException,[localException reason]);
|
|
|
|
//TODO
|
|
|
|
[self unlock];
|
|
|
|
[localException raise];
|
|
|
|
};
|
|
|
|
NS_ENDHANDLER;
|
|
|
|
[self unlock];
|
|
|
|
|
|
|
|
LOGObjectFnStop();
|
|
|
|
|
|
|
|
return url;
|
|
|
|
};
|
|
|
|
|
|
|
|
/** Returns the absolute path (cached or not) for relativePath. Put it in the cache
|
|
|
|
if it was not cached **/
|
|
|
|
-(NSString*)lockedCachedAbsolutePathForRelativePath:(NSString*)relativePath
|
|
|
|
{
|
|
|
|
NSString* path=nil;
|
|
|
|
|
|
|
|
LOGObjectFnStart();
|
|
|
|
|
|
|
|
if (relativePath)
|
|
|
|
{
|
|
|
|
// Test if already cached
|
|
|
|
path = [_absolutePathsCache objectForKey:relativePath];
|
|
|
|
|
|
|
|
// If not, build it
|
|
|
|
if (!path)
|
|
|
|
{
|
|
|
|
path=[[self bundlePath] stringByAppendingPathComponent:relativePath];
|
|
|
|
[_absolutePathsCache setObject:path
|
|
|
|
forKey:relativePath];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
LOGObjectFnStop();
|
|
|
|
|
|
|
|
return path;
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(NSString*)absolutePathForRelativePath:(NSString*)relativePath
|
|
|
|
{
|
|
|
|
NSString* path=nil;
|
|
|
|
|
|
|
|
LOGObjectFnStart();
|
|
|
|
|
|
|
|
[self lock];
|
|
|
|
NS_DURING
|
|
|
|
{
|
|
|
|
path=[self lockedCachedAbsolutePathForRelativePath:relativePath];
|
|
|
|
NSDebugMLLog(@"bundles",@"path=%@",path);
|
|
|
|
}
|
|
|
|
NS_HANDLER
|
|
|
|
{
|
|
|
|
NSDebugMLLog(@"bundles",@"EXCEPTION:%@ (%@)",
|
|
|
|
localException,[localException reason]);
|
|
|
|
//TODO
|
|
|
|
[self unlock];
|
|
|
|
[localException raise];
|
|
|
|
};
|
|
|
|
NS_ENDHANDLER;
|
|
|
|
[self unlock];
|
|
|
|
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStop();
|
2003-11-23 17:59:49 +00:00
|
|
|
|
2002-08-04 18:00:11 +00:00
|
|
|
return path;
|
2003-11-23 17:59:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(NSString*)absolutePathForResourceNamed:(NSString*)aName
|
|
|
|
languages:(NSArray*)someLanguages
|
|
|
|
{
|
2004-01-09 11:38:34 +00:00
|
|
|
NSString* absolutePath=nil;
|
|
|
|
NSString* relativePath=nil;
|
|
|
|
|
|
|
|
LOGObjectFnStart();
|
|
|
|
|
|
|
|
relativePath = [self relativePathForResourceNamed:aName
|
|
|
|
languages:someLanguages];
|
|
|
|
NSDebugMLLog(@"bundles",@"relativePath=%@",relativePath);
|
|
|
|
|
|
|
|
absolutePath=[self absolutePathForRelativePath:relativePath];
|
|
|
|
NSDebugMLLog(@"bundles",@"absolutePath=%@",absolutePath);
|
|
|
|
|
|
|
|
LOGObjectFnStop();
|
|
|
|
return absolutePath;
|
2003-11-23 17:59:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
/** Returns the url (cached or not) for relativePath. Put it in the cache
|
|
|
|
if it was not cached **/
|
|
|
|
-(NSString*)lockedCachedURLForRelativePath:(NSString*)relativePath
|
|
|
|
{
|
|
|
|
NSString* url=nil;
|
|
|
|
|
|
|
|
LOGObjectFnStart();
|
|
|
|
|
|
|
|
if (relativePath)
|
|
|
|
{
|
|
|
|
// Test if already cached
|
|
|
|
url = [_urlsCache objectForKey:relativePath];
|
|
|
|
|
|
|
|
// If not, build it
|
|
|
|
if (!url)
|
|
|
|
{
|
|
|
|
NSString* urlPrefix=[self bundleURLPrefix];
|
|
|
|
NSDebugMLLog(@"bundles",@"urlPrefix=%@",urlPrefix);
|
|
|
|
|
|
|
|
url=[urlPrefix stringByAppendingPathComponent:relativePath];
|
|
|
|
NSDebugMLLog(@"bundles",@"url=%@",url);
|
|
|
|
|
|
|
|
[_urlsCache setObject:url
|
|
|
|
forKey:relativePath];
|
|
|
|
};
|
|
|
|
}
|
|
|
|
LOGObjectFnStop();
|
|
|
|
return url;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
// lock
|
|
|
|
-(void)lock
|
|
|
|
{
|
|
|
|
LOGObjectFnStart();
|
* GSWeb.framework/GSWUtils.h/m
(IsStyle,IsNumberStyle, ExceptionRaise, ExceptionRaise0,
ValidationExceptionRaise, ValidationExceptionRaise0,
ExceptionByAddingUserInfoObjectFrameInfo,
ExceptionByAddingUserInfoObjectFrameInfo0,
ExceptionByAddingUserInfoFunctionFrameInfo,
ExceptionByAddingUserInfoFunctionFrameInfo0, ): Reformat
defines.
(GSW_LOCK_LIMIT): New define.
(ExceptionRaiseFn, ExceptionRaiseFn0,
ValidationExceptionRaiseFn,
ValidationExceptionRaiseFn0): Reformat declaration.
(TmpLock, TmpTryLockBeforeDate, TmpLockBeforeDate, TmpUnlock):
Remove.
([NSLock isLocked]): Remove.
([NSLock tmplock]): Ditto.
([NSLock tmplockFromFunction:file:line:]): Ditto.
([NSLock tmptryLock]): Ditto.
([NSLock tmptryLockFromFunction:file:line:]): Ditto.
([NSLock tmptryLockBeforeDate:]): Ditto.
([NSLock tmptryLockBeforeDate:fromFunction:file:line:]):
Ditto.
([NSLock tmpunlock]): Ditto.
([NSLock tmpunlockFromFunction:file:line:]): Ditto.
([NSLock description]): Ditto.
([NSRecursiveLock isLocked]): Ditto.
([NSRecursiveLock tmplock]): Ditto.
([NSRecursiveLock tmplockFromFunction:file:line:]): Ditto.
([NSRecursiveLock tmptryLock]): Ditto.
([NSRecursiveLock tmptryLockFromFunction:file:line:]): Ditto.
([NSRecursiveLock tmptryLockBeforeDate:]): Ditto.
([NSRecursiveLock
tmptryLockBeforeDate:fromFunction:file:line:]):
Ditto.
([NSRecursiveLock tmpunlock]): Ditto.
([NSRecursiveLock tmpunlockFromFunction:file:line:]): Ditto.
(NSLockException, MessageForMutexLockError)
(LoggedLock, LoggedLockBeforeDate, LoggedTryLock,
LoggedTryLockBeforeDate, LoggedUnlock): New macros.
(loggedLockBeforeDateFromFunctionInFileInLine,
loggedUnlockFromFunctionInFileInLine): New logging lock
functions.
([NSThread description]): New Category.
(volatileInternalDescription): New static function.
(GSW_LOCK_LIMIT): New marco.
* GSWeb.framework/GSWApplication.m
([GSWApplication isRequestHandlingLocked]): Test lock instead
of relying on obsolete lock categories.
([GSWApplication lockRequestHandling]): Use new locking
macros.
([GSWApplication unlockRequestHandling]): Ditto.
([GSWApplication lock]): Ditto.
([GSWApplication unlock]): Ditto.
* GSWeb.framework/GSWAssociation.m
([GSWAssociation setClasse:forHandler:]): Ditto
([GSWAssociation addLogHandlerClasse:]): Ditto.
([GSWAssociation removeLogHandlerClasse:]): Ditto.
([GSWAssociation logValue:forSet:]): Ditto.
([GSWAssociation
logSynchronizeForValue:inComponent:componentToParent:]):
Ditto.
* GSWeb.framework/GSWBundle.m
([GSWBundle unlock]): Ditto.
([GSWBundle lock]): Ditto.
* GSWeb.framework/GSWDefaultAdaptor.m
([GSWDefaultAdaptor tryLock]): Ditto.
([GSWDefaultAdaptor unlock]): Ditto.
* GSWeb.framework/GSWDeployedBundle.m
([GSWDeployedBundle lock]): Ditto.
([GSWDeployedBundle unlock]): Ditto.
* GSWeb.framework/GSWResourceManager.m
([GSWResourceManager unlock]): Ditto.
([GSWResourceManager lock]): Ditto.
* GSWeb.framework/GSWSessionStore.m
([GSWSessionStore unlock]): Ditto.
([GSWSessionStore tryLock]): Ditto.
([GSWSessionStore lock]): Ditto.
* GSWeb.framework/GSWSessionTimeOutManager.m
([GSWSessionTimeOutManager
tryLockBeforeTimeIntervalSinceNow:]):
Ditto.
([GSWSessionTimeOutManager lockBeforeTimeIntervalSinceNow]):
Ditto.
([GSWSessionTimeOutManager unlock]): Ditto.
* GSWeb.framework/GSWStaticResourceRequestHandler.m
([GSWStaticResourceRequestHandler handleRequest:]): Ditto.
* GSWeb.framework/GSWStatisticsStore.m
([GSWStatisticsStore unlock]): Ditto.
([GSWStatisticsStore lock]): Ditto.
* GSWeb.framework/NSObject+IVarAccess+PerformSel.m:
([NSObject getIVarNamed]): Use GSW_LOCK_LIMIT macro.
Reformat.
([NSObject setIVarNamed:withValue:]): Ditto.
* Makefile.postamble: Remove autom4te.cache on distclean.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@18605 72102866-910b-0410-8b05-ffd578937521
2004-02-16 14:37:46 +00:00
|
|
|
NSDebugMLLog(@"bundles",
|
* GSWeb.framework/GSWApplication.m
(GSWApplicationMainReal): Reformat. Use GSCurrentThread
instead of objc_thread_id. Remove \n in NSLog type logs.
(GSWApplicationMain): Ditto.
([GSWApplication init], [GSWApplication lockRequestHandling],
[GSWApplication unlockRequestHandling], [GSWApplication lock],
[GSWApplication unlock], [GSWApplication _sessionClass],
[GSWApplication run],
[GSWApplication addDynCreateClassName:superClassName:],
[GSWApplication pageWithName:],
[GSWApplication dynamicElementWithName:associations:template:]):
Ditto.
* GSWeb.framework/GSWComponent.m
([GSWComponent appendToResponse:inContext:], [GSWComponent
templateWithHTMLString:declarationString:languages:]): Ditto.
* GSWeb.framework/GSWContext.m
([GSWContext dealloc], [GSWContext setValidate:]): Ditto.
* GSWeb.framework/GSWDebug.m
(GSWLogC_, GSWLogDumpObjectFn): Ditto.
* GSWeb.framework/GSWDefaultAdaptor.m
([GSWDefaultAdaptor registerForEvents],
[GSWDefaultAdaptor announceNewConnection:],
[GSWDefaultAdaptor adaptorThreadExited:],
[GSWDefaultAdaptor tryLock]): Ditto.
* GSWeb.framework/GSWDefaultAdaptorThread.m
([GSWDefaultAdaptorThread setPool:destroyLast:],
[GSWDefaultAdaptorThread run:],
[GSWDefaultAdaptorThread threadExited],
[GSWDefaultAdaptorThread isExpired],
[GSWDefaultAdaptorThread sendRetryLasterResponseToStream:],
[GSWDefaultAdaptorThread
sendConnectionRefusedResponseToStream:withMessage:]): Ditto.
* GSWeb.framework/GSWDeployedBundle.m
([GSWDeployedBundle initWithPath:], [GSWDeployedBundle dealloc],
[GSWDeployedBundle lock], [GSWDeployedBundle unlock]): Ditto.
* GSWeb.framework/GSWLifebeatThread.m
([GSWLifebeatThread setPool:destroyLast:],
[GSWLifebeatThread threadExited]): Ditto.
* GSWeb.framework/GSWSession.m
([GSWSession initWithCoder:],
[GSWSession _releaseAutoreleasePool]): Ditto.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@18611 72102866-910b-0410-8b05-ffd578937521
2004-02-17 16:53:36 +00:00
|
|
|
@"selfLock=%p selfLockn=%d selfLock_thread_id=%@ "
|
|
|
|
@"GSCurrentThread()=%@",
|
* GSWeb.framework/GSWUtils.h/m
(IsStyle,IsNumberStyle, ExceptionRaise, ExceptionRaise0,
ValidationExceptionRaise, ValidationExceptionRaise0,
ExceptionByAddingUserInfoObjectFrameInfo,
ExceptionByAddingUserInfoObjectFrameInfo0,
ExceptionByAddingUserInfoFunctionFrameInfo,
ExceptionByAddingUserInfoFunctionFrameInfo0, ): Reformat
defines.
(GSW_LOCK_LIMIT): New define.
(ExceptionRaiseFn, ExceptionRaiseFn0,
ValidationExceptionRaiseFn,
ValidationExceptionRaiseFn0): Reformat declaration.
(TmpLock, TmpTryLockBeforeDate, TmpLockBeforeDate, TmpUnlock):
Remove.
([NSLock isLocked]): Remove.
([NSLock tmplock]): Ditto.
([NSLock tmplockFromFunction:file:line:]): Ditto.
([NSLock tmptryLock]): Ditto.
([NSLock tmptryLockFromFunction:file:line:]): Ditto.
([NSLock tmptryLockBeforeDate:]): Ditto.
([NSLock tmptryLockBeforeDate:fromFunction:file:line:]):
Ditto.
([NSLock tmpunlock]): Ditto.
([NSLock tmpunlockFromFunction:file:line:]): Ditto.
([NSLock description]): Ditto.
([NSRecursiveLock isLocked]): Ditto.
([NSRecursiveLock tmplock]): Ditto.
([NSRecursiveLock tmplockFromFunction:file:line:]): Ditto.
([NSRecursiveLock tmptryLock]): Ditto.
([NSRecursiveLock tmptryLockFromFunction:file:line:]): Ditto.
([NSRecursiveLock tmptryLockBeforeDate:]): Ditto.
([NSRecursiveLock
tmptryLockBeforeDate:fromFunction:file:line:]):
Ditto.
([NSRecursiveLock tmpunlock]): Ditto.
([NSRecursiveLock tmpunlockFromFunction:file:line:]): Ditto.
(NSLockException, MessageForMutexLockError)
(LoggedLock, LoggedLockBeforeDate, LoggedTryLock,
LoggedTryLockBeforeDate, LoggedUnlock): New macros.
(loggedLockBeforeDateFromFunctionInFileInLine,
loggedUnlockFromFunctionInFileInLine): New logging lock
functions.
([NSThread description]): New Category.
(volatileInternalDescription): New static function.
(GSW_LOCK_LIMIT): New marco.
* GSWeb.framework/GSWApplication.m
([GSWApplication isRequestHandlingLocked]): Test lock instead
of relying on obsolete lock categories.
([GSWApplication lockRequestHandling]): Use new locking
macros.
([GSWApplication unlockRequestHandling]): Ditto.
([GSWApplication lock]): Ditto.
([GSWApplication unlock]): Ditto.
* GSWeb.framework/GSWAssociation.m
([GSWAssociation setClasse:forHandler:]): Ditto
([GSWAssociation addLogHandlerClasse:]): Ditto.
([GSWAssociation removeLogHandlerClasse:]): Ditto.
([GSWAssociation logValue:forSet:]): Ditto.
([GSWAssociation
logSynchronizeForValue:inComponent:componentToParent:]):
Ditto.
* GSWeb.framework/GSWBundle.m
([GSWBundle unlock]): Ditto.
([GSWBundle lock]): Ditto.
* GSWeb.framework/GSWDefaultAdaptor.m
([GSWDefaultAdaptor tryLock]): Ditto.
([GSWDefaultAdaptor unlock]): Ditto.
* GSWeb.framework/GSWDeployedBundle.m
([GSWDeployedBundle lock]): Ditto.
([GSWDeployedBundle unlock]): Ditto.
* GSWeb.framework/GSWResourceManager.m
([GSWResourceManager unlock]): Ditto.
([GSWResourceManager lock]): Ditto.
* GSWeb.framework/GSWSessionStore.m
([GSWSessionStore unlock]): Ditto.
([GSWSessionStore tryLock]): Ditto.
([GSWSessionStore lock]): Ditto.
* GSWeb.framework/GSWSessionTimeOutManager.m
([GSWSessionTimeOutManager
tryLockBeforeTimeIntervalSinceNow:]):
Ditto.
([GSWSessionTimeOutManager lockBeforeTimeIntervalSinceNow]):
Ditto.
([GSWSessionTimeOutManager unlock]): Ditto.
* GSWeb.framework/GSWStaticResourceRequestHandler.m
([GSWStaticResourceRequestHandler handleRequest:]): Ditto.
* GSWeb.framework/GSWStatisticsStore.m
([GSWStatisticsStore unlock]): Ditto.
([GSWStatisticsStore lock]): Ditto.
* GSWeb.framework/NSObject+IVarAccess+PerformSel.m:
([NSObject getIVarNamed]): Use GSW_LOCK_LIMIT macro.
Reformat.
([NSObject setIVarNamed:withValue:]): Ditto.
* Makefile.postamble: Remove autom4te.cache on distclean.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@18605 72102866-910b-0410-8b05-ffd578937521
2004-02-16 14:37:46 +00:00
|
|
|
(void*)_selfLock,
|
|
|
|
_selfLockn,
|
* GSWeb.framework/GSWApplication.m
(GSWApplicationMainReal): Reformat. Use GSCurrentThread
instead of objc_thread_id. Remove \n in NSLog type logs.
(GSWApplicationMain): Ditto.
([GSWApplication init], [GSWApplication lockRequestHandling],
[GSWApplication unlockRequestHandling], [GSWApplication lock],
[GSWApplication unlock], [GSWApplication _sessionClass],
[GSWApplication run],
[GSWApplication addDynCreateClassName:superClassName:],
[GSWApplication pageWithName:],
[GSWApplication dynamicElementWithName:associations:template:]):
Ditto.
* GSWeb.framework/GSWComponent.m
([GSWComponent appendToResponse:inContext:], [GSWComponent
templateWithHTMLString:declarationString:languages:]): Ditto.
* GSWeb.framework/GSWContext.m
([GSWContext dealloc], [GSWContext setValidate:]): Ditto.
* GSWeb.framework/GSWDebug.m
(GSWLogC_, GSWLogDumpObjectFn): Ditto.
* GSWeb.framework/GSWDefaultAdaptor.m
([GSWDefaultAdaptor registerForEvents],
[GSWDefaultAdaptor announceNewConnection:],
[GSWDefaultAdaptor adaptorThreadExited:],
[GSWDefaultAdaptor tryLock]): Ditto.
* GSWeb.framework/GSWDefaultAdaptorThread.m
([GSWDefaultAdaptorThread setPool:destroyLast:],
[GSWDefaultAdaptorThread run:],
[GSWDefaultAdaptorThread threadExited],
[GSWDefaultAdaptorThread isExpired],
[GSWDefaultAdaptorThread sendRetryLasterResponseToStream:],
[GSWDefaultAdaptorThread
sendConnectionRefusedResponseToStream:withMessage:]): Ditto.
* GSWeb.framework/GSWDeployedBundle.m
([GSWDeployedBundle initWithPath:], [GSWDeployedBundle dealloc],
[GSWDeployedBundle lock], [GSWDeployedBundle unlock]): Ditto.
* GSWeb.framework/GSWLifebeatThread.m
([GSWLifebeatThread setPool:destroyLast:],
[GSWLifebeatThread threadExited]): Ditto.
* GSWeb.framework/GSWSession.m
([GSWSession initWithCoder:],
[GSWSession _releaseAutoreleasePool]): Ditto.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@18611 72102866-910b-0410-8b05-ffd578937521
2004-02-17 16:53:36 +00:00
|
|
|
_selfLock_thread_id,
|
|
|
|
GSCurrentThread());
|
2002-08-04 18:00:11 +00:00
|
|
|
if (_selfLockn>0)
|
|
|
|
{
|
* GSWeb.framework/GSWApplication.m
(GSWApplicationMainReal): Reformat. Use GSCurrentThread
instead of objc_thread_id. Remove \n in NSLog type logs.
(GSWApplicationMain): Ditto.
([GSWApplication init], [GSWApplication lockRequestHandling],
[GSWApplication unlockRequestHandling], [GSWApplication lock],
[GSWApplication unlock], [GSWApplication _sessionClass],
[GSWApplication run],
[GSWApplication addDynCreateClassName:superClassName:],
[GSWApplication pageWithName:],
[GSWApplication dynamicElementWithName:associations:template:]):
Ditto.
* GSWeb.framework/GSWComponent.m
([GSWComponent appendToResponse:inContext:], [GSWComponent
templateWithHTMLString:declarationString:languages:]): Ditto.
* GSWeb.framework/GSWContext.m
([GSWContext dealloc], [GSWContext setValidate:]): Ditto.
* GSWeb.framework/GSWDebug.m
(GSWLogC_, GSWLogDumpObjectFn): Ditto.
* GSWeb.framework/GSWDefaultAdaptor.m
([GSWDefaultAdaptor registerForEvents],
[GSWDefaultAdaptor announceNewConnection:],
[GSWDefaultAdaptor adaptorThreadExited:],
[GSWDefaultAdaptor tryLock]): Ditto.
* GSWeb.framework/GSWDefaultAdaptorThread.m
([GSWDefaultAdaptorThread setPool:destroyLast:],
[GSWDefaultAdaptorThread run:],
[GSWDefaultAdaptorThread threadExited],
[GSWDefaultAdaptorThread isExpired],
[GSWDefaultAdaptorThread sendRetryLasterResponseToStream:],
[GSWDefaultAdaptorThread
sendConnectionRefusedResponseToStream:withMessage:]): Ditto.
* GSWeb.framework/GSWDeployedBundle.m
([GSWDeployedBundle initWithPath:], [GSWDeployedBundle dealloc],
[GSWDeployedBundle lock], [GSWDeployedBundle unlock]): Ditto.
* GSWeb.framework/GSWLifebeatThread.m
([GSWLifebeatThread setPool:destroyLast:],
[GSWLifebeatThread threadExited]): Ditto.
* GSWeb.framework/GSWSession.m
([GSWSession initWithCoder:],
[GSWSession _releaseAutoreleasePool]): Ditto.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@18611 72102866-910b-0410-8b05-ffd578937521
2004-02-17 16:53:36 +00:00
|
|
|
if (_selfLock_thread_id!=GSCurrentThread())
|
2002-08-04 18:00:11 +00:00
|
|
|
{
|
|
|
|
NSDebugMLog0(@"PROBLEM: owner!=thread id");
|
|
|
|
};
|
|
|
|
};
|
* GSWeb.framework/GSWUtils.h/m
(IsStyle,IsNumberStyle, ExceptionRaise, ExceptionRaise0,
ValidationExceptionRaise, ValidationExceptionRaise0,
ExceptionByAddingUserInfoObjectFrameInfo,
ExceptionByAddingUserInfoObjectFrameInfo0,
ExceptionByAddingUserInfoFunctionFrameInfo,
ExceptionByAddingUserInfoFunctionFrameInfo0, ): Reformat
defines.
(GSW_LOCK_LIMIT): New define.
(ExceptionRaiseFn, ExceptionRaiseFn0,
ValidationExceptionRaiseFn,
ValidationExceptionRaiseFn0): Reformat declaration.
(TmpLock, TmpTryLockBeforeDate, TmpLockBeforeDate, TmpUnlock):
Remove.
([NSLock isLocked]): Remove.
([NSLock tmplock]): Ditto.
([NSLock tmplockFromFunction:file:line:]): Ditto.
([NSLock tmptryLock]): Ditto.
([NSLock tmptryLockFromFunction:file:line:]): Ditto.
([NSLock tmptryLockBeforeDate:]): Ditto.
([NSLock tmptryLockBeforeDate:fromFunction:file:line:]):
Ditto.
([NSLock tmpunlock]): Ditto.
([NSLock tmpunlockFromFunction:file:line:]): Ditto.
([NSLock description]): Ditto.
([NSRecursiveLock isLocked]): Ditto.
([NSRecursiveLock tmplock]): Ditto.
([NSRecursiveLock tmplockFromFunction:file:line:]): Ditto.
([NSRecursiveLock tmptryLock]): Ditto.
([NSRecursiveLock tmptryLockFromFunction:file:line:]): Ditto.
([NSRecursiveLock tmptryLockBeforeDate:]): Ditto.
([NSRecursiveLock
tmptryLockBeforeDate:fromFunction:file:line:]):
Ditto.
([NSRecursiveLock tmpunlock]): Ditto.
([NSRecursiveLock tmpunlockFromFunction:file:line:]): Ditto.
(NSLockException, MessageForMutexLockError)
(LoggedLock, LoggedLockBeforeDate, LoggedTryLock,
LoggedTryLockBeforeDate, LoggedUnlock): New macros.
(loggedLockBeforeDateFromFunctionInFileInLine,
loggedUnlockFromFunctionInFileInLine): New logging lock
functions.
([NSThread description]): New Category.
(volatileInternalDescription): New static function.
(GSW_LOCK_LIMIT): New marco.
* GSWeb.framework/GSWApplication.m
([GSWApplication isRequestHandlingLocked]): Test lock instead
of relying on obsolete lock categories.
([GSWApplication lockRequestHandling]): Use new locking
macros.
([GSWApplication unlockRequestHandling]): Ditto.
([GSWApplication lock]): Ditto.
([GSWApplication unlock]): Ditto.
* GSWeb.framework/GSWAssociation.m
([GSWAssociation setClasse:forHandler:]): Ditto
([GSWAssociation addLogHandlerClasse:]): Ditto.
([GSWAssociation removeLogHandlerClasse:]): Ditto.
([GSWAssociation logValue:forSet:]): Ditto.
([GSWAssociation
logSynchronizeForValue:inComponent:componentToParent:]):
Ditto.
* GSWeb.framework/GSWBundle.m
([GSWBundle unlock]): Ditto.
([GSWBundle lock]): Ditto.
* GSWeb.framework/GSWDefaultAdaptor.m
([GSWDefaultAdaptor tryLock]): Ditto.
([GSWDefaultAdaptor unlock]): Ditto.
* GSWeb.framework/GSWDeployedBundle.m
([GSWDeployedBundle lock]): Ditto.
([GSWDeployedBundle unlock]): Ditto.
* GSWeb.framework/GSWResourceManager.m
([GSWResourceManager unlock]): Ditto.
([GSWResourceManager lock]): Ditto.
* GSWeb.framework/GSWSessionStore.m
([GSWSessionStore unlock]): Ditto.
([GSWSessionStore tryLock]): Ditto.
([GSWSessionStore lock]): Ditto.
* GSWeb.framework/GSWSessionTimeOutManager.m
([GSWSessionTimeOutManager
tryLockBeforeTimeIntervalSinceNow:]):
Ditto.
([GSWSessionTimeOutManager lockBeforeTimeIntervalSinceNow]):
Ditto.
([GSWSessionTimeOutManager unlock]): Ditto.
* GSWeb.framework/GSWStaticResourceRequestHandler.m
([GSWStaticResourceRequestHandler handleRequest:]): Ditto.
* GSWeb.framework/GSWStatisticsStore.m
([GSWStatisticsStore unlock]): Ditto.
([GSWStatisticsStore lock]): Ditto.
* GSWeb.framework/NSObject+IVarAccess+PerformSel.m:
([NSObject getIVarNamed]): Use GSW_LOCK_LIMIT macro.
Reformat.
([NSObject setIVarNamed:withValue:]): Ditto.
* Makefile.postamble: Remove autom4te.cache on distclean.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@18605 72102866-910b-0410-8b05-ffd578937521
2004-02-16 14:37:46 +00:00
|
|
|
LoggedLockBeforeDate(_selfLock,GSW_LOCK_LIMIT);
|
2000-01-22 12:49:49 +00:00
|
|
|
#ifndef NDEBUG
|
2002-08-04 18:00:11 +00:00
|
|
|
_selfLockn++;
|
* GSWeb.framework/GSWApplication.m
(GSWApplicationMainReal): Reformat. Use GSCurrentThread
instead of objc_thread_id. Remove \n in NSLog type logs.
(GSWApplicationMain): Ditto.
([GSWApplication init], [GSWApplication lockRequestHandling],
[GSWApplication unlockRequestHandling], [GSWApplication lock],
[GSWApplication unlock], [GSWApplication _sessionClass],
[GSWApplication run],
[GSWApplication addDynCreateClassName:superClassName:],
[GSWApplication pageWithName:],
[GSWApplication dynamicElementWithName:associations:template:]):
Ditto.
* GSWeb.framework/GSWComponent.m
([GSWComponent appendToResponse:inContext:], [GSWComponent
templateWithHTMLString:declarationString:languages:]): Ditto.
* GSWeb.framework/GSWContext.m
([GSWContext dealloc], [GSWContext setValidate:]): Ditto.
* GSWeb.framework/GSWDebug.m
(GSWLogC_, GSWLogDumpObjectFn): Ditto.
* GSWeb.framework/GSWDefaultAdaptor.m
([GSWDefaultAdaptor registerForEvents],
[GSWDefaultAdaptor announceNewConnection:],
[GSWDefaultAdaptor adaptorThreadExited:],
[GSWDefaultAdaptor tryLock]): Ditto.
* GSWeb.framework/GSWDefaultAdaptorThread.m
([GSWDefaultAdaptorThread setPool:destroyLast:],
[GSWDefaultAdaptorThread run:],
[GSWDefaultAdaptorThread threadExited],
[GSWDefaultAdaptorThread isExpired],
[GSWDefaultAdaptorThread sendRetryLasterResponseToStream:],
[GSWDefaultAdaptorThread
sendConnectionRefusedResponseToStream:withMessage:]): Ditto.
* GSWeb.framework/GSWDeployedBundle.m
([GSWDeployedBundle initWithPath:], [GSWDeployedBundle dealloc],
[GSWDeployedBundle lock], [GSWDeployedBundle unlock]): Ditto.
* GSWeb.framework/GSWLifebeatThread.m
([GSWLifebeatThread setPool:destroyLast:],
[GSWLifebeatThread threadExited]): Ditto.
* GSWeb.framework/GSWSession.m
([GSWSession initWithCoder:],
[GSWSession _releaseAutoreleasePool]): Ditto.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@18611 72102866-910b-0410-8b05-ffd578937521
2004-02-17 16:53:36 +00:00
|
|
|
_selfLock_thread_id=GSCurrentThread();
|
2000-01-22 12:49:49 +00:00
|
|
|
#endif
|
* GSWeb.framework/GSWUtils.h/m
(IsStyle,IsNumberStyle, ExceptionRaise, ExceptionRaise0,
ValidationExceptionRaise, ValidationExceptionRaise0,
ExceptionByAddingUserInfoObjectFrameInfo,
ExceptionByAddingUserInfoObjectFrameInfo0,
ExceptionByAddingUserInfoFunctionFrameInfo,
ExceptionByAddingUserInfoFunctionFrameInfo0, ): Reformat
defines.
(GSW_LOCK_LIMIT): New define.
(ExceptionRaiseFn, ExceptionRaiseFn0,
ValidationExceptionRaiseFn,
ValidationExceptionRaiseFn0): Reformat declaration.
(TmpLock, TmpTryLockBeforeDate, TmpLockBeforeDate, TmpUnlock):
Remove.
([NSLock isLocked]): Remove.
([NSLock tmplock]): Ditto.
([NSLock tmplockFromFunction:file:line:]): Ditto.
([NSLock tmptryLock]): Ditto.
([NSLock tmptryLockFromFunction:file:line:]): Ditto.
([NSLock tmptryLockBeforeDate:]): Ditto.
([NSLock tmptryLockBeforeDate:fromFunction:file:line:]):
Ditto.
([NSLock tmpunlock]): Ditto.
([NSLock tmpunlockFromFunction:file:line:]): Ditto.
([NSLock description]): Ditto.
([NSRecursiveLock isLocked]): Ditto.
([NSRecursiveLock tmplock]): Ditto.
([NSRecursiveLock tmplockFromFunction:file:line:]): Ditto.
([NSRecursiveLock tmptryLock]): Ditto.
([NSRecursiveLock tmptryLockFromFunction:file:line:]): Ditto.
([NSRecursiveLock tmptryLockBeforeDate:]): Ditto.
([NSRecursiveLock
tmptryLockBeforeDate:fromFunction:file:line:]):
Ditto.
([NSRecursiveLock tmpunlock]): Ditto.
([NSRecursiveLock tmpunlockFromFunction:file:line:]): Ditto.
(NSLockException, MessageForMutexLockError)
(LoggedLock, LoggedLockBeforeDate, LoggedTryLock,
LoggedTryLockBeforeDate, LoggedUnlock): New macros.
(loggedLockBeforeDateFromFunctionInFileInLine,
loggedUnlockFromFunctionInFileInLine): New logging lock
functions.
([NSThread description]): New Category.
(volatileInternalDescription): New static function.
(GSW_LOCK_LIMIT): New marco.
* GSWeb.framework/GSWApplication.m
([GSWApplication isRequestHandlingLocked]): Test lock instead
of relying on obsolete lock categories.
([GSWApplication lockRequestHandling]): Use new locking
macros.
([GSWApplication unlockRequestHandling]): Ditto.
([GSWApplication lock]): Ditto.
([GSWApplication unlock]): Ditto.
* GSWeb.framework/GSWAssociation.m
([GSWAssociation setClasse:forHandler:]): Ditto
([GSWAssociation addLogHandlerClasse:]): Ditto.
([GSWAssociation removeLogHandlerClasse:]): Ditto.
([GSWAssociation logValue:forSet:]): Ditto.
([GSWAssociation
logSynchronizeForValue:inComponent:componentToParent:]):
Ditto.
* GSWeb.framework/GSWBundle.m
([GSWBundle unlock]): Ditto.
([GSWBundle lock]): Ditto.
* GSWeb.framework/GSWDefaultAdaptor.m
([GSWDefaultAdaptor tryLock]): Ditto.
([GSWDefaultAdaptor unlock]): Ditto.
* GSWeb.framework/GSWDeployedBundle.m
([GSWDeployedBundle lock]): Ditto.
([GSWDeployedBundle unlock]): Ditto.
* GSWeb.framework/GSWResourceManager.m
([GSWResourceManager unlock]): Ditto.
([GSWResourceManager lock]): Ditto.
* GSWeb.framework/GSWSessionStore.m
([GSWSessionStore unlock]): Ditto.
([GSWSessionStore tryLock]): Ditto.
([GSWSessionStore lock]): Ditto.
* GSWeb.framework/GSWSessionTimeOutManager.m
([GSWSessionTimeOutManager
tryLockBeforeTimeIntervalSinceNow:]):
Ditto.
([GSWSessionTimeOutManager lockBeforeTimeIntervalSinceNow]):
Ditto.
([GSWSessionTimeOutManager unlock]): Ditto.
* GSWeb.framework/GSWStaticResourceRequestHandler.m
([GSWStaticResourceRequestHandler handleRequest:]): Ditto.
* GSWeb.framework/GSWStatisticsStore.m
([GSWStatisticsStore unlock]): Ditto.
([GSWStatisticsStore lock]): Ditto.
* GSWeb.framework/NSObject+IVarAccess+PerformSel.m:
([NSObject getIVarNamed]): Use GSW_LOCK_LIMIT macro.
Reformat.
([NSObject setIVarNamed:withValue:]): Ditto.
* Makefile.postamble: Remove autom4te.cache on distclean.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@18605 72102866-910b-0410-8b05-ffd578937521
2004-02-16 14:37:46 +00:00
|
|
|
NSDebugMLLog(@"bundles",
|
* GSWeb.framework/GSWApplication.m
(GSWApplicationMainReal): Reformat. Use GSCurrentThread
instead of objc_thread_id. Remove \n in NSLog type logs.
(GSWApplicationMain): Ditto.
([GSWApplication init], [GSWApplication lockRequestHandling],
[GSWApplication unlockRequestHandling], [GSWApplication lock],
[GSWApplication unlock], [GSWApplication _sessionClass],
[GSWApplication run],
[GSWApplication addDynCreateClassName:superClassName:],
[GSWApplication pageWithName:],
[GSWApplication dynamicElementWithName:associations:template:]):
Ditto.
* GSWeb.framework/GSWComponent.m
([GSWComponent appendToResponse:inContext:], [GSWComponent
templateWithHTMLString:declarationString:languages:]): Ditto.
* GSWeb.framework/GSWContext.m
([GSWContext dealloc], [GSWContext setValidate:]): Ditto.
* GSWeb.framework/GSWDebug.m
(GSWLogC_, GSWLogDumpObjectFn): Ditto.
* GSWeb.framework/GSWDefaultAdaptor.m
([GSWDefaultAdaptor registerForEvents],
[GSWDefaultAdaptor announceNewConnection:],
[GSWDefaultAdaptor adaptorThreadExited:],
[GSWDefaultAdaptor tryLock]): Ditto.
* GSWeb.framework/GSWDefaultAdaptorThread.m
([GSWDefaultAdaptorThread setPool:destroyLast:],
[GSWDefaultAdaptorThread run:],
[GSWDefaultAdaptorThread threadExited],
[GSWDefaultAdaptorThread isExpired],
[GSWDefaultAdaptorThread sendRetryLasterResponseToStream:],
[GSWDefaultAdaptorThread
sendConnectionRefusedResponseToStream:withMessage:]): Ditto.
* GSWeb.framework/GSWDeployedBundle.m
([GSWDeployedBundle initWithPath:], [GSWDeployedBundle dealloc],
[GSWDeployedBundle lock], [GSWDeployedBundle unlock]): Ditto.
* GSWeb.framework/GSWLifebeatThread.m
([GSWLifebeatThread setPool:destroyLast:],
[GSWLifebeatThread threadExited]): Ditto.
* GSWeb.framework/GSWSession.m
([GSWSession initWithCoder:],
[GSWSession _releaseAutoreleasePool]): Ditto.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@18611 72102866-910b-0410-8b05-ffd578937521
2004-02-17 16:53:36 +00:00
|
|
|
@"selfLock=%p selfLockn=%d selfLock_thread_id=%@ "
|
|
|
|
@"GSCurrentThread()=%@",
|
2002-08-04 18:00:11 +00:00
|
|
|
_selfLock,
|
|
|
|
_selfLockn,
|
* GSWeb.framework/GSWApplication.m
(GSWApplicationMainReal): Reformat. Use GSCurrentThread
instead of objc_thread_id. Remove \n in NSLog type logs.
(GSWApplicationMain): Ditto.
([GSWApplication init], [GSWApplication lockRequestHandling],
[GSWApplication unlockRequestHandling], [GSWApplication lock],
[GSWApplication unlock], [GSWApplication _sessionClass],
[GSWApplication run],
[GSWApplication addDynCreateClassName:superClassName:],
[GSWApplication pageWithName:],
[GSWApplication dynamicElementWithName:associations:template:]):
Ditto.
* GSWeb.framework/GSWComponent.m
([GSWComponent appendToResponse:inContext:], [GSWComponent
templateWithHTMLString:declarationString:languages:]): Ditto.
* GSWeb.framework/GSWContext.m
([GSWContext dealloc], [GSWContext setValidate:]): Ditto.
* GSWeb.framework/GSWDebug.m
(GSWLogC_, GSWLogDumpObjectFn): Ditto.
* GSWeb.framework/GSWDefaultAdaptor.m
([GSWDefaultAdaptor registerForEvents],
[GSWDefaultAdaptor announceNewConnection:],
[GSWDefaultAdaptor adaptorThreadExited:],
[GSWDefaultAdaptor tryLock]): Ditto.
* GSWeb.framework/GSWDefaultAdaptorThread.m
([GSWDefaultAdaptorThread setPool:destroyLast:],
[GSWDefaultAdaptorThread run:],
[GSWDefaultAdaptorThread threadExited],
[GSWDefaultAdaptorThread isExpired],
[GSWDefaultAdaptorThread sendRetryLasterResponseToStream:],
[GSWDefaultAdaptorThread
sendConnectionRefusedResponseToStream:withMessage:]): Ditto.
* GSWeb.framework/GSWDeployedBundle.m
([GSWDeployedBundle initWithPath:], [GSWDeployedBundle dealloc],
[GSWDeployedBundle lock], [GSWDeployedBundle unlock]): Ditto.
* GSWeb.framework/GSWLifebeatThread.m
([GSWLifebeatThread setPool:destroyLast:],
[GSWLifebeatThread threadExited]): Ditto.
* GSWeb.framework/GSWSession.m
([GSWSession initWithCoder:],
[GSWSession _releaseAutoreleasePool]): Ditto.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@18611 72102866-910b-0410-8b05-ffd578937521
2004-02-17 16:53:36 +00:00
|
|
|
_selfLock_thread_id,
|
|
|
|
GSCurrentThread());
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStop();
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
// unlock
|
|
|
|
-(void)unlock
|
|
|
|
{
|
|
|
|
LOGObjectFnStart();
|
* GSWeb.framework/GSWApplication.m
(GSWApplicationMainReal): Reformat. Use GSCurrentThread
instead of objc_thread_id. Remove \n in NSLog type logs.
(GSWApplicationMain): Ditto.
([GSWApplication init], [GSWApplication lockRequestHandling],
[GSWApplication unlockRequestHandling], [GSWApplication lock],
[GSWApplication unlock], [GSWApplication _sessionClass],
[GSWApplication run],
[GSWApplication addDynCreateClassName:superClassName:],
[GSWApplication pageWithName:],
[GSWApplication dynamicElementWithName:associations:template:]):
Ditto.
* GSWeb.framework/GSWComponent.m
([GSWComponent appendToResponse:inContext:], [GSWComponent
templateWithHTMLString:declarationString:languages:]): Ditto.
* GSWeb.framework/GSWContext.m
([GSWContext dealloc], [GSWContext setValidate:]): Ditto.
* GSWeb.framework/GSWDebug.m
(GSWLogC_, GSWLogDumpObjectFn): Ditto.
* GSWeb.framework/GSWDefaultAdaptor.m
([GSWDefaultAdaptor registerForEvents],
[GSWDefaultAdaptor announceNewConnection:],
[GSWDefaultAdaptor adaptorThreadExited:],
[GSWDefaultAdaptor tryLock]): Ditto.
* GSWeb.framework/GSWDefaultAdaptorThread.m
([GSWDefaultAdaptorThread setPool:destroyLast:],
[GSWDefaultAdaptorThread run:],
[GSWDefaultAdaptorThread threadExited],
[GSWDefaultAdaptorThread isExpired],
[GSWDefaultAdaptorThread sendRetryLasterResponseToStream:],
[GSWDefaultAdaptorThread
sendConnectionRefusedResponseToStream:withMessage:]): Ditto.
* GSWeb.framework/GSWDeployedBundle.m
([GSWDeployedBundle initWithPath:], [GSWDeployedBundle dealloc],
[GSWDeployedBundle lock], [GSWDeployedBundle unlock]): Ditto.
* GSWeb.framework/GSWLifebeatThread.m
([GSWLifebeatThread setPool:destroyLast:],
[GSWLifebeatThread threadExited]): Ditto.
* GSWeb.framework/GSWSession.m
([GSWSession initWithCoder:],
[GSWSession _releaseAutoreleasePool]): Ditto.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@18611 72102866-910b-0410-8b05-ffd578937521
2004-02-17 16:53:36 +00:00
|
|
|
NSDebugMLLog(@"bundles",
|
|
|
|
@"selfLock=%p selfLockn=%d selfLock_thread_id=%@ "
|
|
|
|
@"GSCurrentThread()=%@",
|
2002-08-04 18:00:11 +00:00
|
|
|
(void*)_selfLock,
|
|
|
|
_selfLockn,
|
* GSWeb.framework/GSWApplication.m
(GSWApplicationMainReal): Reformat. Use GSCurrentThread
instead of objc_thread_id. Remove \n in NSLog type logs.
(GSWApplicationMain): Ditto.
([GSWApplication init], [GSWApplication lockRequestHandling],
[GSWApplication unlockRequestHandling], [GSWApplication lock],
[GSWApplication unlock], [GSWApplication _sessionClass],
[GSWApplication run],
[GSWApplication addDynCreateClassName:superClassName:],
[GSWApplication pageWithName:],
[GSWApplication dynamicElementWithName:associations:template:]):
Ditto.
* GSWeb.framework/GSWComponent.m
([GSWComponent appendToResponse:inContext:], [GSWComponent
templateWithHTMLString:declarationString:languages:]): Ditto.
* GSWeb.framework/GSWContext.m
([GSWContext dealloc], [GSWContext setValidate:]): Ditto.
* GSWeb.framework/GSWDebug.m
(GSWLogC_, GSWLogDumpObjectFn): Ditto.
* GSWeb.framework/GSWDefaultAdaptor.m
([GSWDefaultAdaptor registerForEvents],
[GSWDefaultAdaptor announceNewConnection:],
[GSWDefaultAdaptor adaptorThreadExited:],
[GSWDefaultAdaptor tryLock]): Ditto.
* GSWeb.framework/GSWDefaultAdaptorThread.m
([GSWDefaultAdaptorThread setPool:destroyLast:],
[GSWDefaultAdaptorThread run:],
[GSWDefaultAdaptorThread threadExited],
[GSWDefaultAdaptorThread isExpired],
[GSWDefaultAdaptorThread sendRetryLasterResponseToStream:],
[GSWDefaultAdaptorThread
sendConnectionRefusedResponseToStream:withMessage:]): Ditto.
* GSWeb.framework/GSWDeployedBundle.m
([GSWDeployedBundle initWithPath:], [GSWDeployedBundle dealloc],
[GSWDeployedBundle lock], [GSWDeployedBundle unlock]): Ditto.
* GSWeb.framework/GSWLifebeatThread.m
([GSWLifebeatThread setPool:destroyLast:],
[GSWLifebeatThread threadExited]): Ditto.
* GSWeb.framework/GSWSession.m
([GSWSession initWithCoder:],
[GSWSession _releaseAutoreleasePool]): Ditto.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@18611 72102866-910b-0410-8b05-ffd578937521
2004-02-17 16:53:36 +00:00
|
|
|
_selfLock_thread_id,
|
|
|
|
GSCurrentThread());
|
2002-08-04 18:00:11 +00:00
|
|
|
if (_selfLockn>0)
|
|
|
|
{
|
* GSWeb.framework/GSWApplication.m
(GSWApplicationMainReal): Reformat. Use GSCurrentThread
instead of objc_thread_id. Remove \n in NSLog type logs.
(GSWApplicationMain): Ditto.
([GSWApplication init], [GSWApplication lockRequestHandling],
[GSWApplication unlockRequestHandling], [GSWApplication lock],
[GSWApplication unlock], [GSWApplication _sessionClass],
[GSWApplication run],
[GSWApplication addDynCreateClassName:superClassName:],
[GSWApplication pageWithName:],
[GSWApplication dynamicElementWithName:associations:template:]):
Ditto.
* GSWeb.framework/GSWComponent.m
([GSWComponent appendToResponse:inContext:], [GSWComponent
templateWithHTMLString:declarationString:languages:]): Ditto.
* GSWeb.framework/GSWContext.m
([GSWContext dealloc], [GSWContext setValidate:]): Ditto.
* GSWeb.framework/GSWDebug.m
(GSWLogC_, GSWLogDumpObjectFn): Ditto.
* GSWeb.framework/GSWDefaultAdaptor.m
([GSWDefaultAdaptor registerForEvents],
[GSWDefaultAdaptor announceNewConnection:],
[GSWDefaultAdaptor adaptorThreadExited:],
[GSWDefaultAdaptor tryLock]): Ditto.
* GSWeb.framework/GSWDefaultAdaptorThread.m
([GSWDefaultAdaptorThread setPool:destroyLast:],
[GSWDefaultAdaptorThread run:],
[GSWDefaultAdaptorThread threadExited],
[GSWDefaultAdaptorThread isExpired],
[GSWDefaultAdaptorThread sendRetryLasterResponseToStream:],
[GSWDefaultAdaptorThread
sendConnectionRefusedResponseToStream:withMessage:]): Ditto.
* GSWeb.framework/GSWDeployedBundle.m
([GSWDeployedBundle initWithPath:], [GSWDeployedBundle dealloc],
[GSWDeployedBundle lock], [GSWDeployedBundle unlock]): Ditto.
* GSWeb.framework/GSWLifebeatThread.m
([GSWLifebeatThread setPool:destroyLast:],
[GSWLifebeatThread threadExited]): Ditto.
* GSWeb.framework/GSWSession.m
([GSWSession initWithCoder:],
[GSWSession _releaseAutoreleasePool]): Ditto.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@18611 72102866-910b-0410-8b05-ffd578937521
2004-02-17 16:53:36 +00:00
|
|
|
if (_selfLock_thread_id!=GSCurrentThread())
|
2002-08-04 18:00:11 +00:00
|
|
|
{
|
|
|
|
NSDebugMLog0(@"PROBLEM: owner!=thread id");
|
|
|
|
};
|
|
|
|
};
|
* GSWeb.framework/GSWUtils.h/m
(IsStyle,IsNumberStyle, ExceptionRaise, ExceptionRaise0,
ValidationExceptionRaise, ValidationExceptionRaise0,
ExceptionByAddingUserInfoObjectFrameInfo,
ExceptionByAddingUserInfoObjectFrameInfo0,
ExceptionByAddingUserInfoFunctionFrameInfo,
ExceptionByAddingUserInfoFunctionFrameInfo0, ): Reformat
defines.
(GSW_LOCK_LIMIT): New define.
(ExceptionRaiseFn, ExceptionRaiseFn0,
ValidationExceptionRaiseFn,
ValidationExceptionRaiseFn0): Reformat declaration.
(TmpLock, TmpTryLockBeforeDate, TmpLockBeforeDate, TmpUnlock):
Remove.
([NSLock isLocked]): Remove.
([NSLock tmplock]): Ditto.
([NSLock tmplockFromFunction:file:line:]): Ditto.
([NSLock tmptryLock]): Ditto.
([NSLock tmptryLockFromFunction:file:line:]): Ditto.
([NSLock tmptryLockBeforeDate:]): Ditto.
([NSLock tmptryLockBeforeDate:fromFunction:file:line:]):
Ditto.
([NSLock tmpunlock]): Ditto.
([NSLock tmpunlockFromFunction:file:line:]): Ditto.
([NSLock description]): Ditto.
([NSRecursiveLock isLocked]): Ditto.
([NSRecursiveLock tmplock]): Ditto.
([NSRecursiveLock tmplockFromFunction:file:line:]): Ditto.
([NSRecursiveLock tmptryLock]): Ditto.
([NSRecursiveLock tmptryLockFromFunction:file:line:]): Ditto.
([NSRecursiveLock tmptryLockBeforeDate:]): Ditto.
([NSRecursiveLock
tmptryLockBeforeDate:fromFunction:file:line:]):
Ditto.
([NSRecursiveLock tmpunlock]): Ditto.
([NSRecursiveLock tmpunlockFromFunction:file:line:]): Ditto.
(NSLockException, MessageForMutexLockError)
(LoggedLock, LoggedLockBeforeDate, LoggedTryLock,
LoggedTryLockBeforeDate, LoggedUnlock): New macros.
(loggedLockBeforeDateFromFunctionInFileInLine,
loggedUnlockFromFunctionInFileInLine): New logging lock
functions.
([NSThread description]): New Category.
(volatileInternalDescription): New static function.
(GSW_LOCK_LIMIT): New marco.
* GSWeb.framework/GSWApplication.m
([GSWApplication isRequestHandlingLocked]): Test lock instead
of relying on obsolete lock categories.
([GSWApplication lockRequestHandling]): Use new locking
macros.
([GSWApplication unlockRequestHandling]): Ditto.
([GSWApplication lock]): Ditto.
([GSWApplication unlock]): Ditto.
* GSWeb.framework/GSWAssociation.m
([GSWAssociation setClasse:forHandler:]): Ditto
([GSWAssociation addLogHandlerClasse:]): Ditto.
([GSWAssociation removeLogHandlerClasse:]): Ditto.
([GSWAssociation logValue:forSet:]): Ditto.
([GSWAssociation
logSynchronizeForValue:inComponent:componentToParent:]):
Ditto.
* GSWeb.framework/GSWBundle.m
([GSWBundle unlock]): Ditto.
([GSWBundle lock]): Ditto.
* GSWeb.framework/GSWDefaultAdaptor.m
([GSWDefaultAdaptor tryLock]): Ditto.
([GSWDefaultAdaptor unlock]): Ditto.
* GSWeb.framework/GSWDeployedBundle.m
([GSWDeployedBundle lock]): Ditto.
([GSWDeployedBundle unlock]): Ditto.
* GSWeb.framework/GSWResourceManager.m
([GSWResourceManager unlock]): Ditto.
([GSWResourceManager lock]): Ditto.
* GSWeb.framework/GSWSessionStore.m
([GSWSessionStore unlock]): Ditto.
([GSWSessionStore tryLock]): Ditto.
([GSWSessionStore lock]): Ditto.
* GSWeb.framework/GSWSessionTimeOutManager.m
([GSWSessionTimeOutManager
tryLockBeforeTimeIntervalSinceNow:]):
Ditto.
([GSWSessionTimeOutManager lockBeforeTimeIntervalSinceNow]):
Ditto.
([GSWSessionTimeOutManager unlock]): Ditto.
* GSWeb.framework/GSWStaticResourceRequestHandler.m
([GSWStaticResourceRequestHandler handleRequest:]): Ditto.
* GSWeb.framework/GSWStatisticsStore.m
([GSWStatisticsStore unlock]): Ditto.
([GSWStatisticsStore lock]): Ditto.
* GSWeb.framework/NSObject+IVarAccess+PerformSel.m:
([NSObject getIVarNamed]): Use GSW_LOCK_LIMIT macro.
Reformat.
([NSObject setIVarNamed:withValue:]): Ditto.
* Makefile.postamble: Remove autom4te.cache on distclean.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@18605 72102866-910b-0410-8b05-ffd578937521
2004-02-16 14:37:46 +00:00
|
|
|
LoggedUnlock(_selfLock);
|
2000-01-22 12:49:49 +00:00
|
|
|
#ifndef NDEBUG
|
2002-08-04 18:00:11 +00:00
|
|
|
_selfLockn--;
|
|
|
|
if (_selfLockn==0)
|
|
|
|
_selfLock_thread_id=NULL;
|
2000-01-22 12:49:49 +00:00
|
|
|
#endif
|
* GSWeb.framework/GSWApplication.m
(GSWApplicationMainReal): Reformat. Use GSCurrentThread
instead of objc_thread_id. Remove \n in NSLog type logs.
(GSWApplicationMain): Ditto.
([GSWApplication init], [GSWApplication lockRequestHandling],
[GSWApplication unlockRequestHandling], [GSWApplication lock],
[GSWApplication unlock], [GSWApplication _sessionClass],
[GSWApplication run],
[GSWApplication addDynCreateClassName:superClassName:],
[GSWApplication pageWithName:],
[GSWApplication dynamicElementWithName:associations:template:]):
Ditto.
* GSWeb.framework/GSWComponent.m
([GSWComponent appendToResponse:inContext:], [GSWComponent
templateWithHTMLString:declarationString:languages:]): Ditto.
* GSWeb.framework/GSWContext.m
([GSWContext dealloc], [GSWContext setValidate:]): Ditto.
* GSWeb.framework/GSWDebug.m
(GSWLogC_, GSWLogDumpObjectFn): Ditto.
* GSWeb.framework/GSWDefaultAdaptor.m
([GSWDefaultAdaptor registerForEvents],
[GSWDefaultAdaptor announceNewConnection:],
[GSWDefaultAdaptor adaptorThreadExited:],
[GSWDefaultAdaptor tryLock]): Ditto.
* GSWeb.framework/GSWDefaultAdaptorThread.m
([GSWDefaultAdaptorThread setPool:destroyLast:],
[GSWDefaultAdaptorThread run:],
[GSWDefaultAdaptorThread threadExited],
[GSWDefaultAdaptorThread isExpired],
[GSWDefaultAdaptorThread sendRetryLasterResponseToStream:],
[GSWDefaultAdaptorThread
sendConnectionRefusedResponseToStream:withMessage:]): Ditto.
* GSWeb.framework/GSWDeployedBundle.m
([GSWDeployedBundle initWithPath:], [GSWDeployedBundle dealloc],
[GSWDeployedBundle lock], [GSWDeployedBundle unlock]): Ditto.
* GSWeb.framework/GSWLifebeatThread.m
([GSWLifebeatThread setPool:destroyLast:],
[GSWLifebeatThread threadExited]): Ditto.
* GSWeb.framework/GSWSession.m
([GSWSession initWithCoder:],
[GSWSession _releaseAutoreleasePool]): Ditto.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@18611 72102866-910b-0410-8b05-ffd578937521
2004-02-17 16:53:36 +00:00
|
|
|
NSDebugMLLog(@"bundles",
|
|
|
|
@"selfLock=%p selfLockn=%d selfLock_thread_id=%@ "
|
|
|
|
@"GSCurrentThread()=%@",
|
2002-08-04 18:00:11 +00:00
|
|
|
(void*)_selfLock,
|
|
|
|
_selfLockn,
|
* GSWeb.framework/GSWApplication.m
(GSWApplicationMainReal): Reformat. Use GSCurrentThread
instead of objc_thread_id. Remove \n in NSLog type logs.
(GSWApplicationMain): Ditto.
([GSWApplication init], [GSWApplication lockRequestHandling],
[GSWApplication unlockRequestHandling], [GSWApplication lock],
[GSWApplication unlock], [GSWApplication _sessionClass],
[GSWApplication run],
[GSWApplication addDynCreateClassName:superClassName:],
[GSWApplication pageWithName:],
[GSWApplication dynamicElementWithName:associations:template:]):
Ditto.
* GSWeb.framework/GSWComponent.m
([GSWComponent appendToResponse:inContext:], [GSWComponent
templateWithHTMLString:declarationString:languages:]): Ditto.
* GSWeb.framework/GSWContext.m
([GSWContext dealloc], [GSWContext setValidate:]): Ditto.
* GSWeb.framework/GSWDebug.m
(GSWLogC_, GSWLogDumpObjectFn): Ditto.
* GSWeb.framework/GSWDefaultAdaptor.m
([GSWDefaultAdaptor registerForEvents],
[GSWDefaultAdaptor announceNewConnection:],
[GSWDefaultAdaptor adaptorThreadExited:],
[GSWDefaultAdaptor tryLock]): Ditto.
* GSWeb.framework/GSWDefaultAdaptorThread.m
([GSWDefaultAdaptorThread setPool:destroyLast:],
[GSWDefaultAdaptorThread run:],
[GSWDefaultAdaptorThread threadExited],
[GSWDefaultAdaptorThread isExpired],
[GSWDefaultAdaptorThread sendRetryLasterResponseToStream:],
[GSWDefaultAdaptorThread
sendConnectionRefusedResponseToStream:withMessage:]): Ditto.
* GSWeb.framework/GSWDeployedBundle.m
([GSWDeployedBundle initWithPath:], [GSWDeployedBundle dealloc],
[GSWDeployedBundle lock], [GSWDeployedBundle unlock]): Ditto.
* GSWeb.framework/GSWLifebeatThread.m
([GSWLifebeatThread setPool:destroyLast:],
[GSWLifebeatThread threadExited]): Ditto.
* GSWeb.framework/GSWSession.m
([GSWSession initWithCoder:],
[GSWSession _releaseAutoreleasePool]): Ditto.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@18611 72102866-910b-0410-8b05-ffd578937521
2004-02-17 16:53:36 +00:00
|
|
|
_selfLock_thread_id,
|
|
|
|
GSCurrentThread());
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStop();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-08-04 18:00:11 +00:00
|
|
|
+(id)bundleWithPath:(NSString*)aPath
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2002-08-04 18:00:11 +00:00
|
|
|
id bundle=nil;
|
|
|
|
NSDebugMLLog(@"bundles",@"aPath=%@",aPath);
|
|
|
|
bundle=[[[GSWDeployedBundle alloc]initWithPath:aPath]autorelease];
|
|
|
|
return bundle;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
@end
|