Is possible to do java equivalent of this?

<context:annotation-config/>

call something on context + call refresh() to load xml