forked from mulesoft-labs/mql
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make it possible to use an expression in the from statement. Start on…
… Spring support.
- Loading branch information
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
mql/src/main/java/com/mulesoft/mql/spring/SpringLazyLoadingContext.java
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,31 @@ | ||
/* | ||
* $Id$ | ||
* -------------------------------------------------------------------------------------- | ||
* Copyright (c) MuleSoft, Inc. All rights reserved. http://www.mulesoft.com | ||
* | ||
* The software in this package is published under the terms of the CPAL v1.0 | ||
* license, a copy of which has been included with this distribution in the | ||
* LICENSE.txt file. | ||
*/ | ||
package com.mulesoft.mql.spring; | ||
|
||
import com.mulesoft.mql.LazyResolvingContext; | ||
|
||
import org.springframework.context.ApplicationContext; | ||
|
||
public class SpringLazyLoadingContext extends LazyResolvingContext { | ||
private ApplicationContext applicationContext; | ||
|
||
public SpringLazyLoadingContext(ApplicationContext applicationContext) { | ||
super(); | ||
this.applicationContext = applicationContext; | ||
} | ||
|
||
@Override | ||
public Object load(String key) { | ||
if (applicationContext.containsBean(key)) { | ||
return applicationContext.getBean(key); | ||
} | ||
return null; | ||
} | ||
} |