Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
git-svn-id: http://anonsvn.jboss.org/repos/weld/ri/trunk@2298 1c488680-804c-0410-94cd-c6b725194a0e
- Loading branch information
Showing
8 changed files
with
223 additions
and
129 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
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
34 changes: 34 additions & 0 deletions
34
impl/src/main/java/org/jboss/webbeans/el/NamespaceManager.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,34 @@ | ||
package org.jboss.webbeans.el; | ||
|
||
import javax.inject.manager.Bean; | ||
|
||
public class NamespaceManager | ||
{ | ||
|
||
private final Namespace root; | ||
|
||
public NamespaceManager() | ||
{ | ||
root = new Namespace(null, null); | ||
} | ||
|
||
public void register(Bean<?> bean) | ||
{ | ||
if (bean.getName() != null && bean.getName().indexOf('.') > 0) | ||
{ | ||
String name = bean.getName().substring(0, bean.getName().lastIndexOf('.')); | ||
String[] hierarchy = name.split("\\."); | ||
Namespace namespace = root; | ||
for (String s : hierarchy) | ||
{ | ||
namespace = namespace.putIfAbsent(s); | ||
} | ||
} | ||
} | ||
|
||
public Namespace getRoot() | ||
{ | ||
return root; | ||
} | ||
|
||
} |
110 changes: 0 additions & 110 deletions
110
impl/src/main/java/org/jboss/webbeans/el/NamespacedResolver.java
This file was deleted.
Oops, something went wrong.
49 changes: 49 additions & 0 deletions
49
impl/src/main/java/org/jboss/webbeans/el/RunInDependentContext.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,49 @@ | ||
/** | ||
* | ||
*/ | ||
package org.jboss.webbeans.el; | ||
|
||
import org.jboss.webbeans.context.DependentContext; | ||
import org.jboss.webbeans.context.DependentInstancesStore; | ||
import org.jboss.webbeans.context.DependentStorageRequest; | ||
|
||
abstract class RunInDependentContext | ||
{ | ||
|
||
private final DependentStorageRequest dependentStorageRequest; | ||
|
||
public RunInDependentContext() | ||
{ | ||
dependentStorageRequest = DependentStorageRequest.of(new DependentInstancesStore(), new Object()); | ||
} | ||
|
||
private void setup() | ||
{ | ||
DependentContext.INSTANCE.setActive(true); | ||
DependentContext.INSTANCE.startCollectingDependents(dependentStorageRequest); | ||
} | ||
|
||
private void cleanup() | ||
{ | ||
DependentContext.INSTANCE.stopCollectingDependents(dependentStorageRequest); | ||
// TODO kinky | ||
dependentStorageRequest.getDependentInstancesStore().destroyDependentInstances(dependentStorageRequest.getKey()); | ||
DependentContext.INSTANCE.setActive(false); | ||
} | ||
|
||
protected abstract void execute() throws Exception; | ||
|
||
public final void run() throws Exception | ||
{ | ||
try | ||
{ | ||
setup(); | ||
execute(); | ||
} | ||
finally | ||
{ | ||
cleanup(); | ||
} | ||
} | ||
|
||
} |
Oops, something went wrong.