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.