this.fullName = fullName;
}
@Override
public void getResourceValue(final ResolutionContext resolutionContext, final ServiceBuilder<?> serviceBuilder, final DeploymentPhaseContext phaseContext, final Injector<ManagedReferenceFactory> injector) throws DeploymentUnitProcessingException {
final ContextManagedReferenceFactory managedReferenceFactory = new ContextManagedReferenceFactory(name);
final ServiceName contextServiceName;
if(fullName.startsWith("java:app")) {
contextServiceName = ContextNames.contextServiceNameOfApplication(resolutionContext.getApplicationName());
} else if (fullName.startsWith("java:module") || (fullName.startsWith("java:comp") && resolutionContext.isCompUsesModule())) {
contextServiceName = ContextNames.contextServiceNameOfModule(resolutionContext.getApplicationName(), resolutionContext.getModuleName());
} else if(fullName.startsWith("java:comp")) {
contextServiceName = ContextNames.contextServiceNameOfComponent(resolutionContext.getApplicationName(), resolutionContext.getModuleName(), resolutionContext.getComponentName());
} else {
throw NamingLogger.ROOT_LOGGER.invalidNameForContextBinding(fullName);
}
serviceBuilder.addDependency(contextServiceName, NamingStore.class, managedReferenceFactory.getNamingStoreInjectedValue());
injector.inject(managedReferenceFactory);
}