It seems like you may be trying to extend the functionality of Jenkins with additional Java code that you want to run inside the Jenkins process on the Jenkins master, and possibly on one or more agents attached to the master.
If so, first be certain that there isn't already a Jenkins plugin that solves the specific problem you're trying to solve. The most frequent answer to the question, "Do I need to write a plugin to do X?" is "No, because a plugin already exists to do X, or to do Y which is very similar to X and can be extended or modified to do X".
If a search of available plugins and a discussion of the specific problem you're trying to solve does not identify an existing plugin that will meet the need, then you probably need to write a plugin.
Thanks,
Mark Waite