How to get the object in the spring container after deserialization in the spring environment, not the new object

 

If you need to save -- persist the class method configured in the invoked spring container:

Serialize objects:

{

  className; //class name

  methodName;//Method name

 Object []params;//parameters

}

 

After deserialization, get Object through className-->Class-->Spring beanFactory.isFactoryof(class)--whether it is a bean in this spring container, if so-"Object obj= beanFactory.getBean(class) When the object is the configured bean in the spring environment (which can include other objects that depend on it, transactions (proxy objects), etc.----), it can be reflected through MethodName and params

called.

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326445118&siteId=291194637