Skip to content

Commit

Permalink
Fixes #73 - Implement GlobalContext.lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
mnriem committed Dec 22, 2023
1 parent 5eddd0a commit 80f5cb4
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
package com.manorrock.herring.global;

import java.util.Hashtable;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import javax.naming.Binding;
import javax.naming.Context;
import javax.naming.Name;
Expand All @@ -43,14 +45,19 @@
*/
public class GlobalContext implements Context {

/**
* Stores the bindings.
*/
private final Map<String, Object> bindings = new ConcurrentHashMap<>();

@Override
public Object lookup(Name name) throws NamingException {
return lookup(name.toString());
}

@Override
public Object lookup(String name) throws NamingException {
throw new UnsupportedOperationException("Not supported yet.");
return bindings.get(name);
}

@Override
Expand Down

0 comments on commit 80f5cb4

Please sign in to comment.