{"id":225397,"date":"2014-06-05T22:52:03","date_gmt":"2014-06-05T18:52:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=225397"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=225397","title":{"rendered":"<span class=\"post_title\">Spring bean custom scope<\/span>"},"content":{"rendered":"<div class=\"content html_format\">     \t\u042f \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u044e \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u043e\u0433\u0434\u0430 \u0431\u044b\u0432\u0430\u0435\u0442 \u043d\u0443\u0436\u0435\u043d Spring custom scope.<\/p>\n<p>  \u041c\u044b \u2014 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u044f B2B \u0438 SAAS, \u0438 \u0443 \u043d\u0430\u0441 \u0431\u0435\u0433\u0443\u0442 \u043f\u043e \u0442\u0430\u0439\u043c\u0435\u0440\u0443 \u043d\u0435\u043a\u0438\u0435 \u0434\u043e\u043b\u0433\u0438\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432.<br \/>  \u0423 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432 \u0435\u0441\u0442\u044c \u043a\u0430\u043a\u0438\u0435 \u0442\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 (\u0438\u043c\u044f, \u0442\u0438\u043f \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0438 \u0438 \u0442.\u0434.).<br \/>  \u0420\u0430\u043d\u044c\u0448\u0435 \u043c\u044b \u0434\u0435\u043b\u0430\u043b\u0438 \u043d\u0430\u0448\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u044b prototype \u0431\u0438\u043d\u0430\u043c\u0438 \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u043b\u0438 \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u0438\u0437 \u043d\u0438\u0445 \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0435 \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u0438 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 (flow):<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<pre><code class=\"java\">@Service @Scope(&quot;prototype&quot;) public class ServiceA {     private Customer customer;     private ReloadType reloadType;      private ServiceB serviceB;      @Autowired     private ApplicationContext context;      public ServiceA(final Customer customer, final ReloadType reloadType) {         this.customer = customer;         this.reloadType = reloadType;     }      @PostConstruct     public void init(){         serviceB = (ServiceB) context.getBean(&quot;serviceB&quot;,customer, reloadType);     }      public void doSomethingInteresting(){         doSomthingWithCustomer(customer,reloadType);         serviceB.doSomethingBoring();     }      private void doSomthingWithCustomer(final Customer customer, final ReloadType reloadType) {      } }  <\/code><\/pre>\n<pre><code class=\"java\">@Service @Scope(&quot;prototype&quot;) public class ServiceB {      private Customer customer;     private ReloadType reloadType;      public ServiceB(final Customer customer, final ReloadType reloadType) {         this.customer = customer;         this.reloadType = reloadType;     }      public void doSomethingBoring(){      } }  <\/code><\/pre>\n<pre><code class=\"java\">  \/\/...         ServiceA serviceA = (ServiceA) context.getBean(&quot;serviceA&quot;,customer, ReloadType.FullReaload);         serviceA.doSomethingInteresting();  \/\/... <\/code><\/pre>\n<p>  \u042d\u0442\u043e \u043d\u0435\u0443\u0434\u043e\u0431\u043d\u043e \u2014 \u0432\u043e \u043f\u0435\u0440\u0432\u044b\u0445 \u043c\u043e\u0436\u043d\u043e \u043e\u0448\u0438\u0431\u0438\u0442\u044c\u0441\u044f \u0432 \u0447\u0438\u0441\u043b\u0435 \u0438\u043b\u0438 \u0442\u0438\u043f\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u0431\u0438\u043d\u0430,<br \/>  \u0432\u043e \u0432\u0442\u043e\u0440\u044b\u0445 \u043c\u043d\u043e\u0433\u043e boilerplate \u043a\u043e\u0434\u0430<\/p>\n<p>  \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u0441\u0434\u0435\u043b\u0430\u043b\u0438 \u0441\u0432\u043e\u0439 scope \u0431\u0438\u043d\u0430 \u2014 \u00abcustomer\u00bb.<\/p>\n<p>  \u0418\u0434\u0435\u044f \u0432\u043e\u0442 \u0432 \u0447\u0435\u043c: \u044f \u0441\u043e\u0437\u0434\u0430\u044e \u043d\u0435\u043a\u0438\u0439 \u00ab\u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u00bb \u2014 \u043e\u0431\u044a\u0435\u043a\u0442, \u0445\u0440\u0430\u043d\u044f\u0449\u0438\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0442\u043e\u043c, \u043a\u0430\u043a\u043e\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441\u0435\u0439\u0447\u0430\u0441 \u0431\u0435\u0436\u0438\u0442 (\u043a\u0430\u043a\u043e\u0439 \u043a\u043b\u0438\u0435\u043d\u0442, \u043a\u0430\u043a\u043e\u0439 \u0442\u0438\u043f \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u2014 \u0432\u0441\u0435 \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0437\u043d\u0430\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c) \u0438 \u0445\u0440\u0430\u043d\u044e \u0435\u0433\u043e \u0432 ThreadLocal.<br \/>  \u041f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u0431\u0438\u043d\u0430 \u043c\u043e\u0435\u0433\u043e scope \u044f \u044d\u0442\u043e\u0442 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0442\u0443\u0434\u0430 \u0438\u043d\u0436\u0435\u043a\u0442\u044e.<\/p>\n<p>  \u0412 \u0442\u043e\u043c \u0436\u0435 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0441\u043f\u0438\u0441\u043e\u043a \u0443\u0436\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0445 \u0431\u0438\u043d\u043e\u0432, \u0447\u0442\u043e\u0431\u044b \u043a\u0430\u0436\u0434\u044b\u0439 \u0431\u0438\u043d \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u043b\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u043d\u0430 \u0432\u0435\u0441\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441.<\/p>\n<p>  \u041a\u043e\u0433\u0434\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u044f \u043e\u0447\u0438\u0449\u0430\u044e ThreadLocal \u0438 \u0432\u0441\u0435 \u0431\u0438\u043d\u044b \u0441\u043e\u0431\u0438\u0440\u0430\u044e\u0442\u0441\u044f garbage collector&#8217;\u043e\u043c.<\/p>\n<p>  \u0417\u0430\u043c\u0435\u0442\u044c\u0442\u0435, \u0447\u0442\u043e \u0432\u0441\u0435 \u0431\u0438\u043d\u044b \u043c\u043e\u0435\u0433\u043e scope \u043e\u0431\u044f\u0437\u0430\u043d\u044b \u0438\u043c\u043f\u043b\u0435\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u043a\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441. \u042d\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0438\u043c \u0438\u043d\u0436\u0435\u043a\u0442\u0438\u0442\u044c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442.<\/p>\n<p>  \u0418\u0442\u0430\u043a, \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u043c \u043d\u0430\u0448 scope \u0432 xml:<\/p>\n<pre><code class=\"xml\">.. &lt;bean id=&quot;customerScope&quot; class=&quot;com.scope.CustomerScope&quot;\/&gt;  &lt;bean class=&quot;org.springframework.beans.factory.config.CustomScopeConfigurer&quot;&gt;         &lt;property name=&quot;scopes&quot;&gt;             &lt;map&gt;                 &lt;entry key=&quot;customer&quot; value-ref=&quot;customerScope&quot;\/&gt;             &lt;\/map&gt;         &lt;\/property&gt;     &lt;\/bean&gt; ... <\/code><\/pre>\n<p>  \u0418\u043c\u043f\u043b\u0435\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u0435\u043c \u043d\u0430\u0448 Scope:  <\/p>\n<pre><code class=\"java\">public class CustomerScope implements Scope {      @Override     public Object get(String name, ObjectFactory&lt;?&gt; objectFactory) {         CustomerContext context = resolve();         Object result = context.getBean(name);         if (result == null) {             result = objectFactory.getObject();             ICustomerScopeBean syncScopedBean = (ICustomerScopeBean) result;             syncScopedBean.setContext(context);             Object oldBean = context.setBean(name, result);             if (oldBean != null) {                 result = oldBean;             }         }         return result;     }      @Override     public Object remove(String name) {         CustomerContext context = resolve();          return context.removeBean(name);     }      protected CustomerContext resolve() {         return CustomerContextThreadLocal.getCustomerContext();     }      @Override     public void registerDestructionCallback(String name, Runnable callback) {     }      @Override     public Object resolveContextualObject(String key) {         return null;     }      @Override     public String getConversationId() {         return resolve().toString();     }  } <\/code><\/pre>\n<p>  \u041a\u0430\u043a \u043c\u044b \u0432\u0438\u0434\u0438\u043c \u2014 \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u0442\u043e\u0433\u043e \u0436\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 (flow) \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0442\u0435 \u0436\u0435 \u0438\u043d\u0441\u0442\u0430\u043d\u0441\u044b \u0431\u0438\u043d\u043e\u0432 (\u0442.\u0435. \u044d\u0442\u043e scope \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0435 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u2014 \u0432 prototype \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u043b\u0438\u0441\u044c \u0431\u044b \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u043d\u043e\u0432\u044b\u0435, \u0432 singleton \u2014 \u043e\u0434\u043d\u0438 \u0438 \u0442\u0435 \u0436\u0435).<br \/>  \u0410 \u0441\u0430\u043c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0431\u0435\u0440\u0435\u0442\u0441\u044f \u0438\u0437 ThreadLocal:<\/p>\n<pre><code class=\"java\">public class CustomerContextThreadLocal {       private static ThreadLocal&lt;CustomerContext&gt; customerContext = new ThreadLocal&lt;&gt;();      public static CustomerContext getCustomerContext() {         return customerContext.get();     }      public static void setSyncContext(CustomerContext context) {         customerContext.set(context);     }      public static void clear() {         customerContext.remove();     }      private CustomerContextThreadLocal() {     }      public static void setSyncContext(Customer customer, ReloadType reloadType) {         setSyncContext(new CustomerContext(customer, reloadType));     } <\/code><\/pre>\n<p>  O\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043d\u0430\u0448\u0438\u0445 \u0431\u0438\u043d\u043e\u0432 \u0438 \u0435\u0433\u043e \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e:  <\/p>\n<pre><code class=\"java\">public interface ICustomerScopeBean {     void setContext(CustomerContext context); }   public class AbstractCustomerScopeBean implements ICustomerScopeBean {      protected Customer customer;     protected ReloadType reloadType;      @Override     public void setContext(final CustomerContext context) {         customer = context.getCustomer();         reloadType = context.getReloadType();     } } <\/code><\/pre>\n<p>  \u0418 \u043f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u0448\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u0432\u044b\u0433\u043b\u044f\u0434\u044f\u0442 \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u043a\u0440\u0430\u0441\u0438\u0432\u0435\u0435:  <\/p>\n<pre><code class=\"java\">@Service @Scope(&quot;customer&quot;) public class ServiceA extends AbstractCustomerScopeBean {      @Autowired     private ServiceB serviceB;       public void doSomethingInteresting() {         doSomthingWithCustomer(customer, reloadType);         serviceB.doSomethingBoring();     }      private void doSomthingWithCustomer(final Customer customer, final ReloadType reloadType) {      } }  @Service @Scope(&quot;customer&quot;) public class ServiceB  extends AbstractCustomerScopeBean {         public void doSomethingBoring(){      } }  \/\/....  CustomerContextThreadLocal.setSyncContext(customer, ReloadType.FullReaload);         ServiceA serviceA = context.getBean(ServiceA.class);         serviceA.doSomethingInteresting(); \/\/..... <\/code><\/pre>\n<p>  \u041c\u043e\u0436\u0435\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442\u044c \u0432\u043e\u043f\u0440\u043e\u0441 \u2014 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c ThreadLocal \u2014 \u0430 \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u043c\u044b \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b?<br \/>  \u0413\u043b\u0430\u0432\u043d\u043e\u0435, \u0447\u0442\u043e\u0431\u044b \u0432\u0441\u0451 \u0434\u0435\u0440\u0435\u0432\u043e \u0431\u0438\u043d\u043e\u0432 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u043b\u043e\u0441\u044c \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e, \u0442\u043e\u0433\u0434\u0430 @Autowired \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e.<br \/>  \u0410 \u0435\u0441\u043b\u0438 \u043a\u0430\u043a\u043e\u0439 \u043d\u0438\u0431\u0443\u0434\u044c \u0438\u0437 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0441 @ Async \u2014 \u0442\u043e \u043d\u0435 \u0441\u0442\u0440\u0430\u0448\u043d\u043e, \u0432\u0441\u0451 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0431\u0443\u0434\u0435\u0442, \u0442\u0430\u043a \u043a\u0430\u043a \u0431\u0438\u043d\u044b \u0443\u0436\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u044b.<\/p>\n<p>  \u041d\u0435\u043f\u043b\u043e\u0445\u043e \u0442\u0430\u043a\u0436\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0435\u0441\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0447\u0442\u043e \u0432\u0441\u0435 \u0431\u0438\u043d\u044b \u0441\u043e scope \u00abcustomer\u00bb \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0442 ICustomerScopeBean \u0438 \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442:  <\/p>\n<pre><code class=\"java\">    @ContextConfiguration(locations = {&quot;classpath:beans.xml&quot;}, loader = GenericXmlContextLoader.class)     @RunWith(SpringJUnit4ClassRunner.class)     public class CustomerBeanScopetest {          @Autowired         private AbstractApplicationContext context;          @Test         public void testScopeBeans() throws ClassNotFoundException {              ConfigurableListableBeanFactory beanFactory = context.getBeanFactory();             String[] beanDefinitionNames = beanFactory.getBeanDefinitionNames();             for (String beanDef : beanDefinitionNames) {                 BeanDefinition def = beanFactory.getBeanDefinition(beanDef);                 String scope = def.getScope();                 String beanClassName = def.getBeanClassName();                 if (beanClassName == null)                     continue;                 Class&lt;?&gt; aClass = Class.forName(beanClassName);                 if (ICustomerScopeBean.class.isAssignableFrom(aClass))                     assertTrue(beanClassName + &quot; should have scope 'customer'&quot;, scope.equals(&quot;customer&quot;));                 if (scope.equals(&quot;customer&quot;))                     assertTrue(beanClassName + &quot; should implement 'ICustomerScopeBean'&quot;, ICustomerScopeBean.class.isAssignableFrom(aClass));             }         }     } <\/code><\/pre>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/225397\/\"> http:\/\/habrahabr.ru\/post\/225397\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">     \t\u042f \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u044e \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u043e\u0433\u0434\u0430 \u0431\u044b\u0432\u0430\u0435\u0442 \u043d\u0443\u0436\u0435\u043d Spring custom scope.<\/p>\n<p>  \u041c\u044b \u2014 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u044f B2B \u0438 SAAS, \u0438 \u0443 \u043d\u0430\u0441 \u0431\u0435\u0433\u0443\u0442 \u043f\u043e \u0442\u0430\u0439\u043c\u0435\u0440\u0443 \u043d\u0435\u043a\u0438\u0435 \u0434\u043e\u043b\u0433\u0438\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432.<br \/>  \u0423 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432 \u0435\u0441\u0442\u044c \u043a\u0430\u043a\u0438\u0435 \u0442\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 (\u0438\u043c\u044f, \u0442\u0438\u043f \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0438 \u0438 \u0442.\u0434.).<br \/>  \u0420\u0430\u043d\u044c\u0448\u0435 \u043c\u044b \u0434\u0435\u043b\u0430\u043b\u0438 \u043d\u0430\u0448\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u044b prototype \u0431\u0438\u043d\u0430\u043c\u0438 \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u043b\u0438 \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u0438\u0437 \u043d\u0438\u0445 \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0435 \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u0438 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 (flow):  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-225397","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/225397","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=225397"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/225397\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=225397"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=225397"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=225397"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}