if (instance != null) {
ResourceManager resourceManager = getBus().getExtension(ResourceManager.class);
List<ResourceResolver> resolvers = resourceManager.getResourceResolvers();
resourceManager = new DefaultResourceManager(resolvers);
resourceManager.addResourceResolver(new WebServiceContextResourceResolver());
ResourceInjector injector = new ResourceInjector(resourceManager);
if (Proxy.isProxyClass(instance.getClass()) && getServiceClass() != null) {
injector.inject(instance, getServiceClass());
if (!blockPostConstruct) {
injector.construct(instance, getServiceClass());
}
} else {
injector.inject(instance);
if (!blockPostConstruct) {
injector.construct(instance);
}
}
}
}