How to invoke something just after application loaded and before project starting

Not the postStartupActivity extention point.

I need to run it even if there's no project to start.

Regards,


IL

8 comments

As usual, it's much easier for us to answer such questions if we know what problem you're trying to solve. One possibility is AppLifecycleListener.appFrameCreated().

0

Some of my config are shared online. I need to sync with the server to make sure the local config is up-to-date.


IL

0

In that case I would simply start a pooled thread from the constructor of an ApplicationComponent. (It's essential that all network operations be performed from a background thread, in order not to block the startup of IntelliJ IDEA.)

0

When will this application componet be created?

0

ApplicationComponents are created when the splash screen is displayed, before the welcome screen is shown.

0

Thank you, Dmitry.

Happy new year :-)


IL

0

Are you sure?

It not works for me.

Here's my code:

class XComponent extends ApplicationComponent {
  def initComponent() {
    throw new Exception("init x")
  }

  def disposeComponent() {
  }

  val getComponentName = "X"

  throw new Exception("create x")
}



  <application-components>
    <!-- Add your application components here -->
    <component>
      <implementation-class>sandbox.XComponent</implementation-class>
    </component>
  </application-components>

0

Please sign in to leave a comment.