Skip to main content

2.3.2 Prototype Mode

Prototype mode and singleton mode are opposites. Hasor uses prototype mode by default, so developers do not need any extra configuration.

@Prototype()
public class AopBean {
...
}

You can also declare it in code through ApiBinder:

public class MyModule implements Module {
public void loadModule(ApiBinder apiBinder) {
apiBinder.bindType(PojoInfo.class).asEagerPrototype();
}
}