[
https://issues.apache.org/jira/browse/GERONIMO-6045?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13059475#comment-13059475
]
Ivan commented on GERONIMO-6045:
--------------------------------
Paste some draft codes, if any other better idea, please help to comment.
--->
public class ResourceReference<E extends Throwable> extends SimpleReference
implements BundleAwareReference, KernelAwareReference {
...
@Override
public void setKernel(Kernel kernel) {
if(query == null) {
try {
ConfigurationManager configurationManager =
ConfigurationUtil.getConfigurationManager(kernel);
AbstractName mappedAbstractName = new
AbstractName(configurationManager.getArtifactResolver().resolveInClassLoader(gbeanName.getArtifact()),
gbeanName.getName());
String osgiJndiName =
kernel.getNaming().toOsgiJndiName(mappedAbstractName);
query = "(osgi.jndi.service.name=" + osgiJndiName + ')';
} catch (GBeanNotFoundException e) {
logger.error("Fail to build the jndi name for " + gbeanName, e);
} catch (MissingDependencyException e) {
logger.error("Fail to build the jndi name for " + gbeanName, e);
}
}
}
<---
> Support artifact alias for ResourceReference
> --------------------------------------------
>
> Key: GERONIMO-6045
> URL: https://issues.apache.org/jira/browse/GERONIMO-6045
> Project: Geronimo
> Issue Type: Bug
> Security Level: public(Regular issues)
> Components: naming
> Affects Versions: 3.0
> Reporter: Ivan
> Assignee: Ivan
> Fix For: 3.0
>
>
> With the type of ResourceReference, a OSGi query string built from target
> gbean name is used for querying the injected instance, while the query string
> might need to be updated due to artifact alias is configured. I am thinking
> to generate the query string on the runtime, not the build time.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira