Skip to content
This repository has been archived by the owner on Jul 3, 2019. It is now read-only.

Commit

Permalink
Made Injector#setParentInjector public to enable turning independentl…
Browse files Browse the repository at this point in the history
…y created injectors into child injectors.

This is mainly meant to be used in the context of Robotlegs, which subclasses Injector to allow for using swappable injector implementations through a uniform interface.
Because SwiftSuspenders must not have a dependency on Robotlegs, we can't internally create an instance of Robotlegs' SwiftSuspendersInjector. Using the public setParentInjector method, it's possible to manually instantiate SwiftSuspendersInjector and set the parent context's injector as the parent injector afterwards.
  • Loading branch information
tschneidereit committed Jan 4, 2010
1 parent cf9e8ba commit b3da255
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/org/swiftsuspenders/Injector.as
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,11 @@ package org.swiftsuspenders
injector.setParentInjector(this);
return injector;
}

public function setParentInjector(parentInjector : Injector) : void
{
m_parentInjector = parentInjector;
}


/*******************************************************************************************
Expand Down Expand Up @@ -316,10 +321,5 @@ package org.swiftsuspenders
getInjectionPoints(Class(getDefinitionByName(parentClassName)));
injectionPoints.push.apply(injectionPoints, parentInjectionPoints);
}

private function setParentInjector(parentInjector : Injector) : void
{
m_parentInjector = parentInjector;
}
}
}

0 comments on commit b3da255

Please sign in to comment.