-
Notifications
You must be signed in to change notification settings - Fork 268
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #69 from eriksundin/infrastructure_components
Infrastructure components
- Loading branch information
Showing
47 changed files
with
12,986 additions
and
3,562 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
//////////////////////////////////////////////////////////////////////////////// | ||
// | ||
// TYPHOON FRAMEWORK | ||
// Copyright 2013, Jasper Blues & Contributors | ||
// All Rights Reserved. | ||
// | ||
// NOTICE: The authors permit you to use, modify, and distribute this file | ||
// in accordance with the terms of the license agreement accompanying it. | ||
// | ||
//////////////////////////////////////////////////////////////////////////////// | ||
|
||
#import "TyphoonDefinition.h" | ||
|
||
@class TyphoonPropertyPlaceholderConfigurer; | ||
@protocol TyphoonResource; | ||
|
||
/** | ||
Declares short-hand definition factory methods for infrastructure components. | ||
*/ | ||
@interface TyphoonDefinition (Infrastructure) | ||
|
||
/** | ||
Factory method for a TyphoonPropertyPlaceholderConfigurer. | ||
@param resource The resource to load. | ||
@return a definition. | ||
*/ | ||
+ (TyphoonDefinition*)propertyPlaceholderWithResource:(id<TyphoonResource>)resource; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
//////////////////////////////////////////////////////////////////////////////// | ||
// | ||
// TYPHOON FRAMEWORK | ||
// Copyright 2013, Jasper Blues & Contributors | ||
// All Rights Reserved. | ||
// | ||
// NOTICE: The authors permit you to use, modify, and distribute this file | ||
// in accordance with the terms of the license agreement accompanying it. | ||
// | ||
//////////////////////////////////////////////////////////////////////////////// | ||
|
||
|
||
#import "TyphoonDefinition+Infrastructure.h" | ||
#import "TyphoonPropertyPlaceholderConfigurer.h" | ||
#import "TyphoonResource.h" | ||
#import "TyphoonInitializer.h" | ||
|
||
@implementation TyphoonDefinition (Infrastructure) | ||
|
||
+ (TyphoonDefinition *)propertyPlaceholderWithResource:(id<TyphoonResource>)resource { | ||
|
||
TyphoonDefinition *definition = [self withClass:[TyphoonPropertyPlaceholderConfigurer class] initialization:^(TyphoonInitializer *initializer) { | ||
|
||
initializer.selector = @selector(configurerWithResource:); | ||
[initializer injectWithObject:resource]; | ||
|
||
}]; | ||
definition.key = [NSString stringWithFormat:@"%@-%@", NSStringFromClass(definition.class), [resource description]]; | ||
return definition; | ||
} | ||
|
||
@end |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
Source/Factory/Config/TyphoonComponentFactoryPostProcessor.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
//////////////////////////////////////////////////////////////////////////////// | ||
// | ||
// TYPHOON FRAMEWORK | ||
// Copyright 2013, Jasper Blues & Contributors | ||
// All Rights Reserved. | ||
// | ||
// NOTICE: The authors permit you to use, modify, and distribute this file | ||
// in accordance with the terms of the license agreement accompanying it. | ||
// | ||
//////////////////////////////////////////////////////////////////////////////// | ||
|
||
|
||
#import <Foundation/Foundation.h> | ||
|
||
@class TyphoonComponentFactory; | ||
|
||
/** | ||
Allows for custom modification of a component factory's definitions. | ||
Component factories can auto-detect TyphoonComponentFactoryPostProcessor components in their definitions and apply them before any other components get created. | ||
@see TyphoonPropertyPlaceholderConfigurer for an example implementation. | ||
*/ | ||
@protocol TyphoonComponentFactoryPostProcessor <NSObject> | ||
|
||
/** | ||
Post process a component factory after its initialization. | ||
@param factory The component factory | ||
*/ | ||
- (void)postProcessComponentFactory:(TyphoonComponentFactory *)factory; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.