{"id":4059,"date":"2022-12-05T10:11:26","date_gmt":"2022-12-05T02:11:26","guid":{"rendered":"https:\/\/www.zeroheart.xyz\/wordpress\/?p=4059"},"modified":"2022-12-05T10:11:26","modified_gmt":"2022-12-05T02:11:26","slug":"refreshscope%e5%88%b7%e6%96%b0%e5%8e%9f%e7%90%86-%e6%8e%98%e9%87%91-juejin-cn","status":"publish","type":"post","link":"https:\/\/www.zeroheart.xyz\/wordpress\/?p=4059","title":{"rendered":"@RefreshScope\u5237\u65b0\u539f\u7406 &#8211; \u6398\u91d1 (juejin.cn)"},"content":{"rendered":"\n<p>\u539f\u6587\uff1a<a href=\"https:\/\/juejin.cn\/post\/7172890205425238030\">@RefreshScope\u5237\u65b0\u539f\u7406 &#8211; \u6398\u91d1 (juejin.cn)<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><code>@RefreshScope<\/code>\u5237\u65b0\u539f\u7406<\/h2>\n\n\n\n<p>\u5728\u914d\u5408\u914d\u7f6e\u4e2d\u5fc3\u4fee\u6539\u914d\u7f6e\u8ba9\u5e94\u7528\u81ea\u52a8\u5237\u65b0\u914d\u7f6e\u65f6\uff0c\u6211\u4eec\u8981\u5728\u9700\u8981\u611f\u77e5\u914d\u7f6e\u53d8\u5316\u7684bean\u4e0a\u9762\u52a0\u4e0a<code>@RereshScope<\/code>\u3002\u5982\u679c\u6211\u4eec\u4e0d\u52a0\u4e0a\u8fd9\u6ce8\u89e3\uff0c\u90a3\u4e48\u6709\u53ef\u80fd\u65e0\u6cd5\u5b8c\u6210\u914d\u7f6e\u81ea\u52a8\u5237\u65b0\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u4e00\u3001\u5165\u53e3<\/h3>\n\n\n\n<p>\u53ef\u4ee5\u770b\u5230<code>@RereshScope<\/code>\u662f<code>@Scope(\"refresh\")<\/code>(bean\u7684\u4f5c\u7528\u57df)\u7684\u6d3e\u751f\u6ce8\u89e3\u5e76\u6307\u5b9a\u4e86\u4f5c\u7528\u57df\u4e3a<code>refresh<\/code>\u5e76\u5728\u9ed8\u8ba4\u60c5\u51b5\u4e0b<code>proxyMode= ScopedProxyMode.TARGET_CLASS<\/code>\u5373<strong>\u4f7f\u7528CGLIB\u751f\u6210\u4ee3\u7406\u5bf9\u8c61<\/strong>\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>@Target({ElementType.TYPE, ElementType.METHOD})\n@Retention(RetentionPolicy.RUNTIME)\n@Scope(\"refresh\")\n@Documented\npublic @interface RefreshScope {\n    ScopedProxyMode proxyMode() default ScopedProxyMode.TARGET_CLASS;\n}\n\u590d\u5236\u4ee3\u7801<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\"><code>ScopedProxyMode<\/code><\/h4>\n\n\n\n<p><code>ScopedProxyMode<\/code>\u8868\u793a\u4f5c\u7528\u57df\u7684\u4ee3\u7406\u6a21\u5f0f\uff0c\u5171\u6709\u4ee5\u4e0b\u56db\u4e2a\u503c\uff1a<\/p>\n\n\n\n<ul>\n<li><code>DEFAULT<\/code>\uff1a\u9ed8\u8ba4no<\/li>\n\n\n\n<li><code>NO<\/code>\uff1a\u4e0d\u4f7f\u7528\u4ee3\u7406<\/li>\n\n\n\n<li><code>INTERFACES<\/code>\uff1a\u4f7f\u7528JDK\u52a8\u6001\u4ee3\u7406<\/li>\n\n\n\n<li><code>TARGET_CLASS<\/code>\uff1a\u4f7f\u7528CGLIB\u52a8\u6001\u4ee3\u7406<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>public enum ScopedProxyMode {\n   \/**\n    * Default typically equals {@link #NO}, unless a different default\n    * has been configured at the component-scan instruction level.\n    *\/\n   DEFAULT,\n   \/**\n    * Do not create a scoped proxy.\n    *\/\n   NO,\n   \/**\n    * Create a JDK dynamic proxy implementing &lt;i&gt;all&lt;\/i&gt; interfaces exposed by\n    * the class of the target object.\n    *\/\n   INTERFACES,\n   \/**\n    * Create a class-based proxy (uses CGLIB).\n    *\/\n   TARGET_CLASS;\n}\n\u590d\u5236\u4ee3\u7801<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\u4e8c\u3001\u914d\u7f6e\u7c7b\u89e3\u6790<\/h3>\n\n\n\n<p>\u5728\u4e0a\u6587\u5237\u65b0\u65f6\u4f1a\u6267\u884c<code>BeanFacotryPostProcessor<\/code>\u5bf9<code>beanDefinition<\/code>\u4fee\u6539\u548c\u589e\u52a0\uff0c\u5176\u4e2d\u914d\u7f6e\u7c7b\u89e3\u6790\u3001\u7c7b\u626b\u63cf\u7684\u5de5\u4f5c\u5c31\u662f\u5728\u5176\u4e2d\u6267\u884c\uff0c\u800c\u5bf9\u4e8e\u4e00\u4e2a<code>ScopedProxyMode.NO<\/code>\u5b83\u4f1a<strong>\u89e3\u6790\u6210\u4e00\u4e2a<code>ScopedProxyFactoryBean<\/code><\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ConfigurationClassBeanDefinitionReader\u914d\u7f6e\u7c7b\u89e3\u6790\u4ee3\u7801\u7247\u6bb5\ndefinitionHolder = AnnotationConfigUtils.applyScopedProxyMode(scopeMetadata, definitionHolder, this.registry);\n\n\/\/\u5982\u679c\u9700\u8981\u751f\u4ea7\u4ee3\u7406\u5219\u521b\u5efa\u4e00\u4e2aScopedProxy\u7684BeanDefinition\nstatic BeanDefinitionHolder applyScopedProxyMode(\n\t\tScopeMetadata metadata, BeanDefinitionHolder definition, BeanDefinitionRegistry registry) {\n\n\tScopedProxyMode scopedProxyMode = metadata.getScopedProxyMode();\n\tif (scopedProxyMode.equals(ScopedProxyMode.NO)) {\n\t\treturn definition;\n\t}\n\tboolean proxyTargetClass = scopedProxyMode.equals(ScopedProxyMode.TARGET_CLASS);\n\treturn ScopedProxyCreator.createScopedProxy(definition, registry, proxyTargetClass);\n}\n\n\/\/createScopedProxy \u4ee3\u7801\u7247\u6bb5 \u53ef\u4ee5\u770b\u5230BeanDefinition\u662fScopedProxyFactoryBean\nRootBeanDefinition proxyDefinition = new RootBeanDefinition(ScopedProxyFactoryBean.class);\n\u590d\u5236\u4ee3\u7801<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\"><code>ScopedProxyFactoryBean<\/code>-\u751f\u6210\u4ee3\u7406\u5bf9\u8c61<\/h4>\n\n\n\n<p><code>FactoryBean<\/code>\u5728\u6ce8\u5165\u65f6\u8fd4\u56de\u7684\u662f<code>getObject()<\/code>\u6240\u8fd4\u56de\u7684\u5bf9\u8c61\uff0c\u5728\u8fd9\u91cc\u5c31\u662f\u8fd4\u56de\u7684\u5c31\u662f<code>proxy<\/code>\u3002<code>ScopedProxyFactoryBean<\/code>\u5b9e\u73b0\u4e86<code>BeanFactoryAware<\/code>\u90a3\u4e48\u5728\u8fd9\u4e2abean\u521d\u59cb\u5316\u4e2d\u4f1a\u8c03\u7528<code>setBeanFactory()<\/code>\u65b9\u6cd5\uff0c\u800c\u5728\u8fd9\u4e2a\u65b9\u6cd5\u4e2d\uff0c\u4e3a\u5b83\u521b\u5efa\u4e00\u4e2a<code>CGLIB<\/code>\u4ee3\u7406\u5bf9\u8c61\u4f5c\u4e3a<code>getObject()<\/code>\u7684\u8fd4\u56de\u503c\uff0c\u5e76\u4f7f\u7528<code>ScopedObject<\/code>\u6765\u4ee3\u66ff\u88ab\u4ee3\u7406\u5bf9\u8c61\u3002\u800c\u5728<code>ScopedObject<\/code>\u9ed8\u8ba4\u5b9e\u73b0\u4e2d<strong>\u6bcf\u6b21\u90fd\u662f\u4ece<code>BeanFactory<\/code>\u4e2d\u83b7\u53d6<\/strong>\uff08\u91cd\u70b9\uff09\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>@Override\npublic Object getObject() {\n\tif (this.proxy == null) {\n\t\tthrow new FactoryBeanNotInitializedException();\n\t}\n    \/\/\u8fd4\u56de\u4ee3\u7406\u5bf9\u8c61\n\treturn this.proxy;\n}\n@Override\npublic void setBeanFactory(BeanFactory beanFactory) {\n   \/\/...\u7701\u7565\u5176\u4ed6\u4ee3\u7801\n    \n   \/\/ Add an introduction that implements only the methods on ScopedObject.\n   \/\/\u589e\u52a0\u4e00\u4e2a\u62e6\u622a\u4f7f\u7528ScopedObject\u6765\u88ab\u4ee3\u7406\u5bf9\u8c61\u8c03\u7528\u65b9\u6cd5\n   ScopedObject scopedObject = new DefaultScopedObject(cbf, this.scopedTargetSource.getTargetBeanName());\n   \/\/\u59d4\u6258ScopedObject\u53bb\u6267\u884c\n   pf.addAdvice(new DelegatingIntroductionInterceptor(scopedObject));\n\n   \/\/ Add the AopInfrastructureBean marker to indicate that the scoped proxy\n   \/\/ itself is not subject to auto-proxying! Only its target bean is. AOP\u65f6\u590d\u7528\u8fd9\u4e2a\u4ee3\u7406\u5bf9\u8c61\n   pf.addInterface(AopInfrastructureBean.class);\n   \/\/\u521b\u5efa\u4ee3\u7406\u5bf9\u8c61   \n   this.proxy = pf.getProxy(cbf.getBeanClassLoader());\n}\n\u590d\u5236\u4ee3\u7801<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\"><code>ScopedObject<\/code>-\u4ece\u5bb9\u5668\u4e2d\u83b7\u53d6\u4ee3\u7406\u76ee\u6807<\/h4>\n\n\n\n<p>\u4f5c\u7528\u57df\u5bf9\u8c61\u7684<code>AOP<\/code>\u5f15\u5165\u7684\u63a5\u53e3\u3002\u53ef\u4ee5\u5c06\u4ece<code>ScopedProxyFactoryBean<\/code>\u521b\u5efa\u7684\u5bf9\u8c61\u5f3a\u5236\u8f6c\u6362\u5230\u6b64\u63a5\u53e3\uff0c\u4ece\u800c\u53ef\u4ee5\u63a7\u5236\u8bbf\u95ee\u539f\u59cb\u76ee\u6807\u5bf9\u8c61\u5e76\u901a\u8fc7\u7f16\u7a0b\u5220\u9664\u76ee\u6807\u5bf9\u8c61\u3002\u5728\u9ed8\u8ba4\u5b9e\u73b0\u4e2d\u662f<strong>\u6bcf\u6b21\u65b9\u6cd5\u62e6\u622a\u90fd\u4ece\u5bb9\u5668\u4e2d\u83b7\u53d6\u88ab\u4ee3\u7406\u7684\u76ee\u6807\u5bf9\u8c61<\/strong>\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>public interface ScopedObject extends RawTargetAccess {\n  \/\/\u8fd4\u56de\u5f53\u524d\u4ee3\u7406\u5bf9\u8c61\u540e\u9762\u7684\u76ee\u6807\u5bf9\u8c61\n   Object getTargetObject();\n   void removeFromScope();\n}\npublic class DefaultScopedObject implements ScopedObject, Serializable {\n    \/\/...\u7701\u7565\u5b57\u6bb5\u4fe1\u606f\u548c\u6784\u9020\u5668\n\t@Override\n\tpublic Object getTargetObject() {\n        \/\/\u4ece\u5bb9\u5668\u4e2d\u83b7\u53d6\n\t\treturn this.beanFactory.getBean(this.targetBeanName);\n\t}\n\t@Override\n\tpublic void removeFromScope() {\n\t\tthis.beanFactory.destroyScopedBean(this.targetBeanName);\n\t}\n}\n\n\u590d\u5236\u4ee3\u7801<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\u4e09\u3001\u4f5c\u7528\u57df\u539f\u7406<\/h3>\n\n\n\n<p>\u5728<code>BeanFactory<\/code>\u83b7\u53d6bean\u65f6\uff08<code>doGetBean<\/code>\uff09\uff0c\u5982\u679c**\u4e0d\u662f\u5355\u4f8b\u6216\u8005\u539f\u578b<code>bean<\/code>**\u5c06\u4ea4\u7ed9\u5bf9\u5e94\u7684<code>Socpe<\/code>\u53bb<code>bean<\/code>,\u800c\u521b\u5efa<code>bean<\/code>\u65b9\u5f0f\u548c\u5355\u4f8bbean\u662f\u4e00\u6837\u7684\u3002\u5176\u4ed6\u4f5c\u7528\u57df\u50cf<code>request<\/code>\u3001<code>session<\/code>\u7b49\u7b49\u90fd\u662f\u5c5e\u4e8e\u8fd9\u4e00\u5757\u7684\u6269\u5c55\uff1a<strong>SPI+\u7b56\u7565\u6a21\u5f0f<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/AbstractBeanFactory doGetBean()\u4ee3\u7801\u7247\u6bb5\nString scopeName = mbd.getScope();\n\/\/\u83b7\u53d6\u5bf9\u5e94\u7684scope\nfinal Scope scope = this.scopes.get(scopeName);\n\/\/\u53c2\u6570\u68c0\u67e5\u7701\u7565\u3002\u3002\u3002\ntry {\n    \/\/\u4f7f\u7528\u7684\u5bf9\u5e94\u7684Socpe\u53bb\u83b7\u53d6bean \u83b7\u53d6\u4e0d\u5230\u5219\u4f7f\u7528\u540e\u9762\u7684`ObjectFactory`\n   Object scopedInstance = scope.get(beanName, () -&gt; {    \n       \/\/ObjectFactory lambda\u8868\u8fbe\u5f0f \u600e\u4e48\u521b\u5efabean\t\n      beforePrototypeCreation(beanName);\n      try {\n         return createBean(beanName, mbd, args);\n      }\n      finally {\n         afterPrototypeCreation(beanName);\n      }\n   });\n   bean = getObjectForBeanInstance(scopedInstance, name, beanName, mbd);\n\u590d\u5236\u4ee3\u7801<\/code><\/pre>\n\n\n\n<p><code>RefreshScope<\/code>\u7ee7\u627f<code>GenericScope<\/code>\u6bcf\u6b21\u83b7\u53d6bean\u662f\u4ece\u81ea\u5df1\u7684\u7f13\u5b58(<code>ConcurrentHashMap<\/code>)\u4e2d\u83b7\u53d6\u3002 \u5982\u679c\u7f13\u5b58\u4e2dbean\u88ab\u9500\u6bc1\u4e86\u5219\u7528<code>objectFactory<\/code>\u521b\u5efa\u4e00\u4e2a\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/GenericScope \u4e2d\u83b7\u53d6get\u5b9e\u73b0\npublic Object get(String name, ObjectFactory&lt;?&gt; objectFactory) {\n    \/\/\u4ece\u7f13\u5b58\u4e2d\u83b7\u53d6 \u7f13\u5b58\u7684\u5b9e\u73b0\u5c31\u662fConcurrentHashMap\n    BeanLifecycleWrapper value = this.cache.put(name, new BeanLifecycleWrapper(name, objectFactory));\n    this.locks.putIfAbsent(name, new ReentrantReadWriteLock());\n    try {\n        return value.getBean();\n    } catch (RuntimeException var5) {\n        this.errors.put(name, var5);\n        throw var5;\n    }\n}\n\u590d\u5236\u4ee3\u7801<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>    private static class BeanLifecycleWrapper {\n        \/\/\u5f53\u524dbean\u5bf9\u8c61\n        private Object bean;\n        \/\/\u9500\u6bc1\u56de\u8c03\n        private Runnable callback;\n        \/\/bean\u540d\u79f0\n        private final String name;\n        \/\/bean\u5de5\u5382\n        private final ObjectFactory&lt;?&gt; objectFactory;\n        \/\/\u83b7\u53d6\n        public Object getBean() {\n            if (this.bean == null) {\n                synchronized(this.name) {\n                    if (this.bean == null) {\n                        this.bean = this.objectFactory.getObject();\n                    }\n                }\n            }\n            return this.bean;\n        }\n       \/\/\u9500\u6bc1\n        public void destroy() {\n            if (this.callback != null) {\n                synchronized(this.name) {\n                    Runnable callback = this.callback;\n                    if (callback != null) {\n                        callback.run();\n                    }\n                    this.callback = null;\n                    \/\/\u53ea\u4e3anull\n                    this.bean = null;\n                }\n            }\n        }\n}\n\u590d\u5236\u4ee3\u7801<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\u56db\u3001\u914d\u7f6e\u5237\u65b0<\/h3>\n\n\n\n<p>\u5f53\u914d\u7f6e\u4e2d\u5fc3\u5237\u65b0\u914d\u7f6e\u4e4b\u540e\uff0c\u6709\u4e24\u79cd\u65b9\u5f0f\u53ef\u4ee5\u52a8\u6001\u5237\u65b0Bean\u7684\u914d\u7f6e\u53d8\u91cf\u503c\uff0c\uff08<code>SpringCloud-Bus<\/code>\u8fd8\u662f<code>Nacos<\/code>\u5dee\u4e0d\u591a\u90fd\u662f\u8fd9\u4e48\u5b9e\u73b0\u7684\uff09\uff1a<\/p>\n\n\n\n<ul>\n<li>\u5411\u4e0a\u4e0b\u6587\u53d1\u5e03\u4e00\u4e2a<code>RefreshEvent<\/code>\u4e8b\u4ef6<\/li>\n\n\n\n<li><code>Http<\/code>\u8bbf\u95ee<code>\/refresh<\/code>\u8fd9\u4e2a<code>EndPoint<\/code><\/li>\n<\/ul>\n\n\n\n<p>\u4e0d\u7ba1\u662f\u4ec0\u4e48\u65b9\u5f0f\uff0c<strong>\u6700\u7ec8\u90fd\u4f1a\u8c03\u7528<code>ContextRefresher<\/code>\u8fd9\u4e2a\u7c7b\u7684<code>refresh<\/code>\u65b9\u6cd5<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>public synchronized Set&lt;String&gt; refresh() {\n     \/\/\u5237\u65b0\u73af\u5883\n     Set&lt;String&gt; keys = this.refreshEnvironment();\n     \/\/\u5237\u65b0bean \u5176\u5b9e\u5c31\u662f\u9500\u6bc1refreshScope\u4e2d\u7f13\u5b58\u7684bean\n     this.scope.refreshAll();\n     return keys;\n}\n\/\/RefreshScope\u5237\u65b0\npublic void refreshAll() {\n     super.destroy();\n     this.context.publishEvent(new RefreshScopeRefreshedEvent());\n}\n\u590d\u5236\u4ee3\u7801<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\u4e94\u3001\u603b\u7ed3<\/h3>\n\n\n\n<p><code>@RereshScope<\/code>\u4f1a\u4e3a\u8fd9\u4e2a\u6807\u8bb0\u7684bean\u751f\u6210<code>ScopedProxyFactoryBean<\/code>\uff0c<code>ScopedProxyFactoryBean<\/code><strong>\u751f\u6210\u4e00\u4e2a\u4ee3\u7406\u5bf9\u8c61\u4f7f\u6bcf\u6b21\u65b9\u6cd5\u8c03\u7528\u7684\u76ee\u6807\u5bf9\u8c61\u90fd\u4ece\u5bb9\u5668\u4e2d\u83b7\u53d6<\/strong>\uff0c\u800c<strong>\u83b7\u53d6<code>refresh<\/code>\u4f5c\u7528\u57df\u7684Bean\u662f<code>RefreshScope<\/code>\u7f13\u5b58\u4e2d\u83b7\u53d6<\/strong>\u3002\u5f53\u914d\u7f6e\u4e2d\u5fc3\u5728<strong>\u89e6\u53d1\u5237\u65b0\u65f6<code>RefreshScope<\/code>\u4f1a\u5220\u9664<code>Socpe<\/code>\u7f13\u5b58\u7684Bean<\/strong>,\u7136\u540e\u4e0b\u6b21\u83b7\u53d6\u65f6\u5c31\u4f1a\u7528\u65b0\u7684<code>Environment<\/code>\u521b\u5efa\u914d\u7f6e\u4fee\u6539\u540e\u7684Bean,\u8fd9\u6837\u5c31\u8fbe\u5230\u4e86\u914d\u7f6e\u7684\u81ea\u52a8\u66f4\u65b0\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u516d\u3001\u95ee\u9898<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">\u4e3a\u4ec0\u4e48\u9700\u8981\u751f\u6210\u4ee3\u7406\u5bf9\u8c61\uff1f<\/h4>\n\n\n\n<p>\u56e0\u4e3aBean\u88c5\u914d\u662f\u4e00\u6b21\u6027\u7684\uff0c\u5047\u8bbe\u6ca1\u6709\u4ee3\u7406\u7684\u60c5\u51b5\u4e0b\uff0c\u5728\u53e6\u4e00\u4e2abean\u6ce8\u5165\u8fd9\u4e2a<code>refreshBean<\/code>\u4e4b\u540e\u5c31\u65e0\u6cd5\u6539\u53d8\u4e86\uff0c\u5c31\u7b97<code>refreshBean<\/code>\u9500\u6bc1\uff08\u5728\u7f13\u5b58\u4e2d\u7f6e\u4e3anull\uff09\u5e76\u540e\u9762\u91cd\u65b0\u751f\u6210\u4e86\uff0c\u4f46\u662f\u4e4b\u524d\u5f15\u7528\u8fd8\u662f\u8001\u7684<code>bean<\/code>\uff0c\u8fd9\u4e5f\u662f\u4e3a\u4ec0\u4e48\u6ca1\u6709\u52a0<code>@RefreshScope<\/code>\u6ce8\u89e3\u800c\u5bfc\u81f4\u914d\u7f6e\u81ea\u52a8\u5237\u65b0\u5931\u6548\u4e86\u3002<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u539f\u6587\uff1a@RefreshScope\u5237\u65b0\u539f\u7406 &#8211; \u6398\u91d1 (juejin.cn) @RefreshSco [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"_links":{"self":[{"href":"https:\/\/www.zeroheart.xyz\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/4059"}],"collection":[{"href":"https:\/\/www.zeroheart.xyz\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.zeroheart.xyz\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.zeroheart.xyz\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.zeroheart.xyz\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4059"}],"version-history":[{"count":3,"href":"https:\/\/www.zeroheart.xyz\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/4059\/revisions"}],"predecessor-version":[{"id":4062,"href":"https:\/\/www.zeroheart.xyz\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/4059\/revisions\/4062"}],"wp:attachment":[{"href":"https:\/\/www.zeroheart.xyz\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4059"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.zeroheart.xyz\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4059"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zeroheart.xyz\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4059"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}