I'm having an issue designing a good event based system in my Java game. How it currently works is, there are subsystems: Graphics, Physics, Input, and Entity. Each one has a class that implements EventListener, an interface with a method: void act(EventMessage message). They also add themselves to the event queue's listener list. Each of the subsystems holds a reference to the EventQueue, so they can push messages into it if needed. When the EventQueue polls messages each frame, it pops the message off and invokes all listener's act method, and a listener can use the message if needed. EventMessage is simply the base class to all messages, and it holds a String name, to distinguish itself from other events passed into a listener's act method.
The problem I'm having is that I want it completely decoupled so that the Entity sub system doesn't have to know what the Graphics or Physics systems are. The way it works now, an event CreateSpriteMessage can be pushed onto the queue, and it holds a String for the texture path that the graphics will load the texture from, but the problem is that there is no way for the class that sent that message to know what the id is for that image, in this case an int index in an ArrayList. Another problem is collision detection in the Physics system, the way I have it designed, when a collision occurs, it'll push a message for the collision, but I'm perplexed on how I'll tell the Entity system what hitboxes were collided, and how the entities will know if that's their hitbox or not.
I'm just wondering if i'm implementing an event queue correctly, and if there's any practical ways to combat these issues.