public Object lookup(Name name) throws NamingException, ServiceUnavailableException
{
ServiceReference blueprintContainerRef = getBlueprintContainerRef(_callersBundle);
Object result;
try {
BlueprintContainer blueprintContainer = (BlueprintContainer)
_callersBundle.getBundleContext().getService(blueprintContainerRef);
BlueprintName bpName;
if (name instanceof BlueprintName) {
bpName = (BlueprintName) name;
} else if (_parentName != null) {
bpName = new BlueprintName(_parentName.toString() + "/" + name.toString());
} else {
bpName = (BlueprintName) _parser.parse(name.toString());
}
if (bpName.hasComponent()) {
String componentId = bpName.getComponentId();
try {
result = blueprintContainer.getComponentInstance(componentId);
} catch (NoSuchComponentException nsce) {
throw new NameNotFoundException(nsce.getMessage());
}
} else {
result = new BlueprintURLContext(_callersBundle, bpName, _env);